@prisma/orm-mongo 8.0.0-rc.9-dev.5 → 8.0.0-rc.9-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/package.json +9 -9
  3. package/skills/prisma-8/SKILL.md +12 -12
  4. package/skills/prisma-8/references/build.md +6 -6
  5. package/skills/prisma-8/references/contract.md +11 -11
  6. package/skills/prisma-8/references/debug.md +4 -4
  7. package/skills/prisma-8/references/feedback.md +8 -8
  8. package/skills/prisma-8/references/migration-model.md +3 -3
  9. package/skills/prisma-8/references/migration-review.md +2 -2
  10. package/skills/prisma-8/references/migrations.md +10 -10
  11. package/skills/prisma-8/references/queries-mongo.md +4 -4
  12. package/skills/prisma-8/references/queries-postgres.md +5 -5
  13. package/skills/prisma-8/references/queries.md +7 -7
  14. package/skills/prisma-8/references/quickstart.md +20 -20
  15. package/skills/prisma-8/references/runtime.md +10 -10
  16. package/skills/prisma-8/references/supabase.md +6 -6
  17. package/skills/prisma-8/references/upgrade-app.md +4 -4
  18. package/skills/prisma-8/references/upgrade-extension.md +4 -4
  19. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/instructions.md +1 -1
  20. package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/instructions.md +6 -6
  21. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +2 -2
  22. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +1 -1
  23. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.6-to-8.0.0-rc.7/instructions.md +1 -1
  24. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.9-to-8.0.0-rc.10/instructions.md +1 -0
  25. package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +1 -1
  26. package/skills/prisma-8/upgrading/extension/upgrades/0.14-to-0.15/instructions.md +1 -1
  27. package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/instructions.md +4 -4
  28. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +1 -1
  29. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +1 -1
  30. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.6-to-8.0.0-rc.7/instructions.md +1 -1
  31. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.9-to-8.0.0-rc.10/instructions.md +1 -0
package/README.md CHANGED
@@ -15,7 +15,7 @@ The one package a MongoDB application installs. It wires the framework, the Mong
15
15
  └── @prisma/orm-toolchain ORM command family for the `prisma` CLI, emitter, config loader
16
16
  ```
17
17
 
18
- `mongodb` is a peer dependency: the driver is the application's, so a single connection pool and a single BSON implementation serve both Prisma Next and any direct `mongodb` use in the same process.
18
+ `mongodb` is a peer dependency: the driver is the application's, so a single connection pool and a single BSON implementation serve both Prisma 8 and any direct `mongodb` use in the same process.
19
19
 
20
20
  ## Entrypoints
21
21
 
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@prisma/orm-mongo",
3
- "version": "8.0.0-rc.9-dev.5",
3
+ "version": "8.0.0-rc.9-dev.6",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
- "description": "Prisma Next for MongoDB: the one package a MongoDB application installs",
7
+ "description": "Prisma 8 for MongoDB: the one package a MongoDB application installs",
8
8
  "files": [
9
9
  "dist",
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-mongo": "8.0.0-rc.9-dev.5",
14
- "@prisma/orm-framework": "8.0.0-rc.9-dev.5",
15
- "@prisma/orm-target-mongo": "8.0.0-rc.9-dev.5",
16
- "@prisma/orm-toolchain": "8.0.0-rc.9-dev.5",
13
+ "@prisma/orm-family-mongo": "8.0.0-rc.9-dev.6",
14
+ "@prisma/orm-framework": "8.0.0-rc.9-dev.6",
15
+ "@prisma/orm-target-mongo": "8.0.0-rc.9-dev.6",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.9-dev.6",
17
17
  "pathe": "^2.0.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@internal/mongo": "8.0.0-rc.9-dev.5",
21
- "@repo/tsconfig": "8.0.0-rc.9-dev.5",
22
- "@repo/tsdown": "8.0.0-rc.9-dev.5",
20
+ "@internal/mongo": "8.0.0-rc.9-dev.6",
21
+ "@repo/tsconfig": "8.0.0-rc.9-dev.6",
22
+ "@repo/tsdown": "8.0.0-rc.9-dev.6",
23
23
  "tsdown": "0.22.14",
24
24
  "typescript": "5.9.3"
25
25
  },
@@ -1,32 +1,32 @@
1
1
  ---
2
2
  name: prisma-8
3
3
  description: >-
4
- Comprehensive guide for building with Prisma 8 (Prisma Next), the
4
+ Comprehensive guide for building with Prisma 8 (Prisma 8), the
5
5
  contract-first data layer. Use whenever working on Prisma code in a project
6
6
  that uses it — authoring or editing the data contract (contract.prisma, PSL,
7
7
  TypeScript builders), migrations, queries (db.orm / db.sql), runtime wiring
8
8
  (db.ts, middleware, DATABASE_URL), build-tool integration, Supabase / RLS,
9
9
  reading PN-* structured errors, or filing feedback — and for orientation
10
- questions like "what is Prisma Next" or comparisons to other ORMs. Signals
10
+ questions like "what is Prisma 8" or comparisons to other ORMs. Signals
11
11
  that this skill applies: @internal/* imports, prisma.config.ts,
12
12
  contract.prisma / contract.json / contract.d.ts, the prisma-next CLI,
13
13
  PN-* error codes. Also covers upgrading Prisma in a project — "upgrade
14
- Prisma 8", "bump Prisma Next", "move to Prisma Next X.Y", or dealing
14
+ Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", or dealing
15
15
  with an @internal/* version bump, in a consumer app or in an extension
16
16
  package. Does not apply to Prisma ORM 7 or earlier
17
17
  (schema.prisma + @prisma/client projects).
18
18
  metadata:
19
19
  library: '@prisma/orm-mongo'
20
- library_version: '8.0.0-rc.9-dev.5'
20
+ library_version: '8.0.0-rc.9-dev.6'
21
21
  ---
22
22
 
23
- # Prisma Next (Prisma 8)
23
+ # Prisma 8 (Prisma 8)
24
24
 
25
25
  > **Edit your data contract. Prisma handles the rest.**
26
26
 
27
27
  Prisma 8 moves fast, and your training data about it is very likely outdated. This skill ships inside the installed Prisma packages, so it describes the exact version this project has — treat it and its reference files as the source of truth, over anything you remember about Prisma. The `metadata.library_version` in this file's frontmatter is the version it was published with; if it does not match the project's installed Prisma packages, run `prisma skills sync` and re-read.
28
28
 
29
- Prisma Next is a contract-first data layer. This skill routes every Prisma Next task to the right reference file — open the reference before writing code; do not answer from this file alone.
29
+ Prisma 8 is a contract-first data layer. This skill routes every Prisma 8 task to the right reference file — open the reference before writing code; do not answer from this file alone.
30
30
 
31
31
  ## The canonical model (one paragraph)
32
32
 
@@ -48,7 +48,7 @@ Open the reference whose triggers match the task. If more than one matches, open
48
48
 
49
49
  | Task | Reference | Triggers |
50
50
  | --- | --- | --- |
51
- | Adopt / set up / first steps | [`references/quickstart.md`](references/quickstart.md) | new project, existing database, "what can I do with Prisma Next", "where do I start", "just ran createprisma", `npx create-prisma`, first steps, first query, `prisma orm init` greenfield setup, `contract infer` + `db sign` brownfield adoption, connect-write-read first arc, day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `db migrate`, `db schema`, `db verify`), flags `--target` / `--authoring` / `--schema-path` / `--probe-db` / `--output` |
51
+ | Adopt / set up / first steps | [`references/quickstart.md`](references/quickstart.md) | new project, existing database, "what can I do with Prisma 8", "where do I start", "just ran createprisma", `npx create-prisma`, first steps, first query, `prisma orm init` greenfield setup, `contract infer` + `db sign` brownfield adoption, connect-write-read first arc, day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `db migrate`, `db schema`, `db verify`), flags `--target` / `--authoring` / `--schema-path` / `--probe-db` / `--output` |
52
52
  | Edit the data contract | [`references/contract.md`](references/contract.md) | schema, models, fields, attributes, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` / `@@base`), extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), `prisma.config.ts` / `defineConfig`, `prisma contract emit`, PSL, `contract.prisma`, `contract.ts`, `contract.json`, `contract.d.ts`, `@internal/postgres/config`, `@internal/postgres/contract-builder`, `@internal/mongo/config`, `extensions:`, pgvector, cipherstash, postgis, paradedb, `@@control`, control policy (managed / tolerated / external / observed), soft delete, validations, callbacks |
53
53
  | Author migrations | [`references/migrations.md`](references/migrations.md) | `db update` vs `migration plan`, `db migrate`, `migration new`, `migration show`, `db update --dry-run`, `db verify`, `db sign`, data migration, `dataTransform`, placeholder sentinels in framework-rendered `migration.ts`, `MIGRATION.HASH_MISMATCH`, PN-MIG-2001 unfilled placeholder, schema drift |
54
54
  | Migration graph, refs, plan origin | [`references/migration-model.md`](references/migration-model.md) | migration graph, refs, `migration ref set` / `list` / `delete`, the `db` ref, `--advance-ref`, `migration plan --from`, `from: (baseline)` in plan output, greenfield / from-scratch plan, baseline, first migration before deploy (Composer / CD-managed databases), chaining migrations, retrofitting migrations onto an existing database, `MIGRATION.HASH_NOT_IN_GRAPH`, `MIGRATION.PATH_UNREACHABLE` at plan/chain time |
@@ -58,7 +58,7 @@ Open the reference whose triggers match the task. If more than one matches, open
58
58
  | Build-tool integration | [`references/build.md`](references/build.md) | Vite plugin (`@internal/vite-plugin-contract-emit`, Vite 7/8), `vite.config.ts`, contract emit on save, HMR / dev server, Next.js / Webpack / esbuild / Rollup / Turbopack (named gaps, not fabricated) |
59
59
  | Supabase | [`references/supabase.md`](references/supabase.md) | `@internal/extension-supabase`, RLS, row level security, policies (`policy_select` / `policy_update` / `@@rls`, `auth.uid()`), role binding (`asUser(jwt)` / `asAnon()` / `asServiceRole()`), `auth.users`, cross-space FKs to `supabase:auth.AuthUser`, JWT / JWKS (`SUPABASE_JWKS_URL`, `SUPABASE_JWT_SECRET`), `SUPABASE.JWT_INVALID`, `SUPABASE.CONFIG_INVALID`, `RoleBoundDb`, session pooler |
60
60
  | Debug an error | [`references/debug.md`](references/debug.md) | any structured error envelope (code, domain, severity, why, fix, meta), emit failed, query won't typecheck, query crashed, migration won't apply, `MIGRATION.HASH_MISMATCH`, `BUDGET.ROWS_EXCEEDED`, `BUDGET.TIME_EXCEEDED`, `RUNTIME.ABORTED`, `PLAN.HASH_MISMATCH`, `CONTRACT.MARKER_MISSING`, PN-RUN-*/ PN-MIG-* / PN-CLI-*/ PN-SCHEMA-* codes, drift, capability missing, planner conflict, EXPLAIN, query log, script won't exit / close connection |
61
- | Upgrade Prisma in an app | [`references/upgrade-app.md`](references/upgrade-app.md) | "upgrade Prisma", "upgrade Prisma Next", "bump Prisma Next", "move to Prisma Next X.Y", `@internal/*` version bump in an application, per-transition upgrade instructions in [`upgrading/app/upgrades/`](upgrading/app/upgrades/), extension-pin pre-flight, `PN-UPGRADE-*` |
61
+ | Upgrade Prisma in an app | [`references/upgrade-app.md`](references/upgrade-app.md) | "upgrade Prisma", "upgrade Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", `@internal/*` version bump in an application, per-transition upgrade instructions in [`upgrading/app/upgrades/`](upgrading/app/upgrades/), extension-pin pre-flight, `PN-UPGRADE-*` |
62
62
  | Upgrade Prisma in an extension | [`references/upgrade-extension.md`](references/upgrade-extension.md) | the same request in a package that *is* a Prisma extension (`@internal/contract` / SPI dependency, `^@.*/extension-` name), `prisma-8-check-pins`, exact-pin rule, per-transition instructions in [`upgrading/extension/upgrades/`](upgrading/extension/upgrades/) |
63
63
  | File feedback / ask the team | [`references/feedback.md`](references/feedback.md) | bug report, file an issue, feature request, missing feature, capability gap, "this is broken", surprising behaviour, Q&A / design discussion, ask the Prisma team, Prisma Discord (pris.ly/discord), extension-author questions |
64
64
 
@@ -68,13 +68,13 @@ If the task clearly matches a row, open that reference directly without asking.
68
68
 
69
69
  For a vague prompt, ask **one** disambiguating question. Pick from:
70
70
 
71
- - *"Are you new to Prisma Next and asking what you can do with it, or where to start?"* → [`references/quickstart.md`](references/quickstart.md) (first-touch orientation path).
72
- - *"Do you want to set up a new Prisma Next project, or wire it into an existing database?"* → [`references/quickstart.md`](references/quickstart.md).
71
+ - *"Are you new to Prisma 8 and asking what you can do with it, or where to start?"* → [`references/quickstart.md`](references/quickstart.md) (first-touch orientation path).
72
+ - *"Do you want to set up a new Prisma 8 project, or wire it into an existing database?"* → [`references/quickstart.md`](references/quickstart.md).
73
73
  - *"Do you want to edit your data contract (add a model / field / relation), or work with the database (migrations, queries)?"* → [`references/contract.md`](references/contract.md) vs the others.
74
74
  - *"Is this about authoring a migration, or about reviewing what's going to run on deploy?"* → [`references/migrations.md`](references/migrations.md) vs [`references/migration-review.md`](references/migration-review.md). If it's about where a plan starts, refs, or an unexpected from-scratch plan → [`references/migration-model.md`](references/migration-model.md).
75
- - *"Is this about wiring Prisma Next into your build tool (Vite / Next.js / …), or about wiring `db.ts` and middleware at runtime?"* → [`references/build.md`](references/build.md) vs [`references/runtime.md`](references/runtime.md).
75
+ - *"Is this about wiring Prisma 8 into your build tool (Vite / Next.js / …), or about wiring `db.ts` and middleware at runtime?"* → [`references/build.md`](references/build.md) vs [`references/runtime.md`](references/runtime.md).
76
76
  - *"What error or symptom are you seeing?"* → [`references/debug.md`](references/debug.md).
77
- - *"Do you want to report this as a bug to the Prisma Next team, or is this a feature request?"* → [`references/feedback.md`](references/feedback.md).
77
+ - *"Do you want to report this as a bug to the Prisma 8 team, or is this a feature request?"* → [`references/feedback.md`](references/feedback.md).
78
78
  - *"Is the project you want to upgrade an application, or a Prisma extension package?"* → [`references/upgrade-app.md`](references/upgrade-app.md) vs [`references/upgrade-extension.md`](references/upgrade-extension.md).
79
79
 
80
80
  If you still can't tell which reference applies, ask the user what they want to do. Do not guess.
@@ -1,19 +1,19 @@
1
1
 
