From 8f4e197ba4fe9cbd0ca9686f96ec291839cf9258 Mon Sep 17 00:00:00 2001 From: Adam Haglund Date: Tue, 20 Apr 2021 08:46:44 -0700 Subject: [PATCH] Update supabase.yml --- web/spec/supabase.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index eff74387c40..6ecd6faafd2 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -191,8 +191,12 @@ pages: ```bash 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. + + Important disclaimers: + + - The generator can't know if a column is specified as an array, and will thus just generate the type as `string`, even though supabase handles this automatically and returns arrays. + You can fix this manually in the files by changing the type, e.g. `names: string` -> `names: string[]` + - The types won't automatically stay in sync with your database, so make sure to regenerate your types after your make changes to your database. After you have generated your types, you can use them in your TypeScript projects: