From 3e707168df8fa0eafc22ed2d72e3329e30b613ec Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 19 Aug 2026 14:00:54 +0200 Subject: [PATCH] docs: align Prisma 8 blogs and guides with the rc.6 CLI and current scaffold Every CLI invocation in the Prisma 8 blogs and v8 guides now uses the unified prisma@next CLI, and the scaffold-dependent steps match what create-prisma@next actually generates today, validated end to end against a live Prisma Postgres database and a local MongoDB replica set. Co-Authored-By: Claude Fable 5 --- .../data-migrations-in-prisma-next/index.mdx | 6 +-- .../blog/mongodb-without-compromise/index.mdx | 4 +- .../index.mdx | 16 +++---- .../index.mdx | 6 +-- .../prisma-next-ltree-extension/index.mdx | 15 +++--- .../index.mdx | 4 +- .../index.mdx | 4 +- .../blog/prisma-next-roadmap/index.mdx | 4 +- .../prisma-studio-migrations-view/index.mdx | 33 +++++++------ .../index.mdx | 16 +++---- .../index.mdx | 4 +- .../index.mdx | 10 ++-- .../PgvectorDemoRunner.tsx | 23 +++++---- .../index.mdx | 25 +++++----- apps/docs/content/docs/(index)/index.mdx | 23 +++++---- .../quickstart/prisma-next.mdx | 30 +++++++----- .../docs/(index)/v8/full-stack-tutorial.mdx | 40 +++++++++------- .../docs/(index)/v8/getting-started.mdx | 13 ++--- apps/docs/content/docs/(index)/v8/index.mdx | 11 +++-- .../v8/prisma-postgres/from-the-cli.mdx | 24 ++++++---- .../docs/(index)/v8/quickstart/mongodb.mdx | 45 ++++++++--------- .../docs/(index)/v8/quickstart/postgresql.mdx | 48 +++++++++---------- apps/docs/content/docs/composer/databases.mdx | 4 +- .../docs/guides/v8/frameworks/astro.mdx | 29 ++++++----- .../docs/guides/v8/frameworks/elysia.mdx | 21 ++++---- .../docs/guides/v8/frameworks/hono.mdx | 23 +++++---- .../docs/guides/v8/frameworks/nestjs.mdx | 29 ++++++----- .../docs/guides/v8/frameworks/nextjs.mdx | 29 ++++++----- .../docs/guides/v8/frameworks/nuxt.mdx | 31 ++++++------ .../docs/guides/v8/frameworks/sveltekit.mdx | 29 ++++++----- .../guides/v8/frameworks/tanstack-start.mdx | 29 ++++++----- .../content/docs/guides/v8/runtimes/bun.mdx | 21 ++++---- .../content/docs/guides/v8/runtimes/deno.mdx | 14 +++--- .../guides/v8/upgrade-prisma-orm/meta.json | 5 +- .../orm/v8/extensions/using-extensions.mdx | 2 +- .../orm/v8/migrations/editing-a-migration.mdx | 2 +- .../orm/v8/migrations/the-migration-graph.mdx | 6 +-- apps/docs/content/docs/studio/prisma-next.mdx | 42 +++++++++------- 38 files changed, 372 insertions(+), 348 deletions(-) diff --git a/apps/blog/content/blog/data-migrations-in-prisma-next/index.mdx b/apps/blog/content/blog/data-migrations-in-prisma-next/index.mdx index fe4327f865..968a0963a8 100644 --- a/apps/blog/content/blog/data-migrations-in-prisma-next/index.mdx +++ b/apps/blog/content/blog/data-migrations-in-prisma-next/index.mdx @@ -204,18 +204,18 @@ dataTransform(endContract, "backfill-product-status", { }); ``` -Same `check` and `run` callbacks. Same compilation to a JSON file. Same kind of typed query against a contract snapshot specific to this migration. The query language is Mongo's, `.match(...).updateMany(...)` instead of `.where(...).update(...)`, but everything else carries over. There's a fully working example [in the prisma-next repo](https://github.com/prisma/prisma-next/blob/main/examples/retail-store/migrations/20260416_backfill-product-status/migration.ts), and we'll cover Mongo data migrations in more depth in a follow-up post. +Same `check` and `run` callbacks. Same compilation to a JSON file. Same kind of typed query against a contract snapshot specific to this migration. The query language is Mongo's, `.match(...).updateMany(...)` instead of `.where(...).update(...)`, but everything else carries over. There's a fully working example [in the Prisma repo](https://github.com/prisma/prisma/blob/main/examples/retail-store/migrations/app/20260513T0508_backfill_product_status/migration.ts), and we'll cover Mongo data migrations in more depth in a follow-up post. ## Try it yourself If you're as excited about this as we are, go ahead and try it out! [The Prisma 8 Release Candidate is available](https://www.prisma.io/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app). ```bash -pnpx prisma-next init +npx prisma@next orm init ``` This command will set up Prisma 8 in a new or existing project with a simple example contract. Write a schema change with a data step in the same file, plan it, read the JSON it compiled to, and apply it. -Tell us what worked and what didn't on [Discord](https://pris.ly/discord) in the `#prisma-next` channel, and **star and watch [prisma/prisma-next](https://pris.ly/pn-gh) on GitHub** to follow development. We'd love to hear your feedback! +Tell us what worked and what didn't on [Discord](https://pris.ly/discord) in the `#prisma-next` channel, and **star and watch [prisma/prisma](https://github.com/prisma/prisma) on GitHub** to follow development. We'd love to hear your feedback! Prisma 8 is a Release Candidate. Prisma 7 is the current generally available release, so if you're using it, keep using it. diff --git a/apps/blog/content/blog/mongodb-without-compromise/index.mdx b/apps/blog/content/blog/mongodb-without-compromise/index.mdx index e0f7f20954..f7d4757da3 100644 --- a/apps/blog/content/blog/mongodb-without-compromise/index.mdx +++ b/apps/blog/content/blog/mongodb-without-compromise/index.mdx @@ -112,7 +112,7 @@ The `@@index` declarations in the contract above are not just documentation. The When you update your contract and run `migration plan`, the planner compares the current state with the desired state: ```shell -$ npx @prisma/cli@next migration plan +$ npx prisma@next migration plan Migration: 20260409T1200_add_post_indexes @@ -254,6 +254,6 @@ The MongoDB Node.js Driver team's input from user-journey research and feature-g We believe this raises the bar for what MongoDB developers should expect from their tools. -- **Star + watch the repo:** [github.com/prisma/prisma-next](https://github.com/prisma/prisma-next) +- **Star + watch the repo:** [github.com/prisma/prisma](https://github.com/prisma/prisma) - **Try the Mongo demo app:** [examples/mongo-demo](https://github.com/prisma/prisma/tree/main/examples/mongo-demo) - **Join the conversation:** [Discord](http://pris.ly/discord) diff --git a/apps/blog/content/blog/prisma-next-call-for-extension-authors/index.mdx b/apps/blog/content/blog/prisma-next-call-for-extension-authors/index.mdx index dba06fc47b..f370de8c26 100644 --- a/apps/blog/content/blog/prisma-next-call-for-extension-authors/index.mdx +++ b/apps/blog/content/blog/prisma-next-call-for-extension-authors/index.mdx @@ -36,7 +36,7 @@ There is no "core API" and "plugin API." There is one SPI, used by the team buil ## What an extension can ship -An extension is a normal npm package: `@yourname/prisma-next-extension-foo`. Your users `pnpm add` it, [add one line to `prisma-next.config.ts`](https://www.prisma.io/docs/orm/v8/extensions/using-extensions), and your additions show up in their contract, their queries, and (if you ship migrations) their migration plans. +An extension is a normal npm package: `@yourname/prisma-next-extension-foo`. Your users `pnpm add` it, [add one line to `prisma.config.ts`](https://www.prisma.io/docs/orm/v8/extensions/using-extensions), and your additions show up in their contract, their queries, and (if you ship migrations) their migration plans. An extension can include any subset of four layers, in any combination: @@ -58,14 +58,14 @@ Three extensions ship in the repo today, each demonstrating a different combinat All three show up in the same project, file by file: ```typescript -// prisma-next.config.ts: register the pack +// prisma.config.ts: register the pack import pgvector from "@prisma/orm-extension-pgvector/control"; export default defineConfig({ - family: sql, - target: postgres, - adapter: postgresAdapter, - extensionPacks: [pgvector], + orm: ormConfig({ + extensions: [pgvector], + // ...contract and db settings + }), }); // prisma/contract.ts: declare a dimensioned vector column @@ -127,7 +127,7 @@ We, the Prisma 8 team, are available on Discord and eager to help you build, as ## The fastest way to start -Clone [`prisma/prisma-next`](https://pris.ly/pn-gh), point your coding agent at the repo, and tell it what you want to build. +Clone [`prisma/prisma`](https://github.com/prisma/prisma), point your coding agent at the repo, and tell it what you want to build. The repo is dense with architecture docs, architecture decision record (ADRs), SPI READMEs, and reference extensions: enough context that an agent can absorb it in seconds and scaffold a working pack from your description alone, without you reading a line of it first. @@ -143,7 +143,7 @@ Either way, the packages are small. Reading code is faster than reading docs. ## Build an extension -Build it, then tell us about it in [`#prisma-next`](https://pris.ly/discord) on Discord, and star [`prisma/prisma-next`](https://pris.ly/pn-gh) on GitHub to follow the SPI as it matures. +Build it, then tell us about it in [`#prisma-next`](https://pris.ly/discord) on Discord, and star [`prisma/prisma`](https://github.com/prisma/prisma) on GitHub to follow the SPI as it matures. Prisma 8 is early, and the SPI is stable enough that the existing extensions are real proof of what's possible, though we expect to iterate as more of you build against it. diff --git a/apps/blog/content/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app/index.mdx b/apps/blog/content/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app/index.mdx index 1b2451e5fc..345a644447 100644 --- a/apps/blog/content/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app/index.mdx +++ b/apps/blog/content/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app/index.mdx @@ -205,7 +205,7 @@ npm create prisma@next To add Prisma 8 to an existing project, run: ```bash -npx prisma-next@latest init +npx prisma@next orm init ``` From there, just ask your agent to build something: @@ -218,11 +218,11 @@ Or ask your agent _anything_ about Prisma 8: > _"What happens if a migration fails during deployment?"_ > _"How do I handle breaking changes in my code?"_ -Once you've got something running, tag [us on X](https://pris.ly/x) and tell us what you built. The best community builds get a shout-out from the Prisma account and a link in the [Prisma 8 README](https://github.com/prisma/prisma-next). +Once you've got something running, tag [us on X](https://pris.ly/x) and tell us what you built. The best community builds get a shout-out from the Prisma account and a link in the [Prisma 8 README](https://github.com/prisma/prisma). And when you're ready to ship it, our hosted database [Prisma Postgres](https://www.prisma.io/postgres) comes with a generous free tier. -Star and watch [prisma/prisma-next](https://github.com/prisma/prisma-next) on GitHub to follow what ships next. And if you hit a snag, start a thread in [#prisma-next](https://pris.ly/discord) on [our Discord](https://pris.ly/discord). +Star and watch [prisma/prisma](https://github.com/prisma/prisma) on GitHub to follow what ships next. And if you hit a snag, start a thread in [#prisma-next](https://pris.ly/discord) on [our Discord](https://pris.ly/discord). We can't wait to see what you build. diff --git a/apps/blog/content/blog/prisma-next-ltree-extension/index.mdx b/apps/blog/content/blog/prisma-next-ltree-extension/index.mdx index 536cf3b603..a36aa9faed 100644 --- a/apps/blog/content/blog/prisma-next-ltree-extension/index.mdx +++ b/apps/blog/content/blog/prisma-next-ltree-extension/index.mdx @@ -51,14 +51,17 @@ npm install prisma-ltree Control config and the runtime client both take an `extensions` array. Control is where the pack contributes schema types and migrations: ```typescript -// prisma-next.config.ts -import { defineConfig } from "@prisma/orm-postgres/config"; +// prisma.config.ts +import { defineConfig } from "@prisma/cli-engine"; +import { defineConfig as ormConfig } from "@prisma/orm-postgres/config"; import ltree from "prisma-ltree/control"; export default defineConfig({ - contract: "./prisma/contract.prisma", - extensions: [ltree], - db: { connection: process.env.DATABASE_URL! }, + orm: ormConfig({ + contract: "./prisma/contract.prisma", + extensions: [ltree], + db: { connection: process.env.DATABASE_URL! }, + }), }); ``` @@ -112,7 +115,7 @@ There is a TypeScript schema lane too, with the same compiled output as PSL (Pri **5. Initialize the database** -The pack ships a baseline migration that runs `CREATE EXTENSION IF NOT EXISTS ltree`. On a fresh project: `npx prisma-next contract emit`, then `npx prisma-next migration plan`, then `npx prisma-next db init`. +The pack ships a baseline migration that runs `CREATE EXTENSION IF NOT EXISTS ltree`. On a fresh project: `npx prisma@next contract emit`, then `npx prisma@next migration plan`, then `npx prisma@next db init`. **6. Insert and query paths** diff --git a/apps/blog/content/blog/prisma-next-performance-benchmark/index.mdx b/apps/blog/content/blog/prisma-next-performance-benchmark/index.mdx index 065c57172a..ca7b0c7504 100644 --- a/apps/blog/content/blog/prisma-next-performance-benchmark/index.mdx +++ b/apps/blog/content/blog/prisma-next-performance-benchmark/index.mdx @@ -110,7 +110,7 @@ This sets you up with a [Prisma Postgres](https://www.prisma.io/postgres) databa To add Prisma 8 to an existing app, run: ```shell -bunx prisma-next@latest init +bunx prisma@next orm init ``` -To learn more, start with the [announcement blog post](https://pris.ly/pn-ea). Star and watch [prisma/prisma-next](https://github.com/prisma/prisma-next) on GitHub to follow what ships next, and if you hit a snag, start a thread in [`#prisma-next` on our Discord](https://pris.ly/discord). +To learn more, start with the [announcement blog post](https://pris.ly/pn-ea). Star and watch [prisma/prisma](https://github.com/prisma/prisma) on GitHub to follow what ships next, and if you hit a snag, start a thread in [`#prisma-next` on our Discord](https://pris.ly/discord). diff --git a/apps/blog/content/blog/prisma-next-roadmap-april-milestone/index.mdx b/apps/blog/content/blog/prisma-next-roadmap-april-milestone/index.mdx index 6857ef5249..d6e7ea9274 100644 --- a/apps/blog/content/blog/prisma-next-roadmap-april-milestone/index.mdx +++ b/apps/blog/content/blog/prisma-next-roadmap-april-milestone/index.mdx @@ -84,11 +84,11 @@ Three things to watch this month: ## Try it out -You can start building with Prisma 8 today. Run `npx prisma-next init`, open the contract, add a model, run `prisma-next migration plan` — it takes about as long as reading this paragraph. +You can start building with Prisma 8 today. Run `npx prisma@next orm init`, open the contract, add a model, run `npx prisma@next migration plan` — it takes about as long as reading this paragraph. The API is still settling, so expect breaking changes often. If you find rough edges or something you were hoping for that's missing, drop into [`#prisma-next` on Discord](https://pris.ly/discord) and tell us. Feedback right now is the most valuable thing we can get. -Star or watch [`prisma/prisma-next` on GitHub](https://pris.ly/pn-gh) to follow updates as they land, and subscribe to the [Prisma blog](https://www.prisma.io/blog) for the monthly milestone update. +Star or watch [`prisma/prisma` on GitHub](https://github.com/prisma/prisma) to follow updates as they land, and subscribe to the [Prisma blog](https://www.prisma.io/blog) for the monthly milestone update. Prisma 8 is not yet production-ready. Prisma 7 remains the right choice for production today. diff --git a/apps/blog/content/blog/prisma-next-roadmap/index.mdx b/apps/blog/content/blog/prisma-next-roadmap/index.mdx index 2d3c5705ee..89eec2b06a 100644 --- a/apps/blog/content/blog/prisma-next-roadmap/index.mdx +++ b/apps/blog/content/blog/prisma-next-roadmap/index.mdx @@ -68,6 +68,6 @@ For teams looking to upgrade, you'll be able to run Prisma 8 and Prisma 7 in par ## Follow along -For the most up-to-date view, follow the [roadmap in the Prisma 8 repo](https://github.com/prisma/prisma-next/tree/main/ROADMAP.md) as it develops in real time. We'll post announcements like this one as we learn more. +For the most up-to-date view, follow the [roadmap in the Prisma 8 repo](https://github.com/prisma/prisma/blob/main/ROADMAP.md) as it develops in real time. We'll post announcements like this one as we learn more. -For the broader picture, [check out the Prisma 8 repo](https://github.com/prisma/prisma-next/tree/main) and star it to subscribe to updates. +For the broader picture, [check out the Prisma 8 repo](https://github.com/prisma/prisma) and star it to subscribe to updates. diff --git a/apps/blog/content/blog/prisma-studio-migrations-view/index.mdx b/apps/blog/content/blog/prisma-studio-migrations-view/index.mdx index 32fdb43759..260b3bc8b2 100644 --- a/apps/blog/content/blog/prisma-studio-migrations-view/index.mdx +++ b/apps/blog/content/blog/prisma-studio-migrations-view/index.mdx @@ -53,14 +53,13 @@ Here is the workflow, from an empty directory. The screenshots in this post come npm create prisma@next ``` -Answer the prompts (PostgreSQL, PSL, and yes to [Prisma Postgres](https://www.prisma.io/docs/postgres)) or skip them: +Answer the prompts (PostgreSQL, PSL, your package manager) or skip them: ```bash -npm create prisma@next -- my-app --yes --provider postgres --authoring psl \ - --template minimal --prisma-postgres --install --emit +npm create prisma@next -- my-app --yes --provider postgres --authoring psl --template minimal ``` -This provisions a database, writes `DATABASE_URL` into `.env`, and scaffolds a contract at `src/prisma/contract.prisma`. The database is temporary for 24 hours; `.env` also holds a `CLAIM_URL` to keep it. +This scaffolds a contract at `src/prisma/contract.prisma`. Then create a [Prisma Postgres](https://www.prisma.io/docs/postgres) database with `npx create-db@latest` and export the connection string it prints as `DATABASE_URL` (the CLI reads the environment variable, not `.env`). The database is temporary for 24 hours; `create-db` also prints a claim URL to keep it. ### Step 2: Model, plan, apply @@ -93,9 +92,9 @@ model Post { Compile it, [plan a migration](https://www.prisma.io/docs/orm/v8/migrations/generating-a-migration), [apply it](https://www.prisma.io/docs/orm/v8/migrations/applying-a-migration): ```bash -npx @prisma/cli@next contract emit -npx @prisma/cli@next migration plan --name init_users_posts -npx @prisma/cli@next migrate --advance-ref db +npx prisma@next contract emit +npx prisma@next migration plan --name init_users_posts +npx prisma@next migrate --advance-ref db ``` `--advance-ref db` moves a [ref](https://www.prisma.io/docs/orm/v8/migrations/the-migration-graph#name-important-states-with-refs), a name pinned to a point in your migration history, onto what you just applied. Later plans start from there and produce a delta instead of recreating everything. @@ -136,9 +135,9 @@ model Post { ``` ```bash -npx @prisma/cli@next contract emit -npx @prisma/cli@next migration plan --name add_roles_and_publishing -npx @prisma/cli@next migrate --advance-ref db +npx prisma@next contract emit +npx prisma@next migration plan --name add_roles_and_publishing +npx prisma@next migrate --advance-ref db ``` Repeat for whatever your app needs; when a change needs a backfill, [Data Migrations in Prisma 8](/data-migrations-in-prisma-next) covers that. The history behind the screenshots here has six migrations: an initial pair of models, this enum-and-fields change, a `Category` model with a relation and two unique constraints, a destructive column drop, and two more field additions. @@ -153,14 +152,14 @@ npm run db:seed ### Step 5: Open Studio -A Prisma 8 project has no `schema.prisma`, so Studio takes the connection string with `--url`. It lives in `.env` rather than your shell, so load it first: +A Prisma 8 project has no `schema.prisma`, so Studio takes the connection string with `--url`. The connection string lives in `.env` rather than your shell, so load it first. Run Studio from a directory outside the project: the Prisma 7 CLI that ships Studio cannot read the Prisma 8 `prisma.config.ts` and fails if it finds one: ```bash set -a && . ./.env && set +a -npx prisma@dev studio --url "$DATABASE_URL" +cd .. && npx prisma@latest studio --url "$DATABASE_URL" ``` -Studio opens on `http://localhost:5555`, and **Migrations** is in the left navigation. +Studio prints the local URL it serves on; open it, and **Migrations** is in the left navigation. ## Reading a migration @@ -201,7 +200,7 @@ The practical consequence: a migration applied from CI, from a teammate's laptop ## Where you can use it -The Migrations view shipped in `@prisma/studio-core` 0.32.0. The Prisma CLI bundles Studio, and a new enough version is currently only in the CLI's `dev` release, so use `npx prisma@dev studio` to try it locally. +The Migrations view shipped in `@prisma/studio-core` 0.32.0, and the stable Prisma CLI bundles it since 7.9. Run `npx prisma@latest studio --url "$DATABASE_URL"` from a directory outside your Prisma 8 project to try it locally. It is also in the embedded Studio in [Prisma Console](https://console.prisma.io), for any database with an applied Prisma 8 migration history. Open your database's Studio tab and select **Migrations**. No local setup, and the selected migration is part of the Console URL too. @@ -225,7 +224,7 @@ This matters most where the repo can't help you. The database your app talks to The Migrations view is a screen in Prisma Studio that lists every applied migration of a Prisma 8 database, newest first, with a visual diff of the models it changed, the SQL it executed, and a Prisma-schema diff. It shipped in `@prisma/studio-core` 0.32.0 and reads the history from the database itself. -The Migrations item appears only when the connected database has at least one applied Prisma 8 migration, recorded in the `prisma_contract.ledger` table. It stays hidden for databases with no applied migrations, for Prisma ORM projects using `prisma migrate`, and for Studio versions older than `@prisma/studio-core` 0.32.0. The stable Prisma CLI still bundles an older Studio, so run `npx prisma@dev studio`. +The Migrations item appears only when the connected database has at least one applied Prisma 8 migration, recorded in the `prisma_contract.ledger` table. It stays hidden for databases with no applied migrations, for Prisma ORM projects using `prisma migrate`, and for Studio versions older than `@prisma/studio-core` 0.32.0. Prisma CLI 7.9 and later bundle a new enough Studio; run `npx prisma@latest studio`. No. Projects managed with `prisma migrate` record their history in the `_prisma_migrations` table, which the view does not read. The Migrations view requires a Prisma 8 project on PostgreSQL, which records each apply in `prisma_contract.ledger`. @@ -243,8 +242,8 @@ npm create prisma@next Model something, apply two migrations, and open **Migrations**. Tell us what you'd want in the timeline next on [Discord](https://pris.ly/discord). -**Star and watch [prisma/prisma-next](https://pris.ly/pn-gh) on GitHub** to follow development. +**Star and watch [prisma/prisma](https://github.com/prisma/prisma) on GitHub** to follow development. --- -The Migrations view shipped in `@prisma/studio-core` 0.32.0. The Prisma CLI bundles Studio, and a new enough version is currently only in the CLI's `dev` release, hence `npx prisma@dev studio`. [Prisma 8 is in Early Access](https://www.prisma.io/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app) and not production-ready yet. Prisma 7 is still the right choice for production today. +The Migrations view shipped in `@prisma/studio-core` 0.32.0; the stable Prisma CLI bundles it since 7.9. [Prisma 8 is in Early Access](https://www.prisma.io/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app) and not production-ready yet. Prisma 7 is still the right choice for production today. diff --git a/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx b/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx index f483c942f6..621d9b38ff 100644 --- a/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx +++ b/apps/blog/content/blog/ship-risky-schema-changes-without-a-shared-staging-database/index.mdx @@ -38,7 +38,7 @@ Three Prisma products appear here, each with one job: - **Prisma Compute** (Public Beta) hosts your app and provisions a database for each branch you deploy with `--db`. It provides the isolation. Its CLI is `@prisma/cli`. - **Prisma Postgres** is the database each branch gets. -- **[Prisma 8](https://www.prisma.io/docs/orm/v8)** (Release Candidate) provides the migration toolchain in the examples, via the unified Prisma CLI (`npx @prisma/cli@next`). The same workflow also works with Prisma 7's `prisma migrate deploy`. +- **[Prisma 8](https://www.prisma.io/docs/orm/v8)** (Release Candidate) provides the migration toolchain in the examples, via the unified Prisma CLI (`npx prisma@next`). The same workflow also works with Prisma 7's `prisma migrate deploy`. ::: @@ -127,7 +127,7 @@ Add `displayName` as nullable, so existing code that only knows about `name` kee skill="prisma-next-migrations" before={expandContractBefore} after={expandContractAfter} - terminalCommand="npx @prisma/cli@next migration plan --name add_display_name" + terminalCommand="npx prisma@next migration plan --name add_display_name" terminalLines={expandTerminalLines} /> @@ -147,7 +147,7 @@ override get operations() { } ``` -Apply it to your branch database with `npx @prisma/cli@next migrate` and deploy the branch. Old code still reads `name`; new code can start writing `displayName`. +Apply it to your branch database with `npx prisma@next migrate` and deploy the branch. Old code still reads `name`; new code can start writing `displayName`. ### Step 2: Migrate @@ -166,7 +166,7 @@ model User { ``` ```bash -npx @prisma/cli@next migration plan --name require_display_name +npx prisma@next migration plan --name require_display_name ``` The planner can write the `SET NOT NULL` itself, but only you know what existing rows should contain, so it scaffolds a backfill placeholder in front of the constraint and leaves the query to you. The backfill lives [inside the migration](https://pris.ly/data-migrations-pn) as a `dataTransform`, written with the same type-safe query builder you use in your app, instead of a standalone script that runs outside your migration history. Filled in: @@ -211,7 +211,7 @@ Once all code reads `displayName` and the backfill is verified, remove the old c skill="prisma-next-migrations" before={contractContractBefore} after={contractContractAfter} - terminalCommand="npx @prisma/cli@next migration plan --name drop_legacy_name" + terminalCommand="npx prisma@next migration plan --name drop_legacy_name" terminalLines={contractTerminalLines} /> @@ -270,7 +270,7 @@ jobs: PRISMA_SERVICE_TOKEN: ${{ secrets.PRISMA_SERVICE_TOKEN }} - name: Apply migrations to the branch database - run: npx @prisma/cli@next migrate --db "$DATABASE_URL" + run: npx prisma@next migrate --db "$DATABASE_URL" env: DATABASE_URL: ${{ secrets.BRANCH_DB_URL }} @@ -317,9 +317,9 @@ Neon branches copy schema and data from a parent branch by default. Compute bran [Prisma 8 is in Early Access](https://www.prisma.io/blog/prisma-next-early-access-write-your-contract-prompt-your-agent-ship-your-app). It isn't production-ready yet; Prisma 7 remains the right choice for production today. But the per-branch workflow is ready to try now: ```bash -npx @prisma/cli@next orm init +npx prisma@next orm init ``` Write a contract, plan a migration, and read the `migration.ts` and `ops.json` it produces. Then, from a feature branch, deploy to [Compute](https://www.prisma.io/docs/prisma-compute/deploy) with `npx @prisma/cli@latest app deploy --db`. The CLI targets your current Git branch, so that one command gives the branch its own database, ready for the expand-and-contract cycle. -Tell us what worked and what didn't on [Discord](https://pris.ly/discord) in the `#prisma-next` channel, and **star [prisma/prisma-next](https://pris.ly/pn-gh) on GitHub** to follow development. +Tell us what worked and what didn't on [Discord](https://pris.ly/discord) in the `#prisma-next` channel, and **star [prisma/prisma](https://github.com/prisma/prisma) on GitHub** to follow development. diff --git a/apps/blog/content/blog/stop-your-ai-agent-dropping-your-database/index.mdx b/apps/blog/content/blog/stop-your-ai-agent-dropping-your-database/index.mdx index 33b61ecc28..cf4d4bd9d6 100644 --- a/apps/blog/content/blog/stop-your-ai-agent-dropping-your-database/index.mdx +++ b/apps/blog/content/blog/stop-your-ai-agent-dropping-your-database/index.mdx @@ -173,12 +173,12 @@ Because it's authenticated through the Prisma Cloud API, you only ever expose an ## Try Prisma 8 -The first Prisma 8 release candidate comes out in the next week. Until it lands, everything described here ships today as the `prisma-next` package. It's ready for production use, though some features of Prisma 7 aren't present yet. +Prisma 8 is available today as a Release Candidate. Some features of Prisma 7 aren't present yet, and Prisma 7 remains the right choice for production while the RC settles. To get started, run: ```bash -pnpx prisma-next@latest init +npx prisma@next orm init ``` Then ask your agent to make a schema change and watch the workflow it follows: edit the contract, plan a migration, run it. That workflow, not a warning, is what stands between your agent and a viral screenshot. diff --git a/apps/blog/content/blog/typescript-migrations-in-prisma-next/index.mdx b/apps/blog/content/blog/typescript-migrations-in-prisma-next/index.mdx index 95521cbf15..84c9ee22ce 100644 --- a/apps/blog/content/blog/typescript-migrations-in-prisma-next/index.mdx +++ b/apps/blog/content/blog/typescript-migrations-in-prisma-next/index.mdx @@ -144,7 +144,7 @@ Wrote ops.json + migration.json to migrations/20260423T1154_add_users_and_posts/ ## Every operation is verified before and after it runs -Each factory function (`createTable`, `addUnique`, `createIndex`, and so on) returns an operation made up of three parts: a **precheck** that runs before the change, the **execute** step that makes the change, and a **postcheck** that runs after ([see how `createTable` is built](https://github.com/prisma/prisma-next/blob/main/packages/3-targets/3-targets/postgres/src/core/migrations/operations/tables.ts)). When you run `migration.ts`, those operations are written out to `ops.json`. Here's one operation from the output: +Each factory function (`createTable`, `addUnique`, `createIndex`, and so on) returns an operation made up of three parts: a **precheck** that runs before the change, the **execute** step that makes the change, and a **postcheck** that runs after ([see how `createTable` is built](https://github.com/prisma/prisma/blob/main/packages/3-targets/3-targets/postgres/src/core/migrations/operations/tables.ts)). When you run `migration.ts`, those operations are written out to `ops.json`. Here's one operation from the output: ```json { @@ -180,13 +180,13 @@ You edit the TypeScript. The system runs the JSON. Both get committed, much like Most migrations don't get written from scratch. They get [planned](https://www.prisma.io/docs/orm/v8/migrations/generating-a-migration) from changes to your [Prisma contract](https://www.prisma.io/docs/orm/v8/contract-authoring/the-data-contract) (the `.prisma` file that describes your database schema). Say you add a `displayName String` field to your `User` model. Then: ```text -$ npx prisma-next migration plan +$ npx prisma@next migration plan ✔ Planned 2 operation(s) │ ├─ Add column "displayName" to "user" [additive] └─ Set NOT NULL on "user"."displayName" [destructive] -$ npx prisma-next migrate --verbose +$ npx prisma@next migrate --verbose ✔ Applied 1 migration(s) └─ 20260424T0930_add_user_displayname [2 op(s)] @@ -201,7 +201,7 @@ When you do need to [edit a migration](https://www.prisma.io/docs/orm/v8/migrati Where it gets interesting is when something goes wrong. The runner doesn't just bail with a database error. It names the operation that failed and the check inside it that the database refused to satisfy: ```text -$ npx prisma-next migrate +$ npx prisma@next migrate ✖ Operation alterNullability.setNotNull.user.displayName failed during precheck: ensure no NULL values in "displayName" (PN-RUN-5001) Why: Migration runner halted before destructive ALTER Fix: Fix the issue and re-run `prisma-next migrate`. Previously applied migrations are preserved. @@ -293,7 +293,7 @@ Most importantly, `migration.ts` combined with `ops.json` is _really_ easy to re But you can try it now: ```bash -pnpx prisma-next init +npx prisma@next orm init ``` Start a project, write a contract, plan a migration, and see what `migration.ts` and `ops.json` look like for yourself. We'd love your feedback. Join us on [Discord](https://pris.ly/discord) and tell us what works and what doesn't. diff --git a/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/PgvectorDemoRunner.tsx b/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/PgvectorDemoRunner.tsx index 2b4238d2ab..966855def7 100644 --- a/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/PgvectorDemoRunner.tsx +++ b/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/PgvectorDemoRunner.tsx @@ -43,18 +43,21 @@ model Movie { }, { title: "Wire the extension", - filename: "prisma-next.config.ts", + filename: "prisma.config.ts", lang: "typescript", source: `import "dotenv/config"; import pgvector from "@prisma/orm-extension-pgvector/control"; -import { defineConfig } from "@prisma/orm-postgres/config"; +import { defineConfig } from "@prisma/cli-engine"; +import { defineConfig as ormConfig } from "@prisma/orm-postgres/config"; export default defineConfig({ - contract: "./src/prisma/contract.prisma", - extensions: [pgvector], - db: { - connection: process.env.DATABASE_URL!, - }, + orm: ormConfig({ + contract: "./src/prisma/contract.prisma", + extensions: [pgvector], + db: { + connection: process.env.DATABASE_URL!, + }, + }), });`, caption: "One entry in extensions teaches the CLI, the migration engine, and the query builder what a vector is.", @@ -64,9 +67,9 @@ export default defineConfig({ title: "Migrate", filename: "terminal", lang: "bash", - source: `bunx @prisma/cli@next contract emit -bunx @prisma/cli@next migration plan -bunx @prisma/cli@next db init`, + source: `bunx prisma@next contract emit +bunx prisma@next migration plan +bunx prisma@next db init`, caption: "migration plan copies the pgvector pack's own baseline migration into your repo; db init applies both spaces. You never run CREATE EXTENSION by hand.", output: [ diff --git a/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/index.mdx b/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/index.mdx index 4e40b595a9..0b00a922c0 100644 --- a/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/index.mdx +++ b/apps/blog/content/blog/you-dont-need-a-vector-database-postgres-already-has-pgvector/index.mdx @@ -155,19 +155,22 @@ model Movie { The line that matters is `Vibe = pgvector.Vector(4)`. The dimension is part of the type, and every `Movie.embedding` is a 4-dimensional vector from here on. A real app would write `pgvector.Vector(1536)` to match its embedding model. -Wire the extension into `prisma-next.config.ts` at the project root: +Wire the extension into `prisma.config.ts` at the project root: ```typescript import "dotenv/config"; import pgvector from "@prisma/orm-extension-pgvector/control"; -import { defineConfig } from "@prisma/orm-postgres/config"; +import { defineConfig } from "@prisma/cli-engine"; +import { defineConfig as ormConfig } from "@prisma/orm-postgres/config"; export default defineConfig({ - contract: "./src/prisma/contract.prisma", - extensions: [pgvector], - db: { - connection: process.env.DATABASE_URL!, - }, + orm: ormConfig({ + contract: "./src/prisma/contract.prisma", + extensions: [pgvector], + db: { + connection: process.env.DATABASE_URL!, + }, + }), }); ``` @@ -176,9 +179,9 @@ export default defineConfig({ Three commands take the contract from a `.prisma` file to a live, signed database: ```bash -bunx prisma-next contract emit -bunx prisma-next migration plan -bunx prisma-next db init +bunx prisma@next contract emit +bunx prisma@next migration plan +bunx prisma@next db init ``` `contract emit` compiles the contract to `contract.json` plus a `contract.d.ts` where `Movie.embedding` is typed as `Vector<4>`. @@ -357,7 +360,7 @@ Yes. An embedding is just an array of numbers, so you can insert hand-made vecto ## Recap - Embeddings are vectors; semantic search is ordering by the angle between them. pgvector gives Postgres a `vector(N)` column type and a `<=>` cosine distance operator. -- [`@prisma/orm-extension-pgvector`](https://github.com/prisma/prisma-next) is a Prisma 8 extension pack: a codec (`Vector<4>` in your types), typed `cosineDistance`/`cosineSimilarity` operations, and a baseline migration that installs the extension for you. +- [`@prisma/orm-extension-pgvector`](https://github.com/prisma/prisma/tree/main/packages/3-extensions/pgvector) is a Prisma 8 extension pack: a codec (`Vector<4>` in your types), typed `cosineDistance`/`cosineSimilarity` operations, and a baseline migration that installs the extension for you. - The demo ran on a throwaway database from `npx create-db@latest`, and the whole flow is four commands: `contract emit`, `migration plan`, `db init`, `bun index.ts`. - Fit: apps already on Postgres with up to a few million vectors that want embeddings, filters, and transactions in one place. Reach for a dedicated engine when extreme-scale ANN or full search-engine features are the product. diff --git a/apps/docs/content/docs/(index)/index.mdx b/apps/docs/content/docs/(index)/index.mdx index 8e28514a1f..85a1686bdf 100644 --- a/apps/docs/content/docs/(index)/index.mdx +++ b/apps/docs/content/docs/(index)/index.mdx @@ -35,13 +35,15 @@ The tutorial's journey, condensed: hand the prompt to your coding agent, or run .env npx @prisma/cli@latest app deploy --env .env`}> ```text @@ -49,11 +51,12 @@ Create a new [framework] application with Prisma 8, seed it, and run it locally. If I have not told you which framework, stop and ask before scaffolding. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia. -1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --prisma-postgres --yes`. The `--prisma-postgres` flag provisions a Prisma Postgres database. If I give you a connection string, pass `--database-url ""` instead of `--prisma-postgres`. -2. From the project directory, apply the starter contract and seed: `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun. -3. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. -4. Update the seed script and the app routes to query the new schema, start `npm run dev` in the background, and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. -5. Deploy with Prisma Compute. First apply the framework's deploy requirement from the guide at https://www.prisma.io/docs/guides/v8/frameworks/[guide].md, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`. The requirements: Next.js needs `output: "standalone"` in `next.config.ts` (without it the deployed app returns 504s), TanStack Start needs the nitro build plugin, Astro needs the `@astrojs/node` adapter plus `--env HOST=0.0.0.0`, and Elysia needs `--framework bun --entry src/index.ts` on the deploy command. If the template is `svelte`, skip this step; Compute does not support SvelteKit yet. Check `npx @prisma/cli@latest auth whoami`. If I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`, because that step opens a browser. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` so DATABASE_URL reaches the deployment, and verify the deployed URL with curl. +1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --yes`. +2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `.env` in the project directory; the generated scripts read the environment variable, and the deploy step reads `.env`. +3. From the project directory, apply the starter contract: `npm run db:init`. Sample users are seeded automatically on the app's first query; there is no separate seed script. +4. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. +5. Update the seed script under `src/prisma/` and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. +6. Deploy with Prisma Compute. First apply the framework's deploy requirement from the guide at https://www.prisma.io/docs/guides/v8/frameworks/[guide].md, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`. The requirements: Next.js needs `output: "standalone"` in `next.config.ts` (without it the deployed app returns 504s), TanStack Start needs the nitro build plugin, Astro needs the `@astrojs/node` adapter plus `--env HOST=0.0.0.0`, and Elysia needs `--framework bun --entry src/index.ts` on the deploy command. If the template is `svelte`, skip this step; Compute does not support SvelteKit yet. Check `npx @prisma/cli@latest auth whoami`. If I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`, because that step opens a browser. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` so DATABASE_URL reaches the deployment, and verify the deployed URL with curl. Use the installed Prisma 8 skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version). ``` @@ -124,8 +127,8 @@ Create a new [framework] application with Prisma 8 against my existing PostgreSQ If I have not given you a connection string, stop and ask; do not invent one. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia. -1. Scaffold: `npx create-prisma@next create my-app --template [framework] --provider postgres --database-url "" --yes`. -2. From the project directory: `npm run db:init`, then `npm run db:seed`, then start `npm run dev` in the background and verify the sample query returns data. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun. +1. Scaffold: `npx create-prisma@next create my-app --template [framework] --provider postgres --yes`. +2. Export my connection string as `DATABASE_URL` in the shell; the generated scripts read the environment variable, not `.env`. From the project directory: `npm run db:init`, then start `npm run dev` in the background and verify the sample query returns data. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Evolve the starter contract under `src/prisma/` into my schema, then run `npm run contract:emit`, `npx prisma@next migration plan`, and `npx prisma@next migrate --yes`. Do not provision any hosted database. Use the installed Prisma 8 skills and https://www.prisma.io/docs/llms.txt for current docs. diff --git a/apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-next.mdx b/apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-next.mdx index e7796e9386..b180eae557 100644 --- a/apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-next.mdx +++ b/apps/docs/content/docs/(index)/prisma-postgres/quickstart/prisma-next.mdx @@ -3,7 +3,7 @@ title: Prisma 8 description: Create a Prisma 8 app with Prisma Postgres. url: /prisma-postgres/quickstart/prisma-next metaTitle: 'Quickstart: Prisma 8 with Prisma Postgres' -metaDescription: Create a Prisma 8 app, provision Prisma Postgres, seed data, and run your first query. +metaDescription: Create a Prisma 8 app, create a Prisma Postgres database, initialize it, and run your first query. badge: release-candidate --- @@ -15,13 +15,23 @@ Create a Prisma 8 app backed by Prisma Postgres. npx create-prisma@next ``` -Run this from a Node.js 24 or newer environment. When prompted, choose PostgreSQL and Prisma Postgres. +Run this from a Node.js 24 or newer environment. When prompted, choose PostgreSQL. -Setup provisions the database, writes `DATABASE_URL`, adds a starter contract, creates `prisma-next.md`, installs project-level Prisma 8 skills for your coding agent, and adds package scripts for the database steps below. +Setup adds a starter contract, creates `prisma-next.md`, installs project-level Prisma 8 skills for your coding agent, and adds package scripts for the database steps below. Choose the minimal template if you want the fastest first run, or a framework template when you want the first query wired into an app route or page. -## 1. Create the app +## 1. Create the database -Run `create-prisma@next` and choose the minimal template if you want the fastest first run. Choose a framework template when you want the first query wired into an app route or page. +Create a Prisma Postgres database from the terminal and export its connection string. The generated scripts read the environment variable, not `.env`: + +```npm +npx create-db@latest +``` + +```bash +export DATABASE_URL="" +``` + +The command also prints a claim URL; open it within 24 hours to keep the database in your account. ## 2. Initialize the database @@ -31,15 +41,9 @@ From the generated project directory, run `db:init` to apply the starter schema npm run db:init ``` -## 3. Seed data - -`db:seed` inserts sample data so the first query returns something immediately. - -```npm -npm run db:seed -``` +Sample users are seeded automatically the first time the app queries the database, so there is no separate seed step. -## 4. Run the app +## 3. Run the app Start the app and confirm the sample query runs successfully. diff --git a/apps/docs/content/docs/(index)/v8/full-stack-tutorial.mdx b/apps/docs/content/docs/(index)/v8/full-stack-tutorial.mdx index 8afd52d36a..48313fb551 100644 --- a/apps/docs/content/docs/(index)/v8/full-stack-tutorial.mdx +++ b/apps/docs/content/docs/(index)/v8/full-stack-tutorial.mdx @@ -26,10 +26,11 @@ Prefer to delegate? This is the same journey as the prompt on the [getting start ```text Create a new Hono API with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-app --template hono --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. -3. Start `npm run dev` in the background and verify `curl http://localhost:3000/users` returns the seeded users. -4. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL's /users endpoint with curl. +1. Scaffold: `npx create-prisma@next create my-app --template hono --provider postgres --yes`. +2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +3. In `my-app`, run `npm run db:init`. Sample users are seeded automatically on the app's first query; there is no separate seed script. +4. Start `npm run dev` in the background (with `DATABASE_URL` exported) and verify `curl http://localhost:3000/users` returns the seeded users. +5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL's /users endpoint with curl. Use the installed Prisma 8 skills. ``` @@ -38,39 +39,46 @@ Use the installed Prisma 8 skills. ## 1. Scaffold the app -One command creates the app, wires up Prisma 8, and can provision the database: +One command creates the app and wires up Prisma 8: ```npm npx create-prisma@next create my-app --template hono --provider postgres ``` -Pick **Prisma Postgres** at the database prompt to have a database created for you, or paste your own connection string. Then enter the project: +Answer the prompts for contract authoring style and package manager, then enter the project: ```npm cd my-app ``` -The scaffold writes `DATABASE_URL` to `.env`, generates a Hono server in `src/index.ts` with `GET /` and `GET /users` routes, puts the Prisma 8 setup under `src/prisma/`, and installs [Prisma 8 skills](/ai/tools/skills) for your coding agent. If the database was provisioned without a signed-in CLI, `.env` also contains a `CLAIM_URL`; open it within 24 hours to claim the database into your account and keep it. +The scaffold generates a Hono server in `src/index.ts` with `GET /` and `GET /users` routes, puts the Prisma 8 setup under `src/prisma/`, and installs [Prisma 8 skills](/ai/tools/skills) for your coding agent. -## 2. Initialize and seed the database +Next, get a Prisma Postgres connection string. If you don't have one, create a database from the terminal: -`db:init` applies the starter contract to Prisma Postgres and signs the database; `db:seed` inserts sample users: +```npm +npx create-db@latest +``` + +The command prints a connection string and a claim URL; open the claim URL within 24 hours to keep the database in your account. Export the connection string in the shell you work in, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database + +`db:init` applies the starter contract to Prisma Postgres and signs the database: ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: +Sample users are seeded automatically the first time the app queries the database, so there is no separate seed step. ## 3. Run it and query your data diff --git a/apps/docs/content/docs/(index)/v8/getting-started.mdx b/apps/docs/content/docs/(index)/v8/getting-started.mdx index 03a9292740..085e87e55b 100644 --- a/apps/docs/content/docs/(index)/v8/getting-started.mdx +++ b/apps/docs/content/docs/(index)/v8/getting-started.mdx @@ -20,10 +20,10 @@ npx create-prisma@next The whole journey in one sitting: scaffold, Prisma Postgres, first query, and a Prisma Compute deploy. }> - Create the app, pick Prisma Postgres (provisioned for you) or your own PostgreSQL, seed data, and run the first query. + Create the app, run it against a local Prisma Postgres from Composer or your own PostgreSQL, and run the first query. }> - Create the app, choose MongoDB, start or connect to MongoDB, seed data, and run the first query. + Create the app, connect a MongoDB replica set, apply the first migration, and run the first query. @@ -34,10 +34,11 @@ Create a new [framework] application with Prisma 8, seed it, and run it locally. If I have not told you which framework, stop and ask before scaffolding. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia. -1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --prisma-postgres --yes`. The `--prisma-postgres` flag provisions a Prisma Postgres database. If I give you a connection string, pass `--database-url ""` instead of `--prisma-postgres`. -2. From the project directory, apply the starter contract and seed: `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun. -3. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. -4. Update the seed script and the app routes to query the new schema, start `npm run dev` in the background, and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. +1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --yes`. +2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell; the generated scripts read the environment variable, not `.env`. +3. From the project directory, apply the starter contract: `npm run db:init`. Sample users are seeded automatically on the app's first query; there is no separate seed script. +4. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. +5. Update the seed script under `src/prisma/` and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. Use the installed Prisma 8 skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version). ``` diff --git a/apps/docs/content/docs/(index)/v8/index.mdx b/apps/docs/content/docs/(index)/v8/index.mdx index aa457c63e8..09b2258574 100644 --- a/apps/docs/content/docs/(index)/v8/index.mdx +++ b/apps/docs/content/docs/(index)/v8/index.mdx @@ -46,11 +46,12 @@ Create a new [framework] application with Prisma 8, seed it, and run it locally. If I have not told you which framework, stop and ask before scaffolding. Valid --template values: next, hono, nuxt, astro, nest, svelte, tanstack-start, elysia. -1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --prisma-postgres --yes`. The `--prisma-postgres` flag provisions a Prisma Postgres database. If I give you a connection string, pass `--database-url ""` instead of `--prisma-postgres`. -2. From the project directory, apply the starter contract and seed: `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and any route files that query `db.orm`, then rerun. -3. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. -4. Update the seed script and the app routes to query the new schema, start `npm run dev` in the background, and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. -5. Deploy with Prisma Compute. First apply the framework's deploy requirement from the guide at https://www.prisma.io/docs/guides/v8/frameworks/[guide].md, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`. The requirements: Next.js needs `output: "standalone"` in `next.config.ts` (without it the deployed app returns 504s), TanStack Start needs the nitro build plugin, Astro needs the `@astrojs/node` adapter plus `--env HOST=0.0.0.0`, and Elysia needs `--framework bun --entry src/index.ts` on the deploy command. If the template is `svelte`, skip this step; Compute does not support SvelteKit yet. Check `npx @prisma/cli@latest auth whoami`. If I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`, because that step opens a browser. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` so DATABASE_URL reaches the deployment, and verify the deployed URL with curl. +1. Scaffold the app: `npx create-prisma@next create my-app --template [framework] --provider postgres --yes`. +2. Get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `.env` in the project directory; the generated scripts read the environment variable, and the deploy step reads `.env`. +3. From the project directory, apply the starter contract: `npm run db:init`. Sample users are seeded automatically on the app's first query; there is no separate seed script. +4. Edit the starter contract under `src/prisma/` into a small schema for my use case, then run `npm run contract:emit` and plan and apply the migration: `npx prisma@next migration plan`, then `npx prisma@next migrate --yes`. Migration planning diffs the emitted contract, so the emit step is required. +5. Update the seed script under `src/prisma/` and the app routes to query the new schema, start `npm run dev` in the background (with `DATABASE_URL` exported), and verify with a request against the running app. For the `nest` template, if routes return 500s with `reading 'findAll'` in the logs, add explicit `@Inject()` tokens as shown in https://www.prisma.io/docs/guides/v8/frameworks/nestjs.md. +6. Deploy with Prisma Compute. First apply the framework's deploy requirement from the guide at https://www.prisma.io/docs/guides/v8/frameworks/[guide].md, where [guide] is the template name except: template `next` → guide `nextjs`, `nest` → `nestjs`, `svelte` → `sveltekit`. The requirements: Next.js needs `output: "standalone"` in `next.config.ts` (without it the deployed app returns 504s), TanStack Start needs the nitro build plugin, Astro needs the `@astrojs/node` adapter plus `--env HOST=0.0.0.0`, and Elysia needs `--framework bun --entry src/index.ts` on the deploy command. If the template is `svelte`, skip this step; Compute does not support SvelteKit yet. Check `npx @prisma/cli@latest auth whoami`. If I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`, because that step opens a browser. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` so DATABASE_URL reaches the deployment, and verify the deployed URL with curl. Use the installed Prisma 8 skills and the current Prisma docs: https://www.prisma.io/docs/llms.txt (append `.md` to any docs URL for a markdown version). ``` diff --git a/apps/docs/content/docs/(index)/v8/prisma-postgres/from-the-cli.mdx b/apps/docs/content/docs/(index)/v8/prisma-postgres/from-the-cli.mdx index 8e73f10dea..98625674dd 100644 --- a/apps/docs/content/docs/(index)/v8/prisma-postgres/from-the-cli.mdx +++ b/apps/docs/content/docs/(index)/v8/prisma-postgres/from-the-cli.mdx @@ -15,26 +15,34 @@ Use the CLI when you want Prisma 8 and Prisma Postgres set up without leaving th npx create-prisma@next ``` -Choose PostgreSQL and Prisma Postgres when prompted. +Choose PostgreSQL when prompted. Setup adds `prisma-next.md`, installs project-level Prisma 8 skills for your coding agent, and writes the generated scripts used below. -Setup provisions Prisma Postgres, writes `DATABASE_URL`, adds `prisma-next.md`, installs project-level Prisma 8 skills for your coding agent, and writes the generated scripts used below. +## Create the database -## Initialize the database - -From the generated project directory, run: +Create a Prisma Postgres database from the terminal and export its connection string. The generated scripts read the environment variable, not `.env`: ```npm -npm run db:init +npx create-db@latest +``` + +```bash +export DATABASE_URL="" ``` -## Seed data +The command also prints a claim URL; open it within 24 hours to keep the database in your account. + +## Initialize the database + +From the generated project directory, run: ```npm -npm run db:seed +npm run db:init ``` ## Run the app +Sample users are seeded automatically on the app's first query. + ```npm npm run dev ``` diff --git a/apps/docs/content/docs/(index)/v8/quickstart/mongodb.mdx b/apps/docs/content/docs/(index)/v8/quickstart/mongodb.mdx index d7448bbbda..99bda871e7 100644 --- a/apps/docs/content/docs/(index)/v8/quickstart/mongodb.mdx +++ b/apps/docs/content/docs/(index)/v8/quickstart/mongodb.mdx @@ -3,10 +3,10 @@ title: MongoDB description: Create a new Prisma 8 project with MongoDB using create-prisma@next. url: /v8/quickstart/mongodb metaTitle: 'Quickstart: Prisma 8 with MongoDB' -metaDescription: Scaffold a Prisma 8 project with MongoDB, apply the starter migration, seed data, and run your first query. +metaDescription: Scaffold a Prisma 8 project with MongoDB, apply the starter migration, and run your first query. --- -Create a Prisma 8 app with MongoDB, seed it, and run your first query. +Create a Prisma 8 app with MongoDB, apply the first migration, and run your first query against seeded data. :::note[The Prisma 8 Release Candidate is available] @@ -22,33 +22,30 @@ If you want to stay on the current generally available version of Prisma ORM, yo npx create-prisma@next --provider mongodb ``` -Run this from a Node.js 24 or newer environment. The command preselects MongoDB. The generated local setup gives you a MongoDB replica set through `db:up`; if you use MongoDB Atlas or another existing deployment, set `DATABASE_URL` and skip `db:up`. +Run this from a Node.js 24 or newer environment. The command preselects MongoDB and prompts you for the contract authoring style (PSL or TypeScript) and your package manager. -Setup gives you the app template, a starter contract, `prisma-next.md`, project-level Prisma 8 skills for your coding agent, and package scripts for the database steps below. +Setup gives you the app template, a starter contract, `prisma-next.md`, project-level Prisma 8 skills for your coding agent, and package scripts for the database steps below. Sample users are seeded automatically the first time the app queries the database, so there is no separate seed step. -For local development, use a replica set. MongoDB Atlas already provides one, and the generated `db:up` script starts one for you. +Prisma 8 needs a MongoDB replica set. MongoDB Atlas already gives you one; for local development, run a single-node replica set named `rs0` on port 27017 to match the generated connection string. -## 1. Check the database connection +## 1. Set the database connection -Open `.env` and confirm that `DATABASE_URL` points to the MongoDB deployment you want Prisma 8 to use. +The scaffold writes a `.env` with a local replica-set connection string: ```text title=".env" -DATABASE_URL="mongodb://127.0.0.1:27017/app?replicaSet=rs0" +DATABASE_URL="mongodb://localhost:27017/mydb?replicaSet=rs0&directConnection=true" ``` -If you use MongoDB Atlas, replace this with the connection string from your Atlas cluster. +The generated scripts read environment variables directly rather than `.env`, and the CLI and the app use different variable names: the CLI commands read `MONGODB_URL`, and the app reads `DATABASE_URL`. Export both in the shell you work in: -## 2. Start MongoDB - -From the generated project directory, run `db:up` to start the local replica set. - -```npm -npm run db:up +```bash +export MONGODB_URL="mongodb://localhost:27017/mydb?replicaSet=rs0&directConnection=true" +export DATABASE_URL="$MONGODB_URL" ``` -Skip this command when you use MongoDB Atlas or another existing deployment. +If you use MongoDB Atlas, use the connection string from your Atlas cluster instead. -## 3. Create the migration plan +## 2. Create the migration plan Create the first migration plan from the starter contract. @@ -56,7 +53,9 @@ Create the first migration plan from the starter contract. npm run migration:plan -- --name init ``` -## 4. Apply the migration +The output reports the planned operations: creating the `users` and `posts` collections and a unique index on `users.email`. + +## 3. Apply the migration Apply the planned migration to MongoDB. @@ -64,15 +63,9 @@ Apply the planned migration to MongoDB. npm run migrate ``` -## 5. Seed data - -`db:seed` inserts sample users so the first query has data to show. - -```npm -npm run db:seed -``` +The output ends with a summary like `Applied 1 migration(s) (3 operation(s)) across 1 contract space(s)`. If it fails with a connection error, confirm your MongoDB deployment is a replica set and `MONGODB_URL` is exported in this shell. -## 6. Run the app +## 4. Run the app Start the app and confirm the sample query runs successfully. diff --git a/apps/docs/content/docs/(index)/v8/quickstart/postgresql.mdx b/apps/docs/content/docs/(index)/v8/quickstart/postgresql.mdx index 6bc5c847bc..be44d1c406 100644 --- a/apps/docs/content/docs/(index)/v8/quickstart/postgresql.mdx +++ b/apps/docs/content/docs/(index)/v8/quickstart/postgresql.mdx @@ -3,10 +3,10 @@ title: PostgreSQL description: Create a new Prisma 8 project with PostgreSQL using create-prisma@next. url: /v8/quickstart/postgresql metaTitle: 'Quickstart: Prisma 8 with PostgreSQL' -metaDescription: Scaffold a Prisma 8 project with PostgreSQL, initialize the database, seed data, and run your first query. +metaDescription: Scaffold a Prisma 8 project with PostgreSQL, initialize the database, and run your first query. --- -Create a Prisma 8 app with PostgreSQL, seed it, and run your first query. +Create a Prisma 8 app with PostgreSQL and run your first query against seeded data. :::note[The Prisma 8 Release Candidate is available] @@ -22,45 +22,45 @@ If you want to stay on the current generally available version of Prisma ORM, yo npx create-prisma@next --provider postgres ``` -Run this from a Node.js 24 or newer environment. The command preselects PostgreSQL, so you can focus on the template and database URL prompts. Pick Prisma Postgres if you want setup to create the database for you, or paste your own `DATABASE_URL`. +Run this from a Node.js 24 or newer environment. The command preselects PostgreSQL and prompts you for the contract authoring style (PSL or TypeScript) and your package manager. -Setup gives you the app template, a starter contract, `prisma-next.md`, project-level Prisma 8 skills for your coding agent, and package scripts for the database steps below. +Setup gives you the app template, a starter contract, `prisma-next.md`, project-level Prisma 8 skills for your coding agent, and package scripts for the database steps below. Sample users are seeded automatically the first time the app queries the database, so there is no separate seed step. -If you use your own database, keep the connection string ready before you start. +From here you have two paths: let [Prisma Composer](/composer) run a local Prisma Postgres database for you, or connect a PostgreSQL database you provide. -## 1. Check the database connection +## Path A: Run with a local database -Open `.env` and confirm that `DATABASE_URL` points to the PostgreSQL database you want Prisma 8 to use. +Composer builds the app, starts a local Prisma Postgres database, and applies the starter contract for you. No connection string needed. -```text title=".env" -DATABASE_URL="postgresql://username:password@host:5432/database?sslmode=require" +```npm +npm run dev:composer ``` -If you chose Prisma Postgres during setup, this value is already written for you. If you pasted your own connection string, keep it in `.env` and do not hardcode it in application code. - -## 2. Initialize the database +Open the URL the command prints. You should see the seeded users returned from PostgreSQL. -From the generated project directory, run `db:init` to apply the starter schema to PostgreSQL and sign the database. +## Path B: Connect your own database -```npm -npm run db:init -``` +### 1. Set the database connection -:::warning[Known issue in the current RC scaffold] +Export `DATABASE_URL` in the shell you run the commands from. The generated scripts read the variable from the environment, not from `.env`. -The current `create-prisma@next` release scaffolds some imports under an outdated package name. If `db:init` (or the setup's own emit step) fails with `PN-CLI-4999: Failed to load config`, change `@prisma/orm-postgres/config` to `@prisma-next/postgres/config` in `prisma-next.config.ts` and `@prisma/orm-postgres` to `@prisma-next/postgres` in `src/prisma/db.ts`, then rerun. If a query later fails with `Cannot read properties of undefined`, address models through their schema namespace: `db.orm.public.User` instead of `db.orm.User`. +```bash +export DATABASE_URL="postgresql://username:password@host:5432/database?sslmode=require" +``` -::: +If you don't have a PostgreSQL database yet, `npx create-db@latest` creates a temporary Prisma Postgres database and prints its connection string, plus a claim URL if you want to keep it. -## 3. Seed data +### 2. Initialize the database -`db:seed` inserts sample users so the first query has data to show. +From the generated project directory, run `db:init` to apply the starter contract to PostgreSQL and sign the database. ```npm -npm run db:seed +npm run db:init ``` -## 4. Run the app +The output ends with a summary like `Applied 5 operation(s) across 1 space(s), database signed`. + +### 3. Run the app Start the app and confirm the sample query runs successfully. @@ -68,7 +68,7 @@ Start the app and confirm the sample query runs successfully. npm run dev ``` -Use the URL or terminal output shown by your template. You should see the seeded users returned from PostgreSQL. +Use the URL or terminal output shown by your template. You should see the seeded users returned from PostgreSQL. If the response is `Could not query users yet`, `DATABASE_URL` is not set in the environment the app runs in; export it in the same shell and restart. ## Next steps diff --git a/apps/docs/content/docs/composer/databases.mdx b/apps/docs/content/docs/composer/databases.mdx index df8e82e294..ccd86a9f02 100644 --- a/apps/docs/content/docs/composer/databases.mdx +++ b/apps/docs/content/docs/composer/databases.mdx @@ -71,11 +71,11 @@ You call `pnPostgres()` on both sides of the wiring, and what you pass it tells deps: { db: pnPostgres(catalogData) } ``` -Passing an options object declares the resource. The module that owns the database provisions it, naming the `prisma-next.config.ts` path (relative to the module file) so the deploy can find `migrations/`: +Passing an options object declares the resource. The module that owns the database provisions it, naming the `prisma.config.ts` path (relative to the module file) so the deploy can find `migrations/`: ```ts const db = provision( - pnPostgres({ name: 'database', contract: catalogData, config: './prisma-next.config.ts' }), + pnPostgres({ name: 'database', contract: catalogData, config: './prisma.config.ts' }), ); ``` diff --git a/apps/docs/content/docs/guides/v8/frameworks/astro.mdx b/apps/docs/content/docs/guides/v8/frameworks/astro.mdx index c7b10a3595..a380e5e773 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/astro.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/astro.mdx @@ -20,12 +20,12 @@ One command scaffolds the project with Prisma 8 wired in: npx create-prisma@next create my-astro-app --template astro --provider postgres ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. +Answer the prompts, then export `DATABASE_URL` in your shell before running the database scripts. Need a database? `npx create-db@latest` prints a Prisma Postgres connection string. ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -36,8 +36,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Astro app with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-astro-app --template astro --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-astro-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-astro-app --template astro --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-astro-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-astro-app`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, verify http://localhost:4321 lists the seeded users and `curl http://localhost:4321/api/users` returns them as JSON, then stop the dev server. 4. Prepare the deploy build: run `npm install @astrojs/node@^10`, then set `output: "server"` and `adapter: node({ mode: "standalone" })` in `astro.config.mjs`, following https://www.prisma.io/docs/guides/v8/frameworks/astro.md. 5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-astro-app --env .env --env HOST=0.0.0.0` (without HOST the live URL answers `Service not found`) and verify the live URL's /api/users endpoint with curl. @@ -54,27 +54,26 @@ npx create-prisma@next create my-astro-app --template astro --provider postgres cd my-astro-app ``` -The scaffold writes your connection string to `.env`, generates the Astro app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +The scaffold generates the Astro app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `astro` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: - -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first page something to show. +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/frameworks/elysia.mdx b/apps/docs/content/docs/guides/v8/frameworks/elysia.mdx index f571fca494..3f0188730f 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/elysia.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/elysia.mdx @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Verify `bun --version` first; if Bun is missing, stop and ask. Create a new Elysia API with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `bunx create-prisma@next create my-elysia-api --template elysia --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-elysia-api`, run `bun run db:init`, then `bun run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `bunx create-prisma@next create my-elysia-api --template elysia --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-elysia-api/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-elysia-api`, run `bun run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `bun run dev` in the background, wait until it reports ready, verify `curl http://localhost:3000/users` returns the seeded users, then stop the dev server. 4. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-elysia-api --env .env --framework bun --entry src/index.ts` and verify the live URL's /users endpoint. @@ -44,28 +44,27 @@ bunx create-prisma@next create my-elysia-api --template elysia --provider postgr Pick your database at the prompt. The template generates an Elysia server in `src/index.ts` with `GET /` and `GET /users` routes, the Prisma 8 setup in `src/prisma/`, and package scripts for the database steps. +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + ```bash cd my-elysia-api ``` -## 2. Initialize and seed the database +## 2. Initialize the database ```bash bun run db:init -bun run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `elysia` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: - ## 3. Run the server ```bash diff --git a/apps/docs/content/docs/guides/v8/frameworks/hono.mdx b/apps/docs/content/docs/guides/v8/frameworks/hono.mdx index a4be233722..37acb887d0 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/hono.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/hono.mdx @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Hono API with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-hono-api --template hono --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-hono-api`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-hono-api --template hono --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-hono-api/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-hono-api`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, verify `curl http://localhost:3000/users` returns the seeded users, then stop the dev server. 4. Add a POST /users route that creates a user from the request body, following https://www.prisma.io/docs/guides/v8/frameworks/hono.md, restart the dev server, and verify it with curl. 5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-hono-api --env .env` and verify the live URL's /users endpoint. @@ -43,30 +43,29 @@ Use the installed Prisma 8 skills. bunx create-prisma@next create my-hono-api --template hono --provider postgres ``` -Pick your package manager and database at the prompts. The template generates a Hono server in `src/index.ts` with two routes (`GET /` and `GET /users`), the Prisma 8 setup in `src/prisma/`, and package scripts for the database steps. +Pick your contract authoring style and package manager at the prompts. The template generates a Hono server in `src/index.ts` with two routes (`GET /` and `GET /users`), the Prisma 8 setup in `src/prisma/`, and package scripts for the database steps. ```bash cd my-hono-api ``` -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```bash bun run db:init -bun run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `hono` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: - ## 3. Run the server ```bash diff --git a/apps/docs/content/docs/guides/v8/frameworks/nestjs.mdx b/apps/docs/content/docs/guides/v8/frameworks/nestjs.mdx index b9df8440ac..6fa45fd403 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/nestjs.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/nestjs.mdx @@ -3,7 +3,7 @@ title: NestJS description: Set up Prisma 8 in a NestJS app with create-prisma, from scaffold to seeded API to a live deploy on Prisma Compute. url: /guides/v8/frameworks/nestjs metaTitle: How to use Prisma 8 with NestJS -metaDescription: Scaffold a NestJS API with Prisma 8 and Prisma Postgres, initialize and seed the database, query it over HTTP, and deploy to Prisma Compute. +metaDescription: Scaffold a NestJS API with Prisma 8 and Prisma Postgres, initialize the database, query it over HTTP, and deploy to Prisma Compute. --- ## Introduction @@ -15,7 +15,7 @@ Every command below was run end to end against a live [Prisma Postgres](/postgre ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new NestJS API with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-nest-api --template nest --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-nest-api`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-nest-api --template nest --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-nest-api/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-nest-api`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, and verify `curl http://localhost:3000/users` returns the seeded users; stop the dev server once verified. If it returns a 500 and the server logs `Cannot read properties of undefined (reading 'findAll')`, add explicit injection tokens: `@Inject(UsersService)` on the constructor parameter in `src/users.controller.ts` and `@Inject(PrismaService)` in `src/users.service.ts` (import `Inject` from `@nestjs/common`), then retry. 4. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-nest-api --env .env` and verify the live URL's /users endpoint. @@ -43,27 +43,26 @@ npx create-prisma@next create my-nest-api --template nest --provider postgres cd my-nest-api ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. The scaffold writes your connection string to `.env`, generates the NestJS app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +Answer the prompts for contract authoring style and package manager. The scaffold generates the NestJS app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first request something to return. - -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `nest` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/frameworks/nextjs.mdx b/apps/docs/content/docs/guides/v8/frameworks/nextjs.mdx index 8f57544f19..42a0f9cf4c 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/nextjs.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/nextjs.mdx @@ -3,7 +3,7 @@ title: Next.js description: Set up Prisma 8 in a Next.js app with create-prisma, from scaffold to rendered data, and deploy it to Prisma Compute. url: /guides/v8/frameworks/nextjs metaTitle: How to use Prisma 8 with Next.js -metaDescription: Scaffold a Next.js app with Prisma 8 and Prisma Postgres, initialize and seed the database, render your data, and deploy to Prisma Compute. +metaDescription: Scaffold a Next.js app with Prisma 8 and Prisma Postgres, initialize the database, render your data, and deploy to Prisma Compute. --- ## Introduction @@ -15,7 +15,7 @@ Every command below was run end to end against a live [Prisma Postgres](/postgre ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Next.js app with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-app --template next --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-app --template next --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-app`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, verify http://localhost:3000 renders the seeded users, then stop the dev server. 4. Set `output: "standalone"` in `next.config.ts`; Prisma Compute deploys the standalone server that `next build` emits. 5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL renders the seeded users. @@ -44,27 +44,26 @@ npx create-prisma@next create my-app --template next --provider postgres cd my-app ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. The scaffold writes your connection string to `.env`, generates the Next.js app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +Answer the prompts for contract authoring style and package manager. The scaffold generates the Next.js app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first page something to show. - -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `next` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/frameworks/nuxt.mdx b/apps/docs/content/docs/guides/v8/frameworks/nuxt.mdx index 834a2d220f..8d3843cabd 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/nuxt.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/nuxt.mdx @@ -3,7 +3,7 @@ title: Nuxt description: Set up Prisma 8 in a Nuxt app with create-prisma, from scaffold to rendered data, and deploy it to Prisma Compute. url: /guides/v8/frameworks/nuxt metaTitle: How to use Prisma 8 with Nuxt -metaDescription: Scaffold a Nuxt app with Prisma 8 and Prisma Postgres, initialize and seed the database, render your data, and deploy to Prisma Compute. +metaDescription: Scaffold a Nuxt app with Prisma 8 and Prisma Postgres, initialize the database, render your data, and deploy to Prisma Compute. --- ## Introduction @@ -20,12 +20,12 @@ One command scaffolds the project with Prisma 8 wired in: npx create-prisma@next create my-app --template nuxt --provider postgres ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. +Answer the prompts, then export `DATABASE_URL` in your shell before running the database scripts. Need a database? `npx create-db@latest` prints a Prisma Postgres connection string. ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -36,8 +36,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Nuxt app with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-app --template nuxt --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-app --template nuxt --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-app`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, verify that http://localhost:3000 lists the seeded users and `curl http://localhost:3000/api/users` returns them, then stop the dev server. 4. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL's /api/users endpoint. @@ -53,27 +53,26 @@ npx create-prisma@next create my-app --template nuxt --provider postgres cd my-app ``` -The scaffold writes your connection string to `.env`, generates the Nuxt app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +The scaffold generates the Nuxt app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first page something to show. - -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `nuxt` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/frameworks/sveltekit.mdx b/apps/docs/content/docs/guides/v8/frameworks/sveltekit.mdx index 42bf1d565a..83a4130010 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/sveltekit.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/sveltekit.mdx @@ -20,12 +20,12 @@ One command scaffolds the project with Prisma 8 wired in: npx create-prisma@next create my-app --template svelte --provider postgres ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. +Answer the prompts, then export `DATABASE_URL` in your shell before running the database scripts. Need a database? `npx create-db@latest` prints a Prisma Postgres connection string. ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -36,8 +36,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new SvelteKit app with Prisma 8, seed it, and verify the page renders. -1. Scaffold: `npx create-prisma@next create my-app --template svelte --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-app --template svelte --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-app`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Do not deploy to Prisma Compute; it does not support SvelteKit yet. Start `npm run dev` in the background, wait until it reports ready, verify http://localhost:5173 lists the three seeded users, then stop the dev server, following https://www.prisma.io/docs/guides/v8/frameworks/sveltekit.md. Use the installed Prisma 8 skills. @@ -52,27 +52,26 @@ npx create-prisma@next create my-app --template svelte --provider postgres cd my-app ``` -The scaffold writes your connection string to `.env`, generates the SvelteKit app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +The scaffold generates the SvelteKit app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `svelte` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. - -::: - -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first page something to show. +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/frameworks/tanstack-start.mdx b/apps/docs/content/docs/guides/v8/frameworks/tanstack-start.mdx index 13bd0551fa..e294d69168 100644 --- a/apps/docs/content/docs/guides/v8/frameworks/tanstack-start.mdx +++ b/apps/docs/content/docs/guides/v8/frameworks/tanstack-start.mdx @@ -20,12 +20,12 @@ One command scaffolds the project with Prisma 8 wired in: npx create-prisma@next create my-app --template tanstack-start --provider postgres ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. +Answer the prompts, then export `DATABASE_URL` in your shell before running the database scripts. Need a database? `npx create-db@latest` prints a Prisma Postgres connection string. ## Prerequisites - [Node.js](https://nodejs.org) 24 or later -- A PostgreSQL connection string, or nothing at all: the scaffold can create the database for you +- A PostgreSQL connection string, or nothing at all: `npx create-db@latest` can create a Prisma Postgres database for you ## Use with your agent @@ -36,8 +36,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new TanStack Start app with Prisma 8, seed it, and deploy it to Prisma Compute. -1. Scaffold: `npx create-prisma@next create my-app --template tanstack-start --provider postgres --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-app`, run `npm run db:init`, then `npm run db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun. +1. Scaffold: `npx create-prisma@next create my-app --template tanstack-start --provider postgres --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `npx create-db@latest` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-app`, run `npm run db:init` with `DATABASE_URL` exported. Sample users are seeded automatically on the app's first query; there is no separate seed script. 3. Start `npm run dev` in the background, wait until it reports ready, verify http://localhost:3000 renders the three seeded users, then stop the dev server. 4. Prepare the deploy build: install `nitro` and enable the `nitro()` Vite plugin for builds only, following https://www.prisma.io/docs/guides/v8/frameworks/tanstack-start.md. 5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-app --env .env` and verify the live URL renders the seeded users. @@ -54,27 +54,26 @@ npx create-prisma@next create my-app --template tanstack-start --provider postgr cd my-app ``` -The scaffold writes your connection string to `.env`, generates the TanStack Start app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. +The scaffold generates the TanStack Start app with Prisma 8 wired in, installs dependencies, and emits the contract your queries are type-checked against. -## 2. Initialize and seed the database +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `npx create-db@latest`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + +## 2. Initialize the database ```npm npm run db:init -npm run db:seed ``` ```text no-copy "summary": "Applied 5 operation(s) across 1 space(s), database signed" -Seeded 3 users. ``` -`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it; the seed gives the first page something to show. - -:::note - -Seeing `Cannot read properties of undefined (reading 'where')`? The current `tanstack-start` template still generates the older unqualified query form. Update `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts` and `src/prisma/users.ts`, then rerun `db:seed`. The home page reads through `src/prisma/users.ts`, so until both files are updated it shows "Could not query users yet" instead of the user list. - -::: +`db:init` applies your schema (`src/prisma/contract.prisma`) to the database and signs it. Sample users are seeded automatically the first time the app queries the database. ## 3. Run and verify diff --git a/apps/docs/content/docs/guides/v8/runtimes/bun.mdx b/apps/docs/content/docs/guides/v8/runtimes/bun.mdx index 8fda4c30de..c066555b7b 100644 --- a/apps/docs/content/docs/guides/v8/runtimes/bun.mdx +++ b/apps/docs/content/docs/guides/v8/runtimes/bun.mdx @@ -15,7 +15,7 @@ Every command and code sample below was run end to end against a live Prisma Pos ## Prerequisites - [Bun](https://bun.sh/) 1.1 or later (`bun --version`) -- A PostgreSQL connection string, or nothing at all: the scaffold can create a [Prisma Postgres](/postgres) database for you +- A PostgreSQL connection string, or nothing at all: `bunx create-db` can create a [Prisma Postgres](/postgres) database for you ## Use with your agent @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Bun app with Prisma 8, run a first typed query, and deploy it to Prisma Compute. -1. Scaffold: `bunx create-prisma@next create my-bun-app --template minimal --provider postgres --package-manager bun --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-bun-app`, run `bun run contract:emit`, then `bun run db:init`. If any script fails with `undefined is not an object (evaluating 'db.orm.User.where')`, change `db.orm.User` to `db.orm.public.User` in `src/index.ts`, `src/prisma/seed.ts`, and `src/prisma/users.ts`, then rerun. +1. Scaffold: `bunx create-prisma@next create my-bun-app --template minimal --provider postgres --package-manager bun --yes`. Then get a database connection string: use the one I give you, or create a Prisma Postgres database with `bunx create-db` and show me the claim URL it prints. Export it as `DATABASE_URL` in the shell and write it to `my-bun-app/.env` for the deploy step; the generated scripts read the environment variable, not `.env`. +2. In `my-bun-app`, run `bun run contract:emit`, then `bun run db:init`, with `DATABASE_URL` exported. 3. Replace `src/index.ts` with a script that creates a user and reads all users back via `db.orm.public.User`, following https://www.prisma.io/docs/guides/v8/runtimes/bun.md, and verify `bun run dev` prints the created user. 4. Add `src/server.ts` with a `Bun.serve` server exposing GET /users, and verify `curl http://localhost:3000/users` returns the users. 5. Deploy: check `npx @prisma/cli@latest auth whoami`; if I am not signed in, stop and ask me to run `npx @prisma/cli@latest auth login`. Then run `npx @prisma/cli@latest app deploy --create-project my-bun-app --env .env --framework bun --entry src/server.ts` and verify the live URL's /users endpoint. @@ -45,12 +45,19 @@ Create the project with `create-prisma`. Pick Bun as the package manager when pr bunx create-prisma@next create my-bun-app --template minimal --provider postgres --package-manager bun ``` -When the prompt asks about the database, pick Prisma Postgres to have one created for you, or paste your own `DATABASE_URL`. The scaffold writes the connection string to `.env`, sets up `src/prisma/` with a starter schema, and installs dependencies with Bun. +Answer the prompts for contract authoring style. The scaffold sets up `src/prisma/` with a starter schema and installs dependencies with Bun. ```bash cd my-bun-app ``` +Next, set the database connection. Use your own PostgreSQL connection string, or create a Prisma Postgres database with `bunx create-db`; it prints a connection string and a claim URL you can open to keep the database. Export the variable, and write it to `.env` for the deploy step later. The generated scripts read the environment variable, not `.env`: + +```bash +export DATABASE_URL="" +echo "DATABASE_URL=\"$DATABASE_URL\"" > .env +``` + ## 2. Emit the contract and initialize the database Prisma 8 compiles your schema (`src/prisma/contract.prisma`) into a contract that your queries are type-checked against. Emit it, then apply the schema to the database: @@ -72,12 +79,6 @@ If `db:init` reports that the contract file is missing, run `bun run contract:em Replace `src/index.ts` with a script that creates a user and reads every user back. Model access is namespace-qualified on PostgreSQL: `db.orm.public.User`, where `public` is the default schema. -:::note - -The scaffolded `src/index.ts`, `src/prisma/seed.ts`, and `src/prisma/users.ts` still use the older unqualified form `db.orm.User`, which fails under Bun with `TypeError: undefined is not an object (evaluating 'db.orm.User.where')`. Replacing `src/index.ts` below fixes the script you run here; if you also want `bun run db:seed`, update `db.orm.User` to `db.orm.public.User` in the other two files first. - -::: - ```ts title="src/index.ts" import { db } from "./prisma/db"; diff --git a/apps/docs/content/docs/guides/v8/runtimes/deno.mdx b/apps/docs/content/docs/guides/v8/runtimes/deno.mdx index 3b3d3ac030..d0c8ffc5fa 100644 --- a/apps/docs/content/docs/guides/v8/runtimes/deno.mdx +++ b/apps/docs/content/docs/guides/v8/runtimes/deno.mdx @@ -15,7 +15,7 @@ Every command and code sample below was run end to end against a live Prisma Pos ## Prerequisites - [Deno](https://deno.com/) 2.0 or later (`deno --version`) -- A PostgreSQL connection string, or nothing at all: the scaffold can create a [Prisma Postgres](/postgres) database for you +- A PostgreSQL connection string, or nothing at all: the scaffold provisions a temporary [Prisma Postgres](/postgres) database for you ## Use with your agent @@ -26,8 +26,8 @@ Prefer to delegate this guide? Copy the prompt and hand it to your coding agent: ```text Create a new Prisma 8 project on Deno, seed it, and run a first typed query. -1. Scaffold: `deno run -A npm:create-prisma@next create my-deno-app --template minimal --provider postgres --package-manager deno --prisma-postgres --yes` (or pass `--database-url ""` instead of `--prisma-postgres` if I give you a connection string). -2. In `my-deno-app`, run `deno install`, then `deno run -A --env-file=.env npm:prisma@next contract emit` and `deno run -A --env-file=.env npm:prisma@next db init`. +1. Scaffold: `deno run -A npm:create-prisma@next create my-deno-app --template minimal --provider postgres --package-manager deno --yes`. The scaffold provisions a temporary Prisma Postgres database and writes `DATABASE_URL` and a `CLAIM_URL` to `.env`; show me the claim URL so I can keep the database. If I give you a connection string, put it in `.env` as `DATABASE_URL` instead. +2. In `my-deno-app`, run `deno install`, then `deno task contract:emit` and `deno task db:init`. Do not call `npm:prisma@next` directly; the unified CLI does not load under Deno yet, and the generated tasks use the working `npm:prisma-next` entry point. 3. Run `deno task db:seed`. If seeding fails with `Cannot read properties of undefined (reading 'where')`, change `db.orm.User` to `db.orm.public.User` in `src/prisma/seed.ts`, `src/prisma/users.ts`, and `src/index.ts`, then rerun. 4. Replace `src/index.ts` with a script that creates a user and reads all users back, following https://www.prisma.io/docs/guides/v8/runtimes/deno.md. Keep the `.ts` extension on relative imports. Verify `deno task dev` prints the created user and the user count. 5. Do not deploy to Prisma Compute; it does not support Deno yet. @@ -45,7 +45,7 @@ Use the installed Prisma 8 skills. deno run -A npm:create-prisma@next create my-deno-app --template minimal --provider postgres --package-manager deno ``` -Pick Prisma Postgres at the database prompt to have a database created for you, or paste your own `DATABASE_URL`. The generated `package.json` scripts wrap every command in `deno run -A --env-file=.env`, so environment variables load without a dotenv import. +By default the scaffold provisions a temporary Prisma Postgres database and writes `DATABASE_URL` and a `CLAIM_URL` to `.env`; open the claim URL within 24 hours to keep the database in your account, or replace `DATABASE_URL` with your own connection string. The generated `package.json` scripts wrap every command in `deno run -A --env-file=.env`, so environment variables load without a dotenv import. ```bash cd my-deno-app @@ -54,9 +54,11 @@ deno install ## 2. Emit the contract and initialize the database +Use the generated tasks. They call the `npm:prisma-next` entry point; the unified `npm:prisma@next` CLI does not load under Deno yet, and fails with `ERR_MODULE_NOT_FOUND`. + ```bash -deno run -A --env-file=.env npm:prisma@next contract emit -deno run -A --env-file=.env npm:prisma@next db init +deno task contract:emit +deno task db:init ``` The first command compiles `src/prisma/contract.prisma` into the contract your queries are type-checked against and prints a JSON summary with `"ok": true` and the emitted file paths. The second creates the tables and signs the database. It exits quietly on success. diff --git a/apps/docs/content/docs/guides/v8/upgrade-prisma-orm/meta.json b/apps/docs/content/docs/guides/v8/upgrade-prisma-orm/meta.json index 4290efa555..8b696b5d45 100644 --- a/apps/docs/content/docs/guides/v8/upgrade-prisma-orm/meta.json +++ b/apps/docs/content/docs/guides/v8/upgrade-prisma-orm/meta.json @@ -1,7 +1,4 @@ { "title": "Upgrade Prisma ORM", - "pages": [ - "postgresql", - "mongodb" - ] + "pages": ["postgresql", "mongodb"] } diff --git a/apps/docs/content/docs/orm/v8/extensions/using-extensions.mdx b/apps/docs/content/docs/orm/v8/extensions/using-extensions.mdx index 3c1549d3b0..dccb77aa7f 100644 --- a/apps/docs/content/docs/orm/v8/extensions/using-extensions.mdx +++ b/apps/docs/content/docs/orm/v8/extensions/using-extensions.mdx @@ -116,7 +116,7 @@ You can build an extension that does not exist yet. The catalog is first-party t All target PostgreSQL. ParadeDB and Supabase are experimental (ParadeDB supports the `key_field` index option only so far). The rest are part of the Release Candidate. Extension names link to each package's README on GitHub. -For a working project per extension, see the runnable examples: [pgvector](https://github.com/prisma/prisma-next/tree/main/examples/prisma-next-demo), [PostGIS](https://github.com/prisma/prisma-next/tree/main/examples/prisma-next-postgis-demo), [ParadeDB](https://github.com/prisma/prisma-next/tree/main/examples/paradedb-demo), and [Supabase](https://github.com/prisma/prisma-next/tree/main/examples/supabase). +For a working project per extension, see the runnable examples: [pgvector](https://github.com/prisma/prisma/tree/main/examples/prisma-8-demo), [PostGIS](https://github.com/prisma/prisma/tree/main/examples/prisma-8-postgis-demo), [ParadeDB](https://github.com/prisma/prisma/tree/main/examples/paradedb-demo), and [Supabase](https://github.com/prisma/prisma/tree/main/examples/supabase). ## See also diff --git a/apps/docs/content/docs/orm/v8/migrations/editing-a-migration.mdx b/apps/docs/content/docs/orm/v8/migrations/editing-a-migration.mdx index f2aadf4850..7ebec6bdc8 100644 --- a/apps/docs/content/docs/orm/v8/migrations/editing-a-migration.mdx +++ b/apps/docs/content/docs/orm/v8/migrations/editing-a-migration.mdx @@ -195,7 +195,7 @@ override get operations() { } ``` -The full working migration, including the two query-plan helpers, is in the Prisma 8 repo's [retail-store example](https://github.com/prisma/prisma-next/blob/main/examples/retail-store/migrations/app/20260513T0508_backfill_product_status/migration.ts). +The full working migration, including the two query-plan helpers, is in the Prisma 8 repo's [retail-store example](https://github.com/prisma/prisma/blob/main/examples/retail-store/migrations/app/20260513T0508_backfill_product_status/migration.ts). ## Starting from a blank migration diff --git a/apps/docs/content/docs/orm/v8/migrations/the-migration-graph.mdx b/apps/docs/content/docs/orm/v8/migrations/the-migration-graph.mdx index 892a956f2a..75bf90e4d8 100644 --- a/apps/docs/content/docs/orm/v8/migrations/the-migration-graph.mdx +++ b/apps/docs/content/docs/orm/v8/migrations/the-migration-graph.mdx @@ -115,9 +115,9 @@ Four read-only commands, each answering a different question: The Prisma 8 repo ships example graphs (a diamond, a wide fan-out, converging branches, rollback chains) as ready-to-render fixtures: ```bash -git clone https://github.com/prisma/prisma-next -cd prisma-next && pnpm install && pnpm -w build && pnpm install -cd examples/prisma-next-demo +git clone https://github.com/prisma/prisma +cd prisma && pnpm install && pnpm -w build && pnpm install +cd examples/prisma-8-demo npx prisma@next migration graph --config fixtures/showcase/prisma.config.ts --legend ``` diff --git a/apps/docs/content/docs/studio/prisma-next.mdx b/apps/docs/content/docs/studio/prisma-next.mdx index 26d82224ec..f479f81dcc 100644 --- a/apps/docs/content/docs/studio/prisma-next.mdx +++ b/apps/docs/content/docs/studio/prisma-next.mdx @@ -11,14 +11,14 @@ Prisma Studio shows the migration history of your [Prisma 8](/orm/v8) database a This guide takes you from an empty directory to inspecting your own migration history. For browsing, editing, and filtering data in general, see [Getting Started](/studio/getting-started). -The Migrations view requires `@prisma/studio-core` 0.32.0 or later, which currently ships in the Prisma CLI's `dev` release. Run Studio with `npx prisma@dev studio`. The Prisma 8 [Release Candidate](/orm/v8) is available. +The Migrations view requires `@prisma/studio-core` 0.32.0 or later, which ships in the stable Prisma CLI since 7.9. Run Studio with `npx prisma@latest studio`. The Prisma 8 [Release Candidate](/orm/v8) is available. ## Prerequisites - [Node.js](https://nodejs.org) installed - A Prisma 8 project on PostgreSQL -Create the project and provision a [Prisma Postgres](/postgres) database in one step: +Create the project: ```npm npm create prisma@next @@ -27,11 +27,22 @@ npm create prisma@next To skip the prompts: ```npm -npm create prisma@next -- my-app --yes --provider postgres --authoring psl \ - --template minimal --prisma-postgres --install --emit +npm create prisma@next -- my-app --yes --provider postgres --authoring psl --template minimal ``` -This writes your `DATABASE_URL` into `.env` and scaffolds a [data model](/orm/v8/data-modeling) at `src/prisma/contract.prisma`, authored in [PSL](/orm/v8/contract-authoring/psl-syntax). The database expires after 24 hours unless you claim it. Open the `CLAIM_URL` in `.env` to keep it and attach it to your Prisma Console account. +This scaffolds a [data model](/orm/v8/data-modeling) at `src/prisma/contract.prisma`, authored in [PSL](/orm/v8/contract-authoring/psl-syntax). + +Next, create a [Prisma Postgres](/postgres) database and export its connection string. The generated scripts and the CLI read the environment variable, not `.env`: + +```npm +npx create-db@latest +``` + +```bash +export DATABASE_URL="" +``` + +The database expires after 24 hours unless you claim it; `create-db` prints a claim URL to keep it and attach it to your Prisma Console account. ## Apply the first migration @@ -104,28 +115,23 @@ Without a `db` ref and without `--from`, `migration plan` compares against an em ## Seed the database -Migration history is easier to read next to real rows: +Migration history is easier to read next to real rows. The scaffold seeds sample users automatically the first time the app queries the database, so run the app once and hit its endpoint: ```npm -npm run db:seed +npm run dev ``` -The CLI confirms with `Seeded 3 users.` The seed script writes through the Prisma 8 ORM client. See [Writing data](/orm/v8/fundamentals/writing-data) for the API it uses. - -:::note[Namespaced ORM access] -`db.orm` is keyed by namespace first: reach models as `db.orm.public.User`, not `db.orm.User`. If the scaffolded `seed.ts` uses the shorter form, it fails with `TypeError: Cannot read properties of undefined (reading 'where')`. Add the namespace to fix it. -::: +Open the URL the command prints; the seeded users come back through the Prisma 8 ORM client. Then stop the dev server. See [Writing data](/orm/v8/fundamentals/writing-data) for the query API. ## Open Prisma Studio -A Prisma 8 project has no `schema.prisma`, so pass the [connection string](/postgres/database/connecting-to-your-database) with `--url`. Load it from `.env` first: +A Prisma 8 project has no `schema.prisma`, so pass the [connection string](/postgres/database/connecting-to-your-database) with `--url`. Run Studio from a directory outside the project: the Prisma 7 CLI that ships Studio cannot read the Prisma 8 `prisma.config.ts` and fails if it finds one: ```bash -set -a && . ./.env && set +a -npx prisma@dev studio --url "$DATABASE_URL" +cd .. && npx prisma@latest studio --url "$DATABASE_URL" ``` -Studio opens at `http://localhost:5555`. Once the database has at least one applied migration, a **Migrations** item appears in the left navigation. +Studio prints the local URL it serves on. Once the database has at least one applied migration, a **Migrations** item appears in the left navigation. :::note[History lives in your database] Studio reads migration history from the connected database, not from your local `migrations/` directory. Migrations applied from CI or another machine appear automatically. @@ -195,13 +201,13 @@ The hashes are the same ones that make Prisma 8 migrations [a graph rather than | Surface | Available | |---|---| -| Local Studio (`npx prisma@dev studio`) | Yes, with `@prisma/studio-core` 0.32.0 or later | +| Local Studio (`npx prisma@latest studio`) | Yes, with `@prisma/studio-core` 0.32.0 or later | | [Prisma Console](https://console.prisma.io) (embedded Studio) | Yes, for databases with an applied Prisma 8 migration history | | Prisma ORM projects using `prisma migrate` | No | In Prisma Console, open your database's Studio tab and select **Migrations**. The view is the same as local Studio, the selected migration is part of the Console URL, and no local setup is required. -The stable Prisma CLI (`prisma@latest`) currently bundles an older Studio without the Migrations view. Use `npx prisma@dev studio` until it lands in a stable release. +The stable Prisma CLI bundles the Migrations view since 7.9 (`@prisma/studio-core` 0.33.0). Run `npx prisma@latest studio` from a directory outside your Prisma 8 project; the Prisma 7 CLI cannot read the Prisma 8 `prisma.config.ts`. ## Limitations