© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
21 replies
Adam Ambrosius

Query table from edge function

I am new to Supabase and love it so far but think I'm making a dumb mistake. I created tables then an edge function.

const supabaseClient = createClient(
  // Supabase API URL - env var exported by default when deployed.
  Deno.env.get("SUPABASE_URL") ?? "",
  // Supabase API ANON KEY - env var exported by default when deployed.
  Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);

const { data, error } = await supabaseClient
    .from("table_name")
    .select("*");

  console.log({ data, error });
const supabaseClient = createClient(
  // Supabase API URL - env var exported by default when deployed.
  Deno.env.get("SUPABASE_URL") ?? "",
  // Supabase API ANON KEY - env var exported by default when deployed.
  Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);

const { data, error } = await supabaseClient
    .from("table_name")
    .select("*");

  console.log({ data, error });


I am getting an error
{
  data: null,
  error: {
    code: "42P01",
    details: null,
    hint: null,
    message: 'relation "public.table_name" does not exist'
  }
}
{
  data: null,
  error: {
    code: "42P01",
    details: null,
    hint: null,
    message: 'relation "public.table_name" does not exist'
  }
}


Do I need to do something else to link up my tables to my edge functions? Thanks in advance for the help
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

Renamed Table, broke edge function
SupabaseSSupabase / help-and-questions
5mo ago
api query to my supabase table is not working from inside my edge function
SupabaseSSupabase / help-and-questions
3y ago
42P01 error from edge function
SupabaseSSupabase / help-and-questions
4mo ago
Return Error from Edge Function
SupabaseSSupabase / help-and-questions
4y ago