Filtering by foreign key & .or

Hey all,

We are trying to effect a query by checking for a ilike match in either column (home_team or away_team) both serving as a Foreign Key to the same table. We are trying like this:

const { data, error } = await supabaseClient.from('table').select(`home_team!inner(*),away_team!inner(*)`).or(`mascot.ilike.%${q}%`, { foreignTable: 'home_team' }).or(`mascot.ilike.%${q}%`, { foreignTable: 'away_team' })


and

const { data, error } = await supabaseClient.from('table').select(`home_team!inner(*),away_team!inner(*)`).or(`mascot.ilike.%${q}%`, { foreignTable: ['home_team', 'away_team'] })


With no real luck. Is there a way to do the query we are attempting?
Was this page helpful?