Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs(api): note db.schema generic requirement for TS (#49967)

Katerina Skroumpeloubdfd69e9554a
diff --git a/apps/docs/content/guides/api/using-custom-schemas.mdx b/apps/docs/content/guides/api/using-custom-schemas.mdx
index 9b431d22385..dc788a70025 100644
--- a/apps/docs/content/guides/api/using-custom-schemas.mdx
+++ b/apps/docs/content/guides/api/using-custom-schemas.mdx
@@ -56,6 +56,12 @@ const { data: todos, error } = await supabase.from('todos').select('*')
const { data: todos, error } = await supabase.schema('myschema').from('todos').select('*')
```
+<Admonition type="note">
+
+With generated `Database` types that include `public`, `createClient<Database>(...)` type-checks `db.schema` against `public` only, unless the schema name is also passed as the second generic: `createClient<Database, 'myschema'>(...)`. `supabase.schema('myschema').from(...)` infers its schema per call and needs no second generic. In both cases `myschema` has to be present in the generated `Database` type.
+
+</Admonition>
+
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Dart">