#1 2012-01-07 23:05:29

gaddlord
Member
Registered: 2012-01-02
Posts: 8
Website

Why TSQLRequest = object? This is arcane.

I wonder why you chose to declare

TSQLRequest = object
TSQLStatementCached = object

this is arcane Object Pascal way of declaring stuff. And it can create issues as well (see http://stackoverflow.com/questions/1013 … bject-type for example).

Can you convert those to

TSQLRequest = class(TObject)
TSQLStatementCached = class(TObject)

this would allow easier control of declaration, feeing, avoid the need to use pointers in the cache, and allow you building (as in my case) global cache for binded statements (not just Json results).

Last edited by gaddlord (2012-01-07 23:10:29)

Offline

#2 2012-01-07 23:25:47

Leander007
Member
From: Slovenia
Registered: 2011-04-29
Posts: 113

Re: Why TSQLRequest = object? This is arcane.

This was discussed at least in two topics:
First in favor to object.
And second, yes there are possible problems with them too.


"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal

Offline

#3 2012-01-08 09:35:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Why TSQLRequest = object? This is arcane.

TSQLRequest is just a small record pointing to the SQLite3 handles.

Argument of using a global cache for statements is interesting.
But it will be to use it outside the framework.
For this purpose, you have the SynDBSQLlite3 unit available. See http://blog.synopse.info/post/2011/07/2 … ect-access
Statements are already implemented as classes, use an internal cache, and are of higher level: you could use the same code then switch to Oracle or MSSQL (or any OleDB provider) on need.
TSQLRequest is very low-level. In fact, you should not use The SynSQLite3 unit directly in your applications.

Offline

Board footer

Powered by FluxBB