4 ms·
> The main flaw of SQL, however, lies in its very limited support for abstraction. This is objectively bullshit. What SQL database engine doesn't provide view
by bob1029 6y ago
> The main flaw of SQL, however, lies in its very limited support for abstraction.
This is objectively bullshit.
What SQL database engine doesn't provide views, stored procedures and/or user-defined function support?
Failure to construct higher-order abstractions in SQL is a failure of the engineer to understand the problem domain, not a failure of the tool.
SQL is capable of operating at any level of abstraction you wish for it to. It is all engineering from there.
- radiowave 6y agoNone of those things (views, stored procs, functions) are part of the query language. They all involve making somewhat permanent alterations to the structure of the database, and are entirely capable of conflicting with other objects in the database. So if your query needs these things, you're now into "release management" territory. In terms of lack of linguistic abstraction, try writing a query that abstracts over what table it's to be run against, allowing choice of source data to be parameterized, without either resorting to shenanigans like passing strings of SQL fragments around to be eval'd during query execution, or writing the query in some other system such that it can then be compiled into SQL for execution.
- deleted 6y ago[deleted]
- jerf 6y agoTo give a concrete example of what we're talking about, I wrote this a couple of months ago in a similar discussion: https://news.ycombinator.com/item?id=26320573 https://news.ycombinator.com/item?id=26320573 The problem is that "Compose" function is essentially impossible to write. I say essentially because it's probably something that could theoretically be written, but not with any reasonable amount of effort. It would literally be on par with the difficulty of implementing a DB from scratch that implements the Logica language as its base query language.