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 aINNER JOIN categories_articles ca ON a.id = CAST(ca.item AS INTEGER)INNER JOIN categories c ON ca.categories_id = c.idWHERE c.slug = 'the-category-slug';
SELECT a.*FROM articles aINNER JOIN categories_articles ca ON a.id = CAST(ca.item AS INTEGER)INNER JOIN categories c ON ca.categories_id = c.idWHERE c.slug = 'the-category-slug';
Any tips for how to do this with the Supabase API?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.