Skip to content

Conversation

@francemazzi
Copy link
Contributor

@francemazzi francemazzi commented Jan 14, 2026

Summary

Clarifies Prisma ORM initialization in the Prisma Postgres quickstart by separating local vs managed setup.

Context

npx prisma init --db ... provisions a managed Prisma Postgres database (online login + database creation), while local/self-managed Postgres setups should use npx prisma init.

Changes

  • Updated section title to reflect local vs managed setup
  • Added npx prisma init for local/self-managed Postgres
  • Kept npx prisma init --db --output ../generated/prisma for managed Prisma Postgres provisioning

Related

Fixes #7435

Summary by CodeRabbit

  • Documentation
    • Clarified Postgres setup instructions in the getting started guide by distinguishing between two initialization options: local Postgres management and managed Prisma Postgres database provisioning. Updated instructions now explicitly outline both setup paths with separate code examples.

✏️ Tip: You can customize this high-level summary in your review settings.

Added instructions for initializing Prisma with managed Postgres database.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Walkthrough

This documentation change restructures the Prisma PostgreSQL quickstart initialization instructions to clearly distinguish between two setup paths: local self-managed Postgres configuration using npx prisma init, and managed Prisma Postgres provisioning using npx prisma init --db --output ../generated/prisma.

Changes

Cohort / File(s) Summary
Documentation clarification
content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
Replaced single initialization instruction with dual-option setup flow. Added explicit "Initialize Prisma locally" section showing basic npx prisma init command, followed by separate "managed Prisma Postgres provisioning" section with the --db flag variant. Clarifies which path users should take based on their database management preference.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 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 accurately summarizes the main change: clarifying local vs managed Prisma init commands in the Postgres quickstart documentation.
Linked Issues check ✅ Passed The PR successfully addresses all objectives from issue #7435: separating local and managed setup instructions, clarifying which command applies to each scenario, and avoiding confusion between workflows.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the Prisma Postgres quickstart documentation and focused on clarifying initialization commands; no out-of-scope modifications detected.
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.



📜 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 38c1be1 and 84681b4.

📒 Files selected for processing (1)
  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-06T22:06:57.725Z
Learnt from: newclarityex
Repo: prisma/docs PR: 7425
File: content/200-orm/050-overview/500-databases/400-mysql.mdx:80-80
Timestamp: 2026-01-06T22:06:57.725Z
Learning: In Prisma docs, when showing examples of instantiating driver adapters with connection strings from environment variables, use the template literal pattern `const connectionString = `${process.env.DATABASE_URL}`` for consistency across all database adapter examples (PostgreSQL, MySQL/MariaDB, etc.).

Applied to files:

  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
🔇 Additional comments (1)
content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx (1)

77-81: Good intent—clarifying the two paths is valuable.

The PR objective to distinguish local vs. managed setups addresses a real source of confusion (Issue #7435). The direction is right; the execution just needs some polish around sequencing and ensuring downstream steps remain valid for both paths.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

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

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: 0

Caution

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

⚠️ Outside diff range comments (3)
content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx (3)

69-87: Section title and content flow need alignment.

There's a mismatch here that could confuse readers:

  1. The section title says "Initialize Prisma ORM and create a Prisma Postgres database" but only the --db variant actually creates a managed database. Consider updating the title to something like "Initialize Prisma ORM" or splitting into two distinct subsections.

  2. This is the Prisma Postgres quickstart, so leading with the local/self-managed path feels counterintuitive. Users landing here likely want the managed Prisma Postgres experience. Consider swapping the order—show the --db command first as the recommended path for this guide, then mention the local alternative.

  3. The phrasing "you manage Postgres yourself" on line 77 is slightly ambiguous—it could mean an existing local Postgres instance or a cloud-hosted one you provision manually. A small clarification like "(e.g., a local or existing PostgreSQL instance)" would help.

📝 Suggested restructure
 ## 4. Initialize Prisma ORM and create a Prisma Postgres database
 
 You can now invoke the Prisma CLI by prefixing it with `npx`:
 
 ```terminal
 npx prisma

-Initialize Prisma locally (you manage Postgres yourself):
+To provision a managed Prisma Postgres database (handles login + database creation for you), run:

-npx prisma init
+npx prisma init --db --output ../generated/prisma

-If you want Prisma to provision a managed Prisma Postgres database (online login + database creation), use:
+Alternatively, if you already have your own PostgreSQL instance (local or cloud-hosted), initialize without the --db flag:

-npx prisma init --db --output ../generated/prisma
+npx prisma init

</details>

---

`89-100`: **Info block and bullet list apply only to the `--db` path.**

The info block about "answering a few questions" and the bullet point "Creates a new Prisma Postgres database (when using `--db` flag)" only apply to the managed setup. However, positioned after both commands, readers following the local path might be confused when no prompts appear.

Consider either:
- Moving the info block directly under the `--db` command block, or
- Adding a note clarifying that users who ran `npx prisma init` (without `--db`) can skip to the next step since no interactive prompts or database provisioning occurs.

---

`102-130`: **Generated config examples assume the `--db --output` path.**

The `prisma.config.ts` and `schema.prisma` examples show `output = "../generated/prisma"`, which is only generated when using `--db --output ../generated/prisma`. Users who run plain `npx prisma init` will see different defaults (no custom output path, and the Prisma Client would be generated to `node_modules/.prisma/client` by default in the classic generator, or would need manual configuration for the new `prisma-client` generator).

For users on the local path, the subsequent steps (like `import { PrismaClient } from '../generated/prisma/client'` on line 188) won't work out of the box.

You should either:
1. Note that users on the local path need to manually add the `output` directive, or
2. Explicitly state this guide's remaining steps assume the managed `--db` path was used.

</blockquote></details>

</blockquote></details>
📜 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 38c1be1 and 84681b4.

📒 Files selected for processing (1)
  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-06T22:06:57.725Z
Learnt from: newclarityex
Repo: prisma/docs PR: 7425
File: content/200-orm/050-overview/500-databases/400-mysql.mdx:80-80
Timestamp: 2026-01-06T22:06:57.725Z
Learning: In Prisma docs, when showing examples of instantiating driver adapters with connection strings from environment variables, use the template literal pattern `const connectionString = `${process.env.DATABASE_URL}`` for consistency across all database adapter examples (PostgreSQL, MySQL/MariaDB, etc.).

Applied to files:

  • content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx
🔇 Additional comments (1)
content/100-getting-started/02-prisma-orm/100-quickstart/100-prisma-postgres.mdx (1)

77-81: Good intent—clarifying the two paths is valuable.

The PR objective to distinguish local vs. managed setups addresses a real source of confusion (Issue #7435). The direction is right; the execution just needs some polish around sequencing and ensuring downstream steps remain valid for both paths.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

[docs] Clarify local vs managed Prisma init commands

1 participant