In short: it is better to use the SynDB.pas layer on top of SynSQLite3.pas through its SynDBSQLite3.pas classes, as this will allow your code to work in the future with any database accessible through OleDB / ODBC or even direct access (for example, for Oracle).
For example, using the option to store column data:
procedure Test(Props: TSQLDBConnectionProperties); var Customer: Variant; begin with Props.Execute('select * from Customers where AccountNumber like ?', ['AW000001%'],@Customer) do while Step do assert(Copy(Customer.AccountNumber,1,8)='AW000001'); end; var Props: TSQLDBConnectionProperties; Props := TSQLDBSQLite3ConnectionProperties.Create('databasefile.db3','','',''); try Test(Props); finally Props.Free; end;
So, for your question, read the mORMot documentation part related to SynDB and all
But with these units there is no 100% direct RAD access. Just some TClientDataSet fillers. This was not their goal: they want quick and direct access to the database, in code, and not through plumbing.
source share