[aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

classic Classic list List threaded Threaded
7 messages Options
qmx
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

qmx
Administrator
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? :)


[1]:https://developer.mozilla.org/en/docs/IndexedDB/Using_IndexedDB#Creating_or_updating_the_version_of_the_database
[2]:https://github.com/aerogear/aerogear-js/blob/master/src/data-manager/adapters/indexeddb.js#L181-L184

--
qmx
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

attachment0 (539 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

Luke Holmquist

On Feb 1, 2014, at 4:08 PM, Douglas Campos <[hidden email]> 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


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

Summers Pittman
In reply to this post by qmx
On 02/01/2014 04:08 PM, Douglas Campos 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? :)
Well Android does something similar so it isn't too crazy.




[1]:https://developer.mozilla.org/en/docs/IndexedDB/Using_IndexedDB#Creating_or_updating_the_version_of_the_database
[2]:https://github.com/aerogear/aerogear-js/blob/master/src/data-manager/adapters/indexeddb.js#L181-L184



_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
qmx
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

qmx
Administrator
In reply to this post by Luke Holmquist
On Mon, Feb 03, 2014 at 08:40:49AM -0500, Lucas Holmquist wrote:

>
> On Feb 1, 2014, at 4:08 PM, Douglas Campos <[hidden email]> 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

Suppose we have an ACME inventory list app, which underwent structural
changes during the upgrade from 0.0.2 to 0.0.3 and now uses kilograms to
represent weight instead of pounds ;)

I want to have this "data migration" thing so I can do the conversion
the first time the database is open.

Makes sense now?

--
qmx
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

Luke Holmquist

On Feb 3, 2014, at 9:58 AM, Douglas Campos <[hidden email]> wrote:

> On Mon, Feb 03, 2014 at 08:40:49AM -0500, Lucas Holmquist wrote:
>>
>> On Feb 1, 2014, at 4:08 PM, Douglas Campos <[hidden email]> 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
>
> Suppose we have an ACME inventory list app, which underwent structural
> changes during the upgrade from 0.0.2 to 0.0.3 and now uses kilograms to
> represent weight instead of pounds ;)
>
> I want to have this "data migration" thing so I can do the conversion
> the first time the database is open.
>
> Makes sense now?

yup,  makes sense,  then we would need to expose the "version" to the user, so they can increase the value or say to upgrade or something,  also adding the event listener to upgrade

it would also need to work with the sessionLocal adapter.


On a related note,  IndexedDB allows you to define keys for searching and other neat IndexedDBy things.  it would be nice to be able to get some of these things in too, maybe

>
> --
> qmx
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

Luke Holmquist

On Feb 3, 2014, at 10:06 AM, Lucas Holmquist <[hidden email]> wrote:

>
> On Feb 3, 2014, at 9:58 AM, Douglas Campos <[hidden email]> wrote:
>
>> On Mon, Feb 03, 2014 at 08:40:49AM -0500, Lucas Holmquist wrote:
>>>
>>> On Feb 1, 2014, at 4:08 PM, Douglas Campos <[hidden email]> 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
>>
>> Suppose we have an ACME inventory list app, which underwent structural
>> changes during the upgrade from 0.0.2 to 0.0.3 and now uses kilograms to
>> represent weight instead of pounds ;)
>>
>> I want to have this "data migration" thing so I can do the conversion
>> the first time the database is open.
>>
>> Makes sense now?
>
> yup,  makes sense,  then we would need to expose the "version" to the user, so they can increase the value or say to upgrade or something,  also adding the event listener to upgrade
>
> it would also need to work with the sessionLocal adapter.

qmx,  maybe want to JIRA that shizznit


>
>
> On a related note,  IndexedDB allows you to define keys for searching and other neat IndexedDBy things.  it would be nice to be able to get some of these things in too, maybe
>
>>
>> --
>> qmx
>> _______________________________________________
>> aerogear-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
qmx
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-js] portable/fallback-able data migrations?

qmx
Administrator
On Mon, Feb 03, 2014 at 11:24:07AM -0500, Lucas Holmquist wrote:
> qmx,  maybe want to JIRA that shizznit

Will do, mildew

--
qmx
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

attachment0 (539 bytes) Download Attachment