#1 2012-12-17 09:34:55

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Fetching blobs

Hi Ab

I can use a restserver-global parameter to fetch blobs (ForceBlobTransfert=True), or a field specific method to fetch blob data (RetrieveBlob/UpdateBlob).
What's missing here is a way to fetch a single object including all it's blobs depending on the parameter.

This would allow traversing the entire dataset, and only where required load the blobs without changing restserver [parameters or specifying specific blob field names.

Currently, I dont like RetrieveBlob/UpdateBlob that much because it requires a blob field name (=property name) as a parameter. It would already be an enhancement if omitting the property name would fetch all blob's for the provided TSQLRecord.

Also somehow I expected RetrieveBlob/UpdateBlob to be available as methods of TSQLRecord rather than as TRESTserver methods. Otherwise, FillOne was to be expected a method of TRestServer too...


So.

What I am looking for could be something like:

TMormotFetchMode=(fmDefault,fmExcludeBlobs,fmIncludeBlobs);

...

TSQLRecord.FillOne(aFetchMode:TMormotFetchMode=fmDefault)
...

And maybe also a routine something like

  TSQLRecord.FetchAllBlobs; // retrieves all blob fields for the currently loaded record

Whaddyathink?

Hans

Offline

#2 2012-12-17 11:35:35

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: Fetching blobs

smile I have found TSQLRestServer.RetrieveBlobFields and .UpdateBlobfields by now, it was there al the time. smile

Still, I think the optional parameter for TSQLRecord.FillOne as described earlier would be a nice feature.
Same goes -off course- for the TSQLRecord.Add and TSQLRecord.Update methods for that matter.

Offline

#3 2012-12-17 17:25:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,187
Website

Re: Fetching blobs

What do you think of a field parameter list, just as for BATCH?
See http://synopse.info/forum/viewtopic.php?pid=5921#p5921

Offline

Board footer

Powered by FluxBB