3 ms·
Notably, this feature would be very useful in SQL or similar data processing languages. I wish these query languages had the ability to select "all key columns
by jiggawatts 4y ago
Notably, this feature would be very useful in SQL or similar data processing languages.
I wish these query languages had the ability to select "all key columns", "all writeable columns", "non-system-generated columns", etc...
In most database or query platforms this is either impossible, or requires breaking out into another system/approach entirely. For example, it's possible to generate a SQL query to do above by querying the column metadata from INFORMATION_SCHEMA views, but this is obviously not what most people want to be doing when writing a query.
Worse, even if the database platform has features like this, when it gets processed through an ORM in typical languages like Java or C#, any such features are once again lost...
Lenses and optics could apply well to SQL-like query languages, because those are largely functional as well, and thanks to "JSON columns" often have nested structures where the composability of these abstractions would be more elegant than some hideous "tree query syntax" as typically seen in XPath and the like.