Yeah, the the teetering architecture tower is certainly worth an eye-roll given that WebSQL - basically SQLite direct access - was almost accepted as a standard, but was ultimately blocked by Mozilla [https://en.m.wikipedia.org/wiki/Web_SQL_Database] while they pushed this IndexedDB monstrosity.
I am not a fan of the IndexedDB API.
Re:SQL.js: SQLite Compiled to JavaScript
by kbrosnan on Friday November 06, 2020 @04:10PM
(#25011197)
It was blocked because the standards bodies require two or more independent implementations. All Mozilla said was that if they were to implement WebSQL they would use SQLite and there would not be two different implementations. Why should have Mozilla had the burden of implanting WebSQL in a different database?
Re:SQL.js: SQLite Compiled to JavaScript
by sroussey on Friday November 06, 2020 @04:18PM
(#25011279)
This is a case for making exceptions.
No it's not. WebSQL would have become "WebSQLite", quirks and all. That's not good for anyone. Any quirks in SQLite (of which there are _many_) would immediately become unfixable parts of the spec.
Re:SQL.js: SQLite Compiled to JavaScript
by samatman on Friday November 06, 2020 @05:41PM
(#25011829)
Sure would be a shame if a web standard reified implementation quirks as a durable part of the spec, something which has never happened before in the history of the World Wide Web.
Yes, it would be as much a shame now as it was then. This might come as a surprise but you can actually _learn_ from past mistakes and attempt to avoid them in the future. Like websql.
SQLite is a large, complex project by itself. Not only would you be adding it’s quirks into the spec but you’d be basically locked into a specific version of SQLite that has to be bug for bug compatible with whatever version was shipped before.
It’s quite clearly a terrible, terrible idea. And I say that as someone who was quite looking forward to what WebSQL has to offer. It’s more a reflection on “there is only one embedded SQL database suitable for use” than anything else.
Re:SQL.js: SQLite Compiled to JavaScript
by postalrat on Friday November 06, 2020 @03:44PM
(#25010956)
I'll be a big fan of IndexedDB if this ever becomes widely supported https://wicg.github.io/indexed-db-observers/EXPLAINER.html
What is interesting about this approach is that at least for Firefox, IndexDB is implemented using SQLite. So ultimately this approach is SQLite running in SQLite with an IndexDB layer in the middle.