Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Open-source data model definition
1 point by d_watt on March 31, 2022 | hide | past | favorite
I'm trying to find a good language to be able to document relationships between tables. For example, some thing that declares that a `users` table can be joined to a `customers` table on `users.customer_id = customers.id`.

Examples of this that I know of

- ORMs define these relationships

- LookML as a proprietary format

- Foreign Keys can kind of do this, but enforce a restriction, rather than just being declarative.

Ideally this format can be serialized/deserialized to help inform possible queries that can be run, and is agnostic from an ORM/specific data stack.

It's always surprised me the SQL spec itself doesn't have a mechanism for declaring this information about the relationship between tables, other than strict fkeys.



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

Search: