SQL to Supabase query

Apologies if this has already been answered. I could not work out how to do this.

I'm trying to query a category by its slug and return the associated articles in the category. I have a join table categories_articles that contains an id (id of the category) and item (id of the article)

The following SQL query works:
SELECT a.*
FROM articles a
INNER JOIN categories_articles ca ON a.id = CAST(ca.item AS INTEGER)
INNER JOIN categories c ON ca.categories_id = c.id
WHERE c.slug = 'the-category-slug';


Any tips for how to do this with the Supabase API?
Was this page helpful?