Open wyozi opened 11 months ago
Handle column name as target. See column name section at https://postgrest.org/en/stable/references/api/resource_embedding.html#embedding-disambiguation
When a many-to-one relationship from messages->users exists in form of user_id foreign-key in messages, this change allows using the following form to type-safely embed a user:
messages
users
user_id
client.from("messages").select("user:user_id(name)")
This was previously only possible by using a relationship name as the target or by using a foreign key name as a hint
fixes #450
@steve-chavez this one is also rebased and improved
What kind of change does this PR introduce?
Handle column name as target. See column name section at https://postgrest.org/en/stable/references/api/resource_embedding.html#embedding-disambiguation
What is the new behavior?
When a many-to-one relationship from
messages
->users
exists in form ofuser_id
foreign-key inmessages
, this change allows using the following form to type-safely embed a user:This was previously only possible by using a relationship name as the target or by using a foreign key name as a hint
Additional context
fixes #450