Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4y agoβ€’
15 replies
Smardrengr

Joins not working

Hmm, trying to get a simple
join
join
working, obviously doing it wrong. Here are the schemae:

create table events (
  id uuid primary key DEFAULT gen_random_uuid(),
  organizer_id uuid references auth.users not null,
  profile_id uuid references profiles.id not null,
  name text
);

create table profiles (
  id uuid references auth.users not null,
  created_at timestamp with time zone default now(),
  updated_at timestamp with time zone,
  deleted_at timestamp with time zone,  
  name text,
  constraint name_length check (char_length(name) >= 2)
);
create table events (
  id uuid primary key DEFAULT gen_random_uuid(),
  organizer_id uuid references auth.users not null,
  profile_id uuid references profiles.id not null,
  name text
);

create table profiles (
  id uuid references auth.users not null,
  created_at timestamp with time zone default now(),
  updated_at timestamp with time zone,
  deleted_at timestamp with time zone,  
  name text,
  constraint name_length check (char_length(name) >= 2)
);

The query:
    const { data: event } = await supabaseClient
        .from('events')
        .select(
            `id, name, organizer_id,
        profiles(created_at)`
        )
        .eq('id', event.params.id)
        .single();

    return {
        event,
        user: session.user
    };
    const { data: event } = await supabaseClient
        .from('events')
        .select(
            `id, name, organizer_id,
        profiles(created_at)`
        )
        .eq('id', event.params.id)
        .single();

    return {
        event,
        user: session.user
    };


And the result:

{"id":"41aee507-f7c2-492d-879f-551141dc63e4","name":"Chess","organizer_id":"f316de4e-e478-4ce3-842c-00e98f475870","profiles":null}
{"id":"41aee507-f7c2-492d-879f-551141dc63e4","name":"Chess","organizer_id":"f316de4e-e478-4ce3-842c-00e98f475870","profiles":null}


Can't get
profiles
profiles
to be not null and/or include any data. Thoughts?
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

Filter inner joins
SupabaseSSupabase / help-and-questions
4y ago
Typescript issue with joins
SupabaseSSupabase / help-and-questions
3w ago
joins across schemas with client
SupabaseSSupabase / help-and-questions
14mo ago
exchangeCodeForSession not working
SupabaseSSupabase / help-and-questions
3mo ago