Loading ...
Sorry, an error occurred while loading the content.

Update: thoughts on IndexedDB support

Expand Messages
  • taffydb-owner@yahoogroups.com
    Hey gang, Quick update. I ve been hard at work on a project that uses Taffy heavily and pushing out small bug fixes and feature adds along the way. While I
    Message 1 of 1 , Nov 28, 2011
    • 0 Attachment
      Hey gang,

      Quick update. I've been hard at work on a project that uses Taffy heavily and pushing out small bug fixes and feature adds along the way. While I haven't started working on the code yet I wanted to run some thoughts by everyone:

      1. Taffy 2.0 Features an internal DBI api for accessing the array that stores the data. It has methods such as insert and update which are used by the public methods to actually make changes to the data. In theory the can be mounted like a plugin and point to a different source such as IndexedDB.
      2. I propose something like TAFFY.addStorageEngine({name:"indexedDB",otherstuff:func}) to create a new storage engine. That would
      3. I propose that you can create a new database with TAFFY([]) for default storage engine (JS Array) or with the DB type, and config object like TAFFY("indexedDB",{name:"mystuff",data:[]});
      4. The actual filters will need to be converted from functions back to instructions so that they can be read into SQL. Shouldn't be hard and it will probably be faster so I won't need to create a function for every {this:that} pair.
      5. Since indexedDB is asynchronous we'll have support setting that at the storageLevel. If you are running with an asynchronous only DB you then you have to use the callback method to do anything: db().order().limit().callback(function () {this.get()});
      6. Finally, I need to do more research around JSON and indexedDB. Provided you get objects back from indexedDB .get() requests we should be good to go. Otherwise we may need to do some fancy work to make sure the results of things like .first(), .last(), .select(), etc are always the same across storage engines.

      The first step will be to port the existing stuff to a plugin format and then we can author another plugin.

      Thoughts or comments?

      Ian
    Your message has been successfully submitted and would be delivered to recipients shortly.