Hey team, noob question. Say I have the following ...
# help
s
Hey team, noob question. Say I have the following join table relation:
Copy code
bookshelf { user_id, id, title, ...} 
book { id, title, ... }
bookshelf_book { book_id, bookshelf_id, ordering }
How would I go about getting all the bookshelves, with the book and ordering attached from the client?
n
Hello @stopa! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
l
see https://postgrest.org/en/stable/api.html#embedding-through-join-tables should be something like
GET /bookshelf_book?select=ordering,book(*),bookshelf(*)
n
stopa (2022-04-26)
s
I see -- so there's no SDK implementation, I would just write a custom GET request? (works for me!)
l
it also works with the SDK, e.g.
supabase.from('bookshelf_book').select('ordering,book(*),bookshelf(*)')