© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Seraf

Issue to query foreign tables

Hello everyone,

I'm trying to get some data from foreign tables.
Here is the schema of my tables: https://pastebin.com/MHrJkRTc

When I'm doing a:
          let query = supabase
            .from('adherents')
            .select(`
              id,
              nom,
              prenom,
              sexe,
              club,
              date_naissance,
              categorie,
              licence_numero,
              certif_med,
              commande_dobok,
              telephone1,
              telephone2,
              email,
              adresse,
              code_postal,
              ville,
              created_at,
              updated_at,
              grades(
                grade,
                obtention
              ),
              diplomes(
                diplome,
                obtention
              ),
              pratiques(
                pratique,
                saison
              )
            `)
          let query = supabase
            .from('adherents')
            .select(`
              id,
              nom,
              prenom,
              sexe,
              club,
              date_naissance,
              categorie,
              licence_numero,
              certif_med,
              commande_dobok,
              telephone1,
              telephone2,
              email,
              adresse,
              code_postal,
              ville,
              created_at,
              updated_at,
              grades(
                grade,
                obtention
              ),
              diplomes(
                diplome,
                obtention
              ),
              pratiques(
                pratique,
                saison
              )
            `)

My grades are always filled correctly, with a
grades: [{},{}]
grades: [{},{}]
attribute, but my
diplomes
diplomes
and
pratiques
pratiques
stay empty arrays (but they have data in as you can see in the screenshot).

So I don't get how could I query it properly to get the data returned with my
adherents
adherents
🤔

Thanks for the help 🙇‍♂️
image_2022-10-29_143304778.png
Pastebin
---- Name: adherents; Type: TABLE; Schema: public; Owner: postgres-...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Query foreign tables between a post and a user
SupabaseSSupabase / help-and-questions
4y ago
Querying foreign tables w SDK
SupabaseSSupabase / help-and-questions
4y ago
Query table with multiple cols with same foreign key. Join tables.
SupabaseSSupabase / help-and-questions
3y ago
error while Querying foreign tables - JS
SupabaseSSupabase / help-and-questions
4y ago