The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: Fixes the typescript gen docs which are out of date
Paul Copplestone17882f73259b
diff --git a/web/docs/client/generating-types.mdx b/web/docs/client/generating-types.mdxindex e3a600c46c9..0c500e387f5 100644--- a/web/docs/client/generating-types.mdx+++ b/web/docs/client/generating-types.mdx@@ -30,15 +30,15 @@ type Message = {const response = await supabase.from<Message>('messages') // Message maps to the type of the row in your database..select('*, author:user_id(username)')- .match({ channel_id: 2 }); // Your IDE will be able to help with automcompletion.-response.body // Response body will be of type Array<Message>.+ .match({ channel_id: 2 }) // Your IDE will be able to help with automcompletion.+response.data // Response body will be of type Array<Message>.// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.const response = await supabase.from<any>('messages').select('*, author:user_id(username)')- .match({ channel_id: 2 });-response.body // Response body will be of type Array<any>.+ .match({ channel_id: 2 })+response.data // Response data will be of type Array<any>.```### Generate database types from Swagger OpenAPI specification@@ -51,10 +51,10 @@ The Swagger specification for your Supabase project can be accessed as follows:https://your-project.supabase.co/rest/v1/?apikey=your-anon-key```-Using the open source [swagger-to-ts](https://github.com/manifoldco/swagger-to-ts#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:+Using the open source [swagger-to-ts](https://github.com/drwpow/openapi-typescript#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:```bash-npx @manifoldco/swagger-to-ts https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts+npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts```**Note:** Do note that your local types won't automatically stay in sync with your database, so make sure to regenerate your types after your make changes to your database.