Closed TheBuilderJR closed 1 year ago
I think, this syntax is used to join the tables prices
and products
with the "parent" table respectively. For example, on every row of the subscriptions
table, there is a price_id
(foreign) key that's used to join that table with the prices
table (primary key).
To further support my hypothesis, this is from the schema.sql
script:
create table subscriptions (
-- ...
-- ID of the price that created this subscription.
price_id text references prices,
-- ...
);
Yes, correct, this is to pull in the content from foreign tables. You can find docs for it here: https://supabase.com/docs/reference/javascript/select
It's super unclear what the .select(', prices(, products(*))') means.
There is no price field on subscriptions, so what magic is going on? Google doesn't help me. Can we please add a comment?