You are not logged in.
Pages: 1
Hi,
I'm new with your ORM, while reading the SAD documentation. I don't understand how to get a TSQLRecord.CreateAndFillPrepare.
Connect to the database and use a TSQLDBStatement is all right.
But what class do I have to use to connect into the TSQLDBConnection and the TSQLRecord(if that is possible)?
How can I retrieve a record from the database to a TSQLRecord inherited class? Do I have to use TSQLRestServerDB?
Offline
I you use the ORM part, do not use low-level SynSQLite3 nor SynDB classes and methods.
So here, forget about TSQLDBStatement / TSQLDBConnection, and use TSQLRestServerDB for a local server.
See sample 01 and 02 for instance...
Online
OK, but how can I acess Fiberbird withou using TSQLDBStatement / TSQLDBConnection, and only using TSQLRestServerDB?
Offline
You need a SQLite3 kernel, so TSQLRestServerDB is good, but you can leave your main database be ':memory:' so no SQLite3 file will be created.
Then you define all your tables as external, corresponding to your FireBird connection properties.
And you work with the ORM classes, just as usual.
Online
Where in the SAD documentation can I find It? Is there any example for guide me?
Offline
See "SQLite3/Samples/15 - External DB performance/PerfMain.pas" file.
For external DB.
You will get there some ideas, but it is a big complicated since it works with several external engines.
See http://synopse.info/fossil/artifact/eae … f66caad795 for a direct example of setting all tables as external.
It calls VirtualTableExternalRegisterAll() function.
Online
I'm trying to emulate it, but some how doesn't work.
var
Props: TSQLDBFirebirdConnectionClientProperties;
Server : TSQLRestServerDB;
Cli : TClient;
CliModel : TSQLModel;
Client : TSQLRestClientDB;
begin
Props := TSQLDBFirebirdConnectionClientProperties.Create('localhost:X:\MORMOT\ORM\TEST.fdb', 'TEST.fdb', 'SYSDBA', 'masterkey');
CliModel := TSQLModel.Create([TCliente], 'root');
VirtualTableExternalRegister(CliModel, TClient, Props, 'CLIENT');
Server := TSQLRestServerDB.Create(CliModel, 'application.db');
Cli :=TClient.CreateAndFillPrepare(Server, 'ID=?', [1]);
It says theres no such table, but in the database the table is all normal. What am I doing wrong?
Last edited by TommyYommi (2013-01-29 22:41:50)
Offline
Ok, I add the code
Server.CreateMissingTables(0);
It says the table already exists. What can be the cause of this error?
Last edited by TommyYommi (2013-01-30 10:40:26)
Offline
Ensure you have the latest version from http://synopse.info/fossil
Some issues related to external table creation have been fixed.
Online
I downloaded the last version, but the problem persist.
What does CreateMissingTables do?
On the Firebird database already exists a table CLIENT that I created and insert some records in it.I'm just trying to acess this Table and retrive one of those records.
Offline
You are using TSQLDBFirebirdConnectionClientProperties direct access class, which is just not working, since it is not finished, but still a work in progress!
Statements even can not be executed with this unit...
To use an external FireBird database, you have to use the ODBC connector, until SynDBFirebird.pas is implemented.
Online
Ok, do you think until June/2013 this unit will be work fine?
Offline
Perfect, I'm will wait for it.
It would very nice if you developed a example using this unit, when you release SynDBFirebird.pas.
What do you think?
Last edited by TommyYommi (2013-01-30 16:12:25)
Offline
Yes, FireBird will be a first-class citizen within mORMot.
For instance, I would like to include it to SynDBExplorer tool.
Also, I would like to see SynDBfirebird included even within the regression tests, using the embedded version, if the dll is available within the main Delphi executable.
I'm wondering which kind of performance we may achieve.
Online
Pages: 1