coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.73k stars 240 forks source link

'id' column name should be renamed #58

Open DurhamG opened 12 years ago

DurhamG commented 12 years ago

It's rather inconvenient for the library to use the 'id' column name since that's likely to be a name that would occur in the user's schema. For instance, I have a bunch of data I received from the server, and they all come with 'id' fields. I would have to go through and rename all the id fields before I can dump it in to the client database. If you named the persistence.js column something else, like 'pid' or '_id', it would be less likely to conflict.

As a workaround for now, I just renamed all the occurrences of 'id' in persistence.js to be 'pid'.

MarkMYoung commented 12 years ago

My data usage allows me to use 'id' because I have mobile views. However, I would like to see a configuration option like:

persistence.id = 'ID';
kentr commented 8 years ago

From #70 I gather that the id column is really a UUID. I agree with @DurhamG that naming the column id makes using preexisting data sets difficult.

@zefhemel, would you consider a pull request that renames id to uuid?