Hacker News new | ask | show | jobs
by x-shadowban 1371 days ago
Really would like "select * except ..." and a non-dynamic-sql way to remap column names
1 comments

Except in ad hoc queries you shouldn't be using * at all so it isn't really an interesting problem to solve.
That SQL has * as the only abstraction for column names is quite frustrating.

I can think of so many other ways of dereferencing column names, from using a map/or lookup table to using types.

For example, selecting the unique id of a table regardless of what its name is.

Something like that seems reasonable until you realize that the unique id of a table could be a composite key and then things get complicated.