@prisma/orm-mongo 8.0.0-rc.9-dev.11 → 8.0.0-rc.9-dev.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-mongo",
3
- "version": "8.0.0-rc.9-dev.11",
3
+ "version": "8.0.0-rc.9-dev.12",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -10,16 +10,16 @@
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-mongo": "8.0.0-rc.9-dev.11",
14
- "@prisma/orm-framework": "8.0.0-rc.9-dev.11",
15
- "@prisma/orm-target-mongo": "8.0.0-rc.9-dev.11",
16
- "@prisma/orm-toolchain": "8.0.0-rc.9-dev.11",
13
+ "@prisma/orm-family-mongo": "8.0.0-rc.9-dev.12",
14
+ "@prisma/orm-framework": "8.0.0-rc.9-dev.12",
15
+ "@prisma/orm-target-mongo": "8.0.0-rc.9-dev.12",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.9-dev.12",
17
17
  "pathe": "^2.0.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@internal/mongo": "8.0.0-rc.9-dev.11",
21
- "@repo/tsconfig": "8.0.0-rc.9-dev.11",
22
- "@repo/tsdown": "8.0.0-rc.9-dev.11",
20
+ "@internal/mongo": "8.0.0-rc.9-dev.12",
21
+ "@repo/tsconfig": "8.0.0-rc.9-dev.12",
22
+ "@repo/tsdown": "8.0.0-rc.9-dev.12",
23
23
  "tsdown": "0.22.14",
24
24
  "typescript": "5.9.3"
25
25
  },
@@ -1,24 +1,22 @@
1
1
  ---
2
2
  name: prisma-8
3
3
  description: >-