2
- # Prisma Next — Build-System Integration
2
+ # Prisma 8 — Build-System Integration
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- This skill covers Prisma Next's build-tool plugins — the dev-server / build-system integrations that re-emit contract artifacts automatically as the user edits the contract source. Today that's [`@internal/vite-plugin-contract-emit`](https://github.com/prisma/prisma/blob/main/packages/1-framework/3-tooling/vite-plugin-contract-emit/README.md) for Vite 7 and Vite 8. Next.js, Webpack, esbuild, Rollup, and Turbopack plugins are documented under *What Prisma Next doesn't do yet* with the workaround.
6
+ This skill covers Prisma 8's build-tool plugins — the dev-server / build-system integrations that re-emit contract artifacts automatically as the user edits the contract source. Today that's [`@internal/vite-plugin-contract-emit`](https://github.com/prisma/prisma/blob/main/packages/1-framework/3-tooling/vite-plugin-contract-emit/README.md) for Vite 7 and Vite 8. Next.js, Webpack, esbuild, Rollup, and Turbopack plugins are documented under *What Prisma 8 doesn't do yet* with the workaround.
7
7
 
8
8
  **If the project is using Vite and consuming the contract, install the plugin.** There's no good reason not to — manual `prisma contract emit` during dev is friction the plugin eliminates. The agent should proactively offer the plugin whenever it sees a `vite.config.ts` in the project; the user doesn't need to ask.
9
9
 
10
10
  ## When to Use
11
11
 
12
12
  - The project is using Vite (the agent sees a `vite.config.ts` or `@vitejs/*` deps) and the contract is being consumed at runtime — proactively offer the plugin.
13
- - User asks how to wire Prisma Next into their Vite project.
13
+ - User asks how to wire Prisma 8 into their Vite project.
14
14
  - User asks about Next.js integration, Webpack integration, or any other bundler — the answer is *"not yet, here's the workaround"* and the skill walks them through it.
15
15
  - User mentions: *vite plugin, vite-plugin, vite.config.ts, prismaVitePlugin, contract emit on save, HMR, hot reload contract, dev server, vite 7, vite 8*.
16
- - User mentions Next.js / Webpack / esbuild / Rollup / Turbopack in the context of Prisma Next integration — the gap-listing path fires.
16
+ - User mentions Next.js / Webpack / esbuild / Rollup / Turbopack in the context of Prisma 8 integration — the gap-listing path fires.
17
17
 
18
18
  ## When Not to Use
19
19
 
@@ -92,7 +92,7 @@ The plugin does **not** run during `vite build`. For CI and production deploys,
92
92
 
93
93
  ## Workflow — React Router v7 Framework Mode
94
94
 
95
- The Vite plugin is compatible with `@react-router/dev/vite`. Both plugins are listed in `vite.config.ts`; there's no ordering constraint between them today, and the Prisma Next plugin's re-emit fires alongside React Router's own SSR re-load.
95
+ The Vite plugin is compatible with `@react-router/dev/vite`. Both plugins are listed in `vite.config.ts`; there's no ordering constraint between them today, and the Prisma 8 plugin's re-emit fires alongside React Router's own SSR re-load.
96
96
 
97
97
  ```typescript
98
98
  import { reactRouter } from '@react-router/dev/vite';
@@ -117,7 +117,7 @@ See [`examples/react-router-demo`](https://github.com/prisma/prisma/tree/main/ex
117
117
  5. **Emit errors during dev**: the plugin surfaces them via Vite's error overlay. Read the overlay; the underlying cause is a contract authoring problem — chain to `references/debug.md` for resolution (PSL syntax, missing namespace, conflicting extensions).
118
118
  6. **Re-installing dependencies without the plugin's peer-range move.** When PN bumps the plugin's peer range, you must re-run `pnpm install` so the lockfile picks up the new range. A stale lockfile keeps the old plugin and produces confusing version mismatch warnings.
119
119
 
120
- ## What Prisma Next doesn't do yet
120
+ ## What Prisma 8 doesn't do yet
121
121
 
122
122
  - **Next.js plugin.** No first-party `@internal/next-plugin-*` exists. Workaround: run `prisma contract emit` from a `prebuild` script in `package.json` and run it manually during development when the contract changes. Many Next.js projects also run a dev-time `tsx --watch` against a small script that calls the CLI on contract-source change. If you want a first-party Next.js plugin, file a feature request via the `references/feedback.md` skill.
123
123
  - **Webpack, esbuild, Rollup, Turbopack plugins.** None exist yet as first-party. Workaround: the canonical `executeContractEmit` surface lives in `@internal/cli/control-api` — a small per-bundler plugin can call it from the bundler's prebuild hook, but PN doesn't ship one for you. The `vite-plugin-contract-emit` source is the reference implementation if you want to write one yourself. If you want a first-party plugin for your bundler, file a feature request via the `references/feedback.md` skill.
@@ -1,5 +1,5 @@
1
1
 
2
- # Prisma Next — Contract Authoring
2
+ # Prisma 8 — Contract Authoring
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
@@ -26,7 +26,7 @@ Both files are **emitted artefacts**. Edit the source; never the JSON or `.d.ts`
26
26
  - User wants to install or configure an extension via `extensions: [...]` in `prisma.config.ts`, including `@internal/extension-supabase`.
27
27
  - User is migrating between authoring sources (PSL ↔ TypeScript builder).
28
28
  - User received `PN-CLI-4002`, `PN-CLI-4003`, or `PN-CLI-4011` from `contract emit`.
29
- - User mentions: *schema, fields, models, attributes, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, contract emit, façade imports, `@internal/postgres/config`, `@internal/postgres/contract-builder`, extensions, pgvector, cipherstash, postgis, paradedb, supabase, namespaces, cross-space FK, `@@control`, enums, check constraints, `@@check`, value objects, validations, callbacks, soft delete, paranoid, scopes*. (The last cluster routes to *What Prisma Next doesn't do yet* below.)
29
+ - User mentions: *schema, fields, models, attributes, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, contract emit, façade imports, `@internal/postgres/config`, `@internal/postgres/contract-builder`, extensions, pgvector, cipherstash, postgis, paradedb, supabase, namespaces, cross-space FK, `@@control`, enums, check constraints, `@@check`, value objects, validations, callbacks, soft delete, paranoid, scopes*. (The last cluster routes to *What Prisma 8 doesn't do yet* below.)
30
30
 
31
31
  ## When Not to Use
32
32
 
@@ -34,7 +34,7 @@ Both files are **emitted artefacts**. Edit the source; never the JSON or `.d.ts`
34
34
  - User wants to write a query against the contract → `references/queries.md`.
35
35
  - User wants to wire `db.ts` (runtime entry point, middleware, env config) → `references/runtime.md`.
36
36
  - User wants the Vite / bundler integration → `references/build.md`.
37
- - User wants to set up Prisma Next for the first time → `references/quickstart.md`.
37
+ - User wants to set up Prisma 8 for the first time → `references/quickstart.md`.
38
38
  - User wants a deeper read of a single structured error envelope → `references/debug.md`.
39
39
  - User wants to file a missing-feature request → `references/feedback.md`.
40
40
 
@@ -280,10 +280,10 @@ model Order {
280
280
  }
281
281
  ```
282
282
 
283
- `expression` is the raw predicate — the text that goes inside `CHECK (...)` — and it is never parsed, so get it right; Prisma Next does not validate SQL syntax. Exactly one of `name:` or `map:` is required, and they're mutually exclusive:
283
+ `expression` is the raw predicate — the text that goes inside `CHECK (...)` — and it is never parsed, so get it right; Prisma 8 does not validate SQL syntax. Exactly one of `name:` or `map:` is required, and they're mutually exclusive:
284
284
 
285
- - **`name:`** — declaring a new rule. Prisma Next picks the physical constraint name and future plans compare by that name, so Postgres's own reprint of your predicate (which rarely matches what you typed byte-for-byte) never causes false drift.
286
- - **`map:`** — adopting a rule that already exists. Give the constraint's exact physical name and Prisma Next compares the predicate byte-for-byte against what's live. This is the form `contract infer` writes for you (see *Workflow — Brownfield introspection* below) when it finds a hand-written check in the database. Every `map:` body warns at emit time (`PN_EXACT_NAME_BODY_COMPARISON`) — the warning fires on the text, not on who wrote it, so the check `contract infer` just wrote warns again on your next `contract emit` too. That is expected, not a defect: the comparison is still sound because both sides are Postgres's own reprint. Prefer `name:` for anything you're authoring fresh: your text and Postgres's reprint of it rarely match character-for-character, and a byte comparison reports that as drift even when both mean exactly the same thing. Reserve `map:` for adopting what's already there, where both sides are the database's own reprint and so do match.
285
+ - **`name:`** — declaring a new rule. Prisma 8 picks the physical constraint name and future plans compare by that name, so Postgres's own reprint of your predicate (which rarely matches what you typed byte-for-byte) never causes false drift.
286
+ - **`map:`** — adopting a rule that already exists. Give the constraint's exact physical name and Prisma 8 compares the predicate byte-for-byte against what's live. This is the form `contract infer` writes for you (see *Workflow — Brownfield introspection* below) when it finds a hand-written check in the database. Every `map:` body warns at emit time (`PN_EXACT_NAME_BODY_COMPARISON`) — the warning fires on the text, not on who wrote it, so the check `contract infer` just wrote warns again on your next `contract emit` too. That is expected, not a defect: the comparison is still sound because both sides are Postgres's own reprint. Prefer `name:` for anything you're authoring fresh: your text and Postgres's reprint of it rarely match character-for-character, and a byte comparison reports that as drift even when both mean exactly the same thing. Reserve `map:` for adopting what's already there, where both sides are the database's own reprint and so do match.
287
287
 
288
288
  A model can carry any number of `@@check` attributes. The TS builder mirrors this with `check({ expression, name })` / `check({ expression, map })` on a model's `.sql({ checks: [...] })`, next to `index()`.
289
289
 
@@ -382,11 +382,11 @@ Infer captures indexes at full fidelity — expression, partial (`where:`), uniq
382
382
  1. **Forgetting to re-emit after an edit.** `contract.json` and `contract.d.ts` go stale; downstream typecheck and `migration plan` see the old shape. Re-emit, or install the Vite plugin (`references/build.md`).
383
383
  2. **Editing the emitted artefacts.** `contract.json` and `contract.d.ts` are emitted; edits there round-trip away on the next emit. Edit the source.
384
384
  3. **Wrong factory/import path for the TS builder.** `defineContract`, `field`, `model`, `rel` come from `@internal/postgres/contract-builder` (or `@internal/mongo/contract-builder`). Outside the callback overload, the available field constructors are `field.column(...)`, `field.generated(...)`, `field.namedType(...)`.
385
- 4. **Reaching into internal packages from user code.** User-authored files (`prisma.config.ts`, `contract.ts`, `db.ts`, control clients) import only from `@internal/<target>/<subpath>` and `@internal/extension-<name>/<subpath>`. Imports from `@internal/cli/*`, `@internal/family-*`, `@internal/target-*`, `@internal/adapter-*`, `@internal/driver-*`, or `@internal/sql-contract-*` are framework-internal — the façade composes them for you. If a façade subpath you need is missing for your target, see *What Prisma Next doesn't do yet* and route to `references/feedback.md`. The canonical worked examples are `examples/multi-extension-monorepo/app/prisma.config.ts` and `examples/prisma-8-postgis-demo/prisma.config.ts`.
385
+ 4. **Reaching into internal packages from user code.** User-authored files (`prisma.config.ts`, `contract.ts`, `db.ts`, control clients) import only from `@internal/<target>/<subpath>` and `@internal/extension-<name>/<subpath>`. Imports from `@internal/cli/*`, `@internal/family-*`, `@internal/target-*`, `@internal/adapter-*`, `@internal/driver-*`, or `@internal/sql-contract-*` are framework-internal — the façade composes them for you. If a façade subpath you need is missing for your target, see *What Prisma 8 doesn't do yet* and route to `references/feedback.md`. The canonical worked examples are `examples/multi-extension-monorepo/app/prisma.config.ts` and `examples/prisma-8-postgis-demo/prisma.config.ts`.
386
386
  5. **Confusing the config `extensions` with the TS builder's `extensions`.** Same packs, two surfaces, one field name but two shapes: `defineConfig({ extensions: [pgvector] })` (array of *control* descriptors from `@internal/extension-<name>/control`) versus `defineContract({ extensions: { pgvector } })` (record of *pack* descriptors from `@internal/extension-<name>/pack`).
387
- 6. **Renaming a field and expecting the planner to detect it.** Prisma Next has no in-contract rename hint; the planner sees a destructive drop+add. Hand-edit `migration.ts` after `migration plan` (see `references/migrations.md`), or use the keep-then-drop two-migration pattern.
387
+ 6. **Renaming a field and expecting the planner to detect it.** Prisma 8 has no in-contract rename hint; the planner sees a destructive drop+add. Hand-edit `migration.ts` after `migration plan` (see `references/migrations.md`), or use the keep-then-drop two-migration pattern.
388
388
 
389
- ## What Prisma Next doesn't do yet
389
+ ## What Prisma 8 doesn't do yet
390
390
 
391
391
  - **In-contract rename hint.** No `@@rename(old: ..., new: ...)` or similar. Use the workarounds in *Common Pitfalls* #6. To request first-class rename, file via `references/feedback.md`.
392
392
  - **Model validations.** No declarative `@validates(...)` surface. Validate in application code (arktype). To request declarative validations in the contract, file via `references/feedback.md`.
@@ -410,8 +410,8 @@ Infer captures indexes at full fidelity — expression, partial (`where:`), uniq
410
410
  - [ ] All user-authored imports resolve to `@internal/<target>/<subpath>` (e.g. `@internal/postgres/config`) or `@internal/extension-<name>/<subpath>`. No imports from `@internal/cli/*`, `@internal/family-*`, `@internal/target-*`, `@internal/adapter-*`, `@internal/driver-*`, or `@internal/sql-contract-*` in user files.
411
411
  - [ ] Edited the contract source (`contract.prisma` or `contract.ts`), not an emitted artefact.
412
412
  - [ ] For new extension namespaces: added the package, imported its control descriptor (`@internal/extension-<name>/control`), added it to `extensions: [...]` in `defineConfig({...})` (and the matching pack descriptor to `defineContract({extensions: {...}})` if using the TS builder).
413
- - [ ] For renames: hand-edited `migration.ts` after `migration plan` (or used the keep-then-drop two-migration pattern) — Prisma Next has no rename hint today.
413
+ - [ ] For renames: hand-edited `migration.ts` after `migration plan` (or used the keep-then-drop two-migration pattern) — Prisma 8 has no rename hint today.
414
414
  - [ ] Ran `pnpm prisma contract emit` after the edit (or let the Vite plugin re-emit on save).
415
415
  - [ ] Confirmed `contract.json` and `contract.d.ts` updated next to the source.
416
416
  - [ ] Did **not** hand-edit `contract.json` / `contract.d.ts`.
417
- - [ ] Did **not** confabulate a missing feature (validations, callbacks, soft delete, scopes, in-contract rename hint) — referred the user to *What Prisma Next doesn't do yet* + `references/feedback.md`.
417
+ - [ ] Did **not** confabulate a missing feature (validations, callbacks, soft delete, scopes, in-contract rename hint) — referred the user to *What Prisma 8 doesn't do yet* + `references/feedback.md`.
@@ -1,9 +1,9 @@
1
1
 
2
- # Prisma Next — Debug
2
+ # Prisma 8 — Debug
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- When a Prisma Next call fails, the framework returns a **structured envelope**. The agent's job is to read the envelope, route on the `code`, and chain to the right authoring skill for the actual fix. This skill teaches the envelope shapes and the routing — it does not duplicate sibling-skill workflows.
6
+ When a Prisma 8 call fails, the framework returns a **structured envelope**. The agent's job is to read the envelope, route on the `code`, and chain to the right authoring skill for the actual fix. This skill teaches the envelope shapes and the routing — it does not duplicate sibling-skill workflows.
7
7
 
8
8
  ## When to Use
9
9
 
@@ -22,7 +22,7 @@ When a Prisma Next call fails, the framework returns a **structured envelope**.
22
22
 
23
23
  ### Two envelope shapes
24
24
 
25
- Prisma Next emits **two distinct envelopes** depending on which seam threw. Read which one you have *before* routing.
25
+ Prisma 8 emits **two distinct envelopes** depending on which seam threw. Read which one you have *before* routing.
26
26
 
27
27
  **1. CLI envelope** — produced by `prisma ...` commands (emit, db init/update/verify/sign/schema, migration plan/apply/show/status, init). Shape (see `CliErrorEnvelope` in `packages/1-framework/1-core/errors/src/control.ts`):
28
28
 
@@ -119,7 +119,7 @@ If the envelope's `code` is not in this table, follow the envelope's `fix` field
119
119
  4. **Treating drift as something to silence with `db sign`.** `db sign` writes the marker from the current contract hash, but it requires schema verification to pass first. Run `db verify` before reaching for `db sign`.
120
120
  5. **Re-running `db migrate` after a partial failure without inspecting state.** `db schema --db <url>` shows the live shape; `migration status --db <url> --json` shows where the marker actually is.
121
121
 
122
- ## What Prisma Next doesn't do yet
122
+ ## What Prisma 8 doesn't do yet
123
123
 
124
124
  - **Studio / GUI database browser.** No first-party Studio. Workaround: `prisma db schema` for a CLI tree of the live schema, or use a third-party tool (TablePlus, DataGrip, `psql`) against your `DATABASE_URL`. If you need a built-in GUI, file a feature request via `references/feedback.md`.
125
125
  - **First-class query logger middleware.** No built-in "log every query" middleware ships with the framework. Workaround: write a small custom middleware that wraps each operation (see `references/runtime.md` for middleware composition). If you need a built-in query log, file a feature request via `references/feedback.md`.
@@ -1,9 +1,9 @@
1
1
 
2
- # Prisma Next — Feedback (Bug Reports, Feature Requests, Team Q&A)
2
+ # Prisma 8 — Feedback (Bug Reports, Feature Requests, Team Q&A)
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- This skill is the *terminal* of the capability-gap routing pattern. Every other Prisma Next skill's *What Prisma Next doesn't do yet* entries route here when the user wants the gap closed; the skill also fires directly on prompts like *"this is a bug"*, *"file an issue"*, *"feature request"*, *"can I ask the team about this?"*, *"how should I integrate X with Prisma Next?"*.
6
+ This skill is the *terminal* of the capability-gap routing pattern. Every other Prisma 8 skill's *What Prisma 8 doesn't do yet* entries route here when the user wants the gap closed; the skill also fires directly on prompts like *"this is a bug"*, *"file an issue"*, *"feature request"*, *"can I ask the team about this?"*, *"how should I integrate X with Prisma 8?"*.
7
7
 
8
8
  The skill's job is to pick the *right channel* — GitHub issue or Discord — and then either produce a **structured, public-safe** issue body (no secrets, no proprietary schema) the framework team can act on, or hand the user a direct link to the Prisma Discord for synchronous Q&A. Submission to GitHub never happens without explicit user confirmation.
9
9
 
@@ -22,7 +22,7 @@ Canonical channels:
22
22
  ## When Not to Use
23
23
 
24
24
  - User wants to fix the bug themselves in the user's own code. The fix lives in another workflow reference (debug / contract / migrations / queries / runtime / build). Open the right reference first; only fall back to feedback if the user explicitly wants the framework to do something differently.
25
- - User wants to upgrade Prisma Next (the bug may already be fixed) → [`upgrade-app.md`](upgrade-app.md); this reference mentions it as a pre-flight check.
25
+ - User wants to upgrade Prisma 8 (the bug may already be fixed) → [`upgrade-app.md`](upgrade-app.md); this reference mentions it as a pre-flight check.
26
26
  - The user's question is already covered by a workflow reference in this skill (*"how do I add a column?"* → `references/contract.md`; *"what's the right query interface?"* → `references/queries.md`). Route to the workflow reference, not to the team — open the reference, answer the question, and only escalate to Discord if the agent can't.
27
27
 
28
28
  ## Key Concepts
@@ -80,7 +80,7 @@ If both — a bug *and* the user wants a related feature — file two separate i
80
80
 
81
81
  For **either** kind:
82
82
 
83
- - **Prisma Next version**: `pnpm ls @internal/postgres` (or `@internal/mongo`). If the project uses a target package, that version is canonical.
83
+ - **Prisma 8 version**: `pnpm ls @internal/postgres` (or `@internal/mongo`). If the project uses a target package, that version is canonical.
84
84
  - **Node version**: `node -v`.
85
85
  - **Package manager**: `pnpm` / `npm` / `yarn` / `bun` / `deno`.
86
86
  - **OS**: `darwin` / `linux` / `win32` and the version string is enough.
@@ -209,7 +209,7 @@ When step 1 picked the Discord channel (steps 2–7 do not apply):
209
209
  - Extension-author / partner-integration / breaking-change-coordination questions → the public extension-authors channel, or the user can ping a maintainer directly once they're in the server.
210
210
  2. **Help draft the opening message.** Prisma's Discord is searchable; a well-framed opening message gets a faster, more useful answer. The agent drafts a short message with:
211
211
  - One-sentence summary of what the user is trying to do.
212
- - The Prisma Next version (`pnpm ls @internal/postgres` or equivalent).
212
+ - The Prisma 8 version (`pnpm ls @internal/postgres` or equivalent).
213
213
  - A short code snippet (PSL excerpt, query, config file) where relevant — redacted the same way as a GitHub issue body (no `DATABASE_URL`, no customer schema names).
214
214
  - The specific question the user wants answered.
215
215
  3. **Do not auto-post.** The agent surfaces the drafted message to the user — *"here's an opening message you can paste into Discord; want to adjust before sending?"* — and lets the user decide whether to paste it as-is, edit it, or pick a different framing.
@@ -217,7 +217,7 @@ When step 1 picked the Discord channel (steps 2–7 do not apply):
217
217
 
218
218
  ### 9. Follow up
219
219
 
220
- - **Issue path**: record the issue URL in the user's project notes (or in the project's `wip/` if there is one) so a later upgrade or related work can reference it. If the bug is the symptom of an old version of Prisma Next, suggest an upgrade following [`upgrade-app.md`](upgrade-app.md) — many bugs are fixed in newer releases.
220
+ - **Issue path**: record the issue URL in the user's project notes (or in the project's `wip/` if there is one) so a later upgrade or related work can reference it. If the bug is the symptom of an old version of Prisma 8, suggest an upgrade following [`upgrade-app.md`](upgrade-app.md) — many bugs are fixed in newer releases.
221
221
  - **Discord path**: once the conversation on Discord settles into a concrete bug or a concrete feature request, return to step 1 of this skill and file the issue (the Discord thread becomes the *Notes* / *Where the gap surfaces* reference in the issue body).
