IndexedDB polyfill

In my last post, I had introduced the polyfill for IndexedDB that I was working on. IndexedDB is not yet supported on all browsers. Firefox, Chrome and Internet Explorer have implementations of IndexedDB while Safari and Opera still support WebSql. The IndexedDB specifications is also at its final stages and most browsers should have a native implementation of IndexedDB soon.
However, a client side database technology can make web apps very powerful and I thought that it would be a good idea to bridge the gap between IndexedDB and WebSql.
The polyfill exposes IndexedDB like API and uses the underlying WebSql to actually store data. This enables web applications to start using IndexedDB APIs across all the major browsers. The examples using the shim work on browsers and even devices like iPad or iPhone.

To use the polyfill, simply link or include the indexeddb.shim.js file. The polyfill assigns window.indexedDB to be window.mozIndexedDB, window.webkitIndexedDB or window.msIndexedDB is any of those implementations are available. If no implementation is available, the polyfill kicks in and assigns window.shimIndexedDB to window.indexedDB. Hence, web applications can start using window.indexedDB as the starting point for all database operations.

Libraries Tested
The polyfill is based on the IndexedDB specification and hence should work with any library that requires IndexedDB. Some of the libraries that were tested with the polyfill include the following