You are not logged in.
Pages: 1
In a context of Interfaced Service in Server side i would like (seudocode):
function GetSomeData(someParam: Integer): RawJSON;
var
aJSON: rawUTF8;
aObj: TMySQLRecord; // not in the model but declared shared in Server and Client
begin
...
aJSON := '';
aObj := TMySQLRecord.Create;
try
for i := 0 to 100 do
begin
FillMyObject(aObj, i); // Empty and fill the published properties in a complex procedure
aJSON := AddObjectToJSON(aJSON, aObj); << How can do that?
{ how can add aObj streamed as JSON in a not empty aJSON ready for TSQLTableJSON use?? }
end
Finally
aObj.free;
end;
result := aJSON;
end;
The idea is have a service that retrive a rawUTF8, which in the client side can be managed whit TSQLTableJSON and TMySQLRecord.
Note: TMySQLRecord is not in the model, because is filled with a complex procedure and not have a Table in the ExternalDB asociated.
Best ideas are accepted.
Thanks.
Offline
Check TJSONSerializer from mORMot.pas.
See e.g. https://synopse.info/files/html/api-1.1 … SERIALIZER
Offline
Pages: 1