News for hackers. Stuff that matters.
Re:Stop pushing the web forward by tracker1 on Tuesday July 28, 2015 @05:38PM (#9964683)
All because Microsoft wouldn't break down and embed SQLite into their browser like everyone else did for WebSQL. It's actually really disappointing.

IndexedDB could be built on top of WebSQL as a shim... you can't really do the reverse so easily. It's really disappointing... WebSQL/SQLite with a template string builder interface would be amazing. (I know it's an ES6 thing).

I will say, that I do want what's on deck for ES6/7 (2015/2016) to make it into the browsers... async/await is such a useful feature.

Re:Stop pushing the web forward by thristian on Tuesday July 28, 2015 @07:06PM (#9965141)
Because Microsoft and Mozilla wouldn't break down - and Mozilla already shipped SQLite.
Re:Stop pushing the web forward by tracker1 on Tuesday July 28, 2015 @11:59PM (#9966080)
Sorry, I had thought Mozilla had WebSQL with SQLite... I know chrome/safari supported it at least.. I thought MS was the main holdout there. It looks like there's a Firefox plugin for it though.
Re:Stop pushing the web forward by mschuster91 on Tuesday July 28, 2015 @05:57PM (#9964810)
Hmm... would it be possible, using Promises, to create a sorta-shim, you give it a SQL query and a callback function.

The shim does asynchronously all the stuff a DB engine does (most people are going to use "SELECT cola,colb,colc FROM x WHERE foo=bar and baz=quux ORDER BY cola ASC GROUP BY colb" and nothing more complex anyway), then tracks all the stuff it needs to do in its own promise tracker. Once all is done, it assembles the returned row(s), stores them and calls the callback.

The biggest problem I see is locking as all the crap is async so you'd need some sort of locking and query ordering to maintain data consistency.

Re:Stop pushing the web forward by tracker1 on Tuesday July 28, 2015 @06:13PM (#9964903)
If you don't really need true locking pessimism it's more possible... There are actual SQL engines in JS though.

Using a single queue to run queries through would be relatively easy to do... a stage 1 analysis of what collections you need to query could then push the query into one of several queues for pipeline requests.

It would be interesting, but I don't mind IndexDB (or localStorage for that matter) enough to really bother with it.