Document MongoDB URI normalization behavior - #164
Closed
cursor[bot] wants to merge 3 commits into
Closed
cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
new URL() rejects standard replica-set connection strings such as mongodb://host1:27017,host2:27017/db, causing a startup crash when resolveMongoUri runs at module load. URL.toString() also re-encodes credentials when appending a database name. Use string-based path extraction and append logic instead, and add tests for replica-set URIs and encoded credentials. Co-authored-by: Daan Vrieling <contact@zvapor.xyz>
Set process.env.DATABASE_URL to the resolved MongoDB URI so Prisma
schema env("DATABASE_URL") and the client datasourceUrl stay aligned,
preventing P1013 when the env var is empty or lacks a db path.
Add tests for double-slash avoidance, replica-set query params, and
DATABASE_URL sync ordering. Document URI/dbName alignment in AGENTS.md,
.env.example, and engineering-guide.md.
Co-authored-by: Daan Vrieling <contact@zvapor.xyz>
Co-authored-by: Daan Vrieling <contact@zvapor.xyz>
zVapor-Dev
marked this pull request as ready for review
September 16, 2026 22:51
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
Updates contributor-facing documentation for MongoDB URI normalization and Prisma datasource handling.
Docs added/updated
.env.examplecomments forDATABASE_URLalignmentdocs/configuration.mdproduction toggle and MongoDB URI rulesdocs/database.mdPrisma runtime URI resolution/runbook detailsdocs/engineering-guide.mdsetup and persistence notesdocs/getting-started.mdPrisma generation and MongoDB troubleshootingdocs/contributing.mdsetup quick start and current test inventoryCodepaths covered
src/utils/resolveMongoUri.jssrc/handlers/prisma.jssrc/example.config.jstests/Key knowledge gaps addressed
process.env.DATABASE_URLsync beforePrismaClientconstructionconfig.variables.dbNameappendingPRODUCTION === "true"environment selectionnpx prisma generatestep and current resolver test coverageVerification
git diff --cached --checknpm test(61/61 passing)