Hacker News new | ask | show | jobs
by marcuswestin 3392 days ago
I don't know when WebSQL would be better than other storage alternatives, but yes, you could easily add WebSQL storage :)

The rationale behind the new architecture is to make it trivial to write new backing storages - see https://github.com/marcuswestin/store.js#write-your-own-stor... for a quick explanation of how you'd do that.

This is also true for adding new functionality, which sits "on top of" the storage (and is agnostic to whatever particular storage is being used). Here's a list of plugins that come out of the box: https://github.com/marcuswestin/store.js#list-of-all-plugins, and here is a quick explanation for how you'd write your own plugin: https://github.com/marcuswestin/store.js#write-your-own-plug...

1 comments

If I'm not mistaken, your API is designed to be used synchronously. Not sure how WebSQL or IndexedDB could work towards a synchronous API.
That's also the way I read it, and indeed both WebSQL and IndexedDB only have async interfaces. IndexedDB used to have a sync interface available inside workers, but that was removed from the spec as there weren't any supporting use cases.

Overall localForage seems like a better cross-browser storage system, it also has a pluggable backend system (drivers) but defines an async interface.

Duh, of course! Sorry, 3am and not too sharp in the nut at the time :)

I'm genuinely interested in supporting every needed use case - would you be up for creating an issue? Either way I'll have it in the back of my head and see what can be done.

Cheers, Marcus