Array and JSON data type

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Theprasit
Posts: 15
Joined: Fri 17 Nov 2006 04:01

Array and JSON data type

Post by Theprasit » Wed 24 Jun 2015 17:59

Does UniDAC support postgresql Array and JSON data type?

If not what about PgDAC?

Regards,

Theprasit

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Array and JSON data type

Post by azyk » Fri 26 Jun 2015 08:04

UniDAC and PgDAC support the JSON data type and array in PostgreSQL. In UniDAC/PgDAC, for direct access to JSON fields, the TBlobField field type is used, for array fields - the TMemoField field type. Selection, data modification, creation and using indexes for fields with such types are supported on the server side.

For example, the code for data insert to the BLOB_FIELD field with the JSON type from the File.bin file will look like the following:

Code: Select all

  TBlobField(UniQuery.FieldByName('BLOB_FIELD')).LoadFromFile('File.bin');
And the code for reading data from the BLOB_FIELD field to the File.bin file - as follows:

Code: Select all

  TBlobField(UniQuery.FieldByName('BLOB_FIELD')).SaveToFile('File.bin');

Theprasit
Posts: 15
Joined: Fri 17 Nov 2006 04:01

Re: Array and JSON data type

Post by Theprasit » Fri 26 Jun 2015 11:29

Just do a testing on both Array and JSON. I can query a test table by passing SQL with Array and JSON syntax successfully. This is awesome and UniDAC is great.

Thank you and Regards,

Theprasit

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Array and JSON data type

Post by azyk » Wed 01 Jul 2015 08:49

We are glad to see that the suggested solution suits you. Thank you for your feedback. If any further questions come up, please contact us.

Post Reply