You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only happens when one tries to query data using relations in a query; the account type works fine when querying it directly. It also works on other table types where the foreign key id is called account_id instead of not matching the foreign table name + _id.
To Reproduce
Create any 2 tables, with 1:1 foreign key relations on one of them.
Name the column something other than foreign_table + _id
Generate the types using the supabase CLI
Create a query that select fields belonging to the foreign table using (*)
The types will be empty or if specifying a field a QueryResult error will appear.
Expected behavior
The correct types are produced based on the relationships generated by the Supabase DB schema.
Screenshots
System information
Version of supabase-js: 2.33.1
Version of supabase-cli: 1.91.1
Version of Node.js: 16.17.0
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
Given a schema types definition for a table like so:
When querying data from
my_resource
, one gets errors or an empty type:This only happens when one tries to query data using relations in a query; the
account
type works fine when querying it directly. It also works on other table types where the foreign key id is calledaccount_id
instead of not matching the foreign table name +_id
.To Reproduce
foreign_table
+_id
(*)
Expected behavior
The correct types are produced based on the relationships generated by the Supabase DB schema.
Screenshots
System information
The text was updated successfully, but these errors were encountered: