https://supabase.com/ logo
Hi guys, question about relational databases. Can ...
# help
u
Hi guys, question about relational databases. Can I in any way access relational data of a row? Let's say I have
cars
and
brands
, each car references brand by its id (
brand_id
). In my app, I fetch
cars
and would also like to know the brand information (like its name or
logo_url
). Could it be done just by that reference or should I make another request? Thanks in advance 🙏 (by another request I mean getting that
brand_id
and requesting the information thereof)
n
Hello @! Do you even Vim, bro?! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! 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.
g
If your reference is set up as a foreign key then yes. https://supabase.com/docs/reference/javascript/select#query-foreign-tables. You can also go to PostgREST.org for lots of info on types of relationships you can setup and use.