paldepind / synceddb

Makes it easy to write offline-first applications with realtime syncing and server side persistence.
MIT License
411 stars 34 forks source link

Cannot control `keyPath` and `autoIncrement` #15

Closed piglovesyou closed 8 years ago

piglovesyou commented 8 years ago

In current API we cannot pass options to createObjectStore.

reference: https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore#Parameters

paldepind commented 8 years ago

That is correct. Both of the options must be handled by SyncedDB. The code assumes that key is at key. autoIncrement is not useful since the server in the end must choose the key.

That at least is my rationale for not making it available in the API.

piglovesyou commented 8 years ago

That makes sense, server side operations slipped my mind. Reasonable regulation.