Skip to content

Commit

Permalink
Issue #12: SQLite allows any column type declaration, even custom types.
Browse files Browse the repository at this point in the history
* support those declarations which are commonly used in other database systems, and for which Heidi has a fitting grid editor
* move UNIQUEIDENTIFIER from text group to binary group
* remove useless native type ids and empty descriptions
  • Loading branch information
ansgarbecker committed Jan 19, 2020
1 parent c994e43 commit 3b84ccc
Showing 1 changed file with 32 additions and 108 deletions.
140 changes: 32 additions & 108 deletions source/dbstructures.pas
Expand Up @@ -2078,11 +2078,10 @@ TSQLiteLib = class(TDbLib)
)
);

SQLiteDatatypes: Array[0..17] of TDBDatatype =
SQLiteDatatypes: Array[0..13] of TDBDatatype =
(
(
Index: dtUnknown;
NativeTypes: '99999';
Name: 'UNKNOWN';
Description: 'Unknown data type';
HasLength: False;
Expand All @@ -2094,49 +2093,19 @@ TSQLiteLib = class(TDbLib)
),
(
Index: dtTinyint;
NativeTypes: '1';
Name: 'TINYINT';
Names: 'INT2|BOOLEAN|BOOL';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dtSmallint;
NativeTypes: '1';
Name: 'SMALLINT';
Names: '';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dtMediumint;
NativeTypes: '1';
Name: 'INTEGER';
Names: 'MEDIUMINT|INT8';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dtInt;
NativeTypes: '1';
Name: 'INTEGER';
Names: 'INT';
Description: '';
Names: 'INT|MEDIUMINT|INT8';
HasLength: False;
RequiresLength: False;
HasBinary: False;
Expand All @@ -2146,10 +2115,8 @@ TSQLiteLib = class(TDbLib)
),
(
Index: dtBigint;
NativeTypes: '1';
Name: 'BIGINT';
Names: 'UNSIGNED BIG INT';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
Expand All @@ -2158,39 +2125,9 @@ TSQLiteLib = class(TDbLib)
Category: dtcInteger;
),
(
Index: dtChar;
NativeTypes: '3';
Name: 'CHARACTER';
Names: 'CHAR|NCHAR|NATIVE CHARACTER';
Description: '';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: True;
DefLengthSet: '50';
Category: dtcText;
),
(
Index: dtText;
NativeTypes: '3';
Index: dtVarchar;
Name: 'VARCHAR';
Names: 'VARCHAR|VARYING CHARACTER';
Description: '';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: True;
DefLengthSet: '50';
Category: dtcText;
),
(
Index: dtText;
NativeTypes: '3';
Name: 'NVARCHAR';
Names: 'NVARCHAR';
Description: '';
Names: 'VARCHAR|VARYING CHARACTER|NVARCHAR|CHARACTER|CHAR|NCHAR|NATIVE CHARACTER';
HasLength: True;
RequiresLength: True;
HasBinary: False;
Expand All @@ -2201,10 +2138,8 @@ TSQLiteLib = class(TDbLib)
),
(
Index: dtText;
NativeTypes: '3';
Name: 'TEXT';
Names: 'CLOB';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
Expand All @@ -2214,21 +2149,17 @@ TSQLiteLib = class(TDbLib)
),
(
Index: dtUniqueidentifier;
NativeTypes: '3';
Name: 'UNIQUEIDENTIFIER';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: True;
Category: dtcText;
LoadPart: False;
Category: dtcBinary;
),
(
Index: dtBlob;
NativeTypes: '4';
Name: 'BLOB';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
Expand All @@ -2238,10 +2169,8 @@ TSQLiteLib = class(TDbLib)
),
(
Index: dtReal;
NativeTypes: '2';
Name: 'REAL';
Names: 'REAL|NUMERIC';
Description: '';
Names: 'REAL|NUMERIC|DOUBLE|DOUBLE PRECISION|FLOAT|DECIMAL';
HasLength: False;
RequiresLength: False;
HasBinary: False;
Expand All @@ -2250,63 +2179,58 @@ TSQLiteLib = class(TDbLib)
Category: dtcReal;
),
(
Index: dtDouble;
NativeTypes: '2';
Name: 'DOUBLE';
Names: 'DOUBLE PRECISION';
Description: '';
Index: dtDate;
Name: 'DATE';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcReal;
Category: dtcTemporal;
),
(
Index: dtFloat;
NativeTypes: '2';
Name: 'FLOAT';
Description: '';
HasLength: True;
Index: dtTime;
Name: 'TIME';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcReal;
Category: dtcTemporal;
),
(
Index: dtDecimal;
NativeTypes: '2';
Name: 'DECIMAL';
Description: '';
HasLength: True;
Index: dtDatetime;
Name: 'DATETIME';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcReal;
Category: dtcTemporal;
),
(
Index: dtDate;
Name: 'DATE';
Description: '';
HasLength: False;
RequiresLength: False;
Index: dtEnum;
NativeType: mytEnum;
Name: 'ENUM';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcTemporal;
DefLengthSet: '''Y'',''N''';
Category: dtcOther;
),
(
Index: dtDatetime;
Name: 'DATETIME';
Description: '';
HasLength: False;
RequiresLength: False;
Index: dtSet;
NativeType: mytSet;
Name: 'SET';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcTemporal;
DefLengthSet: '''Value A'',''Value B''';
Category: dtcOther;
)
);

Expand Down

0 comments on commit 3b84ccc

Please sign in to comment.