On Feb 1, 2014, at 4:08 PM, Douglas Campos <qmx(a)qmx.me> wrote:
There's a nice feature on IndexedDB which is the version thing +
'upgrade needed' event[1], which we're using for creating the database
automagically[2].
Any ideas on how could we provide an API for something like this, but
which could potentially work with WebSQL too?
var dm = AeroGear.DataManager();
dm.add({
name: "newStore",
storageType: "IndexedDB",
settings: {
dbVersion: 3,
upgradeHandler: function (evt) {
// evt.oldVersion
// evt.newVersion
// evt.store
// do data migration stuff, just caring about objects
}
}
});
How does this sounds? Am I crazier than usual? :)
not sure we really need this since the user doesn't actually created and of the
"fields". there is a field for an id and the other is the json data, so the
user never interacts with modifying the db