Description | Hierarchy | Fields | Methods | Properties |
type TSqlitePassDatabase = class(TComponent)
The TSqlitePassDatabase
component is the main link between your application and the sqlite library. It currently supports sqlite engine version 3.xx and gives you direct acces to a wide range of sqlite databases created using database management progams like kexi, sqlite administrator, sqliteToolbox...etc. With proper setting, you can also use it to read and write to your own custom sqlite databases.
![]() |
Constructor Create(AOwner : TComponent); override; |
![]() |
Destructor Destroy; override; |
![]() |
Function AttachDatabase(FAttachedDatabase, DatabaseAlias: String): Boolean; |
![]() |
Function Compact: Integer; |
![]() |
Function CreateDatabase(DbName: String; DbType: TSqlitePassDatabaseType; Encoding: TSqlitePassEncoding = UTF_8; PageSize: TSqlitePassPageSize = 4096; AutoVacuum: TSqlitePassAutoVacuumType = 0): Boolean; |
![]() |
Function DeleteDatabase(Const DbName: String): Boolean; |
![]() |
Function DetachDatabase(DatabaseAlias: String): Boolean; |
![]() |
Function IsSystemTable(TableName: String): Boolean; |
![]() |
Procedure Close; |
![]() |
Procedure Idle; |
![]() |
Procedure Open; |
![]() |
procedure RefreshDefinitions; |
![]() |
property Connected : Boolean Read FConnected Write SetFConnected Default False; |
![]() |
property Database : String Read FDatabase Write SetFDatabase; |
![]() |
property DatabaseError: TSqlitePassDatabaseError Read FDatabaseError; |
![]() |
property Databases: TSqlitePassDatabasesAttached Read FDatabases; |
![]() |
property DatabaseType : TSqlitePassDatabaseType Read FDatabaseType Write FDatabaseType; |
![]() |
property Datasets: TSqlitePassDatasets Read FDatasets Write FDatasets; |
![]() |
property DatatypeOptions : TSqlitePassDatabaseDataTypeOptions Read FDatatypeOptions Write FDatatypeOptions; |
![]() |
property Engine: TSqlitePassEngine Read GetFEngine; |
![]() |
property IndexDefs: TSqlitePassDatabaseIndexDefs Read FIndexDefs Write FIndexDefs; |
![]() |
property OnAfterConnect : TConnectEvent Read FAfterConnect Write FAfterConnect; |
![]() |
property OnAfterDisconnect : TConnectEvent Read FAfterDisconnect Write FAfterDisconnect; |
![]() |
property OnBeforeConnect : TConnectEvent Read FBeforeConnect Write FBeforeConnect; |
![]() |
property OnBeforeDisconnect : TConnectEvent Read FBeforeDisconnect Write FBeforeDisconnect; |
![]() |
property OnDataTypeConversion : TDataTypeConversion Read FDataTypeConversion Write FDataTypeConversion; |
![]() |
property Options : TSqlitePassDatabaseOptions Read FOptions Write FOptions; |
![]() |
property QueryDefs: TSqlitePassQueryDefs Read FQueryDefs Write FQueryDefs; |
![]() |
property QueryTimeout : Integer Read FQueryTimeout Write FQueryTimeout; |
![]() |
property ReadOnly : Boolean Read FReadOnly Write SetFReadOnly default False; |
![]() |
property ShowSystemObjects : Boolean Read FShowSysObjects Write SetFShowSysObjects; |
![]() |
property SmartOpen : Boolean Read FSmartOpen Write FSmartOpen; |
![]() |
property SQLiteLibrary : String Read FSQLiteLibrary Write SetFSQLiteLibrary; |
![]() |
property SQLStmtDefs: TSqlitePassSQLStmtDefs Read FSQLStmtDefs Write FSQLStmtDefs; |
![]() |
property TableDefs: TSqlitePassTableDefs Read FTableDefs Write FTableDefs; |
![]() |
property Translator: TSqlitePassTranslator Read FTranslator; |
![]() |
property Triggers: TSqlitePassTriggers Read FTriggers Write FTriggers; |
![]() |
property UserTag : Integer Read FUser Write SetFUser; |
![]() |
property VersionInfo : TSqlitePassDatabaseVersionInfo Read FVersionInfo Write FVersionInfo; |
![]() |
property Views: TSqlitePassViews Read FViews Write FViews; |
![]() |
Constructor Create(AOwner : TComponent); override; |
—– Constructor / Destructor —– |
![]() |
Destructor Destroy; override; |
![]() |
Function AttachDatabase(FAttachedDatabase, DatabaseAlias: String): Boolean; |
Enables to attach one or several foreign databases to the current one. The attached databases must be compatible with the current one (the databases must have been created with the same database manager application). Once a database is attached, its content becomes available as part of the current database. Then you can access to tables, queries... as if they were part of the main database. Usage : |
![]() |
Function Compact: Integer; |
![]() |
Function CreateDatabase(DbName: String; DbType: TSqlitePassDatabaseType; Encoding: TSqlitePassEncoding = UTF_8; PageSize: TSqlitePassPageSize = 4096; AutoVacuum: TSqlitePassAutoVacuumType = 0): Boolean; |
![]() |
Function DeleteDatabase(Const DbName: String): Boolean; |
![]() |
Function DetachDatabase(DatabaseAlias: String): Boolean; |
Detaches a previously attached database. |
![]() |
Function IsSystemTable(TableName: String): Boolean; |
Returns True if the Table is a system table |
![]() |
Procedure Close; |
Same as Connected := False |
![]() |
Procedure Idle; |
—– Procedures / Functions —– |
![]() |
Procedure Open; |
Same as Connected := True |
![]() |
procedure RefreshDefinitions; |
Updates the database definition content (TableDefs, QueryDefs...) from file |
![]() |
property Connected : Boolean Read FConnected Write SetFConnected Default False; |
Set this property to True to connect the database defined in the database property. Set it to False to disconnect the database and all the datasets associated with it. You can also verify if a database is |
![]() |
property Database : String Read FDatabase Write SetFDatabase; |
Represents the physical |
![]() |
property DatabaseError: TSqlitePassDatabaseError Read FDatabaseError; |
A utility object to log errors |
![]() |
property Databases: TSqlitePassDatabasesAttached Read FDatabases; |
A collection of attached database to the current one |
![]() |
property DatabaseType : TSqlitePassDatabaseType Read FDatabaseType Write FDatabaseType; |
Represents the database type detected from the database file extension you are using. (*.kexi for kexi database for example). Once the database type is recognised, the TsqlitePassDatabase component sets this property and creates an internal translator to take care of the database specifications. You can also define this property by yourself if the file extension doesn't match the correct database type. |
![]() |
property Datasets: TSqlitePassDatasets Read FDatasets Write FDatasets; |
A collection of all the |
![]() |
property DatatypeOptions : TSqlitePassDatabaseDataTypeOptions Read FDatatypeOptions Write FDatatypeOptions; |
One of the main difficulties when working with Sqlite databases is to detect and translate properly the fields.datatypes since sqlite datatype are not formely defined. SqlitePass implements several ways to define a datatype. The Database.DatatypeOptions property gives you the opportunity to set custom or default behaviors for a given database and lets you also define how fields.datatype will be retrieved and translated into pascal datatypes using TranslationRules and CustomFieldDefs |
![]() |
property Engine: TSqlitePassEngine Read GetFEngine; |
Internal object to access the sqlite |
![]() |
property IndexDefs: TSqlitePassDatabaseIndexDefs Read FIndexDefs Write FIndexDefs; |
The |
![]() |
property OnAfterConnect : TConnectEvent Read FAfterConnect Write FAfterConnect; |
—– Events —– |
![]() |
property OnAfterDisconnect : TConnectEvent Read FAfterDisconnect Write FAfterDisconnect; |
![]() |
property OnBeforeConnect : TConnectEvent Read FBeforeConnect Write FBeforeConnect; |
![]() |
property OnBeforeDisconnect : TConnectEvent Read FBeforeDisconnect Write FBeforeDisconnect; |
![]() |
property OnDataTypeConversion : TDataTypeConversion Read FDataTypeConversion Write FDataTypeConversion; |
![]() |
property Options : TSqlitePassDatabaseOptions Read FOptions Write FOptions; |
Represents the database optional settings. |
![]() |
property QueryDefs: TSqlitePassQueryDefs Read FQueryDefs Write FQueryDefs; |
The |
![]() |
property QueryTimeout : Integer Read FQueryTimeout Write FQueryTimeout; |
![]() |
property ReadOnly : Boolean Read FReadOnly Write SetFReadOnly default False; |
Same as classic dataset behavior |
![]() |
property ShowSystemObjects : Boolean Read FShowSysObjects Write SetFShowSysObjects; |
![]() |
property SmartOpen : Boolean Read FSmartOpen Write FSmartOpen; |
When set to True, the TsqlitePassDataset will automatically takes care of opening the database connection if the database is not connected. Set it to False to manually control the database connection. |
![]() |
property SQLiteLibrary : String Read FSQLiteLibrary Write SetFSQLiteLibrary; |
Represents an alternative library file to be used instead of the default one. By default, sqlitepassDatabase tries to use the sqlitepass3.dll or libsqlitepass3.so file located in the system path directory (..\windows\system32\ or ..\user\lib for example). Enter a complete library file path to use a different library. From version 0.28 TsqlitePassDatabase needs the sqlite library compiled with the ENABLE_METADATA precompiler directive. These libraries are available from http://source.online.free.fr or you can compile your own following the tutorial available on the same internet site. |
![]() |
property SQLStmtDefs: TSqlitePassSQLStmtDefs Read FSQLStmtDefs Write FSQLStmtDefs; |
![]() |
property TableDefs: TSqlitePassTableDefs Read FTableDefs Write FTableDefs; |
The |
![]() |
property Translator: TSqlitePassTranslator Read FTranslator; |
translation object used to get or set data that depend on the DatabaseType property |
![]() |
property Triggers: TSqlitePassTriggers Read FTriggers Write FTriggers; |
The TriggerDefs property is a collection that gives you access to the |
![]() |
property UserTag : Integer Read FUser Write SetFUser; |
![]() |
property VersionInfo : TSqlitePassDatabaseVersionInfo Read FVersionInfo Write FVersionInfo; |
![]() |
property Views: TSqlitePassViews Read FViews Write FViews; |
The ViewDefs property is a collection that gives you access to the |