You are not logged in.
Pages: 1
We have a huge system containing several hundreds of tables and I tries to replace pieces of delphi-code by using mORMot and the DDD-concept.
When I do some testing I find that it won't work when the tables don't contain the ID-field. Which is true in most tables.
I can not access these tables without getting the "Invalid column name 'ID'" - error
In the implementation of the service I'm intend not to use ORM on these tables to avoid such problems. But that's not enough.
Even the call of "CreateMissingTables" returns this error. So I wonder if there is a solution for this or if I need to treat these tables in a total different way?
Delphi-11, WIN10
Offline
A genuine 64-bit integer ID is a limitation/feature of SQlite3, and also of mORMot ORM.
So such legacy tables are not compatible with the ORM - unless you add an ID integer additional primary key (which may not be the best idea).
Some hints:
- Write a persistence service as an interface/class (as required by DDD)
- Uncouple persistence and SOA services (i.e. the SOA TSQLRestServer is a TSQLRestServerFullMemory and not a DB/ORM TSQLRestServerDB)
- Reuse your existing SQL statements, with SynDB as access layer if possible (you will have better performance, and direct JSON support)
- You may use the ORM for MicroService local persistence (with SQLite3) - and/or for new tables in your legacy DB (or another storage, e.g. MongoDB)
Offline
Pages: 1