How to generate TypeScript types with the Supabase CLI - SupabaseTips

preview_player
Показать описание
TypeScript has become a huge part of developing for the web today and in this video, we will explore how to make the most of TypeScript while working on your Supabase project. A prerequisites for using the supabase CLI in your local environment when using the --local or the --db-url flag is to have Docker installed.

Alternatively if you don't want to install Docker to use the types generation with the CLI, you can use the following commands:

supabase login
supabase link
supabase gen types typescript --linked

or

supabase gen types typescript --project-id abc-def-123

Learn more about Supabase 👇

Рекомендации по теме
Комментарии
Автор

Niiiice! I wonder if there's a way to automate the regeneration of your types. Is there a way to send a webhook when you change a db table?

codybontecou
Автор

(node:1) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)... no schema created

thiagoleobons
Автор

Documentation is not clear for windows users. it needs docker to run

shakti_pattanaik
Автор

What’s the best way to make this works for join table queries?

ChangHuangx
Автор

how can I import Suapase generated types in our project without invoking supabase instance? For example, type the FormValues using database posts table.

SeaRich
Автор

How do you do it for python type hints?

VascoAndradeeSilva-ibuz
Автор

Seems dope 🧐 I know a lot of people use Prisma - does this basically replace it? Would love to see a breakdown of using both.

pjmanning
Автор

This is great feature, Is edge hosting possible with supabase? say something like Nextjs edge runtime in cloudfalre workers...?

shafu_xyz
Автор

There is no way to access Foreign tables.

RootEntry
Автор

I did it for hosted supabase project. The cli also required docker running in the background. Not sure why do we need docker.

ParishKhan
Автор

If you are using 'auth-helpers-sveltekit' for example, the createClient method does not accept the database. Any plans on support soon?

camio
Автор

Unfortunately. it doesn't work for me. I have an error - supabase start is not running, but after supabase start I have another error.

andreidetenkov