update prisma docs (#31216)

Co-authored-by: Brian Brennglass <brian@Brians-MacBook-Pro.local>
This commit is contained in:
TheOtherBrian1andBrian Brennglass authored and GitHub committed 2024-12-18 16:29:56 -05:00
1 parent 2bb3a4b677
commit de7d344fb3
1 file changed
+8 -5
+8 -5
View File
@@ -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';
```
</StepHikeCompact.Code>
</StepHikeCompact.Step>
@@ -118,14 +123,12 @@ If you plan to solely use Prisma instead of the Supabase Data API (PostgREST), t
<StepHikeCompact.Step step={3}>
<StepHikeCompact.Details title="Add your connection information to your .env file">
- 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.
<Admonition type="note">
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.
</Admonition>
- 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