-
Notifications
You must be signed in to change notification settings - Fork 876
feat: update read replica docs #7344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughDocumentation for Prisma read replicas was updated to use adapter-based PrismaClient initialization (e.g., Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks✅ Passed checks (3 passed)
Comment |
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
content/200-orm/200-prisma-client/000-setup-and-configuration/200-read-replicas.mdx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
content/200-orm/200-prisma-client/000-setup-and-configuration/200-read-replicas.mdx (1)
64-93: Minor: Harmonize import paths for consistency.The v6 fallback section is well-documented and clearly separated, but uses a different import path pattern:
'../prisma/generated/client'(line 75) vs.'./generated/prisma/client'in the main example (line 34) and multiple replicas example (line 106). While both paths are valid for different project structures, using consistent paths across all examples in the same documentation page will reduce user confusion when copy-pasting code.Consider standardizing on
'./generated/prisma/client'(used in both the main and multiple replicas examples) for consistency within this documentation.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/200-orm/200-prisma-client/000-setup-and-configuration/200-read-replicas.mdx(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7301
File: content/800-guides/410-cloudflare-workers.mdx:87-107
Timestamp: 2025-11-20T21:00:02.587Z
Learning: Do not suggest changes to `prisma.config.ts` files in the prisma/docs repository, as the code examples are intentional for documentation purposes.
📚 Learning: 2025-11-20T21:00:02.587Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7301
File: content/800-guides/410-cloudflare-workers.mdx:87-107
Timestamp: 2025-11-20T21:00:02.587Z
Learning: Do not suggest changes to `prisma.config.ts` files in the prisma/docs repository, as the code examples are intentional for documentation purposes.
Applied to files:
content/200-orm/200-prisma-client/000-setup-and-configuration/200-read-replicas.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 (4)
content/200-orm/200-prisma-client/000-setup-and-configuration/200-read-replicas.mdx (4)
1-27: ✓ Excellent compatibility documentation.The introduction and setup section now clearly communicate the Prisma 7 requirement and adapter-based API, with helpful guidance directing Prisma v6 users to the fallback section. The compatibility note (lines 21–27) explains the architectural change well.
31-62: ✓ Adapter-based pattern correctly implemented.The main example now properly demonstrates the Prisma 7 approach: creating adapters, instantiating clients with them, and extending the main client with the readReplicas extension. The code correctly passes full
PrismaClientinstances rather than URLs, addressing the concern raised in prior review feedback.
99-131: ✓ Multiple replicas example is clear and consistent.The section correctly extends the single-replica pattern to demonstrate multiple database replicas. The pattern of creating adapters, instantiating clients, and passing them as an array to
readReplicasis consistent with the main example and properly documented. The explanation that replicas are randomly selected (line 133) is helpful context.
135-148: ✓ Helper methods well-documented.The
$primary()and$replica()methods are clearly documented with concise, purpose-driven examples that show when and how to override the default query routing.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.