@prisma/orm-sqlite 8.0.0-rc.2-dev.3 → 8.0.0-rc.20
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/README.md +2 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -8
- package/dist/config.mjs.map +1 -1
- package/dist/contract-builder.d.mts +205 -15
- package/dist/contract-builder.d.mts.map +1 -1
- package/dist/contract-builder.mjs +24 -4
- package/dist/contract-builder.mjs.map +1 -1
- package/dist/contract__validate-once.d.mts +1 -0
- package/dist/contract__validate-once.mjs +2 -0
- package/dist/control.d.mts +1 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +1 -1
- package/dist/control.mjs.map +1 -1
- package/dist/family-contract__data-type-support.d.mts +1 -0
- package/dist/family-contract__data-type-support.mjs +2 -0
- package/dist/family-contract__data-type.d.mts +1 -0
- package/dist/family-contract__data-type.mjs +2 -0
- package/dist/family-contract__sql-expression.d.mts +1 -0
- package/dist/family-contract__sql-expression.mjs +2 -0
- package/dist/family__psl-build.d.mts +1 -0
- package/dist/family__psl-build.mjs +2 -0
- package/dist/relational-core__collection-methods.d.mts +1 -0
- package/dist/relational-core__collection-methods.mjs +2 -0
- package/dist/relational-core__functions.d.mts +1 -0
- package/dist/relational-core__functions.mjs +2 -0
- package/dist/relational-core__index-reference.d.mts +1 -0
- package/dist/relational-core__index-reference.mjs +2 -0
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +107 -62
- package/dist/runtime.mjs.map +1 -1
- package/dist/sqlite-Yizsft25-C2Eb0g8b.d.mts +94 -0
- package/dist/sqlite-Yizsft25-C2Eb0g8b.d.mts.map +1 -0
- package/dist/sqlite-static-DHwrAnt0-c2gsEamQ.mjs +83 -0
- package/dist/sqlite-static-DHwrAnt0-c2gsEamQ.mjs.map +1 -0
- package/dist/static.d.mts +25 -2
- package/dist/static.d.mts.map +1 -0
- package/dist/static.mjs +2 -2
- package/dist/target__data-types.d.mts +1 -0
- package/dist/target__data-types.mjs +2 -0
- package/dist/utils__suppress-idle-connection-errors.d.mts +1 -0
- package/dist/utils__suppress-idle-connection-errors.mjs +2 -0
- package/dist/utils__text.d.mts +1 -0
- package/dist/utils__text.mjs +2 -0
- package/package.json +26 -15
- package/skills/prisma-8/SKILL.md +96 -0
- package/skills/prisma-8/references/build.md +142 -0
- package/skills/prisma-8/references/contract.md +544 -0
- package/skills/prisma-8/references/debug.md +149 -0
- package/skills/prisma-8/references/feedback.md +251 -0
- package/skills/prisma-8/references/migration-model.md +179 -0
- package/skills/prisma-8/references/migration-review.md +211 -0
- package/skills/prisma-8/references/migrations.md +581 -0
- package/skills/prisma-8/references/queries-mongo.md +238 -0
- package/skills/prisma-8/references/queries-postgres.md +710 -0
- package/skills/prisma-8/references/queries.md +253 -0
- package/skills/prisma-8/references/quickstart.md +317 -0
- package/skills/prisma-8/references/runtime.md +463 -0
- package/skills/prisma-8/references/supabase.md +234 -0
- package/skills/prisma-8/references/upgrade-app.md +102 -0
- package/skills/prisma-8/references/upgrade-extension.md +106 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.10-to-0.11/instructions.md +56 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/instructions.md +381 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-closed-mongo-contracts.ts +202 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-domain-namespaced-contracts.ts +201 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/re-emit-postgres-public-default.ts +198 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/instructions.md +339 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.12-to-0.13/re-emit-mti-variant-link-columns.ts +229 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/instructions.md +543 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.14-to-0.15/instructions.md +359 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.15-to-0.16/instructions.md +173 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/instructions.md +805 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.17-to-8.0.0-rc.1/instructions.md +72 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.7-to-0.8/instructions.md +8 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/instructions.md +36 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/instructions.md +86 -0
- package/skills/prisma-8/upgrading/app/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +588 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.10-to-8.0.0-rc.11/instructions.md +34 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +639 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/multifile-psl/add-use-prisma-8-directive.mjs +60 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/psl-verbatim-table-names/add-model-map.mjs +256 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/instructions.md +332 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/scripts/execution-ref-entry-field/rename-execution-ref-keys.ts +193 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.13-to-8.0.0-rc.14/instructions.md +489 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/instructions.md +1368 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/scripts/data-type-in-contract/data-type-in-contract.ts +1492 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.15-to-8.0.0-rc.16/instructions.md +108 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.16-to-8.0.0-rc.17/instructions.md +755 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/instructions.md +973 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/scripts/sql-expression-literals-psl/rewrite-sql-strings.mjs +271 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/instructions.md +1826 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/client-takes-contract-value/contract-from-json.ts +382 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/data-type-values/data-type-values.ts +1117 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/default-generators-to-on-create/rewrite-default-generators.mjs +86 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/mongo-field-storage-names/mongo-field-storage-names.ts +250 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/remove-nocheck/remove-nocheck.ts +813 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/instructions.md +502 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/scripts/expand-type-aliases/expand-type-aliases.ts +1171 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +158 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +42 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.5-to-8.0.0-rc.6/instructions.md +157 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.6-to-8.0.0-rc.7/instructions.md +33 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.7-to-8.0.0-rc.8/instructions.md +36 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.8-to-8.0.0-rc.9/instructions.md +63 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.9-to-8.0.0-rc.10/instructions.md +84 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.10-to-0.11/instructions.md +276 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/instructions.md +738 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/migrate-contract-testing-imports.ts +97 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/regenerate-extension-public-baseline.ts +223 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.11-to-0.12/strip-migration-labels-hints.ts +340 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.12-to-0.13/instructions.md +266 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/instructions.md +522 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/migration-op-factories-to-methods.ts +290 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.13-to-0.14/uuid-preset-rename.ts +43 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.14-to-0.15/instructions.md +803 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.15-to-0.16/instructions.md +219 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/instructions.md +731 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.16-to-0.17/strip-sha256-hash-prefixes.ts +382 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.17-to-8.0.0-rc.1/instructions.md +194 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.7-to-0.8/instructions.md +8 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/instructions.md +57 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.8-to-0.9/strip-inline-contracts.ts +226 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/instructions.md +150 -0
- package/skills/prisma-8/upgrading/extension/upgrades/0.9-to-0.10/stamp-storage-types-kind.ts +360 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.1-to-8.0.0-rc.2/instructions.md +746 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.10-to-8.0.0-rc.11/instructions.md +34 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +857 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/scripts/psl-verbatim-table-names/add-model-map.mjs +256 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/instructions.md +504 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.12-to-8.0.0-rc.13/scripts/execution-ref-entry-field/rename-execution-ref-keys.ts +193 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.13-to-8.0.0-rc.14/instructions.md +143 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/instructions.md +2168 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.14-to-8.0.0-rc.15/scripts/data-type-in-contract/data-type-in-contract.ts +1492 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.15-to-8.0.0-rc.16/instructions.md +223 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.16-to-8.0.0-rc.17/instructions.md +583 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.17-to-8.0.0-rc.18/instructions.md +1008 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/instructions.md +2000 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/client-takes-contract-value/contract-from-json.ts +382 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.18-to-8.0.0-rc.19/scripts/remove-nocheck/remove-nocheck.ts +813 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/instructions.md +379 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.19-to-8.0.0-rc.20/scripts/expand-type-aliases/expand-type-aliases.ts +1171 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.2-to-8.0.0-rc.3/instructions.md +5 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.3-to-8.0.0-rc.4/instructions.md +137 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.4-to-8.0.0-rc.5/instructions.md +129 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.5-to-8.0.0-rc.6/instructions.md +102 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.6-to-8.0.0-rc.7/instructions.md +33 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.7-to-8.0.0-rc.8/instructions.md +35 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.8-to-8.0.0-rc.9/instructions.md +86 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.9-to-8.0.0-rc.10/instructions.md +63 -0
- package/dist/family-contract__pack-types.d.mts +0 -1
- package/dist/family-contract__pack-types.mjs +0 -2
- package/dist/sqlite-CjWZostj-Cprd7rkt.d.mts +0 -76
- package/dist/sqlite-CjWZostj-Cprd7rkt.d.mts.map +0 -1
- package/dist/sqlite-static-CBCbqogG-BtpT_pWA.mjs +0 -44
- package/dist/sqlite-static-CBCbqogG-BtpT_pWA.mjs.map +0 -1
- package/dist/target__native-type-normalizer.d.mts +0 -1
- package/dist/target__native-type-normalizer.mjs +0 -2
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
from: "8.0.0-rc.15"
|
|
3
|
+
to: "8.0.0-rc.16"
|
|
4
|
+
changes:
|
|
5
|
+
- id: engine-pin-moves-to-0-6-3
|
|
6
|
+
summary: |
|
|
7
|
+
The toolchain now requires `@prisma/cli-engine@0.6.3` (up from 0.6.2). A project that pins `@prisma/cli-engine` itself must move the pin to `0.6.3`. The engine's only change is that it accepts any ArkType `^2.2.7`, so it shares one ArkType copy with the Prisma ORM packages.
|
|
8
|
+
detection:
|
|
9
|
+
glob: "**/package.json"
|
|
10
|
+
contains:
|
|
11
|
+
- '"@prisma/cli-engine": "0.6.2"'
|
|
12
|
+
- id: default-refusals-point-at-the-written-value
|
|
13
|
+
summary: |
|
|
14
|
+
`@default` reports `PSL_VALUE_TYPE_INCOMPATIBLE` and `PSL_INVALID_LITERAL` at the written value, or at the list element they are about, not at the whole attribute. The `@default` list no longer offers `sql` as an element.
|
|
15
|
+
detection:
|
|
16
|
+
glob: "**/*.{ts,mts,cts,js,mjs}"
|
|
17
|
+
matches:
|
|
18
|
+
- '\bPSL_VALUE_TYPE_INCOMPATIBLE\b'
|
|
19
|
+
- '\bPSL_INVALID_LITERAL\b'
|
|
20
|
+
- 'list of \([^)]*\bsql`\.\.\.`'
|
|
21
|
+
- id: default-refusals-say-what-to-write
|
|
22
|
+
summary: |
|
|
23
|
+
A `@default` refusal from the cast rule starts with what to write instead, as in `Expected a number`, not the list of types the column casts from. It names the column's type and the value's type only when a value of an admitted form is still refused, such as a number too large for the column. `Unknown literal tag` in a `@default` starts with the field it is about, and `this target has no data type for` comes after what to write.
|
|
24
|
+
detection:
|
|
25
|
+
glob: "**/*.{ts,mts,cts,js,mjs,json}"
|
|
26
|
+
matches:
|
|
27
|
+
- '; it casts from '
|
|
28
|
+
- '(: |[''"`])this target has no data type for a (string|boolean|number) value[''"`]'
|
|
29
|
+
- '[''"`]Unknown literal tag '
|
|
30
|
+
- id: function-call-arguments-keep-their-diagnostics
|
|
31
|
+
summary: |
|
|
32
|
+
A call to a function that exactly one alternative of an attribute argument names, such as `@default(uuid(5))`, reports what is wrong with its arguments instead of `Expected one of: …`.
|
|
33
|
+
detection:
|
|
34
|
+
glob: "**/*.{ts,mts,cts,js,mjs}"
|
|
35
|
+
matches:
|
|
36
|
+
- 'Expected one of: string \| number \| boolean \| autoincrement\(\)'
|
|
37
|
+
- id: contract-artifacts-restamp
|
|
38
|
+
summary: |
|
|
39
|
+
An extension that writes its own package version into the contracts it emits, such as the
|
|
40
|
+
Supabase extension, now writes 8.0.0-rc.16. Run `contract emit` once after upgrading so the
|
|
41
|
+
emitted `contract.json` and `contract.d.ts` match the installed extension.
|
|
42
|
+
detection:
|
|
43
|
+
glob: "**/contract.json"
|
|
44
|
+
contains:
|
|
45
|
+
- '"version": "8.0.0-rc.15"'
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
# 8.0.0-rc.15 → 8.0.0-rc.16 — User upgrade instructions
|
|
49
|
+
|
|
50
|
+
## `engine-pin-moves-to-0-6-3`
|
|
51
|
+
|
|
52
|
+
For every `package.json` matched by `detection`, change the `@prisma/cli-engine` version from `0.6.2` to `0.6.3` and reinstall. Projects assembled by the `prisma` CLI resolve the engine automatically.
|
|
53
|
+
|
|
54
|
+
Engine 0.6.2 required ArkType `2.2.3` exactly, while the Prisma ORM packages accept any `^2.2.2`. A package manager could then install two ArkType copies, and with Bun `prisma contract emit` failed on a valid contract with `CONTRACT.VALIDATION_FAILED`. Engine 0.6.3 accepts `^2.2.7`, so one copy serves both. Nothing in the engine's commands or output changes.
|
|
55
|
+
|
|
56
|
+
## `default-refusals-point-at-the-written-value`
|
|
57
|
+
|
|
58
|
+
This entry, `default-refusals-say-what-to-write` and `function-call-arguments-keep-their-diagnostics` matter only to code that reads the location of a PSL diagnostic, or the text of a diagnostic message, such as a test that asserts one. Schemas and contracts do not change.
|
|
59
|
+
|
|
60
|
+
`PSL_VALUE_TYPE_INCOMPATIBLE` and `PSL_INVALID_LITERAL` from `@default` used to point at the whole `@default(...)` attribute. They now point at the written value. When the message names a list element (`at element 2`), they point at that element. The codes are unchanged; the next section describes the new wording. `PSL_DEFAULT_LIST_EXPECTED` and `PSL_INVALID_DEFAULT_LITERAL` still point at the attribute.
|
|
61
|
+
|
|
62
|
+
For `tags Int[] @default([1, "x"])`, the diagnostic `Field "Post.tags" at element 2: Expected a number` now spans `"x"`.
|
|
63
|
+
|
|
64
|
+
When a tagged literal has both an unknown tag and a NUL character or more text than the limit, `@default` now reports the canonicalization code, `PSL_TAGGED_LITERAL_NUL` or `PSL_TAGGED_LITERAL_TOO_LARGE`, where it used to report `PSL_UNKNOWN_LITERAL_TAG`.
|
|
65
|
+
|
|
66
|
+
This supersedes the last row of the table in `default-diagnostic-codes-changed` in the 8.0.0-rc.14 to 8.0.0-rc.15 guide: a `sql` literal inside a list literal is reported with `PSL_VALUE_TYPE_INCOMPATIBLE` at the element, not at the `@default` attribute.
|
|
67
|
+
|
|
68
|
+
Update an assertion on the span or range of one of these diagnostics to the written value.
|
|
69
|
+
|
|
70
|
+
### `sql` is no longer offered as a list element
|
|
71
|
+
|
|
72
|
+
A `sql` literal is never a list element, so the list arm of `@default` no longer lists it. The editor stops offering `sql` inside `@default([`, and an `Expected one of` message for `@default` ends with `list of (string | number | boolean | json`...`)` instead of `list of (string | number | boolean | sql`...` | json`...`)`. A `sql` literal written inside a list is still refused by the cast rule, as before.
|
|
73
|
+
|
|
74
|
+
Update an assertion on that message to the new text.
|
|
75
|
+
|
|
76
|
+
## `default-refusals-say-what-to-write`
|
|
77
|
+
|
|
78
|
+
`@default` and every other position that takes a value of a data type now word a refusal of the cast rule the same way. A refusal starts with what to write instead, the forms the column's type admits, as in `Expected a number`, not the list of types it casts from. It names the column's type and the value's type only when the value has an admitted form and is still refused, such as a number too large for the column. A quoted string on a column whose type has a tag also gets that string as a tagged literal to write, when the column's type takes it, as the `Jsonb` row shows. An element of a list written on a column whose type has a list cast, such as a vector, is refused with the forms of the list cast's element types. The two other refusals change as the table shows. The codes do not change.
|
|
79
|
+
|
|
80
|
+
| Written | Message before | Message now |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `count Int @default(100000000000000099)` | `Field "N.count": pg/int4 has no cast from pg/int8; it casts from pg/int2` | `Field "N.count": Expected a number that pg/int4 can hold; got pg/int8` |
|
|
83
|
+
| `meta Jsonb @default("{}")` | `Field "N.meta": pg/jsonb has no cast from pg/text; it casts from pg/json` | ``Field "N.meta": Expected json`...`; write json`{}` `` |
|
|
84
|
+
| `count Int @default([1])` | `Field "N.count": pg/int4 has no cast from a list; it casts from pg/int2` | `Field "N.count": Expected a number; got a list` |
|
|
85
|
+
| `embed pgvector.Vector(3) @default([1, "x", 3])` | `Field "N.embed" at element 2: pgvector/vector has no cast from pg/text; it casts from pg/int2, pg/int4, pg/int8, pg/numeric` | `Field "N.embed" at element 2: Expected a number` |
|
|
86
|
+
| `active Int @default(true)` on SQLite | `Field "N.active": this target has no data type for a boolean value` | `Field "N.active": Expected a number; this target has no data type for a boolean value` |
|
|
87
|
+
| ``v String @default(pg.sql`x`)`` | `Unknown literal tag "pg.sql". Known tags: sql, json.` | `Field "N.v": Unknown literal tag "pg.sql". Known tags: sql, json.` |
|
|
88
|
+
| ``tags String[] @default([sql`'a'`])`` | `Field "Post.tags" at element 1: pg/text has no cast from sql/expression; it casts from nothing` | `Field "Post.tags" at element 1: Expected a quoted string` |
|
|
89
|
+
| `enum P { @@type("pg/text@1") Low = 1 }` | `enum "P" member "Low": pg/text has no cast from pg/int2; it casts from nothing` | `enum "P" member "Low": Expected a quoted string` |
|
|
90
|
+
| `enum P { Low = 3000000000 }`, an enum without `@@type` | `enum "P" member "Low": pg/int4 has no cast from pg/int8; it casts from pg/int2` | `enum "P" member "Low": Expected a number that pg/int4 can hold; got pg/int8` |
|
|
91
|
+
|
|
92
|
+
Update an assertion on one of these messages to the new text.
|
|
93
|
+
|
|
94
|
+
## `function-call-arguments-keep-their-diagnostics`
|
|
95
|
+
|
|
96
|
+
A call to a default function with wrong arguments used to report `PSL_INVALID_ATTRIBUTE_SYNTAX` with `Expected one of: string | number | boolean | autoincrement() | …` at the whole `@default` value. When exactly one alternative names the called function, the diagnostic now comes from that function, at the argument it is about. The code is still `PSL_INVALID_ATTRIBUTE_SYNTAX`. The same holds for any attribute argument that offers several functions, such as the field functions of a MongoDB `@@index`.
|
|
97
|
+
|
|
98
|
+
| Written | Message before | Message now |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| `@default(uuid(5))` | `Expected one of: string \| number \| …`, at `uuid(5)` | `Expected one of: 4 \| 7`, at `5` |
|
|
101
|
+
| `@default(nanoid(1))` | `Expected one of: string \| number \| …`, at `nanoid(1)` | `Expected an integer between 2 and 255`, at `1` |
|
|
102
|
+
| `@default(cuid())` | `Expected one of: string \| number \| …`, at `cuid()` | `Attribute "cuid" is missing required argument "version"`, at `cuid()` |
|
|
103
|
+
|
|
104
|
+
A call to a function no alternative names, such as `@default(other(1))`, still reports `Expected one of: …`. Schemas and contracts do not change. Update an assertion on the old message or span to the new one.
|
|
105
|
+
|
|
106
|
+
## `contract-artifacts-restamp`
|
|
107
|
+
|
|
108
|
+
For every `contract.json` matched by `detection`, run the project's emit command (`prisma contract emit`, or the project's `contract:emit` script) once after upgrading. This entry accounts for the extension's embedded `version` moving to `8.0.0-rc.16`; any other difference in the emitted files comes from an earlier entry in this guide.
|