Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Foreign keys in general? I am not sure I understand what you mean...


Not something I’ve ever thought about but I think that it could be done via macro,

I have written tsql functions in c# and imagine that other dialects have analogous functionality.

It seems as though the point is to cut down on sql code, it’d also be possible to query the foreign keys and create a data structure that could feed a function for joins.

I haven’t thought out the specifics but think this type of approach would be more practical than changing the sql standard.


At that point you are just building a feature into an "ORM" of some sort. The entire point is to allow queries to be written in a more concise way for this simple equality join use case which is (total ballpark figure) ~half of the joins in my system.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: