update mysql adapter to include connection string parameter#7425
update mysql adapter to include connection string parameter#7425newclarityex wants to merge 1 commit intoprisma:mainfrom
Conversation
WalkthroughDocumentation content updated to include an alternative usage example demonstrating how to instantiate the PrismaMariaDb adapter using a connection string, environment variable retrieval, and integration with PrismaClient. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI Agents
In @content/200-orm/050-overview/500-databases/400-mysql.mdx:
- Line 80: The code wraps process.env.DATABASE_URL in a template literal which
turns undefined into the string "undefined" and causes confusing parsing errors;
replace the template usage by reading the env var directly (const
connectionString = process.env.DATABASE_URL) and add an explicit check that
throws or logs a clear error if connectionString is missing (e.g., if
(!connectionString) throw new Error("DATABASE_URL environment variable not
set")) so failures report the missing env var rather than a malformed
"undefined" connection string.
- Line 82: The code calls new PrismaMariaDb(connectionString) but PrismaMariaDb
expects an options/config object (e.g., host, port, user, password, database,
connectionLimit) rather than a plain connection string; replace the
connectionString argument with an object literal containing those properties
when instantiating PrismaMariaDb (reference: PrismaMariaDb constructor).
|
👋 Hi @newclarityex! Thanks for your contribution to the Prisma docs. We wanted to let you know that we've recently updated our documentation structure and guidelines. Your PR may need to be updated to align with these changes. Action needed:
|
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.