Skip to content

Conversation

@AmanVarshney01
Copy link
Contributor

@AmanVarshney01 AmanVarshney01 commented Nov 17, 2025

Summary by CodeRabbit

  • Documentation
    • Updated database connection configuration guidance for Supabase, Neon, and PgBouncer deployments
    • Adjusted environment variable setup instructions for connection management
    • Modified Prisma CLI configuration examples and initialization patterns
    • Corrected documentation references and anchor links across guides

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

Documentation updates shift database connection guidance across eight pages to introduce a dual-URL architecture: prisma.config.ts handles CLI operations with DIRECT_URL, while Prisma Client runtime uses pooled DATABASE_URL via driver adapters. Changes affect Supabase, Neon, PgBouncer, Vercel, Accelerate guides and connection configuration references.

Changes

Cohort / File(s) Summary
Database Provider Configuration Overhaul
content/200-orm/050-overview/500-databases/880-supabase.mdx, 890-neon.mdx
content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx
Replaces single-URL strategy with dual-URL pattern: datasource configuration moved to prisma.config.ts using DIRECT_URL for CLI, while runtime instantiation uses DATABASE_URL with driver adapters (PrismaPg, PrismaNeon). Introduces new code examples for prisma.config.ts and src/db/client.ts patterns.
Connection Configuration Guides
content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx
content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
Restructures documentation to explain two-variable approach (DATABASE_URL pooled, DIRECT_URL direct) with prisma.config.ts configuration and runtime adapter wiring; updates references from directUrl to prisma.config.ts-based datasource patterns.
Deployment Guidance
content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx
content/300-accelerate/200-getting-started.mdx
Simplifies Vercel docs to use POSTGRES_URL_NON_POOLING directly; updates Accelerate docs to introduce prisma.config.ts for direct connections and new accelerateUrl initialization pattern.
Reference Link Corrections
content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
content/200-orm/500-reference/050-prisma-client-reference.mdx
Corrects anchor references in nested create examples (create-1 → create, createmany-1 → createmany).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Consistency verification: Ensure dual-URL pattern is uniformly applied across all database guides (Supabase, Neon, PgBouncer); verify that DIRECT_URL vs. DATABASE_URL semantics align.
  • prisma.config.ts examples: Validate that all defineConfig examples correctly use env() helper and reference schema paths accurately.
  • Runtime adapter wiring: Confirm PrismaPg, PrismaNeon adapter instantiation patterns in src/db/client.ts examples are correct and use proper import paths.
  • Vercel simplification: Verify that removing the dual-URL approach for Vercel is intentional and doesn't conflict with other platform guidance.
  • Anchor link accuracy: Confirm that the create/createmany anchor corrections reference appropriate documentation sections without broken links.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main objective: updating documentation to demonstrate how to perform migrations using connection pooling alongside the new Prisma config approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
content/300-accelerate/200-getting-started.mdx (1)

44-55: Dual-URL flow looks good; add minimum version note.

Consider adding: “Prisma CLI reads prisma.config.ts in 6.12.0+.” For older versions, mention the schema datasource URL behavior.

content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx (1)

1-8: Title casing consistency (optional).

Docs use sentence case for headings/titles. Consider “Deploy to Vercel Edge Functions and middleware” to align, unless you’re preserving product-cased names.

As per coding guidelines.

content/200-orm/050-overview/500-databases/880-supabase.mdx (1)

44-78: Clarify DIRECT_URL recommendation (avoid session pooler).

For CLI, prefer the true direct DB host (db.[project-ref].supabase.co:5432). The session pooler (pooler.supabase.com:5432) is still pooled and can reintroduce pooling caveats during Migrate/Introspection. Suggest keeping only the direct host as the recommended DIRECT_URL.

content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx (1)

339-371: Great summary of the dual-URL approach.

Consider adding a small note that prisma.config.ts is supported from Prisma 6.12.0+ to set expectations for older projects.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05b7cb0 and 7a9174e.

