peter a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
..
examples ecc8ef0c5f Merged revisions 1780-1783,1800 via svnmerge from 20 anos atrás
interbase a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
mysql a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
odbc a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
postgres a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
Makefile a54a8634aa Merged revisions 375,2257,2261-2262,2271,2296,2376,2443 via svnmerge from 19 anos atrás
Makefile.fpc 94052210ca Merged revisions 1954-1955,1962-1963,1966-1967,1969,1973,1979,1982,1987-1992,1994-1999,2003-2007,2017,2021,2023,2031-2033,2035,2037,2039-2042,2045-2047,2050,2054-2057,2063,2065-2066,2069,2071-2075,2077-2078,2080-2081,2083,2097-2098,2101,2105-2106,2144-2145,2149,2156-2157,2176,2190,2194-2195,2202,2209-2211,2216,2220,2225-2232,2238 via svnmerge from 20 anos atrás
readme.txt a7fa0220a7 Merged revisions 896,913-914,916-917,930-931,944,985 via svnmerge from 20 anos atrás
sqldb.pp 2b73da8927 Merged revisions 1980,2022,2034,2161 via svnmerge from 20 anos atrás
testsqldb.pp b409904e44 Merged revisions 42 via svnmerge from 20 anos atrás

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.