4 ms·
Use a library that uses IndexedDB and uses WebSQL as a fallback then.
by Bahamut 12y ago
Use a library that uses IndexedDB and uses WebSQL as a fallback then.
- binarymax 12y agoThe Web SQL Database specification is no longer being maintained and support may be dropped in future versions. Also - these fallbacks are not exactly swappable. Its like swapping from a Database to a Filesystem as a fallback. Difficult to abstract into a single library/api. And you still potentially leave out IE users if those are your options (depending on your IndexedDB needs). IndexedDB to localStorage fallback might work - but again might not be an easy API abstraction.
- hodoublesy 12y agoI have had good luck with https://github.com/mozilla/localForage https://github.com/mozilla/localForage as an API abstraction
- nolanl 12y agoPouchDB, ydn-db, IndexedDBShim, and Lawnchair will do this as well. Web SQL may be "deprecated," but it's unlikely to be dropped by Apple or Google, since so many mobile web apps depend on it. Even the mobile version of Gmail uses Web SQL.
- jbergens 12y agoThis is what we do and it worked great until iOS8 came along. Read more about some problems here http://www.raymondcamden.com/2014/9/25/IndexedDB-on-iOS-8--Broken-Bad http://www.raymondcamden.com/2014/9/25/IndexedDB-on-iOS-8--B...