Does persistence support creating tables which have an autoincrementing primary key column?

Submitted on 19 August 2010 at 17:29

On 19 August 2010 at 20:45 Zef Hemel commented:

In short, no. persistence.js automatically generates UUIDs for every entity. I posted a explanation of this design decision here. Hope that helps :)


On 27 August 2010 at 20:19 Andrew commented:

I understand the design decision but I am curious as to the lacking functionality of creating an auto incrementing column in addition to the UUID that persistence generates. I hacked together an implementation in a local (and old) copy of persistence I have which makes the auto incrementing column the primary key and then has the UUID column become a unique column. I realize this solution is imperfect with server syncing solutions but it could be provided without much trouble as an additional feature if the database will only live on the clients side.


On 27 August 2010 at 20:27 Zef Hemel commented:

Alright. If you succeeded in implementing this, maybe you can contribute the patches (or even apply them to the current version of persistence.js)? That could be useful to others.

Log in to post comments