© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
3 replies
jarrettsorensen

many-to-many returns empty array

I have the following tables:
account
account
=>
id
id
, ...
sheet
sheet
=>
id
id
, ...
connected_sheets
connected_sheets
=>
pk(account_id, sheet_id)
pk(account_id, sheet_id)
,
fk(account_id)
fk(account_id)
,
fk(sheet_id)
fk(sheet_id)


After following the docs on many-to-many joins here: https://supabase.com/docs/guides/database/joins-and-nesting?queryGroups=language&language=js#many-to-many-joins, I'm trying to select them like this:

const { data, error} = await supabaseClient
    .from('account')
    .select(`
      *,
      sheet(sheet_id)
    `)
    .eq('id', id)
    .single();
const { data, error} = await supabaseClient
    .from('account')
    .select(`
      *,
      sheet(sheet_id)
    `)
    .eq('id', id)
    .single();


I have inserted a row in the join table that connects the account with that same id to a sheet

But I get this response:

{
  id: "66",
  ...,
  sheet: []
}
{
  id: "66",
  ...,
  sheet: []
}


What am I doing wrong here?
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

query returns empty array
SupabaseSSupabase / help-and-questions
13mo ago
Empty array as response
SupabaseSSupabase / help-and-questions
4y ago
storage.from.list(); returns empty
SupabaseSSupabase / help-and-questions
4y ago
Receiving empty array from query
SupabaseSSupabase / help-and-questions
8mo ago