Skip to content

Commit e51b170

Browse files
medkrimimedkrimi
and
medkrimi
authored
Updated Readme file on how to install and use supabase CLI to generate types. (vercel#167)
Co-authored-by: medkrimi <[email protected]>
1 parent 0f2204b commit e51b170

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Diff for: README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,24 @@ The [Stripe CLI](https://stripe.com/docs/stripe-cli#install) `fixtures` command
112112

113113
You can use the [Supabase CLI](https://supabase.com/docs/reference/cli/usage#supabase-gen-types-typescript) to generate types from your Database by running
114114

115+
1. To install supabase cli
116+
117+
```bash
118+
npm install supabase --save-dev
119+
yarn add supabase --dev
120+
```
121+
122+
2. Connect to supabase
123+
124+
```bash
125+
npx supabase login
126+
```
127+
128+
3. Enter your access token. You can generate an access token from https://app.supabase.com/account/tokens
129+
4. Generate types
130+
115131
```bash
116-
supabase gen types typescript --db-url "postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT-REF].supabase.co:5432/postgres" > types_db.ts
132+
npx supabase gen types typescript --project-id [YOUR-PROJECT-REF] --schema public > types_db.ts
117133
```
118134

119135
### That's it

0 commit comments

Comments
 (0)