I can't seem to figure out how to run this query i...
# help
d
I can't seem to figure out how to run this query in supabase. The actual query is
Copy code
SELECT u.first_name, u.date_of_birth, u.profile_picture_urls
FROM public.users u
         JOIN likes l on u.user_id = l.to_user_id
WHERE l.from_user_id = '34fca6cd-4c6e-49f5-87c7-e0e3ff461509'
I did something like this as a test
Copy code
final PostgrestResponse res = await _supabase.client
        .from(_users)
        .select('*, likes!inner(*)')
        .eq("likes.from_user_id", callingUser.userId)
        .execute();
but I'm getting an error because there are multiple foreign keys. Any ideas?
n
Hello @DanMossa! 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.
🆕 Query with multiple foreign keys
g
Maybe something in these answers from steve https://github.com/supabase/supabase/discussions/1291
n
Query with multiple foreign keys
d
I guess I wish there were more examples and the example were clearer on what actually does what
g
Yeah, postgrest.org has the final details, but a bit of translation goes on in supabase.js/postgrest.js to transform to the actual url format.
d
Ok I'm a complete dumbass
Which likes and to what?
So is it basically impossible for me to use Supabase with my schema ?
n
Thread was archived by @DanMossa. Anyone can send a message to unarchive it.