Re: [fpc-pascal] no array support in sqldb/sqldbrestbridge?

2022-06-07 Thread LacaK via fpc-pascal

Hi,


So, is there no array field support in sqldb and/or in sqldbrestbridge?

there was added into DB.pas : TObjectField and TArrayField 
https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-db/src/base/db.pas

but implementation is incomplete. Methods in fields.inc are empty.

Also in TSQLConnection descendants (like TPQConnection) there is no support.

-Laco.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] no array support in sqldb/sqldbrestbridge?

2022-06-07 Thread Luca Olivetti via fpc-pascal

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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal