[fpc-pascal] no array support in sqldb/sqldbrestbridge?
    Luca Olivetti 
    luca at ventoso.org
       
    Tue Jun  7 12:38:19 CEST 2022
    
    
  
llo,
since I'm going to need arrays in a postgresql database to expose via a 
rest api, I did a simple test with sqldbrestbridge.
I created a simple table:
create table prueba (x integer not null, y integer[]);
insert into prueba values (1, '{2,3}');
then I exposed it with sqlrestdb:
FDisp:=TSQLDBRestDispatcher.Create(Self)
FDisp.ExposeDatabase('postgresql','host','database','user','password');
FDisp.Active:=true;
and when I browse the database I only see the x field:
{
   "metaData" : {
     "fields" : [
       {
         "name" : "x",
         "type" : "int"
       }
     ]
   },
   "data" : [
     {
       "x" : 1
     }
   ]
}
So, is there no array field support in sqldb and/or in sqldbrestbridge?
I dropped a TSQLQuery on a form and I could define both fields, but "y" 
was just a plain TField (i.e. it was not mapped to an array field, in 
fact I could not find definitions of array fields in DB.pas, apart from 
the ftArray constant in TFieldType).
Bye
-- 
Luca
    
    
More information about the fpc-pascal
mailing list