From e1b51dff8131aaf95acba6eefbdda100bdbf665f Mon Sep 17 00:00:00 2001 From: Chris Praas Date: Thu, 26 Feb 2026 12:20:29 +0100 Subject: [PATCH] added CLI example for generating types with self-hosted instance Docs Update. Added a example for generating types with self-hosted instance. Co-authored-by: Chris Chinchilla --- apps/docs/content/guides/api/rest/generating-types.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/docs/content/guides/api/rest/generating-types.mdx b/apps/docs/content/guides/api/rest/generating-types.mdx index 3f10c9dee37..c728c698795 100644 --- a/apps/docs/content/guides/api/rest/generating-types.mdx +++ b/apps/docs/content/guides/api/rest/generating-types.mdx @@ -46,6 +46,12 @@ or in case of local development: npx supabase gen types typescript --local > database.types.ts ``` +or in case of a self-hosted instance (see [Accessing Postgres](/docs/guides/self-hosting/docker#accessing-postgres) for more information): + +```bash +npx supabase gen types typescript --db-url postgres://postgres.[POOLER_TENANT_ID]:[POSTGRES_PASSWORD]@[your-domain-or-ip]:5432/postgres --schema public > database.types.ts +``` + These types are generated from your database schema. Given a table `public.movies`, the generated types will look like: ```sql