michael faa121f3c9 Merged revisions 4328 via svnmerge from 19 years ago
..
examples 6af0ccfdbd Merged revisions 4000,4002,4007-4010 via svnmerge from 19 years ago
interbase 868de60ed2 Merged revisions 3896,3926,3928,3943,3950-3951 via svnmerge from 19 years ago
mysql f44f5ea1a2 Merged revisions 4266,4286,4302-4303,4311 via svnmerge from 19 years ago
odbc d3b22205fb Merged revisions 3119,3288,3308-3309,3362,3364,3381,3415,3458,3463,3469,3536,3548-3549,3657,3670,3672,3680,3683,3688 via svnmerge from 19 years ago
oracle 6af0ccfdbd Merged revisions 4000,4002,4007-4010 via svnmerge from 19 years ago
postgres 868de60ed2 Merged revisions 3896,3926,3928,3943,3950-3951 via svnmerge from 19 years ago
Makefile ae38848307 Merged revisions 2556-2558,2604,2630-2631,2635,2638,2640,2649,2657,2660-2664,2678,2706,2719-2720,2724,2746-2750,2759,2761,2767-2768,2776-2777,2787 via svnmerge from 19 years ago
Makefile.fpc ae38848307 Merged revisions 2556-2558,2604,2630-2631,2635,2638,2640,2649,2657,2660-2664,2678,2706,2719-2720,2724,2746-2750,2759,2761,2767-2768,2776-2777,2787 via svnmerge from 19 years ago
readme.txt a7fa0220a7 Merged revisions 896,913-914,916-917,930-931,944,985 via svnmerge from 20 years ago
sqldb.pp faa121f3c9 Merged revisions 4328 via svnmerge from 19 years ago
testsqldb.pp b409904e44 Merged revisions 42 via svnmerge from 20 years ago

readme.txt

SQLDB readme file, 20 Aug 2005, Joost van der Sluis

since there is no real documentation about sqldb yet, this should be regarded as
a small reminder to myself, and to others who want to write their own
connections.

From the TSQLConnection point-of-view the following methods are called if a
select-statement is used:

OPEN:
Prepare: (is only called when prepared is false)
- AllocateCursorHandle (only if the cursor <> nil)
- Preparestatement
Execute:
- Execute
- AddFieldDefs (only if called for the first time after a prepare)

GETNEXTPAKCET: (probably called several times, offcourse)
- Fetch
- Loadfield

CLOSE:
- FreeFieldBuffers
- UnPrepareStatement (Only if prepare is False, thus if prepared queries
were not supported)
UnPrepare:
- UnPrepareStatement

DESTROY:
- DeAllocateCursorHandle (Also called if the Connection is changed)


From the TSQLConnection point-of-view the following methods are called if a non-
select-statement is used (execsql):

Prepare: (is only called when prepared is false)
- AllocateCursorHandle (only if the cursor <> nil)
- Preparestatement

Execute:
- Execute
- UnPrepareStatement (Only if prepare is False, thus if prepared queries
were not supported)


UNPREPARE:
- UnPrepareStatement

DESTROY:
- DeAllocateCursorHandle (Also called if the Connection is changed)


A short description of what each method in a TSQLConnection should do:

* Function AllocateCursorHandle : TSQLCursor; override;

This function creates and returns a TSQLcursor which can be used by any query
for the used type of database. The cursor is only database-dependent, it is
deallocated when the connection of the query changes, or if the query is
destroyed.

* Procedure DeAllocateCursorHandle(var cursor : TSQLCursor); override;

This function deallocates the TSQLCursor, and sets its value to nil.

* procedure PrepareStatement(cursor: TSQLCursor;ATransaction : TSQLTransaction;buf : string; AParams : TParams); override;

This functions prepares the query which is given in buf.

It's only called if Prepared is True.
If the database supports prepared queries for the kind of sql-statement (in
cursor.FStatementType) and the prepare was successfully, then cursor.FPrepared
is set to True, so that prepare will not be called again, until UnPrepared
is called. (which sets FPrepared to False)

* procedure FreeFldBuffers(cursor : TSQLCursor); override;

This procedure is called if a Select-query is closed. This procedure is used to
handle all actions which are needed to close a select-statement.