Class TSQLiteDatabase
Unit
SQLiteWrap
Declaration
type TSQLiteDatabase = class(TObject)
Description
Class for handling SQLite database
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
constructor Create(const FileName: AnsiString); |
Class constructor. Pass filename of database. If databas not exists, then new one is created. If you pass empty string as filename, then temporary database is created. If you pass ':memory:' as filename, then temporary database in memory is created.
 |
destructor Destroy; override; |
Class descructor. Call Free instead.
 |
procedure ExecSQL(const SQL: Ansistring); |
Run SQL command without result. You can call before functions AddParam* for set query parameters.
 |
function GetTable(const SQL: Ansistring; PrepareOnly: Boolean = false): TSQLiteTable; |
Run SQL command with result. You can call before functions AddParam* for set query parameters. If you set PerpareOnly, then query is just prepared but first row is not fetched!
 |
function GetTableValue(const SQL: Ansistring): int64; |
Run SQL command and number from first field in first row is returned. You can call before functions AddParam* for set query parameters.
 |
function GetTableString(const SQL: Ansistring): AnsiString; |
Run SQL command and value from first field in first row is returned. You can call before functions AddParam* for set query parameters.
 |
procedure GetTableStrings(const SQL: Ansistring; const Value: TStrings); |
Run SQL command and values from first field in each row is filled to stringlist. You can call before functions AddParam* for set query parameters.
 |
function InTransaction: Boolean; |
Return True
if database is in transaction state.
 |
procedure Start(const name:AnsiString; const param: AnsiString = ''); |
Start transaction. You can modify transaction type by Param parameter. If you use non-empty Name parameter, then savepoint is used. Savepoint is named and can be nested.
 |
procedure Commit(const name:AnsiString); |
Commit transaction. If you use non-empty Name parameter, then savepoint is used. Savepoint is named and can be nested.
 |
procedure Rollback(const name:AnsiString); |
Rollback transaction. If you use non-empty Name parameter, then savepoint is used. Savepoint is named and can be nested.
 |
function LastInsertRowID: int64; |
Get ROWID of last inserted row.
 |
function LastChangedRows: int64; |
Return number of modified rows by last query.
 |
procedure SetTimeout(Value: integer); |
Set wait timeout. if database is locked, then it wait this timeout. If database is not released within this timeout, then error is returned.
 |
function Version: AnsiString; |
Return SQLite engine version.
 |
procedure AddCustomCollate(name: AnsiString; xCompare: TCollateXCompare); |
Add custom sorting procedure as new Collate.
 |
Procedure AddSystemCollate; |
Add collate named SYSTEM for correct data sorting by user's locale
 |
procedure ParamsClear; |
Clear all query parameters.
 |
procedure AddParamInt(const name: AnsiString; value: int64); |
Add named query parameter of integer type.
 |
procedure AddParamFloat(const name: AnsiString; value: double); |
Add named query parameter of floating-point type.
 |
procedure AddParamText(const name: AnsiString; const value: AnsiString); |
Add named query parameter of string or binary type.
 |
procedure AddParamNull(const name: AnsiString); |
Add named query parameter with null value.
Properties
 |
property DB: TSQLiteDB read fDB; |
SQLite database handler.
 |
property OnQuery: THookQuery read FOnQuery write FOnQuery; |
Debug hook for log all called queries.
Generated by PasDoc 0.9.0 on 2009-06-16 13:42:34