Reputation: 18119
Given that WebSQL is no longer being developed and IndexedDB has yet to become prevalent, what are our choices as developers for client-side relational storage going forward? Is it best simply not utilize any of these features for now? In my scenario, I'm building a browser plugin with support for WebKit (Chrome and Safari) initially so it is acceptable to adopt a technology that isn't (yet) in Firefox and IE. I realize I could use WebSQL in Chrome and Safari, but there's no way of knowing how long support for it will stay in those browsers now that the W3C spec isn't being maintained.
Upvotes: 2
Views: 294
Reputation: 2426
You can use a localStorage variable to store a json string to keep all your data or divide it between many variables still inside localStorage. Read more about it.
Upvotes: 0
Reputation: 48387
I first thought surely you must be mistaken - websql scrapped? But yes I see it has gone.
I think the obvious answer would be to look for an API which abstracts the underlying storage engine. It would be wonderful if there was something which allowed me to write SQL with an option to failover to a server-side database - but with the problems for websql, the sticking point seems to be SQL support.
persistence.js goes some of the way. WSPL does not seem to be making big inroads.
Building an SQL layer for indexedDB looks like a huge task which is unlikely to happen soon.
It looks like lots of other people are trying to solve similar problems. e.g. 1
Upvotes: 0
Reputation: 75777
If it's going to be a Firefox extension then you can use an interface that looks very similar to WebSQL. The SQLite component will be staying in Firefox for a long time, because it's used for so much other stuff including (I believe) the IndexedDB implementation, you just aren't allowed to access it from web pages.
You're correct that there's no way of knowing how long support for WebSQL will stay in WebKit, but Apple have previously stated they will continue to support a number of -webkit-
prefixed CSS properties even after they implement the standard versions (especially if the eventual standard differs from their prefixed version) because they've seen such wide use. I think WebSQL will be treated in a similar fashion and you'll at least have a decent amount of warning if support is ever dropped.
Opera I'm not sure about.
IE is never going to include SQLite, so it'll never have WebSQL. If you're doing a plugin anyway you could always just build SQLite as part of it in a similar fashion to what Gears did.
Upvotes: 1