Skip to content

docs: replace prisma init --db with prisma init in normal docs#7696

Merged
AmanVarshney01 merged 2 commits intomainfrom
dr-7844-replace-prisma-init-db-with-prisma-init
Mar 24, 2026
Merged

docs: replace prisma init --db with prisma init in normal docs#7696
AmanVarshney01 merged 2 commits intomainfrom
dr-7844-replace-prisma-init-db-with-prisma-init

Conversation

@AmanVarshney01
Copy link
Copy Markdown
Member

@AmanVarshney01 AmanVarshney01 commented Mar 24, 2026

Summary

  • replace prisma init --db with prisma init across the current docs quickstarts, guides, and AI prompt docs
  • add npx create-db where Prisma Postgres provisioning is still needed
  • fix package-manager examples discovered during verification by switching fresh-project pnpm/yarn examples to pnpm dlx prisma init and yarn dlx prisma init

Scope

  • updates apps/docs/content/docs only
  • leaves apps/docs/content/docs.v6 unchanged

Verification

  • ran the documented prisma init variants in fresh temp folders for npx, bunx --bun, pnpm dlx, yarn dlx, and deno run -A npm:prisma init and confirmed they create prisma/schema.prisma, prisma.config.ts, and .env
  • ran npx create-db and confirmed it returns a postgres://... connection string
  • previously validated one end-to-end flow with prisma init --output ../generated/prisma -> npx create-db -> migrate -> generate -> test query

Notes

  • prisma init --db remains only in the explicit flag/reference docs and troubleshooting pages that document that flag directly

Summary by CodeRabbit

  • Documentation
    • Updated Prisma initialization workflow across all framework and integration guides
    • Changed command from npx prisma init --db to npx prisma init
    • Introduced separate npx create-db command for Prisma Postgres database provisioning
    • Clarified setup flow: prisma init generates local scaffolding, create-db provisions the actual database
    • Updated DATABASE_URL configuration instructions across all guides

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 24, 2026 0:54am
docs Ready Ready Preview, Comment Mar 24, 2026 0:54am
eclipse Ready Ready Preview, Comment Mar 24, 2026 0:54am
site Ready Ready Preview, Comment Mar 24, 2026 0:54am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

Walkthrough

Documentation updates across 40+ MDX files that replace the npx prisma init --db command with a two-step initialization process: npx prisma init followed by a separate npx create-db step. All changes are pattern-consistent modifications to Prisma setup instructions, removing database creation from the init phase and deferring it to a dedicated database provisioning command.

Changes

