Skip to content

Conversation

@ankur-arch
Copy link
Contributor

@ankur-arch ankur-arch commented Nov 17, 2025

Summary by CodeRabbit

  • Documentation
    • Updated install instructions to include database drivers and TypeScript typings for Postgres, SQLite, and MSSQL.
    • Centralized configuration guidance with examples that preload environment variables.
    • Prisma init flow now shows generated config plus .env and includes an authentication-based Postgres setup.
    • Fixed numerous example import paths, code snippets, and documentation anchors for clearer guidance.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

This PR updates Prisma docs to add database driver typings (e.g., @types/pg, @types/better-sqlite3, @types/mssql) to install instructions and dependency lists, and migrates configuration and examples from schema.prisma datasource blocks to a prisma.config.ts-centered approach with updated generator/output paths and client import locations.

Changes

Cohort / File(s) Summary
Quickstart type definitions
content/100-getting-started/02-prisma-orm/100-quickstart/{100-prisma-postgres.mdx,200-sqlite.mdx,300-postgresql.mdx,500-sql-server.mdx,700-cockroachdb.mdx}
Added runtime drivers and TypeScript typings (pg, @types/pg, @types/better-sqlite3, @types/mssql) to npm install lines and expanded dependency explanation bullets.
Add-to-existing-project type updates
content/100-getting-started/02-prisma-orm/200-add-to-existing-project/{100-prisma-postgres.mdx,200-sqlite.mdx,300-postgresql.mdx,500-sql-server.mdx,700-cockroachdb.mdx}
Same dependency additions for existing-project guides: added driver packages and corresponding @types/* devDependencies and updated descriptive text.
Prisma Postgres CLI & examples
content/100-getting-started/03-prisma-postgres/{100-from-the-cli.mdx,115-import-from-existing-database-mysql.mdx}
Reworked CLI flow to show authentication/browser login flow, added Postgres adapter installation and adapter-based PrismaClient snippets; removed inline DATABASE_URL assignment in a shown datasource example.
Database drivers & config migration
content/200-orm/050-overview/500-databases/{200-database-drivers.mdx,300-postgresql.mdx,400-mysql.mdx,500-sqlite.mdx,800-sql-server/index.mdx}
Migrated datasource/config examples into prisma.config.ts (use of defineConfig and env('DATABASE_URL')), added import 'dotenv/config', removed engineType lines, changed generator output paths to ../generated/prisma, and updated PrismaClient import paths to ../generated/prisma/client.
CLI reference & init behavior
content/200-orm/500-reference/200-prisma-cli-reference.mdx, content/250-postgres/350-integrations/100-netlify.mdx
Reworked init/setup docs to center prisma.config.ts (showing defineConfig, env usage), and clarified that npx prisma init creates prisma.config.ts alongside schema and .env.
MDX examples & getting-started flows
content/600-about/30-docs-components/01-mdx-examples.mdx
Updated initialization messages and example outputs to list generated files (including prisma.config.ts) and restructured the guided "Connect Existing Database" / "Create New Database" workflows.
Anchors & minor doc fixes
content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx, content/200-orm/500-reference/050-prisma-client-reference.mdx
Fixed anchor links for nested-write examples (removed -1 suffixes) to match target anchors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • Generator block changes — confirm removal of engineType = "client" and new output paths are consistent across examples and tabbed install snippets.
  • PrismaClient import paths — verify all examples reference ../generated/prisma/client and no stale import paths remain.
  • prisma.config.ts snippets — ensure defineConfig usage, env('DATABASE_URL') calls, and import 'dotenv/config' placement are accurate and consistent.
  • Type definitions placement — confirm @types/* entries are only in devDependencies and runtime drivers (e.g., pg) are in dependencies.
  • CLI flow/authentication text — validate that added authentication/browser login wording matches actual CLI behavior.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating Prisma initialization-related documentation across multiple files to reflect Prisma ORM 7 configuration patterns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17b67d7 and 96b202e.

📒 Files selected for processing (2)
  • content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx (3 hunks)
  • content/200-orm/500-reference/050-prisma-client-reference.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: Only flag code snippets for (1) exposed secrets with real-looking values that should be placeholders (e.g., API keys, database passwords, AWS credentials), or (2) blatant syntax errors like missing parentheses, brackets, braces, or mismatched delimiters. Do not flag code quality issues, anti-patterns, security vulnerabilities, missing error handling, unused variables, or any other bad practices, as documentation intentionally shows problematic code.

Applied to files:

  • content/200-orm/500-reference/050-prisma-client-reference.mdx
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: All headings and titles should use sentence case (e.g., "Getting started with Prisma ORM", "Best practices for authentication"), not title case. Exception: Always preserve exact casing for product names including "Prisma Postgres", "Prisma", "Prisma ORM", and "Prisma Data Platform".

Applied to files:

  • content/200-orm/500-reference/050-prisma-client-reference.mdx
⏰ 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). (2)
  • GitHub Check: Check internal links
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
content/200-orm/500-reference/050-prisma-client-reference.mdx (1)

828-828: Anchor reference correction is appropriate.

This change updates the internal documentation link to point to the correct anchor, improving the documentation's internal consistency. The fix ensures that the reference to nested create examples directs readers to the accurate section.


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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 17, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96b202e
Status: ✅  Deploy successful!
Preview URL: https://d8db8a24.docs-51g.pages.dev
Branch Preview URL: https://dc-6236-init-command-change.docs-51g.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx (1)

5-5: Minor: metaDescription could be more descriptive.

The metaDescription is quite minimal. Consider expanding slightly to highlight the connection flow (e.g., "Get started with Drizzle ORM and Prisma Postgres by connecting your TypeScript ORM to a managed database.") for better SEO and user clarity.

Also applies to: 8-8

content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (1)

61-61: Import paths use different relative path patterns—verify they match actual directory structure.

Line 61 uses import { PrismaClient } from "./generated/prisma/client" (relative to root), while line 285 uses import { PrismaClient } from '../generated/prisma/client' (relative to lib/ subdirectory). Both are correct for their respective file locations, but users may find the inconsistency confusing.

Consider adding a brief comment in the code examples clarifying that the import path changes based on file location, or add a note in the guide explaining this convention.

Also applies to: 285-285

content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx (1)

28-37: Add description for the @types/node package.

The install command includes @types/node at line 28, but the package descriptions (lines 34-37) only cover four packages, missing an explanation for @types/node. Add:

- **`@types/node`** - TypeScript type definitions for Node.js built-in APIs

This ensures completeness and clarity for developers unfamiliar with why TypeScript type packages are needed.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05b7cb0 and c1c8a27.

📒 Files selected for processing (30)
  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx (2 hunks)
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx (4 hunks)
  • content/100-getting-started/02-prisma-orm/100-quickstart/300-postgresql.mdx (2 hunks)
  • content/100-getting-started/02-prisma-orm/100-quickstart/500-sql-server.mdx (2 hunks)
  • content/100-getting-started/02-prisma-orm/100-quickstart/700-cockroachdb.mdx (2 hunks)
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/100-prisma-postgres.mdx (1 hunks)
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/200-sqlite.mdx (1 hunks)
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/300-postgresql.mdx (1 hunks)
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/500-sql-server.mdx (1 hunks)
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/700-cockroachdb.mdx (1 hunks)
  • content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (1 hunks)
  • content/100-getting-started/03-prisma-postgres/100-quickstart/100-kysely.mdx (2 hunks)
  • content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx (1 hunks)
  • content/100-getting-started/03-prisma-postgres/100-quickstart/300-typeorm.mdx (1 hunks)
  • content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx (8 hunks)
  • content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx (0 hunks)
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx (3 hunks)
  • content/200-orm/050-overview/500-databases/300-postgresql.mdx (2 hunks)
  • content/200-orm/050-overview/500-databases/400-mysql.mdx (2 hunks)
  • content/200-orm/050-overview/500-databases/500-sqlite.mdx (4 hunks)
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx (2 hunks)
  • content/200-orm/050-overview/500-databases/840-cockroachdb.mdx (1 hunks)
  • content/200-orm/050-overview/500-databases/850-planetscale.mdx (1 hunks)
  • content/200-orm/500-reference/200-prisma-cli-reference.mdx (13 hunks)
  • content/250-postgres/100-introduction/225-import-from-existing-database.mdx (0 hunks)
  • content/250-postgres/350-integrations/100-netlify.mdx (1 hunks)
  • content/250-postgres/50-getting-started/200-import-from-existing-database.mdx (1 hunks)
  • content/600-about/30-docs-components/01-mdx-examples.mdx (4 hunks)
  • sidebars.ts (0 hunks)
  • static/_redirects (1 hunks)
💤 Files with no reviewable changes (3)
  • content/250-postgres/100-introduction/225-import-from-existing-database.mdx
  • sidebars.ts
  • content/100-getting-started/03-prisma-postgres/115-import-from-existing-database-mysql.mdx
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: All headings and titles should use sentence case (e.g., "Getting started with Prisma ORM", "Best practices for authentication"), not title case. Exception: Always preserve exact casing for product names including "Prisma Postgres", "Prisma", "Prisma ORM", and "Prisma Data Platform".
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: All headings and titles should use sentence case (e.g., "Getting started with Prisma ORM", "Best practices for authentication"), not title case. Exception: Always preserve exact casing for product names including "Prisma Postgres", "Prisma", "Prisma ORM", and "Prisma Data Platform".

Applied to files:

  • content/250-postgres/50-getting-started/200-import-from-existing-database.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/300-postgresql.mdx
  • content/600-about/30-docs-components/01-mdx-examples.mdx
  • content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/300-typeorm.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/100-kysely.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/700-cockroachdb.mdx
  • content/200-orm/050-overview/500-databases/300-postgresql.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx
  • content/200-orm/050-overview/500-databases/850-planetscale.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
  • content/250-postgres/350-integrations/100-netlify.mdx
  • content/200-orm/050-overview/500-databases/400-mysql.mdx
📚 Learning: 2025-10-09T21:32:50.340Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.

Applied to files:

  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/200-sqlite.mdx
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/300-postgresql.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/500-sql-server.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/300-postgresql.mdx
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/100-prisma-postgres.mdx
  • content/600-about/30-docs-components/01-mdx-examples.mdx
  • content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/700-cockroachdb.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/700-cockroachdb.mdx
  • content/200-orm/050-overview/500-databases/300-postgresql.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx
  • content/200-orm/050-overview/500-databases/500-sqlite.mdx
  • content/200-orm/050-overview/500-databases/850-planetscale.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/500-sql-server.mdx
  • content/200-orm/500-reference/200-prisma-cli-reference.mdx
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
  • content/250-postgres/350-integrations/100-netlify.mdx
  • content/200-orm/050-overview/500-databases/400-mysql.mdx
  • content/200-orm/050-overview/500-databases/840-cockroachdb.mdx
📚 Learning: 2025-08-11T09:40:55.237Z
Learnt from: ankur-arch
Repo: prisma/docs PR: 7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.

Applied to files:

  • content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx
  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/700-cockroachdb.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/700-cockroachdb.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx
  • content/200-orm/050-overview/500-databases/850-planetscale.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx
  • content/200-orm/500-reference/200-prisma-cli-reference.mdx
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
  • content/250-postgres/350-integrations/100-netlify.mdx
  • content/200-orm/050-overview/500-databases/400-mysql.mdx
  • content/200-orm/050-overview/500-databases/840-cockroachdb.mdx
📚 Learning: 2025-10-08T16:22:57.129Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:50-66
Timestamp: 2025-10-08T16:22:57.129Z
Learning: In `.mdx` files, do NOT flag or suggest changes for the following code quality issues even if they represent poor practices: React anti-patterns (using var instead of useState, direct DOM manipulation), missing keys in .map() iterations, non-serializable props in getServerSideProps, unused variables, missing error handling, SQL injection vulnerabilities (unless actively showing how to fix them), insecure cookie settings, missing TypeScript types, PrismaClient instantiation patterns, or any other code quality, security, or performance issues. Documentation code snippets are copied from source code and often intentionally show "before" examples or common mistakes.

Applied to files:

  • content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx
  • content/600-about/30-docs-components/01-mdx-examples.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/100-kysely.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/500-sql-server.mdx
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
  • content/250-postgres/350-integrations/100-netlify.mdx
  • content/200-orm/050-overview/500-databases/400-mysql.mdx
📚 Learning: 2025-10-15T06:36:42.423Z
Learnt from: jy-joung-bitor
Repo: prisma/docs PR: 0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `tsc --init` command requires the `--types node` flag to properly include Node.js type definitions from `types/node` in the generated tsconfig.json, even when types/node is already installed. Without this flag, TypeScript may not automatically pick up Node.js typings.

Applied to files:

  • content/100-getting-started/02-prisma-orm/200-add-to-existing-project/500-sql-server.mdx
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: Only flag code snippets for (1) exposed secrets with real-looking values that should be placeholders (e.g., API keys, database passwords, AWS credentials), or (2) blatant syntax errors like missing parentheses, brackets, braces, or mismatched delimiters. Do not flag code quality issues, anti-patterns, security vulnerabilities, missing error handling, unused variables, or any other bad practices, as documentation intentionally shows problematic code.

Applied to files:

  • content/600-about/30-docs-components/01-mdx-examples.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/100-kysely.mdx
  • content/200-orm/050-overview/500-databases/300-postgresql.mdx
  • content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx
  • content/200-orm/050-overview/500-databases/500-sqlite.mdx
  • content/200-orm/050-overview/500-databases/850-planetscale.mdx
  • content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx
  • content/200-orm/500-reference/200-prisma-cli-reference.mdx
  • content/200-orm/050-overview/500-databases/200-database-drivers.mdx
  • content/200-orm/050-overview/500-databases/800-sql-server/index.mdx
  • content/250-postgres/350-integrations/100-netlify.mdx
  • content/200-orm/050-overview/500-databases/400-mysql.mdx
⏰ 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). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (63)
content/100-getting-started/02-prisma-orm/200-add-to-existing-project/200-sqlite.mdx (4)

24-25: Type definitions addition is well‑placed.

Adding @types/better-sqlite3 alongside prisma and @types/node ensures developers have proper TypeScript support for the SQLite adapter used in this guide. This aligns with the adapter being instantiated on line 167 and strengthens type safety throughout the setup. The package installation sequence is logical and follows the pattern described in later sections.


40-41: Init command correctly specifies custom output path.

The --datasource-provider sqlite --output ../generated/prisma flags align with the new Prisma init command capabilities. The output path is properly mirrored in the schema.prisma generator configuration (line 89) and the PrismaClient import statement (line 168), creating consistent project layout documentation.


49-82: Configuration migration to prisma.config.ts is correctly documented.

The documentation clearly shows the new configuration‑driven approach where datasource URLs are managed in prisma.config.ts rather than hardcoded in schema.prisma. The integration of dotenv/config (lines 68–71) enables proper environment variable loading, and the use of env('DATABASE_URL') demonstrates the intended pattern. This aligns well with the PR objectives around datasource URL migration.


86-95: Schema and import paths are consistent with output configuration.

The schema.prisma generator specifies output = "../generated/prisma", and the PrismaClient import on line 168 (from "../generated/prisma/client") correctly reflects this structure. There's no mismatch between declared output and actual imports—developers following this guide will import from the correct location.

Also applies to: 168-168

content/100-getting-started/02-prisma-orm/100-quickstart/200-sqlite.mdx (5)

30-42: Solid addition of TypeScript types for better-sqlite3.

The new @types/better-sqlite3 package and its description are clear and accurate. Users now have proper TypeScript support from the start of the quickstart.


78-82: Correct use of prisma init flags.

The command appropriately uses --datasource-provider sqlite and --output ../generated/prisma to configure the initial setup. This aligns with the generated client import path at line 201.


104-123: Well-structured configuration progression.

The tutorial clearly demonstrates the initial generated config and then shows the necessary additions: dotenv/config import for environment variables and the migrations path configuration. This helps users understand what's auto-generated versus what they need to customize.


198-209: Consistent import paths and proper setup.

The PrismaClient import correctly references ../generated/prisma/client, which aligns with the --output ../generated/prisma flag specified in the init command. The dotenv import ensures environment variables are loaded before accessing the database URL.


1-273: Excellent documentation structure and consistency.

The entire guide maintains sentence case for headings (e.g., "Install required dependencies", "Define your data model"), preserves product name casing correctly, and presents a clear progression from project setup through querying. All code examples are syntactically sound and the configuration steps align logically.

content/100-getting-started/02-prisma-orm/100-quickstart/500-sql-server.mdx (1)

36-36: @types/mssql addition is comprehensive and well-documented.

Both the npm install command (line 36) and the package description (line 45) are updated together, keeping the documentation consistent. This mirrors the pattern used for other database-specific type definitions across the quickstart docs.

Also applies to: 45-45

content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx (3)

29-29: Good: @types/pg addition aligns with type-safety improvements.

Adding @types/pg to devDependencies ensures TypeScript definitions are available for the node-postgres driver, supporting the type-safe patterns shown in the PrismaPg instantiation code. The description is clear and helpful.

Also applies to: 38-38


79-79: Strong: Clear documentation of init command behavior and generated files.

The --db and --output flags are valid CLI options, and the documentation correctly describes the three generated files (schema, config, env) plus the generated Prisma Client. This aligns with the new prisma.config.ts-based configuration approach. Based on learnings.

Also applies to: 88-94


200-200: Excellent: Import path matches specified output directory.

The import path ../generated/prisma/client correctly corresponds to the output directory specified in the init command, maintaining consistency throughout the guide.

Also applies to: 204-205

content/100-getting-started/02-prisma-orm/200-add-to-existing-project/100-prisma-postgres.mdx (1)

24-24: Consistent: @types/pg addition maintains pattern across guides.

Aligns perfectly with the parallel change in the quickstart version, ensuring consistent TypeScript support across both new-project and add-to-existing-project paths.

content/250-postgres/350-integrations/100-netlify.mdx (1)

123-123: Good: Updated documentation reflects new prisma.config.ts generation.

The text now accurately describes that npx prisma init generates three files (schema, config, and env), which correctly reflects the expanded scope of the init command in this version.

content/100-getting-started/03-prisma-postgres/100-quickstart/200-drizzle-orm.mdx (2)

46-101: Strong: create-db workflow appropriate for managed Prisma Postgres.

The CLI tool introduction and environment setup are well-documented. The security warning about not committing .env files is crucial and appropriately placed. This pattern is consistent with other Prisma Postgres guides.


112-118: Good: Package breakdown includes @types/pg documentation.

The distinction between runtime and development dependencies is clear, and the @types/pg description correctly identifies it as TypeScript definitions for the driver.

content/100-getting-started/03-prisma-postgres/100-quickstart/300-typeorm.mdx (2)

118-139: Excellent: Connection string parsing is robust and SSL properly configured.

The parseConnectionString function correctly uses the URL API to extract connection parameters and removes the leading slash from the database path. The ssl: true configuration is appropriate for managed Prisma Postgres connections. The spread operator usage is clean and readable.

Also applies to: 151-152


172-177: Good: Expected output accurately represents TypeORM behavior.

The shown output correctly demonstrates user creation and retrieval, providing clear verification that the setup worked.

content/100-getting-started/03-prisma-postgres/100-quickstart/100-kysely.mdx (4)

35-55: Strong: TypeScript strict mode requirement clearly emphasized.

The configuration section correctly highlights that strict mode is required for Kysely's type safety, which is a critical setup requirement. The version recommendations for improved type inference are helpful.


71-128: Consistent: create-db workflow pattern applied uniformly across Prisma Postgres guides.

The environment setup follows the established pattern with appropriate security warnings about not committing .env files.


146-203: Excellent: Database types and connection setup follow best practices.

The typed Database interface and parseConnectionString function correctly establish type-safe configuration. The SSL configuration is appropriate, and the inline comments (though verbose) help readers understand the configuration layers.


209-265: Good: Query example demonstrates complete lifecycle.

The create-table, insert, and select operations provide a thorough walkthrough of Kysely usage. The error handling and connection cleanup are properly implemented.

content/100-getting-started/02-prisma-orm/100-quickstart/700-cockroachdb.mdx (1)

34-34: Good: @types/pg addition is appropriate and well-documented for CockroachDB.

The addition correctly recognizes that CockroachDB's PostgreSQL compatibility means it uses the same node-postgres adapter and type definitions, maintaining consistency with other PostgreSQL-based guides.

Also applies to: 42-43

content/100-getting-started/02-prisma-orm/200-add-to-existing-project/300-postgresql.mdx (1)

24-24: Consistent: @types/pg addition maintains alignment with other PostgreSQL guides.

Completes the uniform pattern of adding TypeScript definitions across all PostgreSQL-based quickstart and add-to-existing-project guides.

content/200-orm/050-overview/500-databases/840-cockroachdb.mdx (1)

105-121: Prisma ORM 7 configuration migration is well-documented.

The section correctly explains the shift to prisma.config.ts for database URL configuration. The example is accurate and includes the necessary dotenv/config import for environment variable loading.

content/100-getting-started/02-prisma-orm/200-add-to-existing-project/700-cockroachdb.mdx (1)

24-24: Correct addition of TypeScript type definitions for node-postgres.

Adding @types/pg is the right choice here since the guide uses the @prisma/adapter-pg driver adapter for CockroachDB, which is PostgreSQL-compatible.

content/100-getting-started/02-prisma-orm/100-quickstart/300-postgresql.mdx (1)

40-40: Appropriate inclusion of node-postgres TypeScript definitions.

The @types/pg package and its description are correctly added. This aligns with the driver adapter pattern used in the guide.

Also applies to: 49-49

content/200-orm/050-overview/500-databases/850-planetscale.mdx (1)

77-91: Prisma 7 configuration correctly migrated for PlanetScale.

The transition to prisma.config.ts is properly explained and positioned within the relation mode setup. The example correctly demonstrates environment-based URL configuration.

content/200-orm/050-overview/500-databases/400-mysql.mdx (2)

22-38: MySQL configuration correctly migrated to Prisma 7 pattern.

The shift to prisma.config.ts is properly implemented with appropriate examples and explanation.


61-70: Import paths and driver adapter setup correctly updated.

The addition of import 'dotenv/config' and the updated PrismaClient import path (../generated/prisma/client) align with the Prisma 7 generator output structure. The adapter instantiation is properly formatted.

content/200-orm/050-overview/500-databases/800-sql-server/index.mdx (2)

21-37: SQL Server configuration correctly migrated to Prisma ORM 7.

The prisma.config.ts example properly demonstrates environment-based URL configuration consistent with the broader PR changes.


61-63: Driver adapter section correctly updated with new import paths.

The dotenv/config import and updated PrismaClient import path reflect the Prisma 7 output structure changes.

content/600-about/30-docs-components/01-mdx-examples.mdx (2)

344-362: Prisma init output example correctly reflects Prisma 7 changes.

The updated output demonstrates the new workflow guidance with separate "CONNECT EXISTING DATABASE" and "CREATE NEW DATABASE" sections, which properly aligns with the Prisma 7 init command changes mentioned in the PR objectives.


437-456: Consistent update in custom output example.

The second CodeWithResult example is similarly updated to match the first, maintaining documentation consistency.

content/200-orm/050-overview/500-databases/300-postgresql.mdx (2)

31-47: PostgreSQL configuration successfully migrated to Prisma ORM 7.

The explanation and prisma.config.ts example clearly demonstrate the new approach to URL configuration, consistent across all database guides in this PR.


70-77: Node-postgres driver section correctly updated for Prisma 7.

The import path changes and dotenv/config addition properly reflect the Prisma 7 generator output structure and environment variable handling pattern.

content/200-orm/050-overview/500-databases/500-sqlite.mdx (3)

22-24: Verify that the narrative aligns with schema structure for clarity.

Line 22 should clarify that in Prisma ORM 7, the datasource block in the schema now only specifies the provider, while the actual URL is configured in prisma.config.ts. The current text could be misleading since it doesn't explicitly state this separation. Consider revising to: "The datasource block specifies the sqlite data source connector (provider), while the database URL is configured in prisma.config.ts."


26-35: Configuration structure looks good for Prisma ORM 7.

The prisma.config.ts example correctly uses defineConfig and env() to configure the SQLite connection URL. This aligns with Prisma 7 patterns and the web-based Prisma Config reference documentation.


60-61: Import paths are consistently updated to Prisma 7 conventions.

Both adapter examples correctly import PrismaClient from '../generated/prisma/client', which is the updated path for Prisma ORM 7. This is consistent across the file and aligns with the generator output path configuration.

Also applies to: 78-79

content/200-orm/500-reference/200-prisma-cli-reference.mdx (8)

138-139: Default output path correctly documented.

The default value for --output is now correctly shown as ../generated/prisma, which aligns with Prisma 7's recommended output structure for generated client code.


158-182: Init command output accurately reflects Prisma 7 structure.

The example output correctly shows the creation of prisma.config.ts file, replacing the old inline datasource configuration approach. The instructions guide users to "Configure your DATABASE_URL in prisma.config.ts", which is the Prisma 7 pattern.


197-265: prisma init --db example demonstrates modern Postgres setup well.

The updated output shows the Prisma Postgres initialization flow with proper adapter setup patterns. Line 237 correctly imports from "./generated/prisma/client" and lines 240-243 show the modern adapter instantiation pattern with connectionString from environment.


296-302: Generator provider consistently updated to "prisma-client" across all examples.

All code examples now use provider = "prisma-client" instead of the previous "prisma-client-js", and the output paths are updated to ../generated/prisma. This is consistent across the entire document and aligns with Prisma 7 conventions.

Also applies to: 343-351, 421-425


353-371: Excellent addition of prisma.config.ts documentation section.

The new section clearly explains the purpose and structure of prisma.config.ts, with a complete example showing how to use defineConfig, env(), and the schema/migrations configuration. The reference link to the prisma-config-reference is helpful for users needing more details.


427-443: prisma.config.ts example for --url option is well-structured.

The example correctly shows how prisma init --url mysql://... generates both the schema and the prisma.config.ts file with the custom URL handled via environment variables and the env() function.


944-971: Multiple sections correctly document prisma.config.ts as prerequisite for CLI commands.

The db pull, db push, db execute, migrate diff, and studio commands all include updated prerequisites sections showing the proper prisma.config.ts configuration. This consistency across commands is excellent and helps users understand the Prisma 7 pattern.

Also applies to: 1107-1134, 1219-1248, 1587-1614, 1712-1739


464-478: Generator documentation updated appropriately for the new provider naming.

Line 464 states "The generate command is most often used to generate Prisma Client with the prisma-client generator", which correctly refers to the new provider name. Line 472 in the Prerequisites section also correctly shows the new provider name.

content/200-orm/050-overview/500-databases/200-database-drivers.mdx (4)

15-30: Excellent explanation of Prisma ORM 7's query compiler default.

This note correctly explains that as of v6.16.0, Prisma ORM usage without Rust engine binaries is Generally Available, and the default generator configuration shown is accurate for Prisma 7. The callout that "driver adapters are required when using the query compiler" is crucial context that helps users understand the architecture.


122-122: Import paths correctly align with Prisma 7 output structure.

Both examples import from '../generated/prisma/client', which matches the new default output path configuration. This is consistent and correct.

Also applies to: 140-140


132-147: New section provides critical clarification for driver adapter users.

The section "Driver adapters and database connection configuration" now clearly explains that while prisma.config.ts handles the CLI datasource URL, driver adapters require the connection string to be provided in application code. The example with import 'dotenv/config' and process.env.DATABASE_URL is accurate and demonstrates the proper pattern.


151-170: Clear guidance on custom output paths with practical examples.

The section explains that the default output path is ../generated/prisma and provides both direct import examples and a linked dependency approach using npm/pnpm/yarn. This gives users flexibility in how they want to reference the generated client.

static/_redirects (1)

824-824: LGTM!

The redirect rule is correctly formatted and placed in the dynamic redirects section. The wildcard pattern appropriately captures any URL variations, and the target path follows the convention used throughout this file.

content/250-postgres/50-getting-started/200-import-from-existing-database.mdx (1)

11-11: The redirect target is correct—no inconsistency here.

The concern in the original review comment conflates two unrelated redirects. The React Redirect at line 11 uses /getting-started/prisma-postgres/import-from-existing-database-postgresql, which:

  • Matches the consistent pattern across all other React Redirect components in the codebase (all omit /docs)
  • Aligns with the target in static/_redirects line 697 (which redirects to this exact path)

The /docs/ prefix discrepancy you noted is in line 824 of static/_redirects, but that rule redirects from a different source path (/postgres/introduction/import-from-existing-database*), making it a separate redirect chain—not a contradiction with this React Redirect.

The code is sound as written.

Likely an incorrect or invalid review comment.

content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (5)

186-221: prisma.config.ts setup is correct and follows current best practices.

The introduction of prisma.config.ts with proper dotenv/config import and environment variable handling via the env() helper is solid. When using prisma.config.ts, environment variables from .env files are not automatically loaded, and your guide correctly addresses this by importing dotenv/config at line 208.

Verify that this represents a breaking change from prior documentation and that migration guidance is in place for existing users moving from the traditional schema-embedded datasource pattern to the config-file pattern.


573-573: Prisma Studio command correctly uses new prisma.config.ts pattern.

The explicit --config ./prisma.config.ts flag is appropriate and consistent with how Prisma CLI discovers the config file. Since other commands in the guide (like npx prisma migrate dev and npx prisma generate) omit this flag and rely on default discovery, the behavior is consistent.


2-2: Heading case follows sentence case convention correctly.

"From the CLI" is appropriately formatted in sentence case. No concerns.

Also applies to: 3-3


11-15: Documentation structure and step numbering is clear, though intro overview differs from main section numbering.

The introductory overview (lines 11-15) mentions three high-level outcomes, but the detailed sections begin with "1. Organize your project directory" (line 98). This is structurally sound—the intro is a conceptual overview while the main content has its own step progression—so no changes are necessary, but consider this structure when cross-referencing or in table of contents generation.

Also applies to: 98-124


71-71: Resolve migration command inconsistency across tutorial steps

Your guide teaches two different migration command patterns that serve the same purpose:

  • Line 71 (npx prisma migrate dev): During initial setup, uses automatic naming
  • Line 265 (npx prisma migrate dev --name init): After adding models, uses explicit --name init

Both are functionally valid—Prisma will create a migration either way. However, inconsistent instruction undermines the learning flow. Users won't know which pattern to adopt in their own work.

Choose one approach and apply it consistently:

  1. Prefer explicit naming (--name init at both locations): Reinforces best practice of intentional, discoverable migration names. Better for users building production systems.
  2. Prefer automatic naming (remove --name init from line 265): Simpler mental model for beginners, fewer flags to remember. Works well if your guide emphasizes "let Prisma handle the details."

The explicit naming approach aligns with how migration teams typically manage schema evolution, so that's worth considering when making your choice.

⛔ Skipped due to learnings
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: Only flag code snippets for (1) exposed secrets with real-looking values that should be placeholders (e.g., API keys, database passwords, AWS credentials), or (2) blatant syntax errors like missing parentheses, brackets, braces, or mismatched delimiters. Do not flag code quality issues, anti-patterns, security vulnerabilities, missing error handling, unused variables, or any other bad practices, as documentation intentionally shows problematic code.
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: All headings and titles should use sentence case (e.g., "Getting started with Prisma ORM", "Best practices for authentication"), not title case. Exception: Always preserve exact casing for product names including "Prisma Postgres", "Prisma", "Prisma ORM", and "Prisma Data Platform".
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.
content/100-getting-started/03-prisma-postgres/100-quickstart/50-prisma-orm.mdx (4)

174-174: Clarify the redundancy of dotenv/config imports in both files.

Line 92 imports dotenv/config in prisma.config.ts, and line 174 also imports it in lib/prisma.ts. Since prisma.config.ts is loaded by Prisma CLI (and dotenv is already initialized there), the import in lib/prisma.ts may be redundant. However, if lib/prisma.ts is used in a Node.js context outside of Prisma CLI, it might be necessary.

Clarify whether:

  • Both imports are needed, or if one can be removed
  • The dotenv load order matters for Prisma operations
  • There's a reason for defensive dotenv loading in both locations

This is a minor point but worth documenting if intentional, as it could confuse developers about when/where env vars are loaded.


88-105: Code is correct — no changes needed.

The env() function from "prisma/config" is the recommended way to reference DATABASE_URL in prisma.config.ts, and the import 'dotenv/config' at the top is necessary to load environment variables from your .env file. The code snippet follows Prisma's documented best practices exactly.


71-78: ---

The --output ../generated/prisma approach has known issues—verify this pattern works as intended.

While npx prisma init --output does support relative paths, multiple GitHub reports document cases where custom/relative output paths can produce surprising filesystem locations, with the client generated one directory higher than expected in some cases. Generating clients with certain relative outputs has also caused runtime issues such as SQLite relative-path errors and altered internal relativePath values.

Before publishing this pattern in documentation, either:

  • Test this specific layout end-to-end to confirm it generates at ../generated/prisma/client reliably
  • Switch to an absolute or project-root-relative path (the recommended approach per Prisma guidance)
  • Add explicit testing guidance and warnings for users following this pattern

The relative path structure works in theory, but the documented caveats suggest users should validate it matches their actual filesystem structure.


71-71: The original review was based on a misunderstanding—no changes needed.

Here's why the paths are correct:

When you run npx prisma init --db --output ../generated/prisma from the project root, the --output flag doesn't immediately create a file at that path. Instead, it writes that value into the schema.prisma generator configuration. Later, when Prisma generates the client, it resolves that path relative to the schema file's location (prisma/schema.prisma), not the current working directory.

So ../generated/prisma from prisma/ correctly resolves to generated/prisma/ at the project root—not outside the project as the original review suggested. The import from lib/prisma.ts using ../generated/prisma/client also resolves correctly: up one level from lib/ to the project root, then into the generated directory.

The documentation accurately describes this behavior and matches Prisma's official pattern for custom output paths.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2238
✅ Successful 2209
⏳ Timeouts 0
🔀 Redirected 6
👻 Excluded 22
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 1

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2237
✅ Successful 2208
⏳ Timeouts 0
🔀 Redirected 5
👻 Excluded 22
❓ Unknown 0
🚫 Errors 1
⛔ Unsupported 1

Errors per input

Errors in 800-guides/180-solid-start.mdx

@ankur-arch ankur-arch self-assigned this Nov 17, 2025
@ankur-arch ankur-arch merged commit 5c857d7 into prisma-7 Nov 17, 2025
5 of 6 checks passed
@ankur-arch ankur-arch deleted the DC-6236-init-command-change branch November 17, 2025 13:27
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.

2 participants