From de7d344fb3fb3b917ec26eef6020478f56ec0042 Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:29:56 -0500 Subject: [PATCH] update prisma docs (#31216) Co-authored-by: Brian Brennglass --- apps/docs/content/guides/database/prisma.mdx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/docs/content/guides/database/prisma.mdx b/apps/docs/content/guides/database/prisma.mdx index 4b88a46403a..01755990b0d 100644 --- a/apps/docs/content/guides/database/prisma.mdx +++ b/apps/docs/content/guides/database/prisma.mdx @@ -45,6 +45,11 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t alter default privileges for role postgres in schema public grant all on routines to prisma; alter default privileges for role postgres in schema public grant all on sequences to prisma; ``` + + ```sql + -- alter prisma password if needed + alter user "prisma" with password 'new_password'; + ``` @@ -118,14 +123,12 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t - Visit the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) - ![Session Mode](/docs/img/database/session-mode.png) - Find your Supavisor Session Mode string. It should end with 5432. It will be used in your `.env` file. If you're in an [IPv6 environment](https://github.com/orgs/supabase/discussions/27034) or have the IPv4 Add-On, you can use the direct connection string instead of Supavisor in Session mode. - If you plan on deploying Prisma to a serverless or auto-scaling environment, you'll also need your Supavisor transaction mode string. - ![Transaction Mode](/docs/img/database/transaction-mode.png) - The string is identical to the session mode string but uses port 6543 at the end. @@ -137,7 +140,7 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t In your .env file, set the DATABASE_URL variable to your connection string ```text .env # Used for Prisma Migrations and within your application - DATABASE_URL="postgres://[DB-USER].[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres" + DATABASE_URL="postgres://[DB-USER].[PROJECT-REF]:[PRISMA-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres" ``` Change your string's `[DB-USER]` to `prisma` and add the password you created in step 1 @@ -152,10 +155,10 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t Next, create a DIRECT_URL variable in your .env file and assign the connection string that ends with port 5432 to it. ```text .env # Used in your application (use transaction mode) - DATABASE_URL="postgres://[DB-USER].[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true" + DATABASE_URL="postgres://[DB-USER].[PROJECT-REF]:[PRISMA-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true" # Used for Prisma Migrations (use session mode or direct connection) - DIRECT_URL="postgres://[DB-USER].[PROJECT-REF]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres" + DIRECT_URL="postgres://[DB-USER].[PROJECT-REF]:[PRISMA-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres" ``` Change both your strings' `[DB-USER]` to `prisma` and then add the password created in step 1