update mysql adapter to include connection string parameter#7425
Open
newclarityex wants to merge 1 commit intoprisma:mainfrom
Open
update mysql adapter to include connection string parameter#7425newclarityex wants to merge 1 commit intoprisma:mainfrom
newclarityex wants to merge 1 commit intoprisma:mainfrom
Conversation
Contributor
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 |
Contributor
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.