|
@@ -94,6 +94,8 @@ var SQLDbType : TSQLDBTypes;
|
|
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
|
|
+uses StrUtils;
|
|
|
|
+
|
|
{ TSQLDBConnector }
|
|
{ TSQLDBConnector }
|
|
|
|
|
|
procedure TSQLDBConnector.CreateFConnection;
|
|
procedure TSQLDBConnector.CreateFConnection;
|
|
@@ -131,7 +133,6 @@ begin
|
|
Fconnection := TSQLite3Connection.Create(nil);
|
|
Fconnection := TSQLite3Connection.Create(nil);
|
|
FieldtypeDefinitions[ftCurrency] := 'CURRENCY';
|
|
FieldtypeDefinitions[ftCurrency] := 'CURRENCY';
|
|
FieldtypeDefinitions[ftMemo] := 'CLOB'; //or TEXT SQLite supports both, but CLOB is sql standard (TEXT not)
|
|
FieldtypeDefinitions[ftMemo] := 'CLOB'; //or TEXT SQLite supports both, but CLOB is sql standard (TEXT not)
|
|
- FieldtypeDefinitions[ftFixedChar] := '';
|
|
|
|
end;
|
|
end;
|
|
if SQLDbType = POSTGRESQL then
|
|
if SQLDbType = POSTGRESQL then
|
|
begin
|
|
begin
|
|
@@ -174,9 +175,17 @@ begin
|
|
testValues[ftTime,2]:='23:00:00.000';
|
|
testValues[ftTime,2]:='23:00:00.000';
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+
|
|
if SQLDbType in [sqlite3] then
|
|
if SQLDbType in [sqlite3] then
|
|
testValues[ftCurrency]:=testValues[ftBCD]; //decimal separator for currencies must be decimal point
|
|
testValues[ftCurrency]:=testValues[ftBCD]; //decimal separator for currencies must be decimal point
|
|
|
|
|
|
|
|
+ // SQLite does not support fixed length CHAR datatype
|
|
|
|
+ // MySQL by default trimms trailing spaces on retrieval; so set sql-mode="PAD_CHAR_TO_FULL_LENGTH" - supported from MySQL 5.1.20
|
|
|
|
+ if SQLDbType in [sqlite3] then
|
|
|
|
+ for t := 0 to testValuesCount-1 do
|
|
|
|
+ testValues[ftFixedChar,t] := PadRight(testValues[ftFixedChar,t], 10);
|
|
|
|
+
|
|
|
|
+
|
|
if not assigned(Fconnection) then writeln('Invalid database-type, check if a valid database-type was provided in the file ''database.ini''');
|
|
if not assigned(Fconnection) then writeln('Invalid database-type, check if a valid database-type was provided in the file ''database.ini''');
|
|
|
|
|
|
with Fconnection do
|
|
with Fconnection do
|
|
@@ -190,7 +199,7 @@ begin
|
|
FieldNameQuoteChars[0] := dbQuoteChars[1];
|
|
FieldNameQuoteChars[0] := dbQuoteChars[1];
|
|
FieldNameQuoteChars[1] := dbQuoteChars[2];
|
|
FieldNameQuoteChars[1] := dbQuoteChars[2];
|
|
end;
|
|
end;
|
|
- open;
|
|
|
|
|
|
+ Open;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|