Repository navigation
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
Closed
gregory-boch-prisma wants to merge 1 commit into
gregory-boch-prisma wants to merge 1 commit into
Conversation
…deploy Signed-off-by: Gregory Boch <[email protected]>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
@prisma/orm-extension-arktype-json
@prisma/orm-extension-middleware-cache
@prisma/orm-extension-paradedb
@prisma/orm-extension-pgvector
@prisma/orm-extension-postgis
@prisma/orm-extension-supabase
@prisma/orm-family-mongo
@prisma/orm-family-sql
@prisma/orm-framework
@prisma/orm-mongo
@prisma/orm-postgres
@prisma/orm-sqlite
@prisma/orm-target-mongo
@prisma/orm-target-postgres
@prisma/orm-target-sqlite
@prisma/orm-toolchain
commit: |
Contributor
size-limit report 📦
|
wmadden-electric
left a comment
Contributor
There was a problem hiding this comment.
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 initscaffolds the ORM project. Onboarding to other Prisma products (getting a Prisma Postgres database, deploying to Prisma Compute) is the job of the family-levelprisma init, which prisma-cli owns and which mounts theormfamily.- We already moved one concern out for the same reason: #30097 took agent-skills setup out of
orm initand gave it toprisma init.orm initnow just points users atprisma initas its last step. Hosted-database and deploy hints are the same kind of thing. - The change has to branch on
target === 'postgres'insidepackages/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-dbfrom its init because it had a single CLI. In Prisma 8 the unified CLI'sprisma initis the equivalent place, so that is where parity should be restored.
Suggested direction
- Put the create-db and
prisma deployguidance in prisma-cli'sprisma init, which knows which product families a project has. - In this repo, keep the
DATABASE_URLstep neutral. Something like "Any PostgreSQL 15+ server works, local or hosted" inprisma-8.mdis fine. - Mentioning create-db in the
prisma-8skill'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]>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 initnow namesnpx create-db@latestas an option for getting a temporary database and explains how to deploy a Prisma Composer (Early Access) app withprisma 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-lockfilepnpm 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:skillsandpnpm lint:ratchetspassed.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:packagessuite was not run.Skill update
skills/prisma-8/references/quickstart.mdnow offersnpx create-db@latestwhen a new Postgres project needsDATABASE_URL, including deletion after 24 hours unless claimed and the account requirement for claiming it for free.Checklist
git commit -s) per the DCO.TML-NNNN: <sentence-case title>form. This contribution uses the conventional title format described in CONTRIBUTING.md and has no TML ticket.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.