222
222
 
223
223
  ## Common Pitfalls
@@ -227,9 +227,9 @@ When step 1 picked the Discord channel (steps 2–7 do not apply):
227
227
  3. **Pasting a customer's confidential domain schema.** When original model and field names would leak confidential information (product codenames, customer identifiers, regulated-data fields), rename to neutral placeholders before the body goes into a public issue. Otherwise, keep the original names — a faithful excerpt is easier for the framework team to reason about than a re-themed one. Over-renaming is its own readability cost.
228
228
  4. **Filing a documentation question as a bug.** Documentation questions belong in another skill or in a GitHub Discussion (if the repo enables them). Bugs are about the surface misbehaving.
229
229
  5. **Conflating bug + feature in one issue.** File two. Mixed issues are hard to triage and hard to close.
230
- 6. **Filing without a version.** "I'm using Prisma Next, it's broken" without the version makes triage hopeless. The version is the cheapest piece of context to capture; always include it.
230
+ 6. **Filing without a version.** "I'm using Prisma 8, it's broken" without the version makes triage hopeless. The version is the cheapest piece of context to capture; always include it.
231
231
 
232
- ## What Prisma Next doesn't do yet
232
+ ## What Prisma 8 doesn't do yet
233
233
 
234
234
  - **In-product feedback channel.** No `prisma-next feedback` CLI command. The GitHub Issues page is the canonical surface. If you want a CLI-side feedback command, file a feature request via this skill.
235
235
 
@@ -1,5 +1,5 @@
1
1
 
2
- # Prisma Next — The Migration Graph and Refs (Mental Model)
2
+ # Prisma 8 — The Migration Graph and Refs (Mental Model)
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
@@ -125,7 +125,7 @@ If you skip the chaining, the next default plan resolves to greenfield: the trap
125
125
 
126
126
  ## Workflow — adopt a pre-existing database
127
127
 
128
- The concept: a database that predates Prisma Next enters the system by describing it, not migrating it — `contract infer` derives the contract from the live schema, and after review + `contract emit`, `db sign` records the marker. Full recipe: `references/quickstart.md` § *Brownfield-DB*.
128
+ The concept: a database that predates Prisma 8 enters the system by describing it, not migrating it — `contract infer` derives the contract from the live schema, and after review + `contract emit`, `db sign` records the marker. Full recipe: `references/quickstart.md` § *Brownfield-DB*.
129
129
 
130
130
  ```bash
131
131
  pnpm prisma contract infer --db "$DATABASE_URL" --output src/prisma/contract.prisma
@@ -159,7 +159,7 @@ The concept: the database exists and its marker is accurate (hash **M**) — it
159
159
  6. **Treating `db` as reserved.** It's a naming default. Setting it yourself is fine and sometimes exactly right (deploy-first chaining, retrofit); just expect dev commands on the default URL to overwrite it.
160
160
  7. **Authoring the first migration after the first deploy.** Then no graph node corresponds to what shipped, and every incremental path needs the retrofit. Baseline before the first deploy — it's one command.
161
161
 
162
- ## What Prisma Next doesn't do yet
162
+ ## What Prisma 8 doesn't do yet
163
163
 
164
164
  - **No plan-time ref advancement.** `migration plan` cannot advance a ref for you; keeping the chain current is manual (`migration ref set` after each plan, or `--from` every time). If you want a plan-time advancement flag, file a feature request via the `references/feedback.md` skill.
165
165
 
@@ -1,5 +1,5 @@
1
1
 
2
- # Prisma Next — Migration Review (Deployment + Concurrency)
2
+ # Prisma 8 — Migration Review (Deployment + Concurrency)
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
@@ -204,7 +204,7 @@ For a human-readable ordered preview of the migration path before applying, use
204
204
  4. **Treating diamond convergence as a special procedure.** It's not. It's the normal *edit → plan → apply* loop applied to the post-rebase state. The only extra step is *"port any data-transform logic from your old `migration.ts` over."*
205
205
  5. **Running `migration ref set` to silence a CI mismatch without understanding the cause.** That can mask out-of-band changes or rollback drift. Investigate first.
206
206
 
207
- ## What Prisma Next doesn't do yet
207
+ ## What Prisma 8 doesn't do yet
208
208
 
209
209
  - **Per-environment migration ordering beyond the default chain.** If you need staging to skip a migration that production requires (or vice versa), the supported path is to author the per-env divergence as separate migrations and gate them in your deploy script. If you want first-class per-env routing, file a feature request via the `references/feedback.md` skill.
210
210
  - **A built-in side-by-side "branch diff" view.** There is a full-graph render (`migration graph`) that shows branches, but no `git diff`-style comparison between two branches' migration sets. Workaround: run `migration status` on each branch and `diff` the output. If you want a built-in branch-comparison view, file a feature request via the `references/feedback.md` skill.
@@ -1,12 +1,12 @@
1
1
 
2
- # Prisma Next — Migration Authoring
2
+ # Prisma 8 — Migration Authoring
3
3
 
4
- > **Edit your data contract. Prisma Next plans the migration. You fill in any data transforms.**
4
+ > **Edit your data contract. Prisma 8 plans the migration. You fill in any data transforms.**
5
5
 
6
6
  The three-step user model:
7
7
 
8
8
  1. **You edit your data contract.** (`references/contract.md`)
9
- 2. **Prisma Next plans the migration for you.** ← this skill
9
+ 2. **Prisma 8 plans the migration for you.** ← this skill
10
10
  3. **If a data transform is needed, you edit `migration.ts` and self-emit.** ← this skill
11
11
 
12
12
  Once the contract changes, you choose how the change reaches the database. This skill covers the two paths (`db update` and `migration plan` + `db migrate`), the migration-package contract, the `migration.ts` authoring API, and the failure modes you recover from without leaving the loop.
@@ -377,7 +377,7 @@ There is no built-in filter flag — pipe the JSON through `jq` (or your favouri
377
377
 
378
378
  The concept: `db verify` is a **standalone diagnostic** — not a routine step after `db update` or `db migrate` on the happy path (those commands already verify and advance the marker when they succeed). Reach for `db verify` when you suspect drift or need to prove the DB matches the contract:
379
379
 
380
- - Following manual SQL or ad-hoc edits outside Prisma Next.
380
+ - Following manual SQL or ad-hoc edits outside Prisma 8.
381
381
  - When restoring a database from backup.
382
382
  - If a `db migrate` fails or partially applies (especially on Mongo, where DDL is resumable rather than transaction-wrapped).
383
383
  - When `PN-RUN-3002` / `PN-RUN-3001` surfaces at runtime or from another command.
@@ -478,15 +478,15 @@ In non-interactive contexts (CI, `--no-interactive`, `--json`), the destructive-
478
478
  5. **Routine `db verify` after a successful `db update` or `db migrate`.** Redundant on the happy path — reserve `db verify` for drift diagnosis (manual edits, restore, failed `db migrate`).
479
479
  6. **Aggregate `check` closure in Postgres `this.dataTransform`.** Returning `count(*)` or `bool_and(...)` breaks the precheck/postcheck contract — both sides resolve to constants. Use a rowset shape: `select('id').where(<violation>).limit(1)`.
480
480
  7. **Two contract references in one migration.** Building a query plan against a different contract than the one passed to `this.dataTransform(endContract, ...)` raises `PN-MIG-2005`. Always import `endContract` once at module scope and use the same reference.
481
- 8. **Renaming and expecting the planner to detect it (Postgres).** Prisma Next has no in-contract rename hint today; the planner emits a destructive drop+add. Hand-edit `migration.ts` to rewrite the destructive op as a `rawSql({ ... })` that issues `ALTER TABLE ... RENAME COLUMN ...` (or use the two-migration keep / backfill / drop pattern), then self-emit. See `references/contract.md` § *Edit a field — rename*.
481
+ 8. **Renaming and expecting the planner to detect it (Postgres).** Prisma 8 has no in-contract rename hint today; the planner emits a destructive drop+add. Hand-edit `migration.ts` to rewrite the destructive op as a `rawSql({ ... })` that issues `ALTER TABLE ... RENAME COLUMN ...` (or use the two-migration keep / backfill / drop pattern), then self-emit. See `references/contract.md` § *Edit a field — rename*.
482
482
  9. **Planning with no `db` ref and no `--from` in a project that already has migrations.** The origin falls through to the empty database, which would make the plan a full-create migration; `migration plan` refuses with `MIGRATION.PLAN_ORIGIN_UNKNOWN` rather than writing it. Pick the exit that matches your intent — the error lists them, and `references/migration-model.md` § *The trap* explains which to choose.
483
483
  10. **Hand-authoring `migration.ts` from a blank file, or rewriting the rendered import line.** Migration files are framework-rendered — let `prisma migration plan` (or `migration new`) render the package, then edit only the holes the framework leaves for you. On Postgres leave the rendered `@internal/postgres/migration` (or `@internal/sqlite/migration`) import path alone; on Mongo use `@internal/family-mongo/migration` + `@internal/target-mongo/migration` as rendered. Add symbols to the existing factory import line rather than introducing new import paths.
484
484
 
485
- ## What Prisma Next doesn't do yet
485
+ ## What Prisma 8 doesn't do yet
486
486
 
487
- - **Runtime-apply migrations.** Prisma Next doesn't apply pending migrations from your app's startup code (the "Drizzle pattern" for serverless / edge). Workaround: run `prisma db migrate` from your deploy pipeline before the app starts. If you need runtime-apply built-in, file a feature request via the `references/feedback.md` skill.
488
- - **Seeds-as-first-class.** Prisma Next doesn't ship a `prisma db seed` equivalent. Workaround: write a TypeScript script that imports your `db` instance and runs your setup queries; invoke it from `package.json`'s scripts. If you need first-class seeding, file a feature request via the `references/feedback.md` skill.
489
- - **Migration squashing.** Prisma Next doesn't squash older migrations into a baseline. They accumulate; for very large histories, manual baseline-and-truncate is the path. If you need built-in squashing, file a feature request via the `references/feedback.md` skill.
487
+ - **Runtime-apply migrations.** Prisma 8 doesn't apply pending migrations from your app's startup code (the "Drizzle pattern" for serverless / edge). Workaround: run `prisma db migrate` from your deploy pipeline before the app starts. If you need runtime-apply built-in, file a feature request via the `references/feedback.md` skill.
488
+ - **Seeds-as-first-class.** Prisma 8 doesn't ship a `prisma db seed` equivalent. Workaround: write a TypeScript script that imports your `db` instance and runs your setup queries; invoke it from `package.json`'s scripts. If you need first-class seeding, file a feature request via the `references/feedback.md` skill.
489
+ - **Migration squashing.** Prisma 8 doesn't squash older migrations into a baseline. They accumulate; for very large histories, manual baseline-and-truncate is the path. If you need built-in squashing, file a feature request via the `references/feedback.md` skill.
490
490
  - **In-contract rename hints.** The planner cannot detect that a field rename is a rename rather than a drop+add. Workaround: hand-edit `migration.ts` to issue a `RENAME COLUMN` via `rawSql(...)`, or use a keep / backfill / drop pattern across two migrations. If you need a contract-level rename hint, file a feature request via the `references/feedback.md` skill.
491
491
 
492
492
  ## Graph and history commands
@@ -500,7 +500,7 @@ For the full graph topology: `pnpm prisma migration graph` (also supports `--leg
500
500
 
