0

im trying to select ids from a table by filtering it with a list of values and then selecting only 1 row?

here's what i got so far and i receive null after the second query:

if(index == 0){
      const { data, error } = await supabase
        .from("product_details_us")
        .select(`id`);
        priority = data.map(({id})=> id);
    }
  const { data, error } = await supabase
        .from("products_us")
        .select(`id, url`)
        .not("id", "is", priority)
        .range(index, index)
        
3
  • Have you tried to make a single call using join? Commented Nov 17, 2022 at 21:00
  • It needs to have a foreign key relation but i dont have one.. Maybe if i create one.. Commented Nov 17, 2022 at 22:21
  • Yeah, you'll need to relate both tables with foreign keys. Also, tip: add the foreign key as part of the primary key of the table. This will make it recognizable by the supabase/postgREST client. Commented Nov 18, 2022 at 20:00

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.