Code: Select all
begin
result := TFDConnection.Create(nil);
result.Params.Clear;
result.Params.Add('DriverID=SQLite');
result.Params.Add('Database=' + self.DatabaseFullPath);
result.Params.Add('OpenMode=CreateUTF16');
result.Params.Add('LockingMode=Normal');
result.Params.Add('JournalMode=WAL');
result.Params.Add('Synchronous=Full');
result.Params.Add('UpdateOptions.LockWait=True');
result.Params.Add('BusyTimeout=30000');
result.Params.Add('SQLiteAdvanced=temp_store=MEMORY');
result.Params.Add('SQLiteAdvanced=page_size=8192');
result.Params.Add('SQLiteAdvanced=auto_vacuum=FULL');
result.Open();
end;
Code: Select all
begin
result := TUniConnection.Create(nil);
result.ProviderName := 'SQLite';
result.Database := self.DatabaseFullPath;
result.SpecificOptions.Values['UseUnicode'] := 'True';
result.SpecificOptions.Values['BusyTimeout'] := '30000';
result.Open();
end;
Another option I thought of was to build the connection string and use that but unfortunately I kept getting errors saying 'Connection parameter name is unknown: XXXX' and couldn't find any documentation to help. I did find this reference to the connection string options in .NET documentation https://www.devart.com/dotconnect/sqlit ... tring.html
Hopefully someone can lead me in the right direction.