SupabaseS
Supabase2mo ago
lp

Accessing custom schema locally

I have issue getting in my custom schema locally called app, I have granted to my sevrice_role only and use it, with the secret key...

export async function createClient() {
  const cookieStore = await cookies();

  return createServerClient(
    process.env.SUPABASE_URL!,
    process.env.SUPABASE_SERVICE_ROLE_KEY!,
    {
      db: {
        schema: "app",
      },


I specify my schema here, and try to get profiles table and it always return null, what could it be?

It works fine with the remote key I am very confused...I added to my config too:
[api]
enabled = true
# Port to use for the API URL.
port = 54321
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
# endpoints. `public` and `graphql_public` schemas are included by default.
schemas = ["app"]
# Extra schemas to add to the search_path of every request.
extra_search_path = ["app", "extensions"]


Still does not work

GRANT USAGE ON SCHEMA "app" TO "service_role";

-- Grant full access ONLY to service_role
GRANT ALL ON ALL TABLES IN SCHEMA "app" TO service_role;
GRANT ALL ON ALL SEQUENCES IN SCHEMA "app" TO service_role;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA "app" TO service_role;


For the supabase url I use this: API URL: http://127.0.0.1:54321
Was this page helpful?