Skip to content

Commit 7033a61

Browse files
committed
Added Supabase + Prisma note to supabase auth
1 parent affe721 commit 7033a61

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/guides/frameworks/supabase-authentication.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,27 @@ const supabase = createClient<Database>(
7272
// Your task
7373
```
7474
75+
## Using Prisma with Supabase PgBouncer
76+
77+
When using Prisma with Supabase's PgBouncer connection pooler, you need separate pooled and direct connection URLs to avoid prepared statement conflicts.
78+
79+
```ts
80+
// In trigger.config.ts
81+
prismaExtension({
82+
schema: "prisma/schema.prisma",
83+
directUrlEnvVarName: "DATABASE_URL_UNPOOLED",
84+
}),
85+
```
86+
87+
```bash
88+
# Environment variables
89+
DATABASE_URL=postgresql://[email protected]:6543/postgres?pgbouncer=true&connection_limit=1
90+
DATABASE_URL_UNPOOLED=postgresql://[email protected]:5432/postgres
91+
```
92+
93+
<Note>
94+
The pooled connection (port 6543) is used for regular queries, while the direct connection (port
95+
5432) is used for migrations and schema operations that don't work with connection pooling.
96+
</Note>
97+
7598
<SupabaseDocsCards />

0 commit comments

Comments
 (0)