You are not logged in.
Hi Ab
I am fiddling to load and write an object that contains a Tpersistent derived property.
This property needs to go into a (probably custom) blob field as is size (and class) is only known during runtime. Usually I use the ObjectBinaryToText routines to generate text from my object resources.
I have tried using TSQLPropInfoCustom, but I run into the reader and writer parameters provided. I was expecting something like
TOnSQLPropInfoRecord2Text = procedure(const Data; DataLen: integer; var Text: RawUTF8);
TOnSQLPropInfoRecord2Data = procedure(const Text: RawUTF8; var Data);
but actually, the code in mormot.pas looks like:
TOnSQLPropInfoRecord2Text = procedure(Data: pointer; DataLen: integer; var Text: RawUTF8);
TOnSQLPropInfoRecord2Data = procedure(Text: PUTF8Char; var Data: RawByteString);
What way would you advise to load/save TPersistent objects together with my TSQLRecord?
Regards - Hans
Offline
I think I have worked around it. I'm using a TSQLRawBytes to store my Delphi stream. Previously I stored a TMemorySTream during runtime of by object) but this is just as efficient and also allows the blobreartieve and update routines to work as expected.
My error. - Sorry.
Offline
I suppose it was the easiest to do, without changing the current implementation.
RawByteString or TSQLRawBlob is in fact a good way of storing some BLOB content, without having to worry about freeing the memory, as is required by TMemoryStream.
You have the TRawByteStringStream class in SynCommons.pas to work efficiently with TStream methods, with direct conversion to/from a RawByteString.
Offline
The big issue was that we forgot to implement the ftsBlob handlking in our nexus driver
Once this was fixed, it worked like a charm
Offline