If you ever wanted to use local storage for whatsoever reason (e.g. offline fallback, code examples without need for server-side middleware and database, etc), chances are you're familiar with the diversity of options. WebSQL database being ditched from HTML5 draft in favor to IndexedDB highly suggest the IDB is the option for offline storage.
Usage cases for local (client side) databases and this proxy are:
- caching infrequently changed data (ComboBox entries, settings, localization, etc.)
- fast and easy code samples that don't require server round trips and the whole server side architecture
- offline fallback (although sencha.io is actually a preferred way of doing this)
I was initially uncertain to try something non-SQL-like, but then learned that IndexedDB is so cool and JavaScript oriented that I couldn't just close my eyes on it. Also, it's asynchronous, therefore have your callbacks and events at hand.
To make things even easier I created a proxy for IDB so that you can use all that goodness in your Ext JS 4 models and stores without extra effort.
This is a project in development, and as always, your feedback is most welcome.
Updates:
- Jul 2, 2011 - added support for importing data from other stores (e.g. Server proxy, Ext.Direct proxy, etc)
- Jul 4, 2011 - added support for WebSQL DB. Now you can use a universal Ext.data.proxy.BrowserDB that will automatically switch to WebSQL Database if IndexedDB is not available. That means it will now work on Safari, mobile Safari (iOS), and Android browser
Last edited by grgur; 4 Jul 2011 at 2:02 AM.
Reason: Added fallback to WebDB
Just added fallback support to WebDB (or WebSQL how some like to call it). WebDB is no longer in HTML5 draft, but is still supported in Safari (on mobile devices, too).
I've created a separate proxy that will automatically switch between the two databases (actually, proxies)
First of all thanks for coming up with this awesome functionality. I was looking for WebDB(sqlite) proxy, but only difference is that i needed it in Sencha Touch . I tried porting this to touch but have came across few errors. I'm looking into. If you can come with similar proxy compatible for sencha touch it would be great.
It's awesome to hear that you're finding it useful. I'm probably not going to be looking at the proxy from Sencha Touch perspective in the next couple of weeks, but AFAIK Lisimba has already modified it and will be sharing the ST compatible version of the proxy via github soon.
awesome Work and as tomalex0 it shoud be great for Sencha Touch
Is the IndexedDB proxy for Sencha Touch available somewhere on github ? I didn't found it
awesome Work and as tomalex0 it shoud be great for Sencha Touch
Is the IndexedDB proxy for Sencha Touch available somewhere on github ? I didn't found it
Still thanks for all
The data package isn't that different but there are some differences. You could try