Skip to content

Commit

Permalink
update prisma docs (#31216)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Brennglass <brian@Brians-MacBook-Pro.local>
  • Loading branch information
TheOtherBrian1 and Brian Brennglass authored Dec 18, 2024
1 parent 2bb3a4b commit de7d344
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions apps/docs/content/guides/database/prisma.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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.


Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit de7d344

Please sign in to comment.