1 Jul 2011 5:06 AM #1
IndexedDB Proxy Ext.data.proxy.IndexedDB
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)
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.
Go ahead and try this live example or get the code from GitHub.
This is a project in development, and as always, your feedback is most welcome.
- 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
1 Jul 2011 9:18 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Nice work and great to see documentation!Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
1 Jul 2011 10:06 AM #3
4 Jul 2011 1:08 AM #4
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)
4 Jul 2011 10:04 AM #5
Extremely well written and documented code and a neat UX.
S-CIRCLES Social Network Engine
18 Jul 2011 12:55 AM #6
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.
I have posted this as a feature request.