You are not logged in.
Hello ab,
According to the document (https://synopse.info/files/html/Synopse … ml#TITL_26), any TSQLRecord-derived fields those are defined dynamic arrays, I guess including TInt64DynArray, will be **stored as BLOB format** in the database.
With the current implementation, is it possible (maybe via a setting) to store TInt64DynArray as JSON text value in the db?
That can introduce a lot of benefits, for example, one can take advantage of the JSON1 SQLite extension, one can view the values in plain text so makes debugging issues easier, and so on.
Last edited by edwinsn (2019-03-18 07:50:12)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
PS:
My currently planned solution is to define a child class from TRawUTF8ListHashed (which are stored as JSON text in the db according to the document, since it derives from TRawUTF8List) for storing int64 values, for example:
type
TInt64ListHashed = class(TRawUTF8ListHashed)
public
Add(aValue: Int64): PtrInt; overload;
IndexOf(aValue: Int64): PtrInt; overload;
end;
and use this type as the field type.
Last edited by edwinsn (2019-03-18 07:50:49)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Instead of Declaring your property as a dynamic array, you can declare it as RawUTF8 and use TDynArray.SaveToJSON/LoadFromJSON.
Offline
Instead of Declaring your property as a dynamic array, you can declare it as RawUTF8 and use TDynArray.SaveToJSON/LoadFromJSON.
Hello pvn0, thanks for your good advise! I see TDynArray has the Sort method, so it definitely meets my requirements!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline