© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
6 replies
avalanche8336

Supabase API query join on multiple fields

Let's say I want to join profile on sender_id and receiver_id. Is this a valid syntax? PS: It errors with 'couldn't find relationship between tables'

    return _client
        .from(_conversationTable) //
        .select('''
            id,
            sender:profile(*)&profile.user_id=sender_id,
            receiver:profile(*)&profile.user_id=receiver_id,
            item:item_id(*),
            created_at
          ''')
        .eq('id', conversationId)
        .limit(1)
        .single()
        .execute()
    return _client
        .from(_conversationTable) //
        .select('''
            id,
            sender:profile(*)&profile.user_id=sender_id,
            receiver:profile(*)&profile.user_id=receiver_id,
            item:item_id(*),
            created_at
          ''')
        .eq('id', conversationId)
        .limit(1)
        .single()
        .execute()
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

Can't join supabase users table on query
SupabaseSSupabase / help-and-questions
4y ago
SQL Join Supabase REST API
SupabaseSSupabase / help-and-questions
4y ago
Flutter Supabase query returns multiple instances
SupabaseSSupabase / help-and-questions
4y ago
Supabase query
SupabaseSSupabase / help-and-questions
4y ago