#1 2012-10-14 17:04:21

vladdv89
Member
Registered: 2012-10-14
Posts: 2

Creation of SQL queries in mORMot

I using for access to SQLite from Delphi 7 mORMot http://synopse.info/fossil/wiki?name=Downloads. But thus I will use only connection to a database, but not ORM (Object and relational display) therefore me interest creation of SQL queries in mORMot.

Offline

#2 2012-10-14 23:29:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Creation of SQL queries in mORMot

In short: it is better to use the `SynDB.pas` layer over `SynSQLite3.pas`, via its `SynDBSQLite3.pas` classes, since it will allow your code to work in the future with any database accessible via OleDB / ODBC or even direct access (e.g. for Oracle).

So for your question, read the SynDB-related part of the *mORMot* documentation, and all the [related blog articles](http://blog.synopse.info/tag/SynDB). Those classes are used by the ORM, but you can use those without the ORM.

To start with, there is a `TQuery` wrapper in `SynDB.pas` which works very well with SQLite3 and allow "classic" code-level programming.

But there is not 100% RAD direct access with those units. Just some TClientDataSet "fillers". This was not their purpose: they want fast and direct access to the DB, in code, not via the UI plumbing.

Offline

Board footer

Powered by FluxBB