Skip to content

Commit

Permalink
Update 880-supabase.mdx (#5743)
Browse files Browse the repository at this point in the history
* Update 880-supabase.mdx

This guide is outdated.  

The recent notes can be found here for Postgres 14 and above: 
https://supabase.com/partners/integrations/prisma

* update other .env example

---------

Co-authored-by: Jon Harrell <[email protected]>
  • Loading branch information
sommermeyer and jharrell authored Mar 27, 2024
1 parent 0451053 commit ab1465e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions content/200-orm/050-overview/500-databases/880-supabase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ If you'd like to use the [connection pooling feature](https://supabase.com/docs/

```env file=.env
# Connect to Supabase via connection pooling with Supavisor.
DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true"
DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-region].pooler.supabase.com:6543/postgres?pgbouncer=true"
```

If you would like to use the Prisma CLI in order to perform other actions on your database (e.g. migrations) you will need to add a `DIRECT_URL` environment variable to use in the `datasource.directUrl` property so that the CLI can bypass Supavisor:

```env file=.env highlight=4-5;add
# Connect to Supabase via connection pooling with Supavisor.
DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true"
DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-region].pooler.supabase.com:6543/postgres?pgbouncer=true"
# Direct connection to the database. Used for migrations.
DIRECT_URL="postgres://postgres:[password]@db.[your-supabase-project].supabase.co:5432/postgres"
DIRECT_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-region].pooler.supabase.com:5432/postgres"
```

You can then update your `schema.prisma` to use the new direct URL:
Expand Down

0 comments on commit ab1465e

Please sign in to comment.