relation 'public.table_name' does not exist

I am unable to fetch data from my table while running locally. It does work once deployed though. I have logged my SUPABASE_URL and SUPABASE_ANON_KEY and those are populated successfully. I only have one project, I have linked it and am running
supabase start
, supabase functions serve function-name.
Here is the only code that is being executed which is modeled directly off of the examples provided.
import { createClient } from "https://esm.sh/@supabase/supabase-js@^1.33.2";

export 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") ?? ""
);

import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import { supabaseClient } from "../_shared/supabaseClient.ts";

serve(async (req) => {
  console.log(Deno.env.get("SUPABASE_URL") ?? "");
  console.log(Deno.env.get("SUPABASE_ANON_KEY") ?? "");
  const { data, error } = await supabaseClient.from("positions").select("*");

  console.log({ data, error });

  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  });
});


What do I need to do so that I can execute this locally?
Was this page helpful?