[fpc-pascal] TSQLQuery and buffering.
Michael Van Canneyt
michael at freepascal.org
Sun Mar 26 18:37:36 CEST 2017
r
On Sat, 25 Mar 2017, Martin Schreiber wrote:
> On Saturday 25 March 2017 10:28:37 Michael Van Canneyt wrote:
>> On Sat, 25 Mar 2017, Martin Schreiber wrote:
>> > On Saturday 25 March 2017 09:32:33 Gary Doades wrote:
>> >> I Understand about the "normal" use of TSQLQuery and data sets and I
>> >> also use this for small result set that need the data changing some way
>> >> and writing back to the DB. What I need now is an equally convenient and
>> >> powerful way of processing "big data".
>> >
>> > MSEgui has TSQLResult for that purpose without the TDataset overhead.
>> > https://gitlab.com/mseide-msegui/mseide-msegui/blob/master/lib/common/db/
>> >msesqlresult.pas
>>
>> Can you explain in 2 words how this differs from TDataset ?
>> At first sight it is not fundamentally different.
>> The structure looks almost exactly the same, just the names are different.
>>
> Please follow the datatransfer from database to the destination in application
> in T*Dataset and compare it with TSQLResult and you probably will see the
> difference.
Looking at the above unit, I can only presume you load the field directly
from the cursor returned by the native library.
Makes sense.
>
>> And while you're at it, please explain what the 'overhead' is of TDataset.
>> That TBufDataset introduces overhead is a design decision. But TDataset
>> itself introduces no "overhead".
>>
> TDataset/TDataSource/TDatalink/TField is a complex machine, don't you think?
> Follow the code of a TDataset.Next() call step by step and you will see what
> I mean.
As far as I can make out, TSQLResult is usable only for scanning a result set.
TDataset has a lot more functions, hence has a lot more overhead.
But TSQLResult is an interesting idea; I've long been looking for something
more lightweight for use in web apps, where the typical use case is just
scan a result set and transfer it to the browser. I had thought to reuse
TSQLStatement and keep TField/TFieldDef so as not to invent too much new
classes. I'll maybe use your code as inspiration.
Thanks!
Michael.
More information about the fpc-pascal
mailing list