501
501
  ## `@@control` and DDL scope
502
502
 
503
- Objects whose `@@control` policy excludes them from Prisma Next's managed surface are omitted from planned DDL. The four policies are: `managed` (Prisma plans and applies DDL), `tolerated` (object may exist, no DDL emitted), `external` (object is expected to exist, no DDL), `observed` (Prisma reads but never writes). Declare `@@control(managed|tolerated|external|observed)` in your schema; see `references/contract.md` and [`packages/2-sql/2-authoring/contract-psl/README.md`](../../packages/2-sql/2-authoring/contract-psl/README.md) for authoring syntax.
503
+ Objects whose `@@control` policy excludes them from Prisma 8's managed surface are omitted from planned DDL. The four policies are: `managed` (Prisma plans and applies DDL), `tolerated` (object may exist, no DDL emitted), `external` (object is expected to exist, no DDL), `observed` (Prisma reads but never writes). Declare `@@control(managed|tolerated|external|observed)` in your schema; see `references/contract.md` and [`packages/2-sql/2-authoring/contract-psl/README.md`](../../packages/2-sql/2-authoring/contract-psl/README.md) for authoring syntax.
504
504
 
505
505
  ## Telemetry
506
506
 
@@ -1,4 +1,4 @@
1
- # Prisma Next — Queries (Mongo)
1
+ # Prisma 8 — Queries (Mongo)
2
2
 
3
3
  > Load this guide when `db.ts` imports from `@internal/mongo/runtime`.
4
4
 
@@ -49,7 +49,7 @@ const recent = await db.orm.posts
49
49
 
50
50
  **`.where(...)`** accepts a plain object whose keys are model field names and values are compared with equality (codec-aware — `ObjectId` fields accept string ids from the contract). Chain multiple `.where({ ... })` calls to AND-compose filters.
51
51
 
52
- For operators the object form doesn't cover (`.in([...])`, range comparisons, nested logic), pass a `MongoFilterExpr` — today that means importing filter helpers from `@internal/mongo-query-ast/execution` (a façade-completeness gap; see *What Prisma Next doesn't do yet* in [`queries.md`](./queries.md)). Prefer the object form whenever equality suffices.
52
+ For operators the object form doesn't cover (`.in([...])`, range comparisons, nested logic), pass a `MongoFilterExpr` — today that means importing filter helpers from `@internal/mongo-query-ast/execution` (a façade-completeness gap; see *What Prisma 8 doesn't do yet* in [`queries.md`](./queries.md)). Prefer the object form whenever equality suffices.
53
53
 
54
54
  **Polymorphic roots.** When the contract declares variants on a model, narrow before querying:
55
55
 
