The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Update generating-types.mdx (#28126)
SalvatoreLaba52e2affec4
diff --git a/apps/docs/content/guides/api/rest/generating-types.mdx b/apps/docs/content/guides/api/rest/generating-types.mdxindex 1986477b76b..5bfd5582380 100644--- a/apps/docs/content/guides/api/rest/generating-types.mdx+++ b/apps/docs/content/guides/api/rest/generating-types.mdx@@ -37,13 +37,13 @@ npx supabase initGenerate types for your project to produce the `types/supabase.ts` file:```bash-npx supabase gen types typescript --project-id "$PROJECT_REF" --schema public > types/supabase.ts+npx supabase gen types --lang=typescript --project-id "$PROJECT_REF" --schema public > types/supabase.ts```or in case of local development:```bash-npx supabase gen types typescript --local > types/supabase.ts+npx supabase gen types --lang=typescript --local > types/supabase.ts```These types are generated from your database schema. Given a table `public.movies`, the generated types will look like:@@ -209,7 +209,7 @@ One way to keep your type definitions in sync with your database is to set up aAdd the following script to your `package.json` to run it using `npm run update-types````json-"update-types": "npx supabase gen types typescript --project-id \"$PROJECT_REF\" > types/supabase.ts"+"update-types": "npx supabase gen types --lang=typescript --project-id \"$PROJECT_REF\" > types/supabase.ts"```Create a file `.github/workflows/update-types.yml` with the following snippet to define the action along with the environment variables. This script will commit new type changes to your repo every night.