-
Notifications
You must be signed in to change notification settings - Fork 864
docs: env() behavior with optional environment variables in prisma.config.ts #7342
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
WalkthroughThis PR adds a new "Handling optional environment variables" subsection to the Prisma config reference documentation. It explains how the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📚 Learning: 2025-11-20T21:00:02.587ZApplied to files:
📚 Learning: 2025-10-08T16:23:00.388ZApplied to files:
📚 Learning: 2025-10-09T21:32:50.340ZApplied to files:
⏰ 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). (3)
🔇 Additional comments (1)
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. 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:
|
Deploying docs with
|
| Latest commit: |
0a3fccc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c9f52fcd.docs-51g.pages.dev |
| Branch Preview URL: | https://env-callout.docs-51g.pages.dev |
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.
Pull request overview
This PR updates the Prisma config reference docs to clarify how the env() helper behaves when environment variables are optional in prisma.config.ts, and provides guidance on safe alternatives.
- Adds a new “Handling optional environment variables” section explaining that env() throws if a variable is missing.
- Provides an example using process.env to avoid throwing during commands that don’t require a DB URL.
- Adds a note clarifying when to use env() vs process.env.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.