© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
8 replies
ZetiMente

Hi, can someone please help me turn this query into a supabase-js query ?

select *
from profiles 
INNER JOIN images ON profiles.id = images.profile_id
INNER JOIN follows on profiles.id = follows.following_id
where follower_id = 12;
select *
from profiles 
INNER JOIN images ON profiles.id = images.profile_id
INNER JOIN follows on profiles.id = follows.following_id
where follower_id = 12;


This works:
let { data: images } = await supabase
        .from('images')
        .select('*, profiles!inner(*)')
        .range(0, 25)
        .eq('profiles.id', 10)
        .order('created_at', { ascending: false });
let { data: images } = await supabase
        .from('images')
        .select('*, profiles!inner(*)')
        .range(0, 25)
        .eq('profiles.id', 10)
        .order('created_at', { ascending: false });


But can't figure out the syntax to add follows.following_id. It is a FK to profiles but it's a composite key with followers_id. For some reason can't get a working version of this SQL query into Javascript.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How can I turn this SQL into Supabase-js query?
SupabaseSSupabase / help-and-questions
4y ago
Can someone help me to convert sql query to supabase.js statement?
SupabaseSSupabase / help-and-questions
4y ago
Hi can someone please help me? I am stuck, using Supabase for the first time
SupabaseSSupabase / help-and-questions
13mo ago
Supabase JS query question
SupabaseSSupabase / help-and-questions
13mo ago