3 ms·
> I still feel that the api is a lot more complicated > than it has any right to be. WebSQL for example was nifty From the Web SQL Database W3C Working Group
by combatentropy 10y ago
> I still feel that the api is a lot more complicated
> than it has any right to be. WebSQL for example was nifty
From the Web SQL Database W3C Working Group Note, 18 November 2010 (https://www.w3.org/TR/webdatabase/ https://www.w3.org/TR/webdatabase/):
"The specification reached an impasse:
all interested implementors have used the same SQL backend (Sqlite),
but we need multiple independent implementations
to proceed along a standardisation path."
I would imagine it's no small project to reimplement an SQL interpreter from scratch.
Mozilla has said that IndexedDB is an API at a lower level than SQL:
"IndexedDB . . . allows for a wide number of use cases.
. . . wrapped by JavaScript libraries;
for instance, there’s plenty of room for a CouchDB-style API on top . . .
it would also be very possible to build a SQL-based API on top . . . "
--- https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/ https://hacks.mozilla.org/2010/06/beyond-html5-database-apis...
Although you can use the IndexedDB directly, it sounds like even they admit that you probably would want to use a higher-level library much of the time --- and that one of those libraries could be SQL, if anyone wants to write one.
In that article they also give some of the reasons they don't think the W3 should try to weld SQL directly onto the standard. I think they make some thoughtful points. Although I love SQL, I have to admit that it's one of those things that sounds great from 10,000 feet but the devil is in the details.
select * from table
How hard can that be? But it's when you dive into all the nitty gritty and differences among database brands, and how the spec itself is ultimately ambiguous on certain things, plus the astronomical amount of work it would be, that I think their solution is sound.