© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
6 replies
Ebi

inner join without foreign key relationship

Is it possible to do an inner join with supabase js client without "direct" foreign key relationship?

Working SQL example in supabase sql editor:

select profiles.first_name, profiles.last_name, user_id
from profiles
inner join organization_users
on organization_users.user_id = profiles.id
where organization_users.organization_id = 1


Tables:

profiles
- id
- first_name

organization_users
- id
- user_id
- organization_id

The profiles.id and organization_users.user_id both reference auth.users.id.

When I try the following js code I get an error message "Could not find a relationship between 'profiles' and 'organization_users' in the schema cache":

await supabase
.from("profiles")
.select(",organization_users()")
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

Foreign key relationship isn't one to one
SupabaseSSupabase / help-and-questions
3mo ago
inner join really slow
SupabaseSSupabase / help-and-questions
4y ago
Inner Join in Dart
SupabaseSSupabase / help-and-questions
4y ago
Composite key foreign key issue
SupabaseSSupabase / help-and-questions
6mo ago