@@ -213,7 +213,7 @@ Update callbacks return arrays of field operations (`.set`, `.inc`, `.push`, `.p
213
213
  3. **Calling `.update()` / `.delete()` without `.where()`.** Mutations other than `.create` / `.createAll` require a filter — the compiler enforces this at the type level where possible.
214
214
  4. **Using PascalCase model names on ORM.** Roots are lowercased plurals from the contract (`db.orm.users`, not `db.orm.User`).
215
215
  5. **Expecting Postgres-style lambda `.where((u) => u.email.eq(...))` on ORM.** Prefer object equality `.where({ email: '...' })`; richer operators need `MongoFilterExpr` helpers (façade gap today).
216
- 6. **Expecting `db.transaction(...)`.** The Mongo façade does not expose it today. Multi-document atomicity requires MongoDB transactions on a replica set via the driver — not yet wrapped in the Prisma Next façade. Route to *What Prisma Next doesn't do yet* / `references/feedback.md` if the user needs this.
216
+ 6. **Expecting `db.transaction(...)`.** The Mongo façade does not expose it today. Multi-document atomicity requires MongoDB transactions on a replica set via the driver — not yet wrapped in the Prisma 8 façade. Route to *What Prisma 8 doesn't do yet* / `references/feedback.md` if the user needs this.
217
217
  7. **Trying to use `db.sql`.** There is no `db.sql` on Mongo.
218
218
  8. **Trying to `db.execute(plan)` directly.** Execute query-builder plans via `(await db.runtime()).execute(plan)`.
219
219
  9. **Expecting ORM `.aggregate(...)` / `.groupBy(...)`.** Use `db.query.from(...).group(...).build()` instead.
@@ -232,5 +232,5 @@ Update callbacks return arrays of field operations (`.set`, `.inc`, `.push`, `.p
232
232
  - [ ] Used `.where({ ... }).first()` for single-row reads — not `.all()`.
233
233
  - [ ] Executed query-builder plans via `(await db.runtime()).execute(plan)`.
234
234
  - [ ] For aggregations, used `db.query.from(...).group(...)` rather than a non-existent ORM `.aggregate(...)`.
235
- - [ ] Did NOT confabulate `db.transaction`, `db.sql`, or ORM `.aggregate(...)` — routed to *What Prisma Next doesn't do yet* / `references/feedback.md` instead.
235
+ - [ ] Did NOT confabulate `db.transaction`, `db.sql`, or ORM `.aggregate(...)` — routed to *What Prisma 8 doesn't do yet* / `references/feedback.md` instead.
236
236
  - [ ] Did NOT use the lower-level builder for something the ORM cleanly expresses.
@@ -1,4 +1,4 @@
1
- # Prisma Next — Queries (Postgres)
1
+ # Prisma 8 — Queries (Postgres)
2
2
 
3
3
  > Load this guide when `db.ts` imports from `@internal/postgres/runtime`.
4
4
 
@@ -80,7 +80,7 @@ await db.orm.Sale
80
80
 
81
81
  The two forms emit the same SQL. Pick chained `.where()` when each clause adds a separate condition that reads as its own thought; pick `and(...)` when one logical predicate happens to have two parts and you want the visual grouping. Don't reach for a `between` helper — there isn't one.
82
82
 
83
- **Combinators** (`and`, `or`, `not`) compose predicates, and **relation predicates** (`.some(...)`, `.none(...)`, `.every(...)`) recurse into a relation. These currently come from the internal `@internal/sql-orm-client` package — see *What Prisma Next doesn't do yet* in [`queries.md`](./queries.md):
83
+ **Combinators** (`and`, `or`, `not`) compose predicates, and **relation predicates** (`.some(...)`, `.none(...)`, `.every(...)`) recurse into a relation. These currently come from the internal `@internal/sql-orm-client` package — see *What Prisma 8 doesn't do yet* in [`queries.md`](./queries.md):
84
84
 
85
85
  ```typescript
86
86
  import { and, or, not } from '@internal/sql-orm-client';
@@ -385,11 +385,11 @@ Cross-namespace relations (e.g. `public.Profile` → `auth.User`) follow the sam
385
385
  2. **Using `.all()` when you wanted one row.** `.all()` issues no implicit limit. Use `.first()` or `.first({ pk })`.
386
386
  3. **Coalescing `count()` with `?? 0` "just in case".** `count()` is `number`, not `number | null` — SQL answers an empty set with `0`. The `?? 0` belongs on `sum` / `avg` / `min` / `max`, and its zero should match the aggregate's own type (`0` for an integer sum, `0n` for `sumBigInt`, `'0'` where the result is a decimal string).
387
387
  4. **Reaching for `.between(a, b)` on a field proxy.** It doesn't exist. Either chain `.where((m) => m.field.gte(a)).where((m) => m.field.lte(b))` or use `and(m.field.gte(a), m.field.lte(b))` inside one `.where()` clause.
388
- 5. **Importing `and` / `or` / `not` from a Postgres façade subpath.** The combinators currently live in `@internal/sql-orm-client` — an internal package. See *What Prisma Next doesn't do yet* in [`queries.md`](./queries.md).
388
+ 5. **Importing `and` / `or` / `not` from a Postgres façade subpath.** The combinators currently live in `@internal/sql-orm-client` — an internal package. See *What Prisma 8 doesn't do yet* in [`queries.md`](./queries.md).
389
389
  6. **Trying to `db.sql.from(tables.user)`.** That surface does not exist. The builder is table-shaped: `db.sql.<tableName>.select(...)`. There is no `db.schema.tables` either.
390
390
  7. **Trying to `db.execute(plan)` directly.** Plans execute through the runtime: `db.runtime().execute(plan)`. Inside a transaction, use `tx.execute(plan)`.
391
391
  8. **Setting `capabilities: { lateral: true }` in `prisma.config.ts`.** `defineConfig` does not take `capabilities`. Capabilities are declared by the active adapter and become part of the emitted contract; the Postgres adapter advertises `lateral`, `jsonAgg`, and `returning` out of the box. Enable extension capabilities through `extensions: [...]` in the config (see `references/contract.md`).
392
- 9. **Confabulating a TypedSQL or `.stream()` surface.** Neither exists today. Raw SQL does: the client's raw lane, ``db.raw.sql`…` ``. See *What Prisma Next doesn't do yet* in [`queries.md`](./queries.md) for all three.
392
+ 9. **Confabulating a TypedSQL or `.stream()` surface.** Neither exists today. Raw SQL does: the client's raw lane, ``db.raw.sql`…` ``. See *What Prisma 8 doesn't do yet* in [`queries.md`](./queries.md) for all three.
393
393
  10. **Mixing the ORM mutation return with `runtime.execute(plan)`.** ORM terminals issue the query themselves and return rows. `runtime.execute` is for SQL-builder plans.
394
394
  11. **Ordering grouped rows by an aggregate metric.** The grouped collection supports `.orderBy(...)` on group keys plus `.limit(...)` / `.offset(...)`, but it cannot order by an aggregate alias such as `SUM(amount)`. Sorting the materialized aggregate result in JS is fine at small cardinalities; for large grouped result sets, drop to `db.sql.<table>`.
395
395
 
@@ -412,4 +412,4 @@ Cross-namespace relations (e.g. `public.Profile` → `auth.User`) follow the sam
412
412
  - [ ] Executed SQL-builder plans via `db.runtime().execute(plan)` (or `tx.execute(plan)` inside a transaction).
413
413
  - [ ] Wrapped multi-statement work in `db.transaction(async (tx) => { ... })` where atomicity matters.
414
414
  - [ ] For top-N grouped aggregates at meaningful scale, dropped to `db.sql.<table>` rather than JS-side sort + slice over `groupBy(...).aggregate(...)`.
415
- - [ ] Did NOT confabulate TypedSQL, `.stream()`, `db.batch`, `.between(...)`, a `capabilities` field on `defineConfig`, or a `db.sql.from(tables.user)` API — routed to *What Prisma Next doesn't do yet* / `references/feedback.md` instead. Raw SQL is spelled `db.raw.sql`, not `db.sql.raw`.
415
+ - [ ] Did NOT confabulate TypedSQL, `.stream()`, `db.batch`, `.between(...)`, a `capabilities` field on `defineConfig`, or a `db.sql.from(tables.user)` API — routed to *What Prisma 8 doesn't do yet* / `references/feedback.md` instead. Raw SQL is spelled `db.raw.sql`, not `db.sql.raw`.
@@ -1,5 +1,5 @@
1
1
 
2
- # Prisma Next — Queries
2
+ # Prisma 8 — Queries
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
@@ -24,7 +24,7 @@ Once the contract is emitted and the DB is up to date, this skill covers everyth
24
24
 
25
25
  ## Pick your target
26
26
 
27
- Prisma Next ships **two query lanes per target** on the same `db` value from `src/prisma/db.ts`. **Before writing queries, read `db.ts` and load the matching target guide:**
27
+ Prisma 8 ships **two query lanes per target** on the same `db` value from `src/prisma/db.ts`. **Before writing queries, read `db.ts` and load the matching target guide:**
28
28
 
29
29
  | Runtime import in `db.ts` | Load |
30
30
  | --- | --- |
@@ -177,7 +177,7 @@ Coming from Prisma 7: `Prisma.User` → `Models.public_User` (note: now carries
177
177
 
178
178
  Target-specific pitfalls live in the per-target guides.
179
179
 
180
- ## What Prisma Next doesn't do yet
180
+ ## What Prisma 8 doesn't do yet
181
181
 
182
182
  - **N:M `.include()` across a junction table.** The contract IR supports many-to-many relations with a `through` junction table, and `N:M` relations appear as valid relation names on the ORM collection. However, `.include()` on an N:M relation does not emit the two-step junction join — the query plan builder only handles the direct join columns (`localColumn` / `targetColumn`) and ignores the `through` metadata. Attempting it either produces wrong results or an error. Workaround: express the N:M traversal through `db.sql.<table>` with an explicit join on the junction table.
183
183
  - **N:M nested mutations.** `mutation-executor.ts` explicitly throws `'N:M nested mutations are not supported yet'` for nested creates/links through an N:M relation.
@@ -185,13 +185,13 @@ Target-specific pitfalls live in the per-target guides.
185
185
  - **Ordering grouped aggregates by an aggregate alias (Postgres).** `db.orm.<Model>.groupBy(...)` supports `.orderBy(...)` on group keys plus `.limit(...)` / `.offset(...)`, but the grouped collection cannot order by an aggregate alias such as `SUM(amount)`. A "top-N groups by SUM" query therefore falls back to JS-side sort + slice over the full grouped result, which is fine at small cardinalities and bad at scale. Workarounds: (a) drop to `db.sql.<table>` and write the `GROUP BY` + `ORDER BY` + `LIMIT` against the aggregated table directly; (b) live with the JS-side sort/slice if the grouped cardinality is bounded. File a feature request via `references/feedback.md` if this is hitting you in production.
186
186
  - **A raw-SQL lane.** This one exists. Write whole-query raw SQL through the client's raw lane: ``db.raw.sql`SELECT ...`.returnsRow({ ... }).build()`` for rows, or `.affectedCount()` for a mutation's row count. Each declared column names the codec that decodes it, so the row stays typed. For an expression fragment inside a builder query, use `fns.raw` in a `.select(...)` callback instead.
187
187
  - **TypedSQL (`.sql` files compiled into typed callables).** Not implemented. Workaround: stick to the SQL builder; for repeated queries, extract a function that returns the built plan and call `db.runtime().execute(plan)` at the call site. If you want a `.sql`-file compile path, file a feature request via `references/feedback.md`.
188
- - **`EXPLAIN` / query-plan inspection.** Prisma Next does not expose an `.explain()` method. Workaround: connect a `pg.Pool` you control via the runtime's `pg:` binding (see `references/runtime.md`) and issue `EXPLAIN ANALYZE` through it. If you want a first-class plan-inspection surface, file a feature request via `references/feedback.md`.
188
+ - **`EXPLAIN` / query-plan inspection.** Prisma 8 does not expose an `.explain()` method. Workaround: connect a `pg.Pool` you control via the runtime's `pg:` binding (see `references/runtime.md`) and issue `EXPLAIN ANALYZE` through it. If you want a first-class plan-inspection surface, file a feature request via `references/feedback.md`.
189
189
  - **Streaming large result sets.** No `.stream()` cursor today. Workaround: paginate via `.offset(n).limit(m)` for moderate sizes; for very large sets, hold a `pg.Client` from the runtime's `pg:` binding and stream through it directly. If you want a built-in streaming surface, file a feature request via `references/feedback.md`.
190
- - **Multi-statement batching (Prisma-7-style `db.$transaction([call1, call2])`).** Prisma Next runs each call sequentially. Workaround: wrap atomically-related work in `db.transaction(async (tx) => { ... })` on Postgres. If you want batch-as-array semantics, file a feature request via `references/feedback.md`.
191
- - **Mongo façade transactions.** `@internal/mongo/runtime` does not expose `db.transaction(...)`. Multi-document atomicity is not yet wrapped in the Prisma Next Mongo façade. Workaround: use the MongoDB driver's session API directly if you control the client binding (`mongoClient:` option). File a feature request via `references/feedback.md` if you need a first-class façade surface.
190
+ - **Multi-statement batching (Prisma-7-style `db.$transaction([call1, call2])`).** Prisma 8 runs each call sequentially. Workaround: wrap atomically-related work in `db.transaction(async (tx) => { ... })` on Postgres. If you want batch-as-array semantics, file a feature request via `references/feedback.md`.
191
+ - **Mongo façade transactions.** `@internal/mongo/runtime` does not expose `db.transaction(...)`. Multi-document atomicity is not yet wrapped in the Prisma 8 Mongo façade. Workaround: use the MongoDB driver's session API directly if you control the client binding (`mongoClient:` option). File a feature request via `references/feedback.md` if you need a first-class façade surface.
192
192
  - **Mongo ORM aggregates.** No `.aggregate(...)` / `.groupBy(...)` on `db.orm.<root>`. Workaround: express aggregations through `db.query.from(...).group(...).build()` and `runtime.execute(plan)`.
193
193
  - **Mongo filter helpers on the façade.** Rich filters (`.in`, ranges, boolean composition) currently import from `@internal/mongo-query-ast/execution` (`MongoFieldFilter`, etc.) — not yet re-exported on `@internal/mongo/runtime`. Workaround: use object equality `.where({ field: value })` where possible; import from the internal package only when necessary. Tracked alongside façade-completeness gaps in Linear `TML-2526`.
194
- - **Automatic N+1 detection.** Prisma Next does not warn when an `.include(...)` is missing. Workaround: be deliberate about `.include(...)` in code review; the `lints` middleware (see `references/runtime.md`) catches the more common authoring slips (missing `WHERE` on a `DELETE` / `UPDATE`, missing `LIMIT` on a `SELECT`).
194
+ - **Automatic N+1 detection.** Prisma 8 does not warn when an `.include(...)` is missing. Workaround: be deliberate about `.include(...)` in code review; the `lints` middleware (see `references/runtime.md`) catches the more common authoring slips (missing `WHERE` on a `DELETE` / `UPDATE`, missing `LIMIT` on a `SELECT`).
195
195
 
196
196
  ## Reference Files
197
197
 
@@ -1,11 +1,11 @@
1
1
 
2
- # Prisma Next — Quickstart (Adoption)
2
+ # Prisma 8 — Quickstart (Adoption)
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- This skill takes the user from zero (or near-zero) to a first working query against Prisma Next. Three paths — and they all converge on the same first arc: **connect → write → read**. Schema editing comes *after* the first arc, not before.
6
+ This skill takes the user from zero (or near-zero) to a first working query against Prisma 8. Three paths — and they all converge on the same first arc: **connect → write → read**. Schema editing comes *after* the first arc, not before.
7
7
 
8
- - **First-touch orientation** — the user has arrived at a Prisma Next project for the first time (a scaffold tool like `npx createprisma` dropped them in, they cloned a teammate's repo, or they ran `prisma orm init` themselves and now want to make their first move) and they're asking *"what can I do with Prisma Next?"*, *"where do I start?"*, or *"what's next?"*. The goal is to anchor them on the contract, get them connected to a database, round-trip one row, and let further commands surface organically.
8
+ - **First-touch orientation** — the user has arrived at a Prisma 8 project for the first time (a scaffold tool like `npx createprisma` dropped them in, they cloned a teammate's repo, or they ran `prisma orm init` themselves and now want to make their first move) and they're asking *"what can I do with Prisma 8?"*, *"where do I start?"*, or *"what's next?"*. The goal is to anchor them on the contract, get them connected to a database, round-trip one row, and let further commands surface organically.
9
9
  - **Greenfield** — new project, fresh database. User runs `prisma orm init` themselves. `init` seeds a starter contract with a sample model, so the path joins the first-touch orientation arc as soon as the database is initialised.
10
10
  - **Brownfield-DB** — existing database, no contract yet. Infer the contract from the database with `contract infer`, sign the marker with `db sign`, then write queries against one of the existing tables.
11
11
 
@@ -13,9 +13,9 @@ This skill does **not** cover migrating from another ORM (Drizzle, Prisma 6/7, S
13
13
 
14
14
  ## When to Use
15
15
 
16
- - User asks *"what can I do with Prisma Next?"*, *"what can I do next with Prisma?"*, *"where do I start?"*, *"what should I do first?"* — and a PN project already exists on disk. **First-touch orientation** path below.
16
+ - User asks *"what can I do with Prisma 8?"*, *"what can I do next with Prisma?"*, *"where do I start?"*, *"what should I do first?"* — and a PN project already exists on disk. **First-touch orientation** path below.
17
17
  - User just ran `createprisma` (or equivalent scaffold tool) and is asking what to do next. **First-touch orientation** path.
18
- - User is starting a new project and wants to use Prisma Next. **Greenfield** path.
18
+ - User is starting a new project and wants to use Prisma 8. **Greenfield** path.
19
19
  - User has an existing database (no PN contract) and wants to introduce PN. **Brownfield-DB** path.
20
20
  - User typed *"prisma orm init"*, *"get started with PN"*, *"set up PN"*, *"how do I scaffold a project"*. **Greenfield** path.
21
21
  - User says *"I have an existing Postgres/Mongo, how do I start using PN?"*. **Brownfield-DB** path.
@@ -25,7 +25,7 @@ This skill does **not** cover migrating from another ORM (Drizzle, Prisma 6/7, S
25
25
  - User already has a PN project and wants to add a model → `references/contract.md`.
26
26
  - User wants to migrate FROM a specific ORM → install `@internal/migrate-from-<orm>-skill` (separate).
27
27
  - User wants to wire `db.ts` in a project that already has a contract → `references/runtime.md`.
28
- - User wants to integrate Prisma Next with a build tool (Vite plugin, Next.js, …) → `references/build.md`.
28
+ - User wants to integrate Prisma 8 with a build tool (Vite plugin, Next.js, …) → `references/build.md`.
29
29
 
30
30
  ## Key Concepts
31
31
 
@@ -38,7 +38,7 @@ This skill does **not** cover migrating from another ORM (Drizzle, Prisma 6/7, S
38
38
 
39
39
  ### Canonical on-disk layout
40
40
 
41
- Every application that consumes Prisma Next uses the same shape:
41
+ Every application that consumes Prisma 8 uses the same shape:
42
42
 
43
43
  ```text
44
44
  <app-root>/
@@ -110,15 +110,15 @@ The three workflows below each describe how their path gets the user to that sta
110
110
 
111
111
  ## Workflow — First-touch orientation
112
112
 
113
- Triggers: *"what can I do with Prisma Next?"*, *"what can I do next with Prisma?"*, *"where do I start?"*, *"I just ran createprisma"*, *"what's next?"*, or any close variant — paired with a PN project already on disk (scaffolded by `createprisma`, by `prisma orm init`, by a teammate, however).
113
+ Triggers: *"what can I do with Prisma 8?"*, *"what can I do next with Prisma?"*, *"where do I start?"*, *"I just ran createprisma"*, *"what's next?"*, or any close variant — paired with a PN project already on disk (scaffolded by `createprisma`, by `prisma orm init`, by a teammate, however).
114
114
 
115
- The user's high-level intent is *"I want to be running an application against my database, against this thing called Prisma Next."* The job of this workflow is to anchor them on the contract, get one round-trip working, and let further commands surface organically as their next move requires them. **It is orientation, not a tour, not a feature inventory, not a syllabus.**
115
+ The user's high-level intent is *"I want to be running an application against my database, against this thing called Prisma 8."* The job of this workflow is to anchor them on the contract, get one round-trip working, and let further commands surface organically as their next move requires them. **It is orientation, not a tour, not a feature inventory, not a syllabus.**
116
116
 
117
117
  ### Concept — what to communicate first
118
118
 
119
- Prisma Next is contract-first. Everything the framework does — query types, migrations, runtime types, drift detection — flows from a single source of truth: the **contract**. The contract describes the user's application's data model. The framework reads it; the framework derives the rest. Lead with this.
119
+ Prisma 8 is contract-first. Everything the framework does — query types, migrations, runtime types, drift detection — flows from a single source of truth: the **contract**. The contract describes the user's application's data model. The framework reads it; the framework derives the rest. Lead with this.
120
120
 
121
- The first response to *"what can I do with Prisma Next?"* names the contract path, frames its role in one sentence, and then steers toward getting the user's application running. Don't open with a feature inventory. Don't open with a list of commands. Open with: *"Your contract is at `<path>`. It describes your application — your query types, migrations, and runtime types all flow from it. Let's get you connected to a database so your app can actually run against it."*
121
+ The first response to *"what can I do with Prisma 8?"* names the contract path, frames its role in one sentence, and then steers toward getting the user's application running. Don't open with a feature inventory. Don't open with a list of commands. Open with: *"Your contract is at `<path>`. It describes your application — your query types, migrations, and runtime types all flow from it. Let's get you connected to a database so your app can actually run against it."*
122
122
 
123
123
  The first **arc** — once oriented — is **connect → write → read**. Not edit-the-contract-first, not plan-a-migration-first. The user's win is *I have application code running against my database*.
124
124
 
@@ -175,9 +175,9 @@ The concept: `prisma orm init` is one CLI command that scaffolds config, schema,
175
175
  ```bash
176
176
  mkdir my-app && cd my-app
177
177
  pnpm init # if no package.json yet
178
- pnpm dlx @prisma/cli@next orm init # interactive
178
+ pnpm dlx prisma@latest orm init # interactive
179
179
  # or non-interactive (CI / agent runs):
180
- pnpm dlx @prisma/cli@next orm init --yes --target postgres --authoring psl
180
+ pnpm dlx prisma@latest orm init --yes --target postgres --authoring psl
181
181
  ```
182
182
 
183
183
  > **Telemetry is opt-out.** The CLI collects anonymous usage data by default. Every command — including `init` — prints a one-time notice to **stderr** on first use, then sends; there is no interactive consent prompt. Opt out anytime by running `prisma telemetry disable`, or with `DO_NOT_TRACK=1` or `PRISMA_NEXT_DISABLE_TELEMETRY=1`. The command stores `"enableTelemetry": false` in your user config for you (the CLI's per-user config dir, **not** `prisma.config.ts`). Run `prisma telemetry status` to see what's currently in effect. This is relevant for agent-driven runs — the CLI records that an agent invoked it. What's collected, the per-user config path, and how to fully reset are documented in `docs/Telemetry.md`.
@@ -192,7 +192,7 @@ The flags `init` accepts (run `prisma orm init --help` for the source of truth):
192
192
  - `--probe-db` — connect to `DATABASE_URL` once and check the server version against the target's minimum.
193
193
  - `--strict-probe` — fail init if the probe fails (no-op without `--probe-db`).
194
194
  - `--skip-install` — skip dependency install + initial contract emit.
195
- - `--skip-skills` — skip Prisma Next skills installation (air-gapped / restricted environments). The skill cluster is always installed at the project level — never globally — so its version stays locked to the project's Prisma Next version.
195
+ - `--skip-skills` — skip Prisma 8 skills installation (air-gapped / restricted environments). The skill cluster is always installed at the project level — never globally — so its version stays locked to the project's Prisma 8 version.
196
196
 
197
197
  `init` writes (when it runs cleanly):
198
198
 
@@ -203,7 +203,7 @@ The flags `init` accepts (run `prisma orm init --help` for the source of truth):
203
203
  - `.env.example` (and `.env` if `--write-env`).
204
204
  - Updates `package.json` (deps + scripts) and `tsconfig.json` (required compiler options).
205
205
  - Installs deps and runs `prisma-cli contract emit` once (the project-local bin `@prisma/cli` installs).
206
- - Registers Prisma Next skills with the local agent runtime.
206
+ - Registers Prisma 8 skills with the local agent runtime.
207
207
 
208
208
  **If you took `init`'s default and ended up with a top-level `prisma/` directory** (TML-2532), the cleanup is one move + one config edit:
209
209
 
@@ -232,7 +232,7 @@ The concept: against an existing database with no PN contract, `contract infer`
232
232
  ```bash
233
233
  mkdir my-app && cd my-app
234
234
  pnpm init
235
- pnpm dlx @prisma/cli@next orm init --yes --target postgres --authoring psl \
235
+ pnpm dlx prisma@latest orm init --yes --target postgres --authoring psl \
236
236
  --schema-path src/prisma/contract.prisma
237
237
  # scaffold lands; you'll overwrite the starter schema below
238
238
  ```
@@ -264,7 +264,7 @@ Then run the snippet from *Your first arc — connect, write, read* above, using
264
264
 
265
265
  ## Commands you'll use day-to-day
266
266
 
267
- A reference table — not a script to recite at the user. Commands surface in the workflow above as the user's next move requires them; this table is here for the moment the user asks for a wider view (typically after the first round-trip), and as a one-glance summary anyone newly oriented to Prisma Next can scan. For flag-level detail, run `<command> --help`; the help output is the source of truth.
267
+ A reference table — not a script to recite at the user. Commands surface in the workflow above as the user's next move requires them; this table is here for the moment the user asks for a wider view (typically after the first round-trip), and as a one-glance summary anyone newly oriented to Prisma 8 can scan. For flag-level detail, run `<command> --help`; the help output is the source of truth.
268
268
 
269
269
  | What you want to do | Command | Deeper skill |
270
270
  |---|---|---|
@@ -288,7 +288,7 @@ Switch authoring later by re-running `prisma orm init` in the same directory. Th
288
288
 
289
289
  ## Common Pitfalls
290
290
 
291
- 1. **Running `prisma orm init <project-name>` with a positional argument.** `init` operates on the current working directory; there is no positional project-name argument. `mkdir foo && cd foo && pnpm dlx @prisma/cli@next orm init`.
291
+ 1. **Running `prisma orm init <project-name>` with a positional argument.** `init` operates on the current working directory; there is no positional project-name argument. `mkdir foo && cd foo && pnpm dlx prisma@latest orm init`.
292
292
  2. **`init` doesn't connect to your database.** It only scaffolds files and installs dependencies (and runs the initial `contract emit`). You connect with `db init` / `db update` / `db migrate`. If `init` succeeds and queries fail, the issue is `DATABASE_URL`, not `init`.
293
293
  3. **Treating inferred PSL as the final contract.** `contract infer` produces a starting point. Don't `db sign` against a contract you haven't read.
294
294
  4. **Forgetting to emit after editing the contract.** The contract artefacts (`contract.json`, `contract.d.ts`) are stale until you run `contract emit`. If the type-checker says a model "doesn't exist", you skipped emit.
@@ -296,9 +296,9 @@ Switch authoring later by re-running `prisma orm init` in the same directory. Th
296
296
  6. **Hand-editing `contract.json` or `contract.d.ts`.** They're emitted artefacts; the next `contract emit` overwrites your changes. Edit the source instead.
297
297
  7. **Using `--out` for `contract infer`.** The flag is `--output`.
298
298
 
299
- ## What Prisma Next doesn't do yet
299
+ ## What Prisma 8 doesn't do yet
300
300
 
301
- - **Migration from another ORM.** Prisma Next doesn't migrate your schema *from* Drizzle / Prisma 6/7 / Sequelize / TypeORM / Kysely / Knex / a raw driver. Workaround: install the matching `@internal/migrate-from-<orm>-skill` if one exists for your source, or treat the source as a brownfield database and `contract infer` from it. If you need a guided migration flow built-in, file a feature request via the `references/feedback.md` skill.
301
+ - **Migration from another ORM.** Prisma 8 doesn't migrate your schema *from* Drizzle / Prisma 6/7 / Sequelize / TypeORM / Kysely / Knex / a raw driver. Workaround: install the matching `@internal/migrate-from-<orm>-skill` if one exists for your source, or treat the source as a brownfield database and `contract infer` from it. If you need a guided migration flow built-in, file a feature request via the `references/feedback.md` skill.
302
302
  - **`prisma db push`-style production sync.** `db update` is the quick development path; for production, use migrations (`migration plan` + `db migrate`). PN deliberately does not offer a "push-to-prod-without-a-migration" surface — see `references/migrations.md`.
303
303
  - **Studio / GUI database browser.** Use `prisma db schema` for a CLI tree-style summary of the live DB. If you need an interactive UI, file a feature request via the `references/feedback.md` skill.
304
304
 
@@ -1,5 +1,5 @@
1
1
 
2
- # Prisma Next — Runtime (`db.ts` Wiring)
2
+ # Prisma 8 — Runtime (`db.ts` Wiring)
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
@@ -20,7 +20,7 @@ This skill covers the **runtime entry point** — `db.ts` — and how to compose
20
20
  - User wants to write queries → `references/queries.md`.
21
21
  - User is on Supabase — the `supabase()` role-first factory, `asUser(jwt)` / `asAnon()` / `asServiceRole()`, JWT config, RLS → `references/supabase.md`.
22
22
  - User wants to edit the contract → `references/contract.md`.
23
- - User wants to wire Prisma Next into a build tool (Vite plugin, Next.js, …) → `references/build.md`.
23
+ - User wants to wire Prisma 8 into a build tool (Vite plugin, Next.js, …) → `references/build.md`.
24
24
  - User wants to debug a connection / runtime error → `references/debug.md`.
25
25
  - User wants to file a bug or feature request → `references/feedback.md`.
26
26
 
@@ -59,7 +59,7 @@ Three things to know:
59
59
  - **`with { type: 'json' }` is required.** Node's ESM JSON-import-attribute spec. Without it, the import errors.
60
60
  - **`url` is optional at construct time.** If `DATABASE_URL` is not set when `db.ts` loads, the factory still returns a client; you can call `await db.connect({ url })` later. The factory throws lazily — only when a runtime is actually needed.
61
61
 
62
- The Mongo façade has the same construction shape — `import mongo from '@internal/mongo/runtime'` — and the same `db.connect(...)` / `db.close()` lifecycle methods. **The Mongo façade does not expose `db.transaction(...)`.** See *What Prisma Next doesn't do yet* for the workaround. **The ORM surface differs in one place: keys.** On Mongo, `db.orm` is keyed by the collection's storage name (from `@@map(...)`, or the lowercased model name if no `@@map` is set), not by the PSL model name — so `model User { … @@map("users") }` is reached at `db.orm.users`, not `db.orm.User`. The SQL builder lane (`db.sql.<table>`) doesn't exist on Mongo at all (`db.sql` is `undefined`). See `references/queries.md` § *MongoDB ORM addressing* for the full rule and a rewrite recipe for SQL-target examples.
62
+ The Mongo façade has the same construction shape — `import mongo from '@internal/mongo/runtime'` — and the same `db.connect(...)` / `db.close()` lifecycle methods. **The Mongo façade does not expose `db.transaction(...)`.** See *What Prisma 8 doesn't do yet* for the workaround. **The ORM surface differs in one place: keys.** On Mongo, `db.orm` is keyed by the collection's storage name (from `@@map(...)`, or the lowercased model name if no `@@map` is set), not by the PSL model name — so `model User { … @@map("users") }` is reached at `db.orm.users`, not `db.orm.User`. The SQL builder lane (`db.sql.<table>`) doesn't exist on Mongo at all (`db.sql` is `undefined`). See `references/queries.md` § *MongoDB ORM addressing* for the full rule and a rewrite recipe for SQL-target examples.
63
63
 
64
64
  ## Workflow — Running as a script (teardown)
65
65
 
@@ -130,7 +130,7 @@ Servers (HTTP handlers, workers in a request loop) **do not call `db.close()`**
130
130
  - **`close()` does not abort in-flight queries.** `await` outstanding work before calling `close()`. Async iterators from `db.runtime().execute(plan)` and `PreparedStatement` handles held after `close()` fail on their next call.
131
131
  - **Ownership.** `close()` releases only what the façade constructed (`pg.Pool` from `{ url }`, `MongoClient` from `{ url }` / `{ uri, dbName }`, SQLite handle from `{ path }`). If you supplied your own `pg.Pool` / `pg.Client` (Postgres `pg:` option), `mongodb.MongoClient` (Mongo `mongoClient:` option), or a pre-built `binding`, `db.close()` does **not** touch those — you own their lifecycle.
132
132
 
133
- **`db.end()` does not exist.** The universal `node-postgres` name is `pool.end()` on a `pg.Pool`; the Prisma Next runtime client is not a `pg.Pool`. The right call is `await db.close()`.
133
+ **`db.end()` does not exist.** The universal `node-postgres` name is `pool.end()` on a `pg.Pool`; the Prisma 8 runtime client is not a `pg.Pool`. The right call is `await db.close()`.
134
134
 
135
135
  ## Workflow — Telemetry middleware
136
136
 
@@ -161,7 +161,7 @@ export const db = postgres<Contract>({
161
161
 
162
162
  The concept: lints catch authoring mistakes that survive type-check (e.g. `DELETE` without a `WHERE`, `SELECT` without a `LIMIT` on a large table); budgets enforce row-count and latency ceilings at runtime. Both surface findings through the structured-error envelope so an agent can branch on the code.
163
163
 
164
- These ship in the underlying SQL runtime package (`@internal/sql-runtime`) and are *not* yet re-exported from the postgres façade — see *What Prisma Next doesn't do yet*. The example apps under `examples/prisma-8-demo/src/prisma/db.ts` show the canonical import.
164
+ These ship in the underlying SQL runtime package (`@internal/sql-runtime`) and are *not* yet re-exported from the postgres façade — see *What Prisma 8 doesn't do yet*. The example apps under `examples/prisma-8-demo/src/prisma/db.ts` show the canonical import.
165
165
 
166
166
  ```typescript
167
167
  import postgres from '@internal/postgres/runtime';
@@ -312,17 +312,17 @@ The runtime side (this skill) is the same regardless: `db.ts` reads `contract.js
312
312
  2. **Omitting the `<Contract>` type parameter** in `postgres<Contract>(...)`. Without it, static surfaces collapse to a generic shape and you lose autocomplete for models. There is no second type parameter — the older two-param signature (`postgres<Contract, TypeMaps>`) is gone.
313
313
  3. **Forgetting `with { type: 'json' }` on the contract import.** Required by Node's ESM JSON-import-attribute spec.
314
314
  4. **Middleware order matters.** Outermost wraps. Put telemetry first if you want it to capture inner-middleware errors.
315
- 5. **Importing middleware from a non-existent façade subpath.** `@internal/postgres/middleware` does *not* exist. Telemetry comes from `@internal/middleware-telemetry`; lints / budgets come from `@internal/sql-runtime` today (see *What Prisma Next doesn't do yet*).
315
+ 5. **Importing middleware from a non-existent façade subpath.** `@internal/postgres/middleware` does *not* exist. Telemetry comes from `@internal/middleware-telemetry`; lints / budgets come from `@internal/sql-runtime` today (see *What Prisma 8 doesn't do yet*).
316
316
  6. **Confabulating lint / budget option names.** Lints take `severities` (with the five keys above), not `requireWhere` / `maxRowsWithoutLimit`. Budgets use `maxLatencyMs` (not `maxDurationMs`) plus `maxRows` / `defaultTableRows` / `tableRows`. When in doubt, read the source.
317
317
  7. **Switching targets without re-emitting.** The contract artefacts are target-shaped; emit after the target change.
318
318
  8. **Script hangs after queries finish on Postgres.** The `pg.Pool` keeps Node's event loop alive. Solution: `await db.close()` before the script returns, or `await using db = postgres<Contract>(...)` at the top of a script module. Do not put `await using db = postgres(...)` inside a request handler — it's block-scoped and would close the pool after every request. The right server pattern is a module-level singleton in `db.ts` that lives for the process lifetime.
319
319
 
320
- ## What Prisma Next doesn't do yet
320
+ ## What Prisma 8 doesn't do yet
321
321
 
322
322
  - **`@internal/postgres/middleware` subpath.** The postgres façade re-exports the runtime factory (`./runtime`), config (`./config`), contract-builder (`./contract-builder`), control (`./control`), family (`./family`), target (`./target`), and serverless (`./serverless`) — but not middleware. Today's workaround: import `lints` and `budgets` from `@internal/sql-runtime`, and `createTelemetryMiddleware` from `@internal/middleware-telemetry`. File additional gaps you hit via `references/feedback.md`.
323
- - **Multi-database routing / read replicas.** Prisma Next doesn't ship a built-in primary/replica router or shard-aware client. Workaround: configure separate `db.ts` instances per data store and call the right one in your application code. If you need first-class multi-database routing, file a feature request via the `references/feedback.md` skill.
323
+ - **Multi-database routing / read replicas.** Prisma 8 doesn't ship a built-in primary/replica router or shard-aware client. Workaround: configure separate `db.ts` instances per data store and call the right one in your application code. If you need first-class multi-database routing, file a feature request via the `references/feedback.md` skill.
324
324
  - **Connection pooling as a first-class config field.** `poolOptions.connectionTimeoutMillis` and `poolOptions.idleTimeoutMillis` are wired through, but the rest of `pg.Pool`'s tuning surface (max connections, `allowExitOnIdle`, ssl options, …) is not exposed by name. Workaround: construct the `pg.Pool` yourself and pass it via `pg:`. If you need more pool fields surfaced on the façade, file a feature request via the `references/feedback.md` skill.
325
- - **Query logger middleware as a built-in.** Prisma Next doesn't ship a "log every query" middleware. Workaround: write a small custom middleware that wraps each operation and logs; or use `createTelemetryMiddleware` and log inside the `onEvent` callback. If you need a built-in query log, file a feature request via the `references/feedback.md` skill.
325
+ - **Query logger middleware as a built-in.** Prisma 8 doesn't ship a "log every query" middleware. Workaround: write a small custom middleware that wraps each operation and logs; or use `createTelemetryMiddleware` and log inside the `onEvent` callback. If you need a built-in query log, file a feature request via the `references/feedback.md` skill.
326
326
 
327
327
  ## Reference Files
328
328
 
@@ -340,5 +340,5 @@ This skill is intentionally body-only; `prisma orm init --help`, the `defineConf
340
340
  - [ ] Did NOT hardcode credentials in any committed file.
341
341
  - [ ] Did NOT confabulate a `@internal/postgres/middleware` subpath, a `@internal/postgres-extension-audit` package, or a second type parameter on `postgres<...>`.
342
342
  - [ ] Did NOT claim `db.transaction(...)` exists on the Mongo façade — only Postgres and SQLite expose it.
343
- - [ ] Did NOT confabulate read-replica / multi-DB / extra pool config — pointed at *What Prisma Next doesn't do yet* and routed to `references/feedback.md`.
343
+ - [ ] Did NOT confabulate read-replica / multi-DB / extra pool config — pointed at *What Prisma 8 doesn't do yet* and routed to `references/feedback.md`.
344
344
  - [ ] For build-system / dev-server prompts (Vite plugin, Next.js plugin, …) routed to `references/build.md`.
@@ -1,13 +1,13 @@
1
1
 
2
- # Prisma Next — Supabase
2
+ # Prisma 8 — Supabase
3
3
 
4
4
  > **Edit your data contract. Prisma handles the rest.**
5
5
 
6
- This skill covers using Prisma Next against a **Supabase** project end-to-end: composing the Supabase extension pack, referencing Supabase-owned tables from your contract, authoring row-level-security (RLS) policies, and running role-bound queries through the `supabase()` runtime.
6
+ This skill covers using Prisma 8 against a **Supabase** project end-to-end: composing the Supabase extension pack, referencing Supabase-owned tables from your contract, authoring row-level-security (RLS) policies, and running role-bound queries through the `supabase()` runtime.
7
7
 
8
8
  ## When to Use
9
9
 
10
- - User has a Supabase project (or wants one) and is wiring Prisma Next into it.
10
+ - User has a Supabase project (or wants one) and is wiring Prisma 8 into it.
11
11
  - User wants RLS policies on their tables (`policy_select`, `@@rls`, `auth.uid()`).
12
12
  - User wants per-request role binding (`asUser(jwt)`, `asAnon()`, `asServiceRole()`).
13
13
  - User wants a foreign key into `auth.users` (cross-space FK).
@@ -27,13 +27,13 @@ This skill covers using Prisma Next against a **Supabase** project end-to-end: c
27
27
  - **Roles come from the pack; you never declare them.** RLS `roles = [authenticated]` identifiers resolve against the composed contract. Pointing the runtime at a non-Supabase Postgres fails verify with a `not-found` issue naming the missing role — the common "wrong database" misconfiguration surfaces before queries run.
28
28
  - **The runtime is role-first.** `supabase()` returns a `SupabaseDb` with **no top-level query surface** — there is no `db.sql` / `db.orm` until you bind a role. `await db.asUser(jwt)` / `db.asAnon()` / `db.asServiceRole()` each return a `RoleBoundDb` exposing `.sql`, `.orm`, `.raw`, `.execute(plan)`, and `.transaction(fn)`. This is deliberate: in a Supabase app there is no meaningful "no role" execution context, and defaulting to the connection's login role is a silent-RLS-bypass footgun.
29
29
  - **Role binding is below middleware and cannot leak.** Each role-bound query runs on a connection that had `set_config('role', …)` and `set_config('request.jwt.claims', …)` applied beneath the user-middleware chain, with `RESET ALL` on release. Postgres-side `auth.uid()` / `auth.jwt()` read those session vars — RLS enforcement is Postgres's job; the runtime's job is binding the context.
30
- - **RLS is enforced by policies *and* grants.** Policies filter *rows*; `GRANT` controls *table access*. Prisma Next authors and migrates the policies; it does not author grants (see *What Prisma Next doesn't do yet*). A role with policies but no `GRANT` gets a permission error, not filtered rows. On Supabase your `public` tables already carry the platform-role grants via default privileges — the grant that is actually missing out of the box is `service_role`'s on `auth.*` / `storage.*` (see *Workflow — Grants*).
30
+ - **RLS is enforced by policies *and* grants.** Policies filter *rows*; `GRANT` controls *table access*. Prisma 8 authors and migrates the policies; it does not author grants (see *What Prisma 8 doesn't do yet*). A role with policies but no `GRANT` gets a permission error, not filtered rows. On Supabase your `public` tables already carry the platform-role grants via default privileges — the grant that is actually missing out of the box is `service_role`'s on `auth.*` / `storage.*` (see *Workflow — Grants*).
31
31
  - **JWT validation is eager and configurable — current Supabase projects need `jwksUrl`.** `asUser(jwt)` verifies the token (via `jose`) *before* any connection is acquired: signature + expiry against `jwksUrl` (asymmetric signing keys — **the default on current Supabase projects**, which sign ES256) **xor** `jwtSecret` (the symmetric HS256 secret — legacy projects only). Both or neither → a structured error with code `SUPABASE.CONFIG_INVALID`. Bad tokens throw a structured error with code `SUPABASE.JWT_INVALID` and a typed `meta.reason` — including a mismatch between the token's algorithm and the configured key source (an ES256 token against a `jwtSecret` client names the problem and tells you to switch to `jwksUrl`). The Postgres role is derived from the token's `role` claim (defaults to `authenticated`). Note: `supabase status` still prints a `JWT_SECRET` even on projects that sign ES256 — its presence does not mean your project uses it.
32
32
  - **Admin access to `auth.*` / `storage.*` is a secondary root on `service_role` only — and needs a one-time grant.** `db.asServiceRole().supabase` exposes the pack's own contract (`.sql`, `.orm`, `.nativeEnums`, `.execute`). The root exists only on `service_role` by design, but a real Supabase project grants `service_role` **no table privileges** on `auth.*` / `storage.*` (only schema `USAGE`; only `postgres` holds table grants). Before the admin root can read a Supabase-internal table, run the narrow grant once (see *Workflow — Grants*). `asUser` / `asAnon` have no `.supabase`, and the primary `asServiceRole().sql` / `.orm` stay scoped to *your* contract.
33
33
 
34
34
  ## Workflow — Wire the pack into the config
35
35
 
36
- The concept: the pack registers the Supabase contract space so your contract can reference it and the planner/verifier know what Supabase owns. The extension has no `/control` subpath yet, so it can't go through the target façade's `defineConfig({ extensions: [...] })` — it wires into the low-level config's `extensions` (see *What Prisma Next doesn't do yet*). The low-level imports below are a **deliberate exception** to the façade-only import rule, forced by that gap; the block mirrors `examples/supabase/prisma.config.ts` verbatim — copy it rather than composing your own:
36
+ The concept: the pack registers the Supabase contract space so your contract can reference it and the planner/verifier know what Supabase owns. The extension has no `/control` subpath yet, so it can't go through the target façade's `defineConfig({ extensions: [...] })` — it wires into the low-level config's `extensions` (see *What Prisma 8 doesn't do yet*). The low-level imports below are a **deliberate exception** to the façade-only import rule, forced by that gap; the block mirrors `examples/supabase/prisma.config.ts` verbatim — copy it rather than composing your own:
37
37
 
38
38
  ```typescript
39
39
  // prisma.config.ts
@@ -217,7 +217,7 @@ The concept: the runtime needs a **direct, session-capable** Postgres connection
217
217
  9. **Passing both `jwksUrl` and `jwtSecret`** (or neither) — the `supabase()` promise rejects with `SUPABASE.CONFIG_INVALID`. It's an async factory, so the misconfiguration surfaces as a rejection (`await` / `.catch`), not a synchronous throw.
218
218
  10. **Treating an RLS-filtered write as an error.** An `UPDATE` against a row the role can't see affects **0 rows** (no exception); only `withCheck` violations raise.
219
219
 
220
- ## What Prisma Next doesn't do yet
220
+ ## What Prisma 8 doesn't do yet
221
221
 
222
222
  - **No `/control` subpath on the extension** — it can't register through the target façade's `defineConfig({ extensions: [...] })`; wiring goes through the low-level config's `extensions` as shown above. File interest via `references/feedback.md`.
223
223
  - **`GRANT` authoring.** Table privileges are not contract elements; the one grant a Supabase app needs (the `service_role` `auth.*` pair for admin reads) is run once by hand (SQL editor / `psql`). If you want grants managed by the contract, file via `references/feedback.md`.
@@ -12,13 +12,13 @@ Do the version bump first (step 1 of the per-step flow below), re-sync the skill
12
12
 
13
13
  ## Pre-flight — extension compatibility
14
14
 
15
- Before changing any code, refuse to upgrade past any installed extension's pinned Prisma Next version. Extensions in Prisma Next pin every `@internal/*` dependency to a single exact version (no carets, no ranges); that pin is the highest version the extension has been validated against. Upgrading the user app past that pin would silently desynchronise the extension's type identity from the app's.
15
+ Before changing any code, refuse to upgrade past any installed extension's pinned Prisma 8 version. Extensions in Prisma 8 pin every `@internal/*` dependency to a single exact version (no carets, no ranges); that pin is the highest version the extension has been validated against. Upgrading the user app past that pin would silently desynchronise the extension's type identity from the app's.
16
16
 
17
17
  Steps:
18
18
 
19
19
  1. **Read `prisma.config.ts`** (or its TS-discoverable equivalent at the project root) and enumerate the list of extension packages it imports. Each `extensions: [...]` entry corresponds to an installed npm package.
20
20
  2. **For each extension**, read its installed `package.json` from `node_modules/<extension-package-name>/package.json` and find any `@internal/*` entry under `dependencies`, `peerDependencies`, or `optionalDependencies`. By construction those entries are exact-version pins (e.g. `"0.7.0"`), set when the extension author last ran their own upgrade.
21
- 3. **Compute the lowest pinned version across all extensions.** That is the highest Prisma Next version reachable by this app on its current extension set.
21
+ 3. **Compute the lowest pinned version across all extensions.** That is the highest Prisma 8 version reachable by this app on its current extension set.
22
22
  4. **Compare to the user's target.** If the target exceeds the lowest pin, halt with a structured message naming each lagging extension and its pinned version, and offer two paths:
23
23
  - (a) Wait for the lagging extension to publish a compatible release, then re-run.
24
24
  - (b) Re-run with `--to=<highest-reachable>` (or whatever flag/option the user is using to set the target).
@@ -29,7 +29,7 @@ If `prisma.config.ts` is absent or names no extensions, skip the pre-flight.
29
29
 
30
30
  ## Role detection
31
31
 
32
- This flow applies when the project **consumes** Prisma Next:
32
+ This flow applies when the project **consumes** Prisma 8:
33
33
 
34
34
  - `package.json` declares one or more `@internal/*` packages under `dependencies` / `devDependencies`, and
35
35
  - the package is *not* itself an extension (no `@internal/contract` (or other SPI) under `dependencies`/`peerDependencies`; name does not match `^@.*/extension-`; not referenced from a sibling app's `prisma.config.ts`).
@@ -38,7 +38,7 @@ If the project also matches the extension-author role, run **this** flow first a
38
38
 
39
39
  ## Version detection
40
40
 
41
- - **From-version.** Read the currently-installed Prisma Next version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` package. If the lockfile shows multiple `@internal/*` packages at different minors (already broken), the **lowest** minor is the from-version.
41
+ - **From-version.** Read the currently-installed Prisma 8 version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` package. If the lockfile shows multiple `@internal/*` packages at different minors (already broken), the **lowest** minor is the from-version.
42
42
  - **To-version.** Either the version the user specified, or whatever `npm view @internal/postgres dist-tags.latest` reports. Do not assume that is a stable version: while Prisma 8 is a release candidate, `latest` tracks the newest release, `8.0.0-rc.N` included. If the user wants a stable version specifically, they must name it.
43
43
 
44
44
  Report both back to the user before continuing.
@@ -14,19 +14,19 @@ Do the version bump first (step 1 of the per-step flow below), re-sync the skill
14
14
 
15
15
  ## Role detection
16
16
 
17
- This flow applies when the project **is** a Prisma Next extension. Heuristics:
17
+ This flow applies when the project **is** a Prisma 8 extension. Heuristics:
18
18
 
19
19
  - `package.json` declares `@internal/contract` (or another SPI package) under `dependencies` or `peerDependencies`, and
20
20
  - the package's `name` matches `^@.*/extension-` (the in-tree convention used by `@internal/extension-pgvector`, etc.), or
21
21
  - the package is referenced as an `extensions` entry from a sibling app's `prisma.config.ts` in the same monorepo.
22
22
 
23
- If the project additionally consumes Prisma Next from its own app code, run [`upgrade-app.md`](upgrade-app.md) first, then this flow in the same session.
23
+ If the project additionally consumes Prisma 8 from its own app code, run [`upgrade-app.md`](upgrade-app.md) first, then this flow in the same session.
24
24
 
25
25
  If detection is ambiguous, ask the user which role to operate under.
26
26
 
27
27
  ## Version detection
28
28
 
29
- - **From-version.** Read the currently-installed Prisma Next version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` entry. If the lockfile shows multiple `@internal/*` packages at different minors, the lowest minor is the from-version.
29
+ - **From-version.** Read the currently-installed Prisma 8 version from `pnpm-lock.yaml` (or `package-lock.json` / `yarn.lock`) by inspecting the resolved version of any `@internal/*` entry. If the lockfile shows multiple `@internal/*` packages at different minors, the lowest minor is the from-version.
30
30
  - **To-version.** Either the version the user specified, or whatever `npm view @internal/contract dist-tags.latest` reports. Do not assume that is a stable version: while Prisma 8 is a release candidate, `latest` tracks the newest release, `8.0.0-rc.N` included. If the user wants a stable version specifically, they must name it.
31
31
 
32
32
  Report both back to the user before continuing.
@@ -82,7 +82,7 @@ Move on to the next step. Repeat.
82
82
 
83
83
  ## Exact-pin rule
84
84
 
85
- Prisma Next extensions pin every `@internal/*` dependency to a single **exact** version (no `^`, no `~`, no range, no wildcard, no `workspace:` specifier in the published `package.json`). All `@internal/*` entries share the same version. The pin advances only after a successful upgrade run against the new minor.
85
+ Prisma 8 extensions pin every `@internal/*` dependency to a single **exact** version (no `^`, no `~`, no range, no wildcard, no `workspace:` specifier in the published `package.json`). All `@internal/*` entries share the same version. The pin advances only after a successful upgrade run against the new minor.
86
86
 
87
87
  `prisma-8-check-pins` (shipped by `@internal/extension-author-tools` — install with `pnpm add -D @internal/extension-author-tools`) enforces the rule. Run it locally with:
88
88
 
@@ -414,7 +414,7 @@ A database created under 0.13 still has the native enum type and columns typed w
414
414
 
415
415
  Because the contract hash does not change (the schema conversion in step 1 and the emitted contract are the end state), scaffold the migration as a data-only edge on the current hash: `prisma-next migration new --name convert-<type>-to-value-set --from <current-storage-hash>`, give the ALTER op `operationClass: 'data'`, and self-emit by running the scaffolded `migration.ts`. The `DROP TYPE` has no op builder — express it as an inline `rawSql` op.
416
416
 
417
- A complete worked example ships in the Prisma Next repo: `examples/prisma-8-demo/migrations/app/20260611T1856_convert_user_type_to_value_set/migration.ts` — three ops (data-class ALTER … USING, `addCheckConstraint`, rawSql `DROP TYPE`), each with pre/postchecks that make replay idempotent.
417
+ A complete worked example ships in the Prisma 8 repo: `examples/prisma-8-demo/migrations/app/20260611T1856_convert_user_type_to_value_set/migration.ts` — three ops (data-class ALTER … USING, `addCheckConstraint`, rawSql `DROP TYPE`), each with pre/postchecks that make replay idempotent.
418
418
 
419
419
  Note: `prisma-next contract infer` **refuses** databases containing native enum types — it names each offending type and points at this conversion. Convert the database first, then infer.
420
420
 
@@ -588,7 +588,7 @@ changes:
588
588
 
589
589
  ## `strip-sha256-hash-prefixes`
590
590
 
591
- Starting at the 0.17 release, every content hash Prisma Next mints or accepts is bare lowercase hex — the `sha256:` prefix is removed across the board: emitted `contract.json` / `contract.d.ts` (including the `StorageHashBase<'…'>` / `ProfileHashBase<'…'>` branded type literals), migration manifests, refs, CLI output, and the marker/ledger bookkeeping tables in your database. The prefix carried no information (the algorithm never varied per hash), and the hash **value** — not an in-band tag — signals a format change. Loaders and validators now reject the legacy prefixed form outright.
591
+ Starting at the 0.17 release, every content hash Prisma 8 mints or accepts is bare lowercase hex — the `sha256:` prefix is removed across the board: emitted `contract.json` / `contract.d.ts` (including the `StorageHashBase<'…'>` / `ProfileHashBase<'…'>` branded type literals), migration manifests, refs, CLI output, and the marker/ledger bookkeeping tables in your database. The prefix carried no information (the algorithm never varied per hash), and the hash **value** — not an in-band tag — signals a format change. Loaders and validators now reject the legacy prefixed form outright.
592
592
 
593
593
  Two distinct effects on your checked-in artefacts:
594
594
 
@@ -717,23 +717,23 @@ The two fields could disagree — a `prefix` that is not what `name` ends with w
717
717
 
718
718
  ## Incidental dependency and lint-config bumps
719
719
 
720
- Routine dev-dependency bumps and biome `$schema` version alignment in `examples/` (dependabot `dev-deps` group, PR #1058) require no Prisma Next-specific upgrade action; review and test the affected examples as with any routine dependency update.
720
+ Routine dev-dependency bumps and biome `$schema` version alignment in `examples/` (dependabot `dev-deps` group, PR #1058) require no Prisma 8-specific upgrade action; review and test the affected examples as with any routine dependency update.
721
721
 
722
722
  ## Incidental dependency bumps in examples
723
723
 
724
- Routine runtime dependency bumps in `examples/` (dependabot `runtime-deps` group, PR #1065) require no Prisma Next-specific upgrade action; review and test the affected examples as with any routine dependency update.
724
+ Routine runtime dependency bumps in `examples/` (dependabot `runtime-deps` group, PR #1065) require no Prisma 8-specific upgrade action; review and test the affected examples as with any routine dependency update.
725
725
 
726
726
  ## Incidental runtime dependency bumps in examples (August 2026)
727
727
 
728
- Routine runtime dependency bumps in `examples/` (dependabot `runtime-deps` group, PR #29872) require no Prisma Next-specific upgrade action; review and test the affected examples as with any routine dependency update.
728
+ Routine runtime dependency bumps in `examples/` (dependabot `runtime-deps` group, PR #29872) require no Prisma 8-specific upgrade action; review and test the affected examples as with any routine dependency update.
729
729
 
730
730
  ## Incidental dev-dependency bumps in examples (August 2026)
731
731
 
732
- Routine dev-dependency bumps in `examples/` (dependabot `dev-deps` group, PR #29877) require no Prisma Next-specific upgrade action; review and test the affected examples as with any routine dependency update.
732
+ Routine dev-dependency bumps in `examples/` (dependabot `dev-deps` group, PR #29877) require no Prisma 8-specific upgrade action; review and test the affected examples as with any routine dependency update.
733
733
 
734
734
  ## Incidental example dependency bumps (react-router 8)
735
735
 
736
- The `react-router-demo` example moves its `react-router`, `@react-router/dev`, `@react-router/node`, and `@react-router/serve` dependencies from 7.x to 8.x. This is an example-local framework upgrade and requires no Prisma Next-specific upgrade action; the Prisma Next surfaces the example uses are unchanged.
736
+ The `react-router-demo` example moves its `react-router`, `@react-router/dev`, `@react-router/node`, and `@react-router/serve` dependencies from 7.x to 8.x. This is an example-local framework upgrade and requires no Prisma 8-specific upgrade action; the Prisma 8 surfaces the example uses are unchanged.
737
737
 
738
738
  ## `pg-int8-application-values-are-bigint`
739
739
 
@@ -191,7 +191,7 @@ changes:
191
191
  compares the predicate byte-for-byte, and warns whenever the body was not captured from the
192
192
  database — including on contracts `contract infer` wrote, which warn on the next
193
193
  `contract emit`. `contract infer` now writes the `map:` form for you: pulling a database
194
- emits `@@check` for every live check Prisma Next did not derive, so a hand-written constraint
194
+ emits `@@check` for every live check Prisma 8 did not derive, so a hand-written constraint
195
195
  is declared from the first pull instead of reading as an undeclared extra that a plan allowing
196
196
  destructive changes would drop. Nothing is required of an existing contract — the surface is
197
197
  additive.
@@ -502,7 +502,7 @@ data all along. Grep the first plan for `dropCheckConstraint` and check every co
502
502
  - to keep it, run plans for that table under an additive-only policy. The constraint stays in
503
503
  place and keeps enforcing; plain `db verify` tolerates it, and only `--strict` reports it as
504
504
  an undeclared extra. Better: declare it with `@@check(expression: "…", map: "<physical name>")`,
505
- or re-run `contract infer`, which now emits exactly that for every live check Prisma Next did
505
+ or re-run `contract infer`, which now emits exactly that for every live check Prisma 8 did
506
506
  not derive — the constraint becomes declared and stops being an extra at all;
507
507
  - if it was already dead, let the drop through under the destructive plan.
508
508
 
@@ -24,7 +24,7 @@ changes:
24
24
  to `@prisma/orm-sqlite/config` and `@prisma/orm-mongo/config`.
25
25
  3. If the config reads `process.env`, keep (or add) `import 'dotenv/config';` as the
26
26
  first import — the loader does not read `.env` for you.
27
- 4. In `package.json`, replace the `prisma-next` devDependency with `@prisma/cli@next`
27
+ 4. In `package.json`, replace the `prisma-next` devDependency with `prisma@latest`
28
28
  plus `@prisma/cli-engine` at the exact version that `@prisma/cli` names in its own
29
29
  dependencies, and rewrite scripts: `prisma-next <subcommand>` becomes
30
30
  `prisma-cli <subcommand>` (`migration apply` becomes `migrate`; `init` alone moves
@@ -21,7 +21,7 @@ changes:
21
21
 
22
22
  ## `rename-orm-pagination-methods`
23
23
 
24
- Find calls on Prisma Next ORM collections and apply these translations:
24
+ Find calls on Prisma 8 ORM collections and apply these translations:
25
25
 
26
26
  - `.take(n)` → `.limit(n)`
27
27
  - `.skip(n)` → `.offset(n)`
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  from: "8.0.0-rc.9"
3
3
  to: "8.0.0-rc.10"
4
+ # Prisma 8 naming sweep: prose only, no entry required
4
5
  changes:
5
6
  - id: to-one-relations-record-nullable
6
7
  summary: |
@@ -12,7 +12,7 @@ changes:
12
12
  anyMatch: true
13
13
  - id: facade-add-close-and-async-dispose
14
14
  summary: |
15
- The official Prisma Next facades (`@internal/postgres`, `@internal/sqlite`, `@internal/mongo`) now expose `close()` and `[Symbol.asyncDispose]` so short-lived scripts can release facade-owned resources cleanly and exit instead of hanging on a live connection. Extensions that expose a facade in the same shape should add the same surface for parity, honouring the ownership rule (only close resources the facade itself constructed) and managing a terminal closed state (subsequent operations reject with a clear error). No script — manual code authoring per extension.
15
+ The official Prisma 8 facades (`@internal/postgres`, `@internal/sqlite`, `@internal/mongo`) now expose `close()` and `[Symbol.asyncDispose]` so short-lived scripts can release facade-owned resources cleanly and exit instead of hanging on a live connection. Extensions that expose a facade in the same shape should add the same surface for parity, honouring the ownership rule (only close resources the facade itself constructed) and managing a terminal closed state (subsequent operations reject with a clear error). No script — manual code authoring per extension.
16
16
  detection:
17
17
  glob: "**/src/runtime/*.ts"
18
18
  contains:
@@ -458,7 +458,7 @@ changes:
458
458
  Supabase must create them — `bootstrapSupabaseShim` from
459
459
  `@internal/extension-supabase/test/utils` already does. The public
460
460
  `SupabaseRoleBinding['role']` type is unchanged (`'anon' | 'authenticated' | 'service_role'`);
461
- it is now derived from the `SupabaseRole` Prisma Next enum handle's values; the contract declares the roles via the
461
+ it is now derived from the `SupabaseRole` Prisma 8 enum handle's values; the contract declares the roles via the
462
462
  new PSL `role` blocks inside `namespace unbound { }` (see the `psl-role-block` entry).
463
463
  detection:
464
464
  glob: "**/*.{ts,mts,cts,tsx,prisma,json}"
@@ -523,7 +523,7 @@ changes:
523
523
  devDependencies to compile against those declarations — that workaround is now the
524
524
  hazard. `pg` ships no types of its own, so a second `@types/pg` copy at a different
525
525
  version gives `pg.Client` / `pg.Pool` two identities, and handing your own client or
526
- pool to a Prisma Next API stops compiling with `Argument of type 'Client' is not
526
+ pool to a Prisma 8 API stops compiling with `Argument of type 'Client' is not
527
527
  assignable to parameter of type 'Client'` (`Type 'Client' is missing the following
528
528
  properties from type 'Client': connection, setTypeParser, getTypeParser`). Drop
529
529
  `@types/pg` from your extension and take it transitively, or pin it to the version
@@ -687,7 +687,7 @@ After the migration, run the extension package's typecheck, lint, and tests. Ver
687
687
 
688
688
  `@internal/postgres`, `@internal/extension-supabase`, and `@internal/driver-postgres` re-export `pg` types from their published `.d.mts` files, so each declares `@types/pg` under `dependencies` from 0.17. Compiling against those declarations no longer requires your extension to supply `@types/pg` itself.
689
689
 
690
- If your extension's `package.json` declares `@types/pg`, act on it. `pg` carries no types of its own, so two `@types/pg` copies in the tree give `pg.Client` and `pg.Pool` two distinct identities. Any call that hands your own client or pool to a Prisma Next API — `new PostgresControlDriver(client)`, a driver `connect: { pool }` — then fails:
690
+ If your extension's `package.json` declares `@types/pg`, act on it. `pg` carries no types of its own, so two `@types/pg` copies in the tree give `pg.Client` and `pg.Pool` two distinct identities. Any call that hands your own client or pool to a Prisma 8 API — `new PostgresControlDriver(client)`, a driver `connect: { pool }` — then fails:
691
691
 
692
692
  ```text
693
693
  Argument of type 'Client' is not assignable to parameter of type 'Client'.
@@ -696,11 +696,11 @@ Argument of type 'Client' is not assignable to parameter of type 'Client'.
696
696
 
697
697
  The error names the same type on both sides; the two paths under `node_modules/.pnpm/@types+pg@<version>/` in the full message are what identify it.
698
698
 
699
- Prefer dropping `@types/pg` from your extension's `devDependencies` and taking it transitively, so its version tracks Prisma Next's. If you keep the entry — because your own code imports `pg` directly and you want the dependency explicit — pin it to the version `@internal/postgres` depends on rather than a range that can resolve elsewhere.
699
+ Prefer dropping `@types/pg` from your extension's `devDependencies` and taking it transitively, so its version tracks Prisma 8's. If you keep the entry — because your own code imports `pg` directly and you want the dependency explicit — pin it to the version `@internal/postgres` depends on rather than a range that can resolve elsewhere.
700
700
 
701
701
  ## Incidental lint-config bumps
702
702
 
703
- Biome `$schema` version alignment in `packages/3-extensions/` (dependabot `dev-deps` group, PR #1058) requires no Prisma Next-specific upgrade action by extension authors.
703
+ Biome `$schema` version alignment in `packages/3-extensions/` (dependabot `dev-deps` group, PR #1058) requires no Prisma 8-specific upgrade action by extension authors.
704
704
 
705
705
  ## `codec-json-projections-must-agree-with-encode-json`
706
706
 
@@ -252,7 +252,7 @@ changes:
252
252
  surface is gated on it. And a check is no longer "derived" merely by being wire-named —
253
253
  user-authored checks are wire-named too. Derivation is now decided by whether the wire prefix
254
254
  is one derivation would produce for a column of that table. A pack that read
255
- `check.prefix !== undefined` to mean "Prisma Next generated this" must use the same
255
+ `check.prefix !== undefined` to mean "Prisma 8 generated this" must use the same
256
256
  prefix-shape test, `derivedCheckPrefixes` from `@internal/sql-schema-ir/naming`. An authored
257
257
  name that collides with a derived prefix shape is rejected at authoring with
258
258
  `CONTRACT.CHECK_NAME_RESERVED`.
@@ -24,7 +24,7 @@ changes:
24
24
  to `@prisma/orm-sqlite/config` and `@prisma/orm-mongo/config`.
25
25
  3. If the config reads `process.env`, keep (or add) `import 'dotenv/config';` as the
26
26
  first import — the loader does not read `.env` for you.
27
- 4. In `package.json`, replace the `prisma-next` devDependency with `@prisma/cli@next`
27
+ 4. In `package.json`, replace the `prisma-next` devDependency with `prisma@latest`
28
28
  plus `@prisma/cli-engine` at the exact version that `@prisma/cli` names in its own
29
29
  dependencies, and update your extension's contract-space
30
30
  build and emit scripts from `prisma-next contract emit` to `prisma-cli contract emit`.
@@ -21,7 +21,7 @@ changes:
21
21
 
22
22
  ## `rename-orm-pagination-methods`
23
23
 
24
- Find calls on Prisma Next ORM collections in extension source and tests, then apply these translations:
24
+ Find calls on Prisma 8 ORM collections in extension source and tests, then apply these translations:
25
25
 
26
26
  - `.take(n)` → `.limit(n)`
27
27
  - `.skip(n)` → `.offset(n)`
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  from: "8.0.0-rc.9"
3
3
  to: "8.0.0-rc.10"
4
+ # Prisma 8 naming sweep: prose only, no entry required
4
5
  # sql-orm-client doc-comment sweep: reviewed, no entry required
5
6
  changes:
6
7
  - id: to-one-relations-record-nullable