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 using Chrome/Safari, use WebSQL, if they're using Firefox or Internet Explorer, use IndexedDB.
The poster of this question appears to have homegrown a solution, but did not provide any source code.
Web SQL was deprecated and removed for third-party contexts in Chromium 97. [📍 We are here.] Web SQL access in insecure contexts is deprecated as of Chromium 105 at which time a warning message will be shown in the Chrome DevTools Issue panel.
Why to use indexeddb? The W3C has announced that the Web SQL database is a deprecated local storage specification so web developer should not use this technology any more. indexeddb is an alternative for web SQL data base and more effective than older technologies.
WebSQL Database is a relational database access system, whereas IndexedDB is an indexed table system. Don't start working with IndexedDB, relying on your assumptions from other types of databases. Instead, you should read the docs carefully.
The reason is because when IndexedDB stores an object, it must first create a structured clone of that object, and the structured cloning process happens on the main thread. The larger the object, the longer the blocking time will be.
JasonCasden has shared a huge list of libraries/wrappers at his presentation In-browser storage and me. Here is the list:
lawnchair
persistence.js
persistJS
amplify.store
localStorageDB
https://github.com/axemclion/IndexedDB
realStorage
YUI3 CacheOffline
dojox.storage
DomSQL
Impel
ActiveJS ActiveRecord
JazzRecord
picnet.data.DataManager
ShinyCar
lscache
Kizzy
Artemia
microcache.js
Store.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With