Re:SQL language proposal: JOIN FOREIGN
by hn_throwaway_99 on Thursday December 30, 2021 @07:40PM
(#29743490)
In my entire software development career, I've never had that problem, nor seen it.
Sure, I've mistyped a column name or left one out. But the failure is then nearly always so catastrophic (the query failed to compile), or the data response then so different from what I'd expect (pages of results instead on 1) that it's not something I've seen that needs fixing.
> Other than saving some typing,
I would like to point out the corectness aspect of the proposal.
Today foreign keys are enforced during inserts, updates, deletes. (you just can't violate fk. this is so good) But you can violate it in selects. (e.g. mistype column name, forget to include a column)
This proposal (or its adjustment) would allow to use fk also during select. It's like static typing for join conditions.