Skip to content

fix(docs): align prisma init config examples#7917

Open
AmanVarshney01 wants to merge 1 commit into
mainfrom
aman/fix-prisma-init-config-docs
Open

fix(docs): align prisma init config examples#7917
AmanVarshney01 wants to merge 1 commit into
mainfrom
aman/fix-prisma-init-config-docs

Conversation

@AmanVarshney01
Copy link
Copy Markdown
Member

@AmanVarshney01 AmanVarshney01 commented May 26, 2026

Summary

  • update Prisma ORM quickstart and add-to-existing generated prisma.config.ts snippets to match current prisma init output
  • replace defineConfig, env examples with defineConfig plus process.env["DATABASE_URL"]
  • remove the obsolete extra MongoDB dotenv step because current prisma init already generates it

Root cause

The docs showed an older generated prisma.config.ts shape, while Prisma 7.8.0 now generates comments, imports only defineConfig, and reads DATABASE_URL from process.env.

Validation

  • npx --yes prisma@latest init --datasource-provider postgresql --output ../generated/prisma
  • npx --yes prisma@latest init --datasource-provider mongodb --output ../generated/prisma
  • npx --yes prisma@latest init --datasource-provider sqlite --output ../generated/prisma
  • rg -n 'defineConfig, env|url: env\\("DATABASE_URL"\\)|engine: "classic"|Add dotenvtoprisma.config.ts' apps/docs/content/docs/\\(index\\)/prisma-orm -g '*.mdx' -S\n- cd apps/docs && pnpm exec cspell $(git -C ../.. diff --name-only HEAD~1 -- apps/docs/content/docs/\\(index\\)/prisma-orm/\'*.mdx\' | sed 's#^apps/docs/##') --show-context\n- git diff --check\n\nFixes prisma init ... command generates different output, than what is shown in the docs #7818\n

Summary by CodeRabbit

  • Documentation
    • Updated configuration examples across all database guides (PostgreSQL, MySQL, MongoDB, CockroachDB, PlanetScale, Prisma Postgres, SQL Server, SQLite) to reflect current environment variable configuration standards. Updated snippets now include prerequisite installation notes where applicable.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment May 26, 2026 11:29am
docs Ready Ready Preview, Comment May 26, 2026 11:29am
eclipse Ready Ready Preview, Comment May 26, 2026 11:29am
site Ready Ready Preview, Comment May 26, 2026 11:29am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d7e36027-38cc-4cc1-85bd-1456094d0147

📥 Commits

Reviewing files that changed from the base of the PR and between 9cda317 and d46de18.

📒 Files selected for processing (16)
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/cockroachdb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mysql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/planetscale.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/postgresql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/prisma-postgres.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/sql-server.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/sqlite.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/cockroachdb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/mongodb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/mysql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/planetscale.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/postgresql.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/prisma-postgres.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/sql-server.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/sqlite.mdx

Walkthrough

Sixteen documentation files across Prisma's ORM database guides are synchronized with the current Prisma CLI initialization output. All prisma.config.ts code examples now remove the env() helper import and use direct process.env["DATABASE_URL"] access, with clarifying comments about required prisma and dotenv dependencies.

Changes

Prisma Config Documentation Examples

Layer / File(s) Summary
Add-to-existing-project guides: env() to process.env
apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/cockroachdb.mdx, mongodb.mdx, mysql.mdx, planetscale.mdx, postgresql.mdx, prisma-postgres.mdx, sql-server.mdx, sqlite.mdx
Eight guides update their generated prisma.config.ts snippets to remove the env import from prisma/config and replace env("DATABASE_URL") with process.env["DATABASE_URL"]. MongoDB additionally removes the deprecated engine: "classic" field and clarifies the dotenv/config side-effect import pattern. All guides now include comments documenting the required prisma and dotenv dev dependencies.
Quickstart guides: env() to process.env
apps/docs/content/docs/(index)/prisma-orm/quickstart/cockroachdb.mdx, mongodb.mdx, mysql.mdx, planetscale.mdx, postgresql.mdx, prisma-postgres.mdx, sql-server.mdx, sqlite.mdx
Eight quickstart guides apply the same config example updates: removing env from imports and switching to direct process.env["DATABASE_URL"] access. MongoDB quickstart also removes engine: "classic" and adds explicit dotenv/config import. Generated-file header comments and dependency notes are added or clarified across all guides.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related issues

  • #7818 — Documents the discrepancy between the actual Prisma CLI prisma init output and the documented examples; this PR directly resolves that issue by updating all affected guide examples to match the current CLI-generated format.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(docs): align prisma init config examples' directly and accurately summarizes the main change: updating documentation code examples to match current Prisma output.
Linked Issues check ✅ Passed All code changes in the PR align with issue #7818 requirements: updating 16 documentation files to replace env() helper with process.env across quickstart and add-to-existing guides for all database providers.
Out of Scope Changes check ✅ Passed All 16 file changes are within scope—updating documentation code examples to match current prisma init output as specified in issue #7818; no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant