Skip to content

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

added CLI example for generating types with self-hosted instance

Chris Praase1b51dff8131
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