I\'m curious if there is a library or a project out there to provide a generic interface to IndexedDB or to WebSQL, depending on user\'s browser\'s support. If they\'re usin
The question is answered, I just want to share the updates.
In May 2012 JayData has been released, which is the unified data access library for JavaScript and helps to manage data in IndexedDB, WebSQL, SQLite, MongoDB, HTML5 localStorage databases and Facebook, OData, WebAPI, YQL data services with the same JavaScript Language Query syntax.
Changing to IndexedDB from WebSQL means only changing type of the storage provider:
var todoDB = new TodoDatabase({
provider: 'webSql', databaseName: 'MyTodoDatabase' });
var todoDB = new TodoDatabase({
provider: 'indexedDB', databaseName: 'MyTodoDatabase' });
If you don't specify the provider, the library detects the available storage of the browser/device in the following priority order (WebSQL, IndexedDB, HTML5 localStorage).
Disclaimer: I'm member of the developer team of the open-source JayData project