Cohort / File(s) Summary
Core Documentation
apps/docs/content/docs/(index)/index.mdx, apps/docs/content/docs/(index)/prisma-orm/quickstart/prisma-postgres.mdx, apps/docs/content/docs/(index)/prisma-postgres/*
Removed --db flag from npx prisma init and introduced separate npx create-db step. Updated descriptions to clarify that prisma init generates local DATABASE_URL scaffolding only, with explicit instructions to replace it using the connection string from create-db.
AI Prompts & Tutorials
apps/docs/content/docs/ai/prompts/*.mdx, apps/docs/content/docs/ai/tutorials/typefully-clone.mdx
Updated initialization instructions to remove --db and redirect to npx create-db. Replaced guidance about interactive prompts and Prisma Data Platform login with non-interactive workflow. Added explicit DATABASE_URL replacement instructions.
Authentication Guides
apps/docs/content/docs/guides/authentication/*/...mdx
Removed --db flag from Prisma initialization across all auth integrations (AuthJS, Better Auth, Clerk). Consistently added new steps for npx create-db and .env DATABASE_URL replacement with postgres://... connection string.
Deployment & Workspace Guides
apps/docs/content/docs/guides/deployment/*.mdx, apps/docs/content/docs/guides/making-guides.mdx
Updated workspace setup instructions (Bun, pnpm, Turborepo, Cloudflare Workers) to remove --db and add npx create-db. Removed guidance about CLI authentication and region selection, clarifying that prisma init produces only local scaffolding.
Framework Guides
apps/docs/content/docs/guides/frameworks/*.mdx
Standardized Prisma initialization across all framework guides (Astro, Next.js, Nuxt, SvelteKit, Solid Start, React Router, Elysia, Hono, NestJS) by removing --db flag and adding npx create-db step with DATABASE_URL replacement. Adjusted explanations to reflect local vs. cloud database provisioning separation.
Integration Guides
apps/docs/content/docs/guides/integrations/*.mdx, apps/docs/content/docs/guides/database/multiple-databases.mdx
Removed --db and added npx create-db initialization step across integrations (AI SDK, Datadog, Embed Studio, GitHub Actions, Shopify). Updated .env handling to emphasize local DATABASE_URL replacement with CLI-provided connection strings.
Runtime Guides
apps/docs/content/docs/guides/runtimes/*.mdx
Updated Bun and Deno runtime initialization to remove --db flag. Replaced interactive dashboard workflows with direct npx create-db instructions. Clarified local vs. cloud database separation in runtime-specific contexts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The PR exhibits highly homogeneous changes applied consistently across 40+ files. While the scope is large, the pattern is identical throughout: replace npx prisma init --db with npx prisma init, add npx create-db, and update explanatory text describing the local DATABASE_URL scaffold. Documentation-only modifications with no logic changes or exported entities affected. Verification requires confirming pattern consistency and accuracy of the new two-step workflow description across all contexts, but the repetitive nature minimizes per-file cognitive overhead.

🚥 Pre-merge checks | ✅ 3
✅ 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 clearly and accurately describes the main change: replacing prisma init --db with prisma init across normal documentation files.
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.


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

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Mar 24, 2026, 1:02 PM

Copy link
Copy Markdown
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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
apps/docs/content/docs/guides/making-guides.mdx (1)

317-332: ⚠️ Potential issue | 🟡 Minor

Fix the template’s “This will create” list to match the new flow.

After switching to prisma init + npx create-db, the template still implies prisma init creates the Prisma Postgres database (Line 324). That conflicts with the updated step sequence and can mislead guide authors.

✏️ Suggested wording fix
 This will create:

 - A `prisma` directory with a `schema.prisma` file
-- A Prisma Postgres database
-- A `.env` file containing the `DATABASE_URL`
+- A `.env` file containing a local `DATABASE_URL`
 - A `prisma.config.ts` file for configuration
+
+After you run `npx create-db`, you'll also have a Prisma Postgres database and a `postgres://...` connection string to paste into `.env`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/making-guides.mdx` around lines 317 - 332,
Update the "This will create" bulleted list so it matches the new two-step flow:
indicate that `prisma init` creates the `prisma` directory with `schema.prisma`
and a `.env` containing a local `DATABASE_URL` (and any scaffolding), and that
running `npx create-db` creates the Prisma Postgres database (and produces the
`postgres://...` connection string you should paste into `.env`); remove or
reassign the current claim that `prisma init` creates the Prisma Postgres
database and ensure `prisma.config.ts` is attributed to the correct command that
now generates it.
apps/docs/content/docs/guides/runtimes/bun.mdx (1)

197-198: ⚠️ Potential issue | 🟡 Minor

Section numbering mismatch

Line 197 shows ### 3.3. Add the seed script to Prisma Config but this appears within Section 4 ("Setting up database configuration and creating a seed script"). The heading should be ### 4.3. to maintain consistent numbering.

📝 Suggested fix
-### 3.3. Add the seed script to Prisma Config
+### 4.3. Add the seed script to Prisma Config
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/runtimes/bun.mdx` around lines 197 - 198, The
heading "### 3.3. Add the seed script to Prisma Config" is misnumbered inside
the "Setting up database configuration and creating a seed script" section;
update that heading to "### 4.3. Add the seed script to Prisma Config" so the
section numbering is consistent—locate the exact heading text "Add the seed
script to Prisma Config" in apps/docs/content/docs/guides/runtimes/bun.mdx and
change the leading "3.3." to "4.3.".
apps/docs/content/docs/ai/prompts/nextjs.mdx (1)

544-544: ⚠️ Potential issue | 🟡 Minor

Same inconsistency as nuxt.mdx: this "consequence" contradicts the new workflow.

This line treats npx prisma init without --db as an error case, but that's now the recommended approach. The consequence "NO DATABASE CREATED, ONLY LOCAL FILES" is the expected outcome—users are supposed to run create-db separately.

This line should be removed or rephrased to reflect the new two-step workflow.

,

Suggested fix
-- Using `npx prisma init` without `--db` → **NO DATABASE CREATED, ONLY LOCAL FILES**
+- Forgetting to run `npx create-db` after `npx prisma init` → **NO DATABASE CREATED, ONLY LOCAL FILES**
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/ai/prompts/nextjs.mdx` at line 544, The line "Using
`npx prisma init` without `--db` → **NO DATABASE CREATED, ONLY LOCAL FILES**" is
outdated and contradicts the new two-step workflow; remove or rephrase it so it
no longer treats the absence of a created database as an error—either delete the
line or change it to a neutral/positive note such as "Running `npx prisma init`
without `--db` only initializes local config and schema; create the database
separately with the `create-db` step" so the docs reflect the recommended flow.
apps/docs/content/docs/ai/prompts/nuxt.mdx (1)

562-562: ⚠️ Potential issue | 🟡 Minor

Inconsistency: This "consequence" now contradicts the recommended workflow.

This line flags npx prisma init without --db as an error, but the PR changes the recommended workflow to exactly that pattern (init without --db, then separate create-db). This statement is now misleading because "NO DATABASE CREATED, ONLY LOCAL FILES" is the intended behavior in the new two-step workflow.

Consider removing this line or rephrasing it to clarify that users must run npx create-db as a follow-up step.

,

Suggested fix
-- Using `npx prisma init` without `--db` → **NO DATABASE CREATED, ONLY LOCAL FILES**
+- Forgetting to run `npx create-db` after `npx prisma init` → **NO DATABASE CREATED, ONLY LOCAL FILES**
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/ai/prompts/nuxt.mdx` at line 562, The current sentence
"Using `npx prisma init` without `--db` → **NO DATABASE CREATED, ONLY LOCAL
FILES**" conflicts with the new two-step workflow; update the copy around that
statement (search for the exact phrase) to either remove it or rephrase to
clarify that this is expected behavior when following the new pattern and that
users must run `npx create-db` as a follow-up to actually create the database.
Ensure the revised line explicitly names the follow-up command (`npx create-db`)
and states that `npx prisma init` only scaffolds local files in the new
workflow.
🧹 Nitpick comments (2)
apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx (1)

125-129: Consider using pnpm dlx for consistency

The guide uses pnpm dlx prisma init at line 110 but switches to npx create-db here. For consistency within a pnpm-focused guide, consider:

-```bash
-npx create-db
-```
+```bash
+pnpm dlx create-db
+```

This keeps the tooling consistent throughout the pnpm workspaces guide.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx` around lines
125 - 129, Replace the inconsistent npm command in the code block that currently
shows `npx create-db` with the pnpm equivalent `pnpm dlx create-db` so the guide
consistently uses pnpm tooling (matching the earlier `pnpm dlx prisma init`
usage); update the fenced bash block content for the snippet that contains `npx
create-db` to use `pnpm dlx create-db`.
apps/docs/content/docs/guides/deployment/bun-workspaces.mdx (1)

86-96: Minor style improvement and command consistency

Two small observations:

  1. Repetitive sentence structure (flagged by static analysis): Lines 87-89 all start with "Creates". Consider varying the phrasing:

    - Creates a `prisma` directory containing a `schema.prisma` file for your database models.
    - Generates a `prisma.config.ts` file for configuring Prisma.
    - Adds a `.env` file with a local `DATABASE_URL`.
  2. Command consistency: The guide uses bunx --bun prisma init but then npx create-db. For a Bun-focused guide, consider bunx --bun create-db for consistency.

Neither affects functionality—just polish for a more cohesive reading experience.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/deployment/bun-workspaces.mdx` around lines 86
- 96, The checklist sentences are repetitive and the CLI command is inconsistent
with the Bun-focused guide; update the three bullet lines so they vary wording
(e.g., "Creates a `prisma` directory..." → keep one "Creates", change the others
to "Generates a `prisma.config.ts`" and "Adds a `.env` file...") and replace the
`npx create-db` invocation with the Bun equivalent `bunx --bun create-db` so the
command style matches the earlier `bunx --bun prisma init` usage; edit the
bullets and the command in the section containing the `prisma` directory/schema,
`prisma.config.ts`, and `.env` mention to apply these changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/content/docs/`(index)/prisma-postgres/from-the-cli.mdx:
- Around line 25-31: The relocation steps currently move .env and the prisma/
folder but omit prisma.config.ts; update the "organize project directory"
instructions to also move prisma.config.ts into the new project directory (same
place as .env and prisma/). Specifically, when describing the mkdir and mv
commands that move .env and prisma, add a step to mv prisma.config.ts
./hello-prisma/ so the generated configuration file isn't left behind.

In `@apps/docs/content/docs/guides/database/multiple-databases.mdx`:
- Around line 165-170: Normalize the database initialization steps by replacing
the interactive/newer command in Section 2.1 (currently using `npx prisma@latest
init --db`) with the explicit two-step pattern used in Section 2.2: run `npx
prisma init` then `npx create-db`, instruct the user to replace the generated
DATABASE_URL in `.env` with the returned connection string and then rename the
generated `prisma` folder to `prisma-post-database`; update any adjacent
guidance (the note about `--db` and the prompt-based project naming) to instead
tell users to create the Prisma Postgres database with `npx create-db` and apply
its URL to the `.env`.

In `@apps/docs/content/docs/guides/runtimes/deno.mdx`:
- Around line 116-118: The command block uses `npx create-db` which requires
npm/Node.js; update the Deno guide around the `npx create-db` snippet by adding
a short inline note saying "This step requires npm/Node.js installed." and
optionally mention the Deno fallback `deno run -A npm:create-db@latest` as
unsupported/experimental so readers know it's not guaranteed to work; ensure the
note appears immediately after the `npx create-db` code block in the deno.mdx
content.

---

Outside diff comments:
In `@apps/docs/content/docs/ai/prompts/nextjs.mdx`:
- Line 544: The line "Using `npx prisma init` without `--db` → **NO DATABASE
CREATED, ONLY LOCAL FILES**" is outdated and contradicts the new two-step
workflow; remove or rephrase it so it no longer treats the absence of a created
database as an error—either delete the line or change it to a neutral/positive
note such as "Running `npx prisma init` without `--db` only initializes local
config and schema; create the database separately with the `create-db` step" so
the docs reflect the recommended flow.

In `@apps/docs/content/docs/ai/prompts/nuxt.mdx`:
- Line 562: The current sentence "Using `npx prisma init` without `--db` → **NO
DATABASE CREATED, ONLY LOCAL FILES**" conflicts with the new two-step workflow;
update the copy around that statement (search for the exact phrase) to either
remove it or rephrase to clarify that this is expected behavior when following
the new pattern and that users must run `npx create-db` as a follow-up to
actually create the database. Ensure the revised line explicitly names the
follow-up command (`npx create-db`) and states that `npx prisma init` only
scaffolds local files in the new workflow.

In `@apps/docs/content/docs/guides/making-guides.mdx`:
- Around line 317-332: Update the "This will create" bulleted list so it matches
the new two-step flow: indicate that `prisma init` creates the `prisma`
directory with `schema.prisma` and a `.env` containing a local `DATABASE_URL`
(and any scaffolding), and that running `npx create-db` creates the Prisma
Postgres database (and produces the `postgres://...` connection string you
should paste into `.env`); remove or reassign the current claim that `prisma
init` creates the Prisma Postgres database and ensure `prisma.config.ts` is
attributed to the correct command that now generates it.

In `@apps/docs/content/docs/guides/runtimes/bun.mdx`:
- Around line 197-198: The heading "### 3.3. Add the seed script to Prisma
Config" is misnumbered inside the "Setting up database configuration and
creating a seed script" section; update that heading to "### 4.3. Add the seed
script to Prisma Config" so the section numbering is consistent—locate the exact
heading text "Add the seed script to Prisma Config" in
apps/docs/content/docs/guides/runtimes/bun.mdx and change the leading "3.3." to
"4.3.".

---

Nitpick comments:
In `@apps/docs/content/docs/guides/deployment/bun-workspaces.mdx`:
- Around line 86-96: The checklist sentences are repetitive and the CLI command
is inconsistent with the Bun-focused guide; update the three bullet lines so
they vary wording (e.g., "Creates a `prisma` directory..." → keep one "Creates",
change the others to "Generates a `prisma.config.ts`" and "Adds a `.env`
file...") and replace the `npx create-db` invocation with the Bun equivalent
`bunx --bun create-db` so the command style matches the earlier `bunx --bun
prisma init` usage; edit the bullets and the command in the section containing
the `prisma` directory/schema, `prisma.config.ts`, and `.env` mention to apply
these changes.

In `@apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx`:
- Around line 125-129: Replace the inconsistent npm command in the code block
that currently shows `npx create-db` with the pnpm equivalent `pnpm dlx
create-db` so the guide consistently uses pnpm tooling (matching the earlier
`pnpm dlx prisma init` usage); update the fenced bash block content for the
snippet that contains `npx create-db` to use `pnpm dlx create-db`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59e87223-bf2e-4e9c-aab0-585f775ad54d

📥 Commits

Reviewing files that changed from the base of the PR and between 74746d2 and 51dc4ce.

📒 Files selected for processing (34)
  • apps/docs/content/docs/(index)/index.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/prisma-postgres.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/from-the-cli.mdx
  • apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-orm.mdx
  • apps/docs/content/docs/ai/prompts/astro.mdx
  • apps/docs/content/docs/ai/prompts/nextjs.mdx
  • apps/docs/content/docs/ai/prompts/nuxt.mdx
  • apps/docs/content/docs/ai/tutorials/typefully-clone.mdx
  • apps/docs/content/docs/guides/authentication/authjs/nextjs.mdx
  • apps/docs/content/docs/guides/authentication/better-auth/astro.mdx
  • apps/docs/content/docs/guides/authentication/better-auth/nextjs.mdx
  • apps/docs/content/docs/guides/authentication/clerk/astro.mdx
  • apps/docs/content/docs/guides/authentication/clerk/nextjs.mdx
  • apps/docs/content/docs/guides/database/multiple-databases.mdx
  • apps/docs/content/docs/guides/deployment/bun-workspaces.mdx
  • apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx
  • apps/docs/content/docs/guides/deployment/pnpm-workspaces.mdx
  • apps/docs/content/docs/guides/deployment/turborepo.mdx
  • apps/docs/content/docs/guides/frameworks/astro.mdx
  • apps/docs/content/docs/guides/frameworks/elysia.mdx
  • apps/docs/content/docs/guides/frameworks/hono.mdx
  • apps/docs/content/docs/guides/frameworks/nestjs.mdx
  • apps/docs/content/docs/guides/frameworks/nextjs.mdx
  • apps/docs/content/docs/guides/frameworks/react-router-7.mdx
  • apps/docs/content/docs/guides/frameworks/solid-start.mdx
  • apps/docs/content/docs/guides/frameworks/sveltekit.mdx
  • apps/docs/content/docs/guides/integrations/ai-sdk.mdx
  • apps/docs/content/docs/guides/integrations/datadog.mdx
  • apps/docs/content/docs/guides/integrations/embed-studio.mdx
  • apps/docs/content/docs/guides/integrations/github-actions.mdx
  • apps/docs/content/docs/guides/integrations/shopify.mdx
  • apps/docs/content/docs/guides/making-guides.mdx
  • apps/docs/content/docs/guides/runtimes/bun.mdx
  • apps/docs/content/docs/guides/runtimes/deno.mdx

@AmanVarshney01 AmanVarshney01 merged commit 1305845 into main Mar 24, 2026
18 of 19 checks passed
@AmanVarshney01 AmanVarshney01 deleted the dr-7844-replace-prisma-init-db-with-prisma-init branch March 24, 2026 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