S
Supabase3y ago
Sety

Typescript Database Typings with CLI on Cloud Database

Is this possible? Every post I see here using the v2 CLI only shows it for the Docker image of it.
3 Replies
silentworks
silentworks3y ago
I'm not sure the question you are asking here
Sety
SetyOP3y ago
The examples for the CLI building typescript types automatically are always for --local Even --db-url seems to be a local url and not in the supabase cloud can I have the cli build typescript types in V2 without running a docker locally
silentworks
silentworks3y ago
The docker container is only a small one for the types stuff and it just means you don't need to have a postgres driver installed locally. I've seen some threads on here where folks have just used the code from the repo and do a build themselves to get the types generator You would use the cli like this for supabase cloud hosted db
supabase gen types typescript --db-url your_db_connection_string > schema.ts
supabase gen types typescript --db-url your_db_connection_string > schema.ts
You can find your database connection string on this page https://app.supabase.com/project/_/settings/database by scrolling to the Connection string section and selecting the URI tab

Did you find this page helpful?