marco 0e7e7e98ec * cleanup sqlite connection for BCD formatsetting improvements 14 rokov pred
..
examples 5b8dd4c004 * move fcl sources to separate packages 18 rokov pred
interbase d8187bfdb5 * Raise exceptions in case of wrong parameter types for date/float 14 rokov pred
mysql c1fc8180c8 * Fixed typo/compilation in r17416 14 rokov pred
odbc 428915a90b * Patch from Ladislav Karrach to fix problems when closing TSQLQueries when the connection is not active, bug #17623 14 rokov pred
oracle 8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and 15 rokov pred
postgres ee461becfb * Fix for 19018 14 rokov pred
sqlite 0e7e7e98ec * cleanup sqlite connection for BCD formatsetting improvements 14 rokov pred
Makefile 8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and 15 rokov pred
Makefile.fpc 8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and 15 rokov pred
fpmake.inc 5b8dd4c004 * move fcl sources to separate packages 18 rokov pred
fpmake.pp 5b8dd4c004 * move fcl sources to separate packages 18 rokov pred
readme.txt 5b8dd4c004 * move fcl sources to separate packages 18 rokov pred
sqldb.pp eb3ccbcb1f * commit patch for various SQL formatting and conversions issues from Mantis #17188 from LacaK2 14 rokov pred
testsqldb.pp 606261a21d * Patch from Leonardo M. Ramé which adds sqlite3 to the example 18 rokov pred

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.