<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 02/01/2014 04:08 PM, Douglas Campos
      wrote:<br>
    </div>
    <blockquote cite="mid:20140201210800.GM61817@rohan.local"
      type="cite">
      <pre wrap="">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? :)</pre>
    </blockquote>
    Well Android does something similar so it isn't too crazy.<br>
    <br>
    <br>
    <blockquote cite="mid:20140201210800.GM61817@rohan.local"
      type="cite">
      <pre wrap="">


[1]:<a class="moz-txt-link-freetext" href="https://developer.mozilla.org/en/docs/IndexedDB/Using_IndexedDB#Creating_or_updating_the_version_of_the_database">https://developer.mozilla.org/en/docs/IndexedDB/Using_IndexedDB#Creating_or_updating_the_version_of_the_database</a>
[2]:<a class="moz-txt-link-freetext" href="https://github.com/aerogear/aerogear-js/blob/master/src/data-manager/adapters/indexeddb.js#L181-L184">https://github.com/aerogear/aerogear-js/blob/master/src/data-manager/adapters/indexeddb.js#L181-L184</a>

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
aerogear-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>