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)
        
  • Have you tried to make a single call using [join](https://stackoverflow.com/a/65486845/2188186)? – Mansueli Nov 17 '22 at 21:00
  • It needs to have a foreign key relation but i dont have one.. Maybe if i create one.. – Ted's Projects Nov 17 '22 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. – Mansueli Nov 18 '22 at 20:00

0 Answers0