Sequential IDs for Multi-tenant App?


Any suggestion on how to add items to the database and give them sequential IDs per client? Example:

aleint_A’s items IDs: 1, 2, 3, …
cleint_B’s items IDs: 1, 2, 3, …
cleint_C’s items IDs: 1, 2, 3, …

Given that data might be created in a local realm first then synced later on.


In order to achieve the above requirement, I’m thinking of making a new database per client instead of using the same db for all clients; but I’m not sure how to programmatically create databases in this case!