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>
This commit is contained in:
burggrafandCopple authored and GitHub committed 2021-11-02 18:38:42 +08:00
1 parent 637bddced6
commit df1fdcd027
1 file changed
+12
+12
View File
@@ -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.