Improve documentation
Link
https://supabase.com/docs/reference/javascript/select
Describe the problem
I recently encountered a scenario where I needed to join three tables - product, supplier, and manufacturer - and filter the results based on a column in the manufacturer table.
schema
Product Table:
product_id (Primary Key)
supplier_id (Foreign Key to Supplier Table)
Supplier Table:
supplier_id (Primary Key)
manufacturer_id (Foreign Key to Manufacturer Table)
Manufacturer Table:
manufacturer_id (Primary Key)
max_capacity
However, I found the documentation to be inadequate for my needs. While it provided guidance for querying a single foreign key-constrained table, it didn't offer any information on how to accomplish this with multiple nested tables in the same format.
Describe the improvement
To assist users facing similar issues, I suggest adding an example to the documentation. This would enable them to efficiently join multiple nested tables in the desired format and filter the results according to their requirements.
db
.from("products")
.select(`
product_id,
suppliers (
supplier_id,
manufacturers (
max_capacity
)
)
`)
.eq("suppliers.manufacturers.max_capacity", maxCapacity)
Additional context
It is also applicable for n nested tables.
Improve documentation
Link
https://supabase.com/docs/reference/javascript/select
Describe the problem
I recently encountered a scenario where I needed to join three tables - product, supplier, and manufacturer - and filter the results based on a column in the manufacturer table.
schema
However, I found the documentation to be inadequate for my needs. While it provided guidance for querying a single foreign key-constrained table, it didn't offer any information on how to accomplish this with multiple nested tables in the same format.
Describe the improvement
To assist users facing similar issues, I suggest adding an example to the documentation. This would enable them to efficiently join multiple nested tables in the desired format and filter the results according to their requirements.
db .from("products") .select(` product_id, suppliers ( supplier_id, manufacturers ( max_capacity ) ) `) .eq("suppliers.manufacturers.max_capacity", maxCapacity)Additional context
It is also applicable for
nnested tables.