From ab1465ea0229fbdaee7870987696ba992ab8d4c0 Mon Sep 17 00:00:00 2001 From: "Daniel \"Datproto\" | HG" <66954240+danielHype@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:25:07 +0100 Subject: [PATCH] Update 880-supabase.mdx (#5743) * 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 <4829245+jharrell@users.noreply.github.com> --- .../200-orm/050-overview/500-databases/880-supabase.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/200-orm/050-overview/500-databases/880-supabase.mdx b/content/200-orm/050-overview/500-databases/880-supabase.mdx index 2b3684e57e..72d59b577b 100644 --- a/content/200-orm/050-overview/500-databases/880-supabase.mdx +++ b/content/200-orm/050-overview/500-databases/880-supabase.mdx @@ -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: