Description | Hierarchy | Fields | Methods | Properties |
type TSqlitePassDatabaseDataTypeOptions = class(TPersistent)
The TSqlitePassDatabaseDataTypeOptions
is used by the TSqlitePassDatabase.DatatypeOptions property and gives you the opportunity to set custom or default behaviors for a given database. It lets you also define how fields.datatype will be retrieved and translated into pascal datatypes using TranslationRules and CustomFieldDefs.
![]() |
constructor Create(Database: TSqlitePassDatabase); |
![]() |
destructor Destroy; override; |
![]() |
function GetOwner: TPersistent; override; |
![]() |
Procedure ApplyCustomFieldDefs; |
![]() |
Procedure LoadFromDatabase(_LoadOptions: TSqlitePassDataTypeStorageOptions = []); |
![]() |
Procedure SaveToDatabase(_SaveOptions: TSqlitePassDataTypeStorageOptions = []); |
![]() |
procedure SetDefaultValues(DatabaseType: TSqlitePassDatabaseType; SetTranslationRules: Boolean=false); |
![]() |
property BooleanFormat : String Read FBooleanFormat Write SetFBooleanFormat; |
![]() |
property BooleanStorage : TSqlitePassBooleanStorage Read FBooleanStorage Write FBooleanStorage; |
![]() |
property CustomFieldDefs : TSqlitePassCustomFieldDefs Read FCustomFieldDefs Write FCustomFieldDefs; |
![]() |
property DateFormat : String Read FDateFormat Write SetFDateFormat; |
![]() |
property DateStorage : TSqlitePassDateStorage Read FDateStorage Write FDateStorage; |
![]() |
property DateTimeFormat : String Read FDateTimeFormat Write SetFDateTimeFormat; |
![]() |
property DateTimeStorage : TSqlitePassDateTimeStorage Read FDateTimeStorage Write FDateTimeStorage; |
![]() |
property DecimalSeparator : Char Read FDecimalSeparator Write FDecimalSeparator; |
![]() |
property DefaultFieldType : TFieldType Read FDefaultFieldType Write FDefaultFieldType; |
![]() |
property DetectionMode : TSqlitePassDataTypeDetectionMode Read FDetectionMode Write FDetectionMode; |
![]() |
property LoadOptions : TSqlitePassDataTypeStorageOptions Read FLoadOptions Write FLoadOptions; |
![]() |
property SaveOptions : TSqlitePassDataTypeStorageOptions Read FSaveOptions Write FSaveOptions; |
![]() |
property TimeFormat : String Read FTimeFormat Write SetFTimeFormat; |
![]() |
property TimeStorage : TSqlitePassTimeStorage Read FTimeStorage Write FTimeStorage; |
![]() |
property TranslationRules : TSqlitePassFieldTypesTranslationRules Read FFieldTypesTranslationRules Write FFieldTypesTranslationRules; |
![]() |
constructor Create(Database: TSqlitePassDatabase); |
—– Constructor / Destructor —– |
![]() |
destructor Destroy; override; |
![]() |
function GetOwner: TPersistent; override; |
![]() |
Procedure ApplyCustomFieldDefs; |
— |
![]() |
Procedure LoadFromDatabase(_LoadOptions: TSqlitePassDataTypeStorageOptions = []); |
![]() |
Procedure SaveToDatabase(_SaveOptions: TSqlitePassDataTypeStorageOptions = []); |
![]() |
procedure SetDefaultValues(DatabaseType: TSqlitePassDatabaseType; SetTranslationRules: Boolean=false); |
![]() |
property BooleanFormat : String Read FBooleanFormat Write SetFBooleanFormat; |
a string used as a Boolean formating template. The Usualy When |
![]() |
property BooleanStorage : TSqlitePassBooleanStorage Read FBooleanStorage Write FBooleanStorage; |
|
![]() |
property CustomFieldDefs : TSqlitePassCustomFieldDefs Read FCustomFieldDefs Write FCustomFieldDefs; |
A custom fielddef can be used to overwrite the fielddefs translation already done by the DetectionMode and the TranslationRules properties. A custom fielddef is made of : A TableName and a FieldName to identify the field A FieldType: TfieldType (ftinteger, ftstring...etc) A FieldSize A FieldPrecision This property can be very usefull when a fielddef cannot be built on the datatype. For example, you created a table with two BLOB fields declared with the same datatype (CLOB) in the table create statement. If you want to store MemoText in the first blob and store graphic data in the second, you just need to create two custom fielddefs using the designtime editor or the sqliteToolbox program and store then in your database using LoadOptions and SaveOptions. At design time, a specific editor lets you define the translation rules. |
![]() |
property DateFormat : String Read FDateFormat Write SetFDateFormat; |
a string used as a Date formating template. The usualy |
![]() |
property DateStorage : TSqlitePassDateStorage Read FDateStorage Write FDateStorage; |
|
![]() |
property DateTimeFormat : String Read FDateTimeFormat Write SetFDateTimeFormat; |
a string used as a DateTime formating template. The usualy DateFormat takes one of the following value : DD-MM-YYYY hh:mm:ss DD/MM/YYYY hh:mm:ss DD-MM-YYYY hh:mm:ss:zzz DD/MM/YYYY hh:mm:ss:zzz Note : Kexi databases format DateTime as DD-MM-YYYYThh:mm:ss ) |
![]() |
property DateTimeStorage : TSqlitePassDateTimeStorage Read FDateTimeStorage Write FDateTimeStorage; |
|
![]() |
property DecimalSeparator : Char Read FDecimalSeparator Write FDecimalSeparator; |
Decimal separator : not used |
![]() |
property DetectionMode : TSqlitePassDataTypeDetectionMode Read FDetectionMode Write FDetectionMode; |
The dmTypeName dmDbSpecific dmCustom dmForceStr |
![]() |
property LoadOptions : TSqlitePassDataTypeStorageOptions Read FLoadOptions Write FLoadOptions; |
if SoManual is not selected (default behavior) your optional settings are retrieved directly from a special table named "SQLitePass__DbSettings" every time you open a database The soTranslationRules : It retrieves and fills the TranslationRules collection. soCustomFieldDefs : It retrieves and fills the CustomFieldDefs collection. soManual : The selected parts are not retrieved automatically. You will then have to call LoadFromDatabase to load your database settings. |
![]() |
property SaveOptions : TSqlitePassDataTypeStorageOptions Read FSaveOptions Write FSaveOptions; |
if SoManual is not selected (default behavior) your optional settings are stored directly to a special table named "SQLitePass__DbSettings" every time you close a database. The soTranslationRules : It saves the the TranslationRules collection to the database. soCustomFieldDefs : It saves the CustomFieldDefs collection to the database. soManual : The selected parts are not saved automatically. You will then have to call SaveToDatabase to save your database settings. |
![]() |
property TimeFormat : String Read FTimeFormat Write SetFTimeFormat; |
a string used as a Time formating template. The |
![]() |
property TimeStorage : TSqlitePassTimeStorage Read FTimeStorage Write FTimeStorage; |
|
![]() |
property TranslationRules : TSqlitePassFieldTypesTranslationRules Read FFieldTypesTranslationRules Write FFieldTypesTranslationRules; |
A translation rule is made of : A datatype name (whatever you want depending on how fields datatypes are named inside the database or the table create statement) A matching rule (mmExact, mmExactNoCase, mmPartial, mmPartialNoCase, mmAll); A resulting datatype (ft... pascal fieldtype) The matching rule can be set for each translation rule and can be one of the following values: mmExact the datatype found in the database table definition must match exactly the rule datatype name. It is case sensitive. For example if the 'Int' name is found in the database table definition then it will not match the ('Integer',mmExact,ftInteger) rule thus ftUnknown will be returned mmExactNoCase Same as mmExact but not case sensitive mmPartial the datatype found in the database table definition can partially match the rule datatype name. It is case sensitive. For example if the 'Int' name is found in the database table definition then it will match the ('Integer',mmExact,ftInteger) rule and will return ftInteger mmPartialNoCase Same as mmPartial but not case sensitive mmAll (Default) Tries to determine the datatype using mmExact. If it fails then another try is done using mmPartial If the matching rule failed, the DefaultFieldType is returned (ftUnknown as default). At design time, a specific editor lets you define the translation rules. |