📒 Files selected for processing (9)
  • content/200-orm/050-overview/500-databases/880-supabase.mdx (2 hunks)
  • content/200-orm/050-overview/500-databases/890-neon.mdx (1 hunks)
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx (1 hunks)
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx (1 hunks)
  • content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx (3 hunks)
  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx (1 hunks)
  • content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx (2 hunks)
  • content/200-orm/500-reference/050-prisma-client-reference.mdx (1 hunks)
  • content/300-accelerate/200-getting-started.mdx (5 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: ankur-arch
Repo: prisma/docs PR: 7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: All headings and titles should use sentence case (e.g., "Getting started with Prisma ORM", "Best practices for authentication"), not title case. Exception: Always preserve exact casing for product names including "Prisma Postgres", "Prisma", "Prisma ORM", and "Prisma Data Platform".

Applied to files:

  • content/200-orm/500-reference/050-prisma-client-reference.mdx
  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/050-overview/500-databases/880-supabase.mdx
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: Only flag code snippets for (1) exposed secrets with real-looking values that should be placeholders (e.g., API keys, database passwords, AWS credentials), or (2) blatant syntax errors like missing parentheses, brackets, braces, or mismatched delimiters. Do not flag code quality issues, anti-patterns, security vulnerabilities, missing error handling, unused variables, or any other bad practices, as documentation intentionally shows problematic code.

Applied to files:

  • content/200-orm/500-reference/050-prisma-client-reference.mdx
  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/050-overview/500-databases/880-supabase.mdx
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx
  • content/200-orm/050-overview/500-databases/890-neon.mdx
📚 Learning: 2025-10-08T16:22:57.129Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:50-66
Timestamp: 2025-10-08T16:22:57.129Z
Learning: In `.mdx` files, do NOT flag or suggest changes for the following code quality issues even if they represent poor practices: React anti-patterns (using var instead of useState, direct DOM manipulation), missing keys in .map() iterations, non-serializable props in getServerSideProps, unused variables, missing error handling, SQL injection vulnerabilities (unless actively showing how to fix them), insecure cookie settings, missing TypeScript types, PrismaClient instantiation patterns, or any other code quality, security, or performance issues. Documentation code snippets are copied from source code and often intentionally show "before" examples or common mistakes.

Applied to files:

  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
📚 Learning: 2025-08-11T09:40:55.237Z
Learnt from: ankur-arch
Repo: prisma/docs PR: 7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.

Applied to files:

  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/050-overview/500-databases/880-supabase.mdx
  • content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx
  • content/300-accelerate/200-getting-started.mdx
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx
📚 Learning: 2025-10-09T21:32:50.340Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.

Applied to files:

  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/050-overview/500-databases/880-supabase.mdx
  • content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx
  • content/300-accelerate/200-getting-started.mdx
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check internal links
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (13)
content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx (3)

533-534: Verify consistency of createMany anchor reference across the document.

Line 534 references #createmany-1, while line 643 (also changed in this PR) references #createmany (without the -1 suffix). Both are documenting the same concept (nested createMany operations). According to the AI summary, anchor references should have been updated uniformly across the section, so this inconsistency may indicate an incomplete refactor.

Please verify against the prisma-client-reference documentation whether:

  1. Both references should point to #createmany (without -1)
  2. Or whether #createmany-1 is a distinct, intentional anchor for this specific context

If they should be consistent, apply this diff:

- Use a nested [`createMany`](/orm/reference/prisma-client-reference#createmany-1) query
+ Use a nested [`createMany`](/orm/reference/prisma-client-reference#createmany) query

547-547: Consistent anchor reference for create.

The reference to #create on line 547 is consistent with line 533. No issues detected here.


643-643: Anchor reference updated correctly.

Line 643 properly uses #createmany (without the -1 suffix), aligning with the PR's goal to update anchor references uniformly. However, note the inconsistency flagged in the review comment for line 534.

content/200-orm/500-reference/050-prisma-client-reference.mdx (1)

826-830: Check anchor target for nested create.

The link now points to #create. Please verify the section ID resolves correctly and update any other in-page links that still reference #create-1.

content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx (1)

245-249: Gate prisma.config.ts behavior by version.

You state the CLI reads prisma.config.ts. That’s true starting in Prisma 6.12.0. Please add a brief version note (and fallback to datasource URL in schema for older versions) to prevent confusion.

content/300-accelerate/200-getting-started.mdx (4)

71-73: Verify prisma+postgres support for Migrate/Introspection.

“PostgreSQL has no need for directUrl” relies on CLI compatibility with prisma+postgres://. Please confirm this is supported in the currently documented versions and call it out explicitly (versions and commands).


133-136: Confirm PrismaClient accelerateUrl option.

Is accelerateUrl a supported constructor option for the versions you target, or should the URL be passed via withAccelerate(...) options and DATABASE_URL? Please verify API shape and adjust the snippet if needed.


144-147: Edge client snippet: same concern about accelerateUrl.

As above, please confirm accelerateUrl on the edge client. If unsupported, update to the recommended withAccelerate usage pattern.


158-163: Extension order example: nice.

Good callout on precedence and ordering with Optimize before Accelerate.

content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx (1)

173-181: CLI uses direct connection on Vercel (POSTGRES_URL_NON_POOLING).

This update aligns with the dual-URL guidance. LGTM.

content/200-orm/050-overview/500-databases/890-neon.mdx (1)

49-71: Dual-URL + prisma.config.ts pattern reads well.

Clear split between pooled runtime and direct CLI. LGTM.

content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx (1)

68-99: Direct CLI + pooled runtime via adapter is correct for PgBouncer.

This workaround accurately avoids prepared-statement issues during Migrate while keeping pooling for app traffic.

content/200-orm/050-overview/500-databases/880-supabase.mdx (1)

29-34: Runtime pooled URL guidance looks good.

Using ?pgbouncer=true with Supavisor for the app runtime via adapter is consistent with the overall pattern.

Comment on lines +73 to +81
At runtime, instantiate Prisma Client with the pooled connection string using `@prisma/adapter-neon`:

```ts file=src/db/client.ts showLineNumbers
import { PrismaClient } from '../prisma/generated/client'
import { PrismaNeon } from '@prisma/adapter-neon'

const adapter = new PrismaNeon({ connectionString: process.env.DATABASE_URL })
export const prisma = new PrismaClient({ adapter })
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Keep wording consistent with prisma.config.ts.

Later, the Neon driver section states Migrate/Introspection/Studio “use the connection string defined in the Prisma schema.” With this PR we standardize on prisma.config.ts for CLI tools. Please update that sentence for consistency (and add a version note if needed).

🤖 Prompt for AI Agents
In content/200-orm/050-overview/500-databases/890-neon.mdx around lines 73 to
81, the wording refers to using the connection string defined in the Prisma
schema for Migrate/Introspection/Studio but our repo now standardizes on
prisma.config.ts for CLI tools; update the sentence to say these tools use the
connection string defined in prisma.config.ts (and add a brief version note if
this change is relevant to a specific Prisma/adapter release), ensuring wording
matches prisma.config.ts used earlier in the file.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 17, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 987fce5
Status:⚡️  Build in progress...

View logs

@AmanVarshney01 AmanVarshney01 merged commit f489364 into prisma-7 Nov 17, 2025
5 of 6 checks passed
@AmanVarshney01 AmanVarshney01 deleted the dc-6267-update-docs-to-perform-migrations-with-connection-pooling branch November 17, 2025 13:38
@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2237
✅ Successful 2211
⏳ Timeouts 0
🔀 Redirected 3
👻 Excluded 22
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants