@prisma/orm-mongo 8.0.0-rc.4-dev.17 → 8.0.0-rc.5-dev.1

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 (64) hide show
  1. package/package.json +11 -10
  2. package/skills/prisma-8/SKILL.md +84 -0
  3. package/skills/prisma-8/references/build.md +142 -0
  4. package/skills/prisma-8/references/contract.md +417 -0
  5. package/skills/prisma-8/references/debug.md +141 -0
  6. package/skills/prisma-8/references/feedback.md +251 -0
  7. package/skills/prisma-8/references/migration-review.md +224 -0
  8. package/skills/prisma-8/references/migrations.md +519 -0
  9. package/skills/prisma-8/references/queries-mongo.md +236 -0
  10. package/skills/prisma-8/references/queries-postgres.md +415 -0
  11. package/skills/prisma-8/references/queries.md +168 -0
  12. package/skills/prisma-8/references/quickstart.md +326 -0
  13. package/skills/prisma-8/references/runtime.md +344 -0
  14. package/skills/prisma-8/references/supabase.md +244 -0
  15. package/skills/prisma-8/references/upgrade-app.md +101 -0
  16. package/skills/prisma-8/references/upgrade-extension.md +105 -0
  17. package/skills/prisma-8/upgrading/app/upgrades/0.10-to-0.11/instructions.md +56 -0
  18. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/instructions.md +381 -0
  19. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-closed-mongo-contracts.ts +202 -0
  20. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-domain-namespaced-contracts.ts +201 -0
  21. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-postgres-public-default.ts +198 -0
  22. package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
  23. package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/instructions.md +339 -0
  24. package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/re-emit-mti-variant-link-columns.ts +229 -0
  25. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/instructions.md +543 -0
  26. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
  27. package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
  28. package/skills/prisma-8/upgrading/app/upgrades/0.14-to-0.15/instructions.md +359 -0
  29. package/skills/prisma-8/upgrading/app/upgrades/0.15-to-0.16/instructions.md +173 -0
  30. package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/instructions.md +805 -0
  31. package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
  32. package/skills/prisma-8/upgrading/app/upgrades/0.17-to-8.0.0-rc.1/instructions.md +72 -0
  33. package/skills/prisma-8/upgrading/app/upgrades/0.7-to-0.8/instructions.md +8 -0
  34. package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/instructions.md +36 -0
  35. package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
  36. package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/instructions.md +86 -0
  37. package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
  38. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +588 -0
  39. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
  40. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +158 -0
  41. package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +42 -0
  42. package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +276 -0
  43. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/instructions.md +738 -0
  44. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/migrate-contract-testing-imports.ts +97 -0
  45. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/regenerate-extension-public-baseline.ts +223 -0
  46. package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
  47. package/skills/prisma-8/upgrading/extension/upgrades/0.12-to-0.13/instructions.md +266 -0
  48. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/instructions.md +522 -0
  49. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
  50. package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
  51. package/skills/prisma-8/upgrading/extension/upgrades/0.14-to-0.15/instructions.md +803 -0
  52. package/skills/prisma-8/upgrading/extension/upgrades/0.15-to-0.16/instructions.md +219 -0
  53. package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/instructions.md +731 -0
  54. package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
  55. package/skills/prisma-8/upgrading/extension/upgrades/0.17-to-8.0.0-rc.1/instructions.md +194 -0
  56. package/skills/prisma-8/upgrading/extension/upgrades/0.7-to-0.8/instructions.md +8 -0
  57. package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/instructions.md +57 -0
  58. package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
  59. package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/instructions.md +150 -0
  60. package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
  61. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +746 -0
  62. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
  63. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +137 -0
  64. package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +129 -0
@@ -0,0 +1,219 @@
1
+ ---
2
+ from: "0.15"
3
+ to: "0.16"
4
+ changes:
5
+ - id: extension-supabase-test-utils-export-removed
6
+ summary: |
7
+ `@internal/extension-supabase` no longer exports the `./test/utils` subpath
8
+ (`bootstrapSupabaseShim`), and it is no longer a pattern to copy for extension test
9
+ tooling. The import typechecked (types shipped in `dist`), but the subpath never worked
10
+ from npm — the shim reads fixture `.sql` files that were never published, so every call
11
+ failed with ENOENT before touching a database. Delete any import of
12
+ `@internal/extension-supabase/test/utils`; keep hermetic test helpers package-internal
13
+ (tests import them by source path) rather than publishing them as subpath exports whose
14
+ on-disk fixtures don't ship.
15
+ detection:
16
+ glob: "**/*.{ts,mts,cts,js,mjs}"
17
+ contains:
18
+ - "extension-supabase/test/utils"
19
+ anyMatch: true
20
+ - id: identity-columns-need-explicit-default-under-strict-verify
21
+ summary: |
22
+ `contract infer` now emits `@default(autoincrement())` for a Postgres `GENERATED ALWAYS AS IDENTITY` / `GENERATED BY DEFAULT AS IDENTITY` column (previously it emitted a bare column with no default, since Postgres reports no `column_default` for an identity column). Symmetrically, `db verify` introspecting a live identity column now resolves its default to `autoincrement()` too (previously it resolved to nothing). This only changes `db verify --strict` — without `--strict`, an undeclared live default is tolerated either way (and it is fully tolerated regardless of strictness under `control: 'external'`, the posture most extension packs declare). If your pack's own tests run `db verify --strict` against a table with an identity column whose contract does not declare `@default(autoincrement())`, verify now reports that default as an unexpected extra. Re-run `contract infer` for the affected table, or add `@default(autoincrement())` by hand.
23
+ - id: pluralize-back-relation-names-no-longer-double-pluralize
24
+ summary: |
25
+ `contract infer`'s back-relation field name generation used a hand-rolled pluralization rule that appended `es` to any table name already ending in `s`/`x`/`z`/`ch`/`sh`, doubling an already-plural table name (`sessions` -> `sessionses`). `contract infer` now uses real inflection (the `pluralize` library) and produces the correct name (`sessions` stays `sessions`; a genuinely singular `status` still becomes `statuses`). This only affects a future `contract infer` run — an already-generated `.prisma` file is untouched, so nothing breaks until you next re-run infer for your pack. If you do re-run `contract infer` against a schema with an already-plural table name, diff the regenerated `.prisma` file for any back-relation field whose name changed — that's a public field name your pack's consumers access via `.include()`/`.select()`/the generated TypeScript types, so a rename is a breaking change to your pack's own published surface, to be versioned and documented like any other.
26
+ - id: scalar-type-descriptors-channel-removed
27
+ summary: |
28
+ `ComponentMetadata.scalarTypeDescriptors` is retired — the unified authoring type namespace
29
+ is now the single channel for scalar types. If your extension/adapter descriptor declared
30
+ `scalarTypeDescriptors: new Map([['String', 'pg/text@1'], ...])`, move each entry to a
31
+ zero-arg type-constructor contribution in the descriptor's `authoring.type` namespace:
32
+ `String: { kind: 'typeConstructor', output: { codecId: 'pg/text@1', nativeType: 'text' } }`.
33
+ The `nativeType` is now explicit — it was previously derived from the codec's first target
34
+ type, so check the codec manifest for the value to inline. Code that read
35
+ `ControlStack.scalarTypeDescriptors` / `ContractSourceContext.scalarTypeDescriptors` should
36
+ read `stack.scalarTypes` (the scalar type names) or derive the name ->
37
+ `{ codecId, nativeType }` map via `collectScalarTypeConstructors(stack.authoringContributions.type)`
38
+ from `@internal/framework-components/authoring`. `assembleScalarTypeDescriptors` is
39
+ deleted, and `validateScalarTypeCodecIds` now takes the authoring type namespace instead of
40
+ a descriptor map.
41
+ detection:
42
+ glob: "**/*.{ts,mts,cts}"
43
+ contains:
44
+ - "scalarTypeDescriptors"
45
+ - "assembleScalarTypeDescriptors"
46
+ anyMatch: true
47
+ - id: postgres-json-rebound-to-native-json
48
+ summary: |
49
+ On the postgres target the PSL `Json` scalar re-binds from `pg/jsonb@1` / `jsonb` to
50
+ `pg/json@1` / `json`; a new bare `Jsonb` scalar carries `pg/jsonb@1` / `jsonb`
51
+ (`postgresScalarAuthoringTypes` in `@internal/adapter-postgres`). Extension test
52
+ schemas and fixtures that author postgres `Json` fields and mean jsonb storage must
53
+ switch those fields to `Jsonb`; assertions that pin the `Json` name's derived binding
54
+ (e.g. over `collectScalarTypeConstructors(stack.authoringContributions.type)` or
55
+ `stack.scalarTypes`) now expect `Json -> { codecId: 'pg/json@1', nativeType: 'json' }`
56
+ plus the new `Jsonb -> { codecId: 'pg/jsonb@1', nativeType: 'jsonb' }` entry. PSL
57
+ value-object storage columns still emit jsonb (the interpreter now prefers the target's
58
+ `Jsonb` scalar and falls back to `Json`). The legacy `@db.Json` attribute path
59
+ (`NATIVE_TYPE_SPECS`) is unchanged, as are sqlite/mongo `Json` bindings and the TS
60
+ builder surface (`field.json()`, `jsonbColumn`).
61
+ detection:
62
+ glob: "**/*.{prisma,ts,mts,cts}"
63
+ contains:
64
+ - "Json"
65
+ anyMatch: true
66
+ - id: default-generators-no-longer-set-storage
67
+ summary: |
68
+ `@default(<generator>)` never mutates a column's storage any more — the type position is
69
+ the only storage decider — and the whole generator-storage-override SPI is retired with
70
+ it. Removed surfaces: `MutationDefaultGeneratorDescriptor.resolveGeneratedColumnDescriptor`
71
+ (`@internal/framework-components/control`) — generator descriptors are now
72
+ `{ id, applicableCodecIds?, buildPhases? }` only, and `applicableCodecIds` remains the
73
+ validation channel (`PSL_INVALID_DEFAULT_APPLICABILITY` on mismatch); the transitional
74
+ `baseScalar` marker on `AuthoringTypeConstructorDescriptor` and
75
+ `ScalarTypeConstructorOutput` (`@internal/framework-components/authoring`) — scalar
76
+ type-constructor contributions and the derived scalar view are plain
77
+ `{ codecId, nativeType, typeParams? }` again; and the `@internal/ids` exports
78
+ `resolveBuiltinGeneratedColumnDescriptor` / `GeneratedColumnDescriptor` (the TS spec
79
+ helpers `uuidv4()`, `nanoid()`, … still return `GeneratedColumnSpec` bundling their
80
+ explicit `sql/char@1` column). Packs that registered a generator descriptor with a
81
+ storage-resolution hook must drop the hook; PSL schemas in extension fixtures relying on
82
+ `String @default(uuid()/cuid()/nanoid()/ulid())` producing `character(N)` columns must
83
+ either accept the target String storage (postgres: `pg/text@1` / `text`) or author the
84
+ char storage explicitly in the type position (`Char(36) @default(uuid())`, …), then
85
+ re-emit.
86
+ detection:
87
+ glob: "**/*.{ts,mts,cts,prisma}"
88
+ contains:
89
+ - "resolveGeneratedColumnDescriptor"
90
+ - "resolveBuiltinGeneratedColumnDescriptor"
91
+ - "baseScalar"
92
+ - "@default(uuid("
93
+ - "@default(cuid("
94
+ - "@default(nanoid("
95
+ - "@default(ulid("
96
+ anyMatch: true
97
+ ---
98
+
99
+ <!--
100
+ Release bump to 0.16.0 (PR #1019): the version bump itself. Every
101
+ `packages/3-extensions/*/package.json` advances to 0.16.0 (version field +
102
+ `workspace:` specifier lockstep). The bump commit touches only `package.json`
103
+ files and `pnpm-lock.yaml` — no SPI, contract shape, or emitted artefact change
104
+ beyond the pack version stamp. No extension-author action beyond the normal
105
+ dependency upgrade this recipe covers. Incidental substrate diff only.
106
+ -->
107
+
108
+ <!--
109
+ TML-3037 (contract infer output round-trips through contract emit): the
110
+ `packages/3-extensions/supabase` diff is this repo's own pack regenerating
111
+ under the three fixes recorded as `changes[]` entries above, plus two changes
112
+ that need no entry because they are purely additive: the postgres target now
113
+ registers `btree`/`hash`/`gin`/`gist`/`spgist`/`brin` as built-in index types,
114
+ so `auth.one_time_tokens`' two `USING hash` indexes — previously impossible to
115
+ emit at all (emit threw `unregistered index type "hash"`) — now come back
116
+ declared as `@@index(..., type: "hash")`; and the `Decimal` scalar
117
+ (`pg/numeric@1` with no `typeParams`) no longer crashes `ExecutionContext`
118
+ construction, a base-scalar fix with no prior working case to break.
119
+
120
+ The jsonb `dbgenerated` literal defaults on `custom_oauth_providers`
121
+ (`attribute_mapping`, `authorization_params`), `webauthn_credentials`
122
+ (`transports`), and `iceberg_namespaces` (`metadata`) are also declared again,
123
+ each as `@default(dbgenerated("..."))` verbatim — but this is *not* an
124
+ authoring-side fix and needs no `changes[]` entry of its own: emit still keeps
125
+ the raw expression as `kind: 'function'` exactly as it always did (no
126
+ `contract.json` shape change relative to a pack that already declared these
127
+ defaults). What changed is `db verify`: the postgres target's `SchemaIR`
128
+ construction now resolves the expected side's `kind: 'function'` default
129
+ through the same literal-recognizing parser introspection already used, so a
130
+ literal-shaped `dbgenerated(...)` default compares equal against the live
131
+ column instead of reporting permanent drift. That fix is invisible to
132
+ `contract.json` and the contract's `storageHash`, so nothing downstream needs
133
+ to regenerate anything on account of it.
134
+
135
+ `custom_oauth_providers`' `acceptable_client_ids`/`scopes` — also `text[]`
136
+ with a `dbgenerated("'{}'::text[]")` default, but on *list* fields — stay
137
+ omitted: `contract emit` rejects any function-kind default on a list field
138
+ (`PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED`), and `dbgenerated(...)` always
139
+ lowers to `kind: 'function'` at authoring time now (a target-owned handler
140
+ classifying it as a literal there would need the column's native type,
141
+ threaded through the shared `DefaultFunctionLoweringContext` framework type —
142
+ exactly the family-vocabulary-in-framework violation this round removed).
143
+ This is a known, undocumented-elsewhere limitation, not a regression: it was
144
+ never fixed to begin with on the branch this round reviewed.
145
+
146
+ `generate-contract.ts`'s `DOUBLE_PLURALIZED_FIELD_NAMES` and `INDEX_OMISSIONS`
147
+ workaround tables are deleted entirely; `DEFAULT_OMISSIONS` shrinks from 7
148
+ entries (across `auth.users`, `auth.custom_oauth_providers`,
149
+ `auth.webauthn_credentials`, `storage.iceberg_namespaces`) to 3
150
+ (`auth.users.phone`, a `DEFAULT NULL` that round-trips to `@default(null)`, a
151
+ different still-open defect; and `auth.custom_oauth_providers`'
152
+ `acceptable_client_ids`/`scopes`, the list-default limitation above). No
153
+ extension-authoring SPI change — an extension pack's own contract regenerates
154
+ automatically the same way this pack's did.
155
+ -->
156
+
157
+ <!--
158
+ TML-3027 (foreign keys and indexes are discrete contract entities): emitted
159
+ contract-shape change. `contract emit` now materializes the per-FK `constraint`/
160
+ `index` authoring booleans into discrete entities — a `foreignKeys[]` entry is the
161
+ referential constraint only (no `constraint`/`index` fields), and every backing
162
+ index (including one backing a FK) is its own named `indexes[]` entry. The booleans
163
+ remain as authoring input (`@relation(index:)`, TS `fk({ constraint, index })`,
164
+ `foreignKeyDefaults`). An extension whose contract declares FKs re-emits to the new
165
+ shape on the next `contract emit`, with no authoring change. Extension code that
166
+ reads `.constraint` / `.index` off a contract's `foreignKeys[]` entry (e.g. custom
167
+ migration/verify logic or a hand-built contract fixture) must drop those fields and
168
+ read the discrete `indexes[]` entry instead. No SPI or DDL change: the schema-IR the
169
+ planner and `db verify` derive is identical. (The `packages/3-extensions/` diff is
170
+ pgvector test fixtures updated to the new FK literal shape.)
171
+ -->
172
+
173
+ <!--
174
+ Supabase integration close-out (TML-2503): docs-only. The
175
+ `packages/3-extensions/` touch is `packages/3-extensions/supabase/README.md` —
176
+ links into the deleted `projects/supabase-integration/` workspace re-pointed at
177
+ ADR 237 (the service_role secondary-root decision) or inlined as plain text.
178
+ No SPI, contract shape, or emitted artefact change. Incidental substrate diff
179
+ only.
180
+ -->
181
+
182
+ <!--
183
+ TML-3028 (dependency-graph migration ordering; SchemaDiffIssue.reason removed):
184
+ the migration-diff internal `SchemaDiffIssue` lost its `reason` field —
185
+ discriminate a diff issue via the presence of `expected`/`actual`, or the
186
+ exported `issueOutcome(issue): ExpectationFailureReason` helper from
187
+ `@internal/framework-components/control`. `ExpectationFailureReason` keeps its
188
+ `'not-found' | 'not-expected' | 'not-equal'` values and its export path; it is now
189
+ the helper's return type rather than the removed field's type. This is a framework migration-control
190
+ internal, not an extension-authoring SPI. The `packages/3-extensions/` diff is
191
+ supabase-extension TEST assertions updated from `.reason` to presence — no runtime,
192
+ contract, SPI, or DDL change. Incidental test-only diff.
193
+ -->
194
+
195
+ <!--
196
+ TML-2783 (explicit MTI selections): `changes: []`. The `packages/3-extensions/sql-orm-client` diff is limited to internal polymorphic projection planning and regression tests; it changes no public API, contract/emitted artifact, extension-authoring surface, adapter API, or downstream source translation.
197
+ -->
198
+
199
+ <!--
200
+ Dependabot dev-deps group bump (PR #961): `changes: []`. The
201
+ `packages/3-extensions/` diff is biome.jsonc schema-version alignment for the
202
+ biome 2.5.2 dev-dependency bump plus the code sites biome 2.5 newly flags
203
+ (useOptionalChain in `sql-orm-client/src/collection.ts`); no SPI, contract
204
+ shape, emitted artefact, or extension-authoring surface change. Incidental
205
+ substrate diff only.
206
+ -->
207
+
208
+ <!--
209
+ Dependabot dev-deps group bump (PR #1006): `changes: []`. The
210
+ `packages/3-extensions/` diff is test-only — the `sql-orm-client` tests updated
211
+ from `(x?.y as T).z` to `(x!.y as T).z` to satisfy biome 2.5.3's stricter
212
+ noUnsafeOptionalChaining (biome 2.5.2 → 2.5.3 dev-dependency bump). No SPI,
213
+ contract shape, emitted artefact, or extension-authoring surface change.
214
+ Incidental substrate diff only.
215
+ -->
216
+
217
+ <!--
218
+ TML-2979 (MTI variant predicates in count writes): `changes: []`. The `packages/3-extensions/sql-orm-client` diff fixes internal query planning and adds regression coverage; it changes no public API, contract shape, emitted artefact, extension-authoring surface, adapter API, or downstream source translation. Incidental substrate diff only.
219
+ -->