You are not logged in.
Pages: 1
Sure. I`m just new to mORMot.
Thanks.
Ok, the code.
FModel := TSQLModel.Create([TModelUser]);
VirtualTableExternalRegister(FModel, TModelUser, FOwner.ConnectionProperties);
FServer := TSQLRestServerDB.Create(FModel, SQLITE_MEMORY_DATABASE_NAME);
GetRestServerDb.CreateSQLIndex(TModelUser, ['UserName'], True);
GetRestServerDb.CreateMissingTables;
Where FOwner.ConnectionProperties is a connection property to postgresql server.
When i try to create the index i get:
Project Shell.exe raised exception class ESQLite3Exception with message 'Error SQLITE_ERROR (1) using 3.8.9 - 'no such table: main.ModelUser' extended_errcode=1'.
Is this a known issue?
Thanks in advance.
------
Solved:
Just reverse the last two lines. ;)
Thanks.
Hi there again.
Since mORMot handles fields by published properties i got another question, it is possible to add to the mORMot kernel fields at runtime (i will just provide the size/memory for it).
Or is there a builtin funcionality available for such cases?
Thanks in advance.
Hi, thanks for the reply.
So it seems that the zeos postgresql (maybe others) implementation should be extended as there is a ZSQLException but without any status code in the estabilishment of a connection part.
Hello,
I`m trying to investigate how should i handle connection errors code. Especially with postgresql such as bad database name, invalid user password etc. Any advice? The exceptions doesnt have any code errors just, a message, wich can be either in English or other language depending on pgsql so its not a good way to check it. ZdbcPostgreSqlUtils: CheckPostgreSQLError
Thanks in advance.
Hm, I just saw that FDatabase.Add doesnt add any fields to it... Anyway, should i do something more than just inherit from TSQLRecord and make published properties so they should be visible as fields?
ps. Thats quite strange, because the sample works as expected - but not mine..
ps2. I did find out, that my model TSQLTest = class(TSQLRecord) doesnt have any fields, just an ID. Solved: I did have the fields in the public section of the class not published... Omg.
FModel := TSQLModel.Create([TEntryDb]);
FDatabase := TSQLRestServerDB.Create(FModel, AFilename);
TSQLRestServerDB(FDatabase).CreateMissingTables(0);
FList := TSQLRestServerDB(FDatabase).RetrieveList(TEntryDb, nil, []);
Hm, nothing special same code like in sample 2. I did add the records like in the sample 02.
Hi there,
I got a simple question and cannot find the answer in the samples.
I got an class that inherit TSQLRecord and TSQLRestServerDB. I do everything as in the 02 - Embedded SQLite3 ORM sample, anyway now i want load the data from the sqlite3 file (its created). An here is the problem i use the method RetrieveList wich retrieves me some records but all of them are empty (only the headers of TSQLRecord are saved or assigned somewhere).
Cannot get it to load data from the TSQLRestServerDB.
Any hints? I tried FillPrepare, FillRow, FillOne no success.
Best Regards,
LB.
Pages: 1