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.