Can we use an "Id" with a data type other than String? #426
Replies: 2 comments
-
|
No. int types (and, by extension, bigint) are not suitable because they are not globally unique. You also don't get an auto-increment capability in the mobile world. One thing you CAN do is to have a GUID Id and an int PkId that is not exposed to the user. The PkId is int/auto-increment on first store; the Id is generated when not provided. |
Beta Was this translation helpful? Give feedback.
-
|
@MartinRobins what I do is that, my entities saved in the DB on the server have an Id to be whatever I want, be it GUID or ULID, and another property, SyncId, which is the mapped property of the Id from the DTO on the client side. This permits me to do filtering, ordering or whatever I want server side with it. I have my custom repositories and acces control providers and this facilitates it. If you need further assistance, let me know. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The PK on most of my (SQL Server) tables is of type "int", and some are "bigint" due to the expected number of rows.
Is it possible to use these tables within the synchronisation service without having to create any alternative PK?
Beta Was this translation helpful? Give feedback.
All reactions