Supabase: Augment data fetch from two tables: Advanced data fetching or Join Table?

I’m looking to get multiple fields from a foreign key - This is the setup:

Table: jobs
CompLink → Companies(id)
Table: Companies

I tried this under the advanced mode:

id, 
isFeatured, 
isRemote, 
importId,
Companies: CompLink (Name),
Companies: CompLink (compAddress),
Companies: CompLink (country),
Companies: CompLink (compURL),
Companies: CompLink (compLogo)

but I get this error:
table name “Jobs_Companies_1” specified more than once

I get that this might be inefficient, just curious which direction to go in? Do some table join and fetch that?

Thanks,
T.

id, 
isFeatured, 
isRemote, 
importId,
Companies:CompLink(Name, compAddress, country, compURL, compLogo)

or if you have a many to one relationship

id, 
isFeatured, 
isRemote, 
importId,
...CompLink(Name, compAddress, country, compURL, compLogo)

Also, using capitals in your tables is a horrible thing. Fix it. Become a Supabase Magician in WeWeb (Tutorial With Examples) – Broberto

1 Like

yuupp you’re right - thanks for this!

1 Like