Right now we assume that the connected table always points at the table's primary key. This makes sense for the VAST majority of cases but this causes issues when we want to add support for tables without primary keys and it's also possible to do joins on non-primary key columns. This is a bad example, but here is what it would look like:
class User
table do
column name : String
has_many name_infos : NameInfo, foreign_key: "user_name", primary_key: "name"
end
end