Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Javascript library for localStorage to emulate SQLite

I have an application which uses SQLite for storage. We need to change it to enable it to work with Firefox and other browsers.

LocalStorage seems to be the choice. However, localStorage does not offer the more complex sql functionality (for example OrderBy, GroupBy, table joins etc.).

Would anyone know of a Javascript existing library that would work with localStorage and make it behave more like SQL? -Thank you

like image 223
Ray Vol Avatar asked Dec 25 '12 21:12

Ray Vol


1 Answers

You could use one of the javascript linq implementations. They get their data from plain javascript objects/arrays, so that should make interfacing with localstorage pretty much cake.

http://jslinq.codeplex.com/
http://linqjs.codeplex.com/
or even http://www.thomasfrank.se/sqlike.html

online demo for them: http://secretgeek.net/JsLinq/ (note the options on the top left)

I'm not so sure about the insert/update aspects, but you can sure do some nice data querying with them.

like image 145
goat Avatar answered Oct 12 '22 08:10

goat