Class TSqlitePassEngine

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSqlitePassEngine = class(TObject)

Description

Hierarchy

Overview

Methods

Public Constructor Create(Database: TSqlitePassDatabase);
Public Destructor Destroy; override;
Public function CheckResult(Const i: Integer; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow): Integer;
Public function CreateFunction(FuncName: String; ArgCount: ShortInt; DefaultEncoding: Byte; UserData: Pointer; xFunc, xStep: TFuncHandler; xFinal: TFuncFinalizer): Boolean;
Public function ExecSQL(Const Sql: String; CallBackFunc: TSqlitePassExecCallBack = nil): Integer;
Public function GetChangesCount: Integer;
Public function GetLastInsertRowId: Int64;
Public function GetTotalChangesCount: Integer;
Public Function LoadSqliteLibrary(LibraryFile: String): Boolean;
Public function PrepareStmt(var Stmt: pointer; const sql: String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow): Boolean;
Public function UnprepareStmt(var Stmt: pointer): Boolean;
Public procedure CloseDatabase;
Public procedure ExecQuery(Const Sql: String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
Public procedure ExecQueryUTF16(Const Sql: UTF16WideString; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
Public procedure ExecQueryUTF8(Const Sql: UTF8String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
Public Procedure FinalizePendingStmts;
Public procedure OpenDatabase(Const FullName: String; Const LibraryFile: String = DefaultSQLiteLibrary);
Public Procedure StartChrono;
Public Procedure StopChrono;

Properties

Public property Connection: Pointer read FConnectionHandle;
Public property ElapsedTime: Double read FElapsedTime;
Public property QueryTimeout: Integer Read FQueryTimeout Write FQueryTimeout;
Public property Transaction: TSqlitePassTransaction Read FTransaction Write FTransaction;

Description

Methods

Public Constructor Create(Database: TSqlitePassDatabase);
 
Public Destructor Destroy; override;
 
Public function CheckResult(Const i: Integer; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow): Integer;
 
Public function CreateFunction(FuncName: String; ArgCount: ShortInt; DefaultEncoding: Byte; UserData: Pointer; xFunc, xStep: TFuncHandler; xFinal: TFuncFinalizer): Boolean;

—— User Defined Functions —–

Public function ExecSQL(Const Sql: String; CallBackFunc: TSqlitePassExecCallBack = nil): Integer;

—— SQL Exec ——

Public function GetChangesCount: Integer;
 
Public function GetLastInsertRowId: Int64;
 
Public function GetTotalChangesCount: Integer;
 
Public Function LoadSqliteLibrary(LibraryFile: String): Boolean;

———— Library —————–

Public function PrepareStmt(var Stmt: pointer; const sql: String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow): Boolean;

—— SQL Statements ——

Public function UnprepareStmt(var Stmt: pointer): Boolean;
 
Public procedure CloseDatabase;
 
Public procedure ExecQuery(Const Sql: String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
 
Public procedure ExecQueryUTF16(Const Sql: UTF16WideString; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
 
Public procedure ExecQueryUTF8(Const Sql: UTF8String; VerboseLevel: TSqlitePassVerboseLevel = vlLogAndShow);
 
Public Procedure FinalizePendingStmts;
 
Public procedure OpenDatabase(Const FullName: String; Const LibraryFile: String = DefaultSQLiteLibrary);

————- Database —————-

Public Procedure StartChrono;

Chrono utility

Public Procedure StopChrono;
 

Properties

Public property Connection: Pointer read FConnectionHandle;
 
Public property ElapsedTime: Double read FElapsedTime;
 
Public property QueryTimeout: Integer Read FQueryTimeout Write FQueryTimeout;
 
Public property Transaction: TSqlitePassTransaction Read FTransaction Write FTransaction;

Transactions. TODO : Rework on nested named transactions. Sqlite engine supports only one active transaction at the same time. In other words, you can't use nested transactions. The TSqlitePassTransaction object will automatically handle this, so any attempt to start a transaction while one is running will have no effect. Transactions are really helpfull to speed up and secure data operations. You should use them as often as you can. If no transaction is active, the TSqlitePassDatabase will always try to start a new transaction before writing to the database and commit it. This could be time consuming if you need to update or add many records at the same time and you should proceed like this : Database.Transaction.Start; ... Your code here to update or create records; ... Database.Transaction.Commit;


Generated by PasDoc 0.11.0 on 2010-03-22 23:38:11