You are not logged in.
Pages: 1
mORMot 2, SQLite
I would like to set the initial value of the RowID. When the user adds the first record, the value for RowID should be 1000 when executing Add(..., True) via the ORM. Background: When creating the table, I create records that the user cannot change/delete. For these system records I want to reserve a range of 1..999. How can I achieve this?
I thought I had read a solution before, but I can't find it anymore.
With best regards
Thomas
Last edited by tbo (2021-04-26 17:41:35)
Offline
You can force the RowID when adding a record.
So the easiest is to check at startup (or at first add operation) if IRestOrm.TableHasRows() = false then force RowID=1000 for the first add.
It will have the advantage of working with all kind of DB backends.
Offline
Pages: 1