|
@@ -42,6 +42,8 @@ type
|
|
TArrayStringArray = Array of TStringArray;
|
|
TArrayStringArray = Array of TStringArray;
|
|
PArrayStringArray = ^TArrayStringArray;
|
|
PArrayStringArray = ^TArrayStringArray;
|
|
|
|
|
|
|
|
+ { TSQLite3Connection }
|
|
|
|
+
|
|
TSQLite3Connection = class(TSQLConnection)
|
|
TSQLite3Connection = class(TSQLConnection)
|
|
private
|
|
private
|
|
fhandle: psqlite3;
|
|
fhandle: psqlite3;
|
|
@@ -83,6 +85,7 @@ type
|
|
procedure execsql(const asql: string);
|
|
procedure execsql(const asql: string);
|
|
procedure UpdateIndexDefs(var IndexDefs : TIndexDefs; const TableName : string); // Differs from SQLDB.
|
|
procedure UpdateIndexDefs(var IndexDefs : TIndexDefs; const TableName : string); // Differs from SQLDB.
|
|
function getprimarykeyfield(const atablename: string; const acursor: tsqlcursor): string;
|
|
function getprimarykeyfield(const atablename: string; const acursor: tsqlcursor): string;
|
|
|
|
+ function RowsAffected(cursor: TSQLCursor): TRowsCount; override;
|
|
public
|
|
public
|
|
function GetInsertID: int64;
|
|
function GetInsertID: int64;
|
|
published
|
|
published
|
|
@@ -111,6 +114,8 @@ type
|
|
Procedure UnPrepare;
|
|
Procedure UnPrepare;
|
|
Procedure Execute;
|
|
Procedure Execute;
|
|
Function Fetch : Boolean;
|
|
Function Fetch : Boolean;
|
|
|
|
+ public
|
|
|
|
+ RowsAffected : Largeint;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure freebindstring(astring: pointer); cdecl;
|
|
procedure freebindstring(astring: pointer); cdecl;
|
|
@@ -222,6 +227,7 @@ begin
|
|
{$endif}
|
|
{$endif}
|
|
if (fstate<=sqliteerrormax) then
|
|
if (fstate<=sqliteerrormax) then
|
|
checkerror(sqlite3_reset(fstatement));
|
|
checkerror(sqlite3_reset(fstatement));
|
|
|
|
+ RowsAffected:=sqlite3_changes(fhandle);
|
|
if (fstate=sqlite_row) then
|
|
if (fstate=sqlite_row) then
|
|
fstate:= sqliteerrormax; //first row
|
|
fstate:= sqliteerrormax; //first row
|
|
end;
|
|
end;
|
|
@@ -697,6 +703,14 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TSQLite3Connection.RowsAffected(cursor: TSQLCursor): TRowsCount;
|
|
|
|
+begin
|
|
|
|
+ if assigned(cursor) then
|
|
|
|
+ Result := (cursor as TSQLite3Cursor).RowsAffected
|
|
|
|
+ else
|
|
|
|
+ Result := -1;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TSQLite3Connection.UpdateIndexDefs(var IndexDefs: TIndexDefs;
|
|
procedure TSQLite3Connection.UpdateIndexDefs(var IndexDefs: TIndexDefs;
|
|
const TableName: string);
|
|
const TableName: string);
|
|
var
|
|
var
|