From df1fdcd02729dd969ba73167bae87231d37f1d4c Mon Sep 17 00:00:00 2001 From: burggraf Date: Tue, 2 Nov 2021 03:38:42 -0700 Subject: [PATCH] Document the schema option for createClient (#2683) * Document the schema option for createClient * added TODO documentation * Adds the instructions for exposing more schemas Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com> --- web/spec/supabase.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 33784f5d968..abdce37288b 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -160,7 +160,19 @@ pages: const options = { } const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key", options) ``` + - name: With additional parameters - access non-public schemas + js: | + ```js + import { createClient } from '@supabase/supabase-js' + const options = {schema: "other_schema"} + const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key", options) + ``` + + By default the API server points to the `public` schema. You can enable others database schemas within the Dashboard. + Go to `Settings > API > Schema` and add the schema which you want to expose to on the API. + + Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema. Generating Types: description: | Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript through a third-party tool.