2 ms·
> This ignores the fact that SQL already has standards with multiple implementations and is very well established. You can have a basic portable subset - the pr
by acdha 4y ago
> This ignores the fact that SQL already has standards with multiple implementations and is very well established. You can have a basic portable subset - the problem was already very well specified at the offline level.
This is only partially true, as you can see from the many apps which only support one SQL database even if they're using something like an ORM which is ostensibly portable. Sometimes that's caused by use of things like using extensions but in other cases it can be caused by differences in things like data validation and conversion or how transactions are processed. That doesn't mean that portability is impossible but everyone doing it seriously tests continuously against multiple implementations to make sure they aren't inadvertently introducing a dependency on one flavor. Both SQLite and MySQL are especially notorious for this because you'd have cases where code which was invalid would either be automagically converted (hopefully to what you wanted) or the error silently suppressed so you'd have code which only works, for example, on a database where DATE can be "0000-00-00".
As simple example, at the time Web SQL was proposed as a standard, SQLite did not support foreign key checks at all. It still does not implement full Unicode support so you'd have to require all implementations enable that extension with the same configuration or you'd have data-dependent application bugs.
I would not personally have minded terribly if SQLite was effectively standardized like this but I understand why people wanted to see n>1 implementations. The browser developers are going to be supporting things for many years and as soon as a new feature launches any and all behaviors it exposes will become an API which has to be managed carefully to avoid breaking someone's production application.