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: String); |
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.
Warning: Pass FileName as AnsiString (if you are not using Unicode Delphi version) or as UnicodeString (on Delphi 2009 and higher)!
|
destructor Destroy; override; |
Class descructor. Call Free instead.
|
procedure ExecSQL(const SQL : String); |
Run SQL command without result. You can call before functions AddParam* for set query parameters.
|
function GetTable(const SQL: String; 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: String): 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: String): 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: String; 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:String; const param: String = ''); |
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:String); |
Commit transaction. If you use non-empty Name parameter, then savepoint is used. Savepoint is named and can be nested.
|
procedure Rollback(const name:String); |
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.
|
function TotalChanges: int64; |
Return number of modified rows starting by opened database connection.
|
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: String; |
Return SQLite engine version.
|
procedure EnableLoadExtension(value: boolean); |
Enable/disable suport for loaded extension libraries.
|
procedure SetChunkSize(DatabaseName: ansistring; value: integer); |
Set chunk size for databaze file grow.
|
procedure AddCustomCollate(name: String; 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: String; value: int64); |
Add named query parameter of integer type.
|
procedure AddParamFloat(const name: String; value: double); |
Add named query parameter of floating-point type.
|
procedure AddParamText(const name: String; const value: AnsiString); |
Add named query parameter of string or binary type.
|
procedure AddParamNull(const name: String); |
Add named query parameter with null value.
|
procedure AddParamBlobPtr(const name: String; buffer: pointer; len: integer); |
Add named query parameter of BLOB type from the memory buffer.
|
procedure AddParamBlobText(const name: String; const value: AnsiString); |
Add named query parameter of BLOB type from the binary string.
|
procedure AddParamBlob(const name: String; const value: TStream; len: integer); |
Add named query parameter of BLOB type from the stream.
|
function DBLoadHandle(SourceDB: TSQliteDB): integer; |
|
function DBLoadFile(const FileName: String): integer; |
|
function DBSaveHandle(DestinationDB: TSQliteDB): integer; |
|
function DBSaveFile(const FileName: String): integer; |
|
function DBBackupHandle(DestinationDB: TSQliteDB): integer; |
|
function DBBackupFile(const FileName: String): integer; |
|
procedure DbBackupStop; |
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 2018-03-13 21:07:28