4
- Comprehensive guide for building with Prisma 8 (Prisma 8), the
5
- contract-first data layer. Use whenever working on Prisma code in a project
6
- that uses it authoring or editing the data contract (contract.prisma, PSL,
7
- TypeScript builders), migrations, queries (db.orm / db.sql), runtime wiring
8
- (db.ts, middleware, DATABASE_URL), build-tool integration, Supabase / RLS,
9
- reading structured errors (dotted codes such as MIGRATION.HASH_MISMATCH),
10
- or filing feedback and for orientation questions like "what is Prisma
11
- Next" or comparisons to other ORMs. Signals that this skill applies:
12
- @internal/* or @prisma/orm-* imports, prisma.config.ts, contract.prisma /
13
- contract.json / contract.d.ts, `prisma orm` CLI commands, dotted error
14
- codes. Also covers upgrading Prisma in a project "upgrade
15
- Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", or dealing
16
- with an @internal/* version bump, in a consumer app or in an extension
17
- package. Does not apply to Prisma ORM 7 or earlier
18
- (schema.prisma + @prisma/client projects).
4
+ Use when working in a project that depends on @prisma/orm-postgres,
5
+ @prisma/orm-sqlite, or @prisma/orm-mongo (Prisma 8, formerly Prisma Next): editing
6
+ contract.prisma or a contract.ts builder, running `prisma contract emit`,
7
+ planning or applying migrations, editing migration.ts, writing db.orm /
8
+ db.sql / db.query queries, wiring db.ts or middleware, integrating a build
9
+ tool, using the Supabase extension or RLS, or reading a dotted error code
10
+ such as MIGRATION.HASH_MISMATCH. Use when the user asks "what is Prisma
11
+ 8", "where do I start", or compares it to another ORM. Use when the user
12
+ asks to upgrade or bump Prisma 8 in an app or an extension package. Use when
13
+ you see @internal/* or @prisma/orm-* imports, prisma.config.ts with
14
+ definePrismaConfig, or contract.json / contract.d.ts. Do not use for Prisma
15
+ ORM 7 or earlier (schema.prisma + @prisma/client).
19
16
  metadata:
20
17
  library: '@prisma/orm-mongo'
21
- library_version: '8.0.0-rc.9-dev.11'
18
+ library_version: '8.0.0-rc.9-dev.12'
19
+ version: '2026-09-11'
22
20
  ---
23
21
 
24
22
  # Prisma 8 (Prisma 8)
@@ -27,6 +25,14 @@ metadata:
27
25
 
28
26
  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.
29
27
 
28
+ ## Pre-conditions
29
+
30
+ Check these before acting on anything below. Halt on the first one that fails and tell the user what is missing.
31
+
32
+ 1. **The project is on Prisma 8.** `prisma.config.ts` exports `definePrismaConfig({ orm: ... })`, and `package.json` depends on `@prisma/orm-postgres`, `@prisma/orm-sqlite`, or `@prisma/orm-mongo`. A project with `schema.prisma` and `@prisma/client` is Prisma 7 or earlier; this skill does not apply to it, and its instructions will break such a project.
33
+ 2. **The skill matches the installed version.** Compare `metadata.library_version` in this file's frontmatter with the installed `@prisma/orm-*` version in `package.json`. If they differ, run `prisma skills sync` and re-read this file before continuing.
34
+ 3. **The contract artefacts exist.** `contract.json` and `contract.d.ts` sit next to the contract source named by `prisma.config.ts`. If they are missing or older than the source, run `prisma contract emit` first; every query and migration instruction below assumes current artefacts.
35
+
30
36
  **Import paths in the references.** The reference files spell façade imports as `@internal/<target>/<subpath>` and `@internal/extension-<name>/<subpath>`. In an application those packages are published as `@prisma/orm-<target>/<subpath>` (`@prisma/orm-postgres/runtime`, `@prisma/orm-mongo/config`, `@prisma/orm-sqlite/runtime`) and `@prisma/orm-extension-<name>/<subpath>` (`@prisma/orm-extension-pgvector/control`). Write the `@prisma/orm-*` name in user code; the two spellings are the same package. Paths already written as `@prisma/orm-*` in the references are exact. 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.
31
37
 
32
38
  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.
@@ -75,7 +75,7 @@ Both flags are also available on `migration list` and `migration graph`. `migrat
75
75
 
76
76
  ### Plan- and apply-time diagnostics
77
77
 
78
- These codes surface on `migration plan`, `migration ref set`, and `db migrate` — not on `migration status`. See [Migration System § Recovery affordances](../../docs/architecture%20docs/subsystems/7.%20Migration%20System.md#recovery-affordances) and [ADR 218](../../docs/architecture%20docs/adrs/ADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md).
78
+ These codes surface on `migration plan`, `migration ref set`, and `db migrate` — not on `migration status`. See [Migration System § Recovery affordances](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/subsystems/7.%20Migration%20System.md#recovery-affordances) and [ADR 218](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/adrs/ADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md).
79
79
 
80
80
  | Code | When | Meaning | Next move |
81
81
  |---|---|---|---|
@@ -140,7 +140,7 @@ If the `db` ref's pointer is itself missing and the hash isn't a graph node eith
140
140
 
141
141
  `db` is a **default ref name**, not a reserved one. The framework overwrites it on the next dev cycle; you may `migration ref set db <hash>` explicitly and accept that a subsequent `db update` replaces it when run against the default URL.
142
142
 
143
- Canonical detail: [Migration System § Contract resolution through the snapshot store](../../docs/architecture%20docs/subsystems/7.%20Migration%20System.md#contract-resolution-through-the-snapshot-store), [§ `migration plan`](../../docs/architecture%20docs/subsystems/7.%20Migration%20System.md#migration-plan), [§ Recovery affordances](../../docs/architecture%20docs/subsystems/7.%20Migration%20System.md#recovery-affordances), [ADR 218 — Refs with paired contract snapshots and universal graph-node invariant](../../docs/architecture%20docs/adrs/ADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md) (TML-2629, its paired-snapshot part superseded — see the ADR's Status note), and [ADR 240 — Contract snapshots live in a content-addressed store](../../docs/architecture%20docs/adrs/ADR%20240%20-%20Contract%20snapshots%20live%20in%20a%20content-addressed%20store.md).
143
+ Canonical detail: [Migration System § Contract resolution through the snapshot store](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/subsystems/7.%20Migration%20System.md#contract-resolution-through-the-snapshot-store), [§ `migration plan`](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/subsystems/7.%20Migration%20System.md#migration-plan), [§ Recovery affordances](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/subsystems/7.%20Migration%20System.md#recovery-affordances), [ADR 218 — Refs with paired contract snapshots and universal graph-node invariant](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/adrs/ADR%20218%20-%20Refs%20with%20paired%20contract%20snapshots%20and%20universal%20graph-node%20invariant.md) (TML-2629, its paired-snapshot part superseded — see the ADR's Status note), and [ADR 240 — Contract snapshots live in a content-addressed store](https://github.com/prisma/orm/blob/main/docs/architecture%20docs/adrs/ADR%20240%20-%20Contract%20snapshots%20live%20in%20a%20content-addressed%20store.md).
144
144
 
145
145
  ## Workflow — `db update` (quick path)
146
146
 
@@ -516,11 +516,11 @@ For the full graph topology: `pnpm prisma migration graph` (also supports `--leg
516
516
 
517
517
  ## `@@control` and DDL scope
518
518
 
519
- 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.
519
+ 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`](https://github.com/prisma/orm/blob/main/packages/2-sql/2-authoring/contract-psl/README.md) for authoring syntax.
520
520
 
521
521
  ## Telemetry
522
522
 
523
- The CLI collects anonymous usage data by default. To opt out, set `PRISMA_DISABLE_TELEMETRY=1` or `DO_NOT_TRACK=1` in your environment. See [`docs/Telemetry.md`](../../docs/Telemetry.md) for the full opt-out reference.
523
+ The CLI collects anonymous usage data by default. To opt out, set `PRISMA_DISABLE_TELEMETRY=1` or `DO_NOT_TRACK=1` in your environment. See [`docs/Telemetry.md`](https://github.com/prisma/orm/blob/main/docs/Telemetry.md) for the full opt-out reference.
524
524
 
525
525
  ## Checklist
526
526
 
@@ -80,7 +80,7 @@ await db.orm.public.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. The combinators are exported from the façade's `orm-client` subpath:
83
+ **Combinators** (`and`, `or`, `not`) compose predicates, and **relation predicates** (`.some(...)`, `.none(...)`, `.every(...)`) recurse into a relation. `.some()` and `.none()` take an optional predicate — `u.posts.none()` means "has no posts", `u.posts.some()` means "has at least one" — while `.every(...)` requires one: `u.posts.every((p) => p.published.eq(true))`. The combinators are exported from the façade's `orm-client` subpath:
84
84
 
85
85
  ```typescript
86
86
  import { and, or, not } from '@prisma/orm-postgres/orm-client';
@@ -194,7 +194,7 @@ export const db = postgres<Contract>({
194
194
  });
195
195
  ```
196
196
 
197
- For the full option surface, read the source: `packages/2-sql/5-runtime/src/middleware/lints.ts` and `.../budgets.ts`. The `severities` keys (`selectStar`, `noLimit`, `deleteWithoutWhere`, `updateWithoutWhere`, `readOnlyMutation` for lints; `rowCount`, `latency` for budgets) are the source of truth; do not extrapolate to a key that ripgrep can't find. `lints()` with no argument uses the default severities.
197
+ For the full option surface, read the source: `packages/2-sql/5-runtime/src/middleware/lints.ts` and `.../budgets.ts`. The `severities` keys (`selectStar`, `noLimit`, `deleteWithoutWhere`, `updateWithoutWhere`, `readOnlyMutation` for lints; `rowCount`, `latency` for budgets) are the source of truth; do not extrapolate to a key that is not in those two files. `lints()` with no argument uses the default severities.
198
198
 
199
199
  ## Workflow — Cache middleware
200
200