Vanege
03/03/2022, 1:41 PMVanege
03/03/2022, 1:41 PMmessages
and profiles
. Both have a foreign key user_id
refering to the id of the users
table.
I want to return all messages with the username of the user that has written the message.
In SQL, I would do something like this:
SQL
SELECT messages.text, profiles.username
FROM messages, profiles
WHERE messages.user_id = profiles.user_id
How do I use the supabase client to get something equivalent? I would like a response data that look like this:
js
[{text: "hi mom", username: "Pablo"}, {text: "hello world", username: "Edouard"}]