Repository navigation
Description
What problem are you trying to solve?
prisma orm init --target postgres leaves a new project with a localhost placeholder and nothing that says where a database can come from or how the app gets hosted.
Output today (prisma 8.0.0-rc.22, npx -y prisma@latest orm init --yes --target postgres --authoring psl), from the result document:
1. Set DATABASE_URL in your environment (export it or add it to .env).
2. Edit your schema at src/prisma/contract.prisma, then re-run `prisma contract emit`.
3. Open prisma-8.md for a quick reference on how to write your first typed query.
4. Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.
.env.example(and.envwith--write-env) holds onlyDATABASE_URL="postgresql://user:password@localhost:5432/mydb"(src/commands/init/templates/env.ts).prisma-8.md(templates/quick-reference-postgres.md) shows the same placeholder and names no way to get a database.- The
prisma-8skill's quickstart, under "DATABASE_URLnot set", only says to have the user set it (skills/prisma-8/references/quickstart.md).
A coding agent in the project reads exactly this output and these files. With no database at hand it stops to ask, or improvises a local Postgres setup.
Prisma 7's init did name a cloud option for Postgres (packages/cli/src/Init.ts at tag 7.10.0, line 700):
CREATE NEW DATABASE:
Local: npx prisma dev (runs Postgres locally in your terminal)
Cloud: npx create-db (creates a free Prisma Postgres database)
and the generated schema carried // Get a free hosted Postgres database in seconds: npx create-db. Prisma 8's init dropped both, so this is a parity gap more than a new feature. (prisma dev is not proposed: in the unified CLI it runs a Composer app.)
Proposed solution
Postgres target only. The Mongo output and the Prisma 7 transition steps (pushPrisma7Steps) stay as they are.
nextSteps, DATABASE_URL step (buildNextStepsinsrc/commands/init/output.ts). It keeps theDATABASE_URLsubstring that the doc comment tells agents to match on:Set DATABASE_URL in your environment (export it or add it to .env). No database yet?
npx create-db@latestcreates a temporary Prisma Postgres database and prints its URL; it is deleted after 24 hours unless you claim it.- New step before the agent-skills step:
To host the app:
prisma deploy module.tsdeploys a Prisma Composer (Early Access) app to Prisma Compute afterprisma auth loginand a build: https://www.prisma.io/docs/compute/getting-started - Typed next actions (
buildInitNextActionsinsrc/orm/init-blocks.ts): the same two, as arun-commandfornpx create-db@latestand auser-choicefor hosting. .envand.env.example, a comment aboveDATABASE_URL:# No database yet? npx create-db@latest creates a temporary Prisma Postgres database (deleted after 24 hours unless claimed).prisma-8.md, after theDATABASE_URLparagraph:Any PostgreSQL 15+ server works, local or hosted. No database yet?
npx create-db@latestcreates a temporary Prisma Postgres database and prints its connection string. It is deleted after 24 hours unless you claim it, and claiming it (free) needs a Prisma account. To host the app,npx prisma deploy module.tsdeploys a Prisma Composer (Early Access) app to Prisma Compute afternpx prisma auth loginand a build: see Getting started.skills/prisma-8/references/quickstart.md, "DATABASE_URLnot set" and Greenfield step 1: the same create-db option, with--json(connectionString,claimUrl) for agents.
Smoke test, 2026-10-12 (prisma 8.0.0-rc.22, @prisma/orm-postgres 8.0.0-rc.17, create-db 1.2.1, Node 22.23): prisma orm init --yes --target postgres --authoring psl, then npx create-db@latest --json with its connectionString in .env, then prisma db init (5 operations applied, database signed), then the quickstart's first arc (create plus select on User) printed the rows. Creating the database needed no account; I did not claim it.
Alternatives considered
- Leave it to the docs. An agent working in the project reads the CLI output and the generated files, not docs pages.
- A local database instead. Any PostgreSQL 15+ server keeps working; the new text says so in prisma-8.md. create-db is the one option that needs no install and no account, which is why Prisma 7 listed it.
- Only the database line, no deploy step. Fine by me if you'd rather keep init about the ORM. The deploy step is the one I am least sure belongs here.
Scope and impact
packages/1-framework/3-tooling/cli:output.ts,init-blocks.ts,init.ts(passestargettobuildInitNextActions),templates/env.ts,templates/quick-reference-postgres.md, tests (thetemplates.test.tssnapshot,nextStepsand next-action tests, including ones that pin the Mongo and Prisma 7 output).skills/prisma-8/references/quickstart.md.scripts/lint-framework-vocabulary.config.json: the new lines name the Postgres target in the framework CLI, so the ratchet goes from 254 to 259. If you'd rather the target-specific text live elsewhere, tell me where.- Not breaking:
nextStepsis prose that agents match on by substring, andDATABASE_URLstays in the first step.
I have the change ready on feat/orm-init-database-and-deploy-steps and will open it as a draft PR that refs this issue. @wmadden @SevInf, does this direction work for you, and would you change the wording?
Activity