1

I have 3 tables in supabase.

  • Message --> with foreign key 'request_id' to table Product_Request
  • Product_Request --> with foreign key 'product_id' to table Product
  • Product

How can i select all messages data with info from the others table?

I tried this:

let { data, error } = await supabase .from("message") .select("*, product_request(*), product(*)");

but give me this error:

{ "details": "Searched for a foreign key relationship between 'message' and 'product' in the schema 'public', but no matches were found.", "hint": "Perhaps you meant 'product_request' instead of 'product'.", "message": "Could not find a relationship between 'message' and 'product' in the schema cache" }

1 Answer 1

2

This should do:

const { data, error } = await supabase .from("message") .select("*, product_request(*, product(*))"); 
1
  • Thanks for your tip but i resolved using Prisma client to perform query. Oct 15, 2023 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.