Skip to content

feat(cli): orm init says where to get a Postgres database and how to deploy - #30831

Closed
gregory-boch-prisma wants to merge 1 commit into
mainfrom
feat/orm-init-database-and-deploy-steps
Closed

gregory-boch-prisma wants to merge 1 commit into
mainfrom
feat/orm-init-database-and-deploy-steps

Conversation

@gregory-boch-prisma

@gregory-boch-prisma gregory-boch-prisma commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by prisma/prisma-cli#363. Database and hosting guidance now lives in the platform skill synced by top-level prisma init.


Linked issue

Refs #30688

Summary

For a new Postgres project, prisma orm init now names npx create-db@latest as an option for getting a temporary database and explains how to deploy a Prisma Composer (Early Access) app with prisma deploy module.ts. The next steps, typed actions, environment templates, and quick reference include the database lifetime and the deployment prerequisites; MongoDB and Prisma 7 adoption output remain unchanged.

Prisma 7.10.0 init printed Cloud: npx create-db (source). The wording follows the current create-db documentation, deploy command reference, and Compute getting started guide.

Testing performed

On Node 24.19.0 and Corepack pnpm 10.27.0:

  • pnpm install --frozen-lockfile
  • pnpm build: 87 tasks passed.
  • pnpm typecheck: 172 tasks passed.
  • pnpm lint: 102 tasks passed.
  • pnpm --filter @internal/cli test: 173 files, 2,160 tests passed.
  • pnpm lint:skills and pnpm lint:ratchets passed.

The new regression tests fail on the original behavior and pass with this change. They cover Postgres guidance, install ordering, unchanged MongoDB and Prisma 7 steps/actions, package-manager-specific deployment commands, and preservation of the Prisma 7 environment files. Only the two Postgres quick-reference snapshots changed. The full diff passes the wording and ASCII checks.

The optional full pnpm test:packages suite was not run.

Skill update

skills/prisma-8/references/quickstart.md now offers npx create-db@latest when a new Postgres project needs DATABASE_URL, including deletion after 24 hours unless claimed and the account requirement for claiming it for free.

Checklist

  • All commits are signed off (git commit -s) per the DCO.
  • I read CONTRIBUTING.md and the change is scoped to one logical concern.
  • Tests are updated.
  • The PR title is in TML-NNNN: <sentence-case title> form. This contribution uses the conventional title format described in CONTRIBUTING.md and has no TML ticket.
  • The Skill update section above is filled in.

Notes for the reviewer

Keep this PR in draft until the direction is agreed in #30688. An ORM maintainer's approval is required before merge.

The framework vocabulary threshold changes from 237 to 242 for five new lines in the existing CLI init presentation and environment templates: two Postgres conditions and three user-facing database strings. This is limited to the requested Postgres onboarding guidance; no runtime or adapter behavior changes.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@30831

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@30831

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@30831

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@30831

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@30831

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@30831

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@30831

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@30831

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@30831

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@30831

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@30831

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@30831

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@30831

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@30831

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@30831

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@30831

commit: 24f2be6

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 261.8 KB (0%)
postgres / emit 229.37 KB (0%)
mongo / no-emit 212.12 KB (0%)
mongo / emit 182.14 KB (0%)
cf-worker / no-emit 324.66 KB (0%)
cf-worker / emit 288.47 KB (0%)

@wmadden-electric wmadden-electric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the careful write-up and the smoke test, Gregory. I think the guidance is useful, but it belongs in the unified prisma init in prisma-cli rather than in prisma orm init.

Why not orm init

  • prisma orm init scaffolds the ORM project. Onboarding to other Prisma products (getting a Prisma Postgres database, deploying to Prisma Compute) is the job of the family-level prisma init, which prisma-cli owns and which mounts the orm family.
  • We already moved one concern out for the same reason: #30097 took agent-skills setup out of orm init and gave it to prisma init. orm init now just points users at prisma init as its last step. Hosted-database and deploy hints are the same kind of thing.
  • The change has to branch on target === 'postgres' inside packages/1-framework, and it raises the framework vocabulary threshold from 237 to 242 to get past the lint. We don't branch on target in framework code, and needing to raise that threshold is a sign the code is in the wrong layer.
  • Prisma 7 printed npx create-db from its init because it had a single CLI. In Prisma 8 the unified CLI's prisma init is the equivalent place, so that is where parity should be restored.

Suggested direction

  • Put the create-db and prisma deploy guidance in prisma-cli's prisma init, which knows which product families a project has.
  • In this repo, keep the DATABASE_URL step neutral. Something like "Any PostgreSQL 15+ server works, local or hosted" in prisma-8.md is fine.
  • Mentioning create-db in the prisma-8 skill's quickstart as one way to get a database could still be reasonable, but let's decide that separately from the init output.

gregory-boch-prisma added a commit to prisma/prisma-cli that referenced this pull request Oct 27, 2026
The platform skill copied by `prisma init` explains when to use a
temporary standalone database and what a Composer app needs before
deploying to Prisma Compute.

- Preserve the project's existing database and hosting choices, and
scope the Composer dependency example to apps intended for Prisma
Compute.
- Use `npx create-db@latest` when the user has no Prisma account or
project yet. Explain its 24-hour lifetime and the Prisma account
required to claim it for free. Existing platform projects use the
`postgres` group or declare the database in their module.
- State the Composer configuration, build, and first-project region
prerequisites for deployment.

The maintainer chose `@latest` so the guide follows new `create-db`
releases. The product documentation records the boundary: database and
hosting guidance belongs in the copied skill; `init` does not suggest
products in its output or provision resources. Runtime behavior and
skill installation settings are unchanged.

Supersedes prisma/orm#30831.

## Validation

Current head `3e580de471404d541c2e1c6f8f4431ad99c9468e`, checked
2026-10-23:

- All 16 GitHub checks/statuses pass, including typecheck, lint, skill
packaging, unit tests on Linux and Windows, real-API e2e, CodeQL, and
CodeRabbit.
- CodeRabbit reviewed this head with no new actionable comments; zero
unresolved review threads.

Earlier local verification, before the maintainer's final wording
changes, passed typecheck, lint, 1,039 CLI tests, skill packaging, and 5
shipped-binary init e2e tests. A disposable project received the edited
skill byte-for-byte in all four agent directories. The earlier full
serialized suite had 2,336 passes, 1 skip, and an unchanged CLI-engine
consent re-prompt test timing out locally. Current-head CI passes.

## Sources checked 2026-10-22

- [Project initialization](https://www.prisma.io/docs/cli/init)
- [Temporary Prisma Postgres
databases](https://www.prisma.io/docs/postgres/npx-create-db)
- [Composer deployment
prerequisites](https://www.prisma.io/docs/composer/deploying)
- [Deploy command](https://www.prisma.io/docs/cli/deploy)

---------

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Co-authored-by: willbot <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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