@prisma/orm-mongo 8.0.0-rc.11-dev.17 → 8.0.0-rc.11-dev.19
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 +8 -8
- package/skills/prisma-8/SKILL.md +1 -1
- package/skills/prisma-8/references/upgrade-app.md +1 -1
- package/skills/prisma-8/references/upgrade-extension.md +1 -1
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +0 -108
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +0 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-mongo",
|
|
3
|
-
"version": "8.0.0-rc.11-dev.
|
|
3
|
+
"version": "8.0.0-rc.11-dev.19",
|
|
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.11-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.11-dev.
|
|
15
|
-
"@prisma/orm-target-mongo": "8.0.0-rc.11-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.
|
|
13
|
+
"@prisma/orm-family-mongo": "8.0.0-rc.11-dev.19",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.11-dev.19",
|
|
15
|
+
"@prisma/orm-target-mongo": "8.0.0-rc.11-dev.19",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.19",
|
|
17
17
|
"pathe": "^2.0.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@internal/mongo": "8.0.0-rc.11-dev.
|
|
21
|
-
"@repo/tsconfig": "8.0.0-rc.11-dev.
|
|
22
|
-
"@repo/tsdown": "8.0.0-rc.11-dev.
|
|
20
|
+
"@internal/mongo": "8.0.0-rc.11-dev.19",
|
|
21
|
+
"@repo/tsconfig": "8.0.0-rc.11-dev.19",
|
|
22
|
+
"@repo/tsdown": "8.0.0-rc.11-dev.19",
|
|
23
23
|
"tsdown": "0.22.14",
|
|
24
24
|
"typescript": "5.9.3"
|
|
25
25
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED
|
@@ -51,7 +51,7 @@ If the from-to delta spans more than one release (e.g. `0.6 → 0.8`), build the
|
|
|
51
51
|
0.6 → 0.7 → 0.8
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The [`../upgrading/app/upgrades/`](../upgrading/app/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step
|
|
54
|
+
The [`../upgrading/app/upgrades/`](../upgrading/app/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step normally spans one stable minor (`0.7-to-0.8`) or one release candidate (`8.0.0-rc.1-to-8.0.0-rc.2`). When intermediate versions were not published, a guide may span a larger hop; follow the available directory chain rather than inventing missing steps. Moving onto the RC line from the last stable minor is a single step of its own (`0.17-to-8.0.0-rc.1`).
|
|
55
55
|
|
|
56
56
|
Apply each step in order, fully: bump, install, run instructions, validate, commit — before moving to the next. Halt the chain on the first failed step; do not skip ahead.
|
|
57
57
|
|
|
@@ -39,7 +39,7 @@ If the from-to delta spans more than one release (e.g. `0.6 → 0.8`), build the
|
|
|
39
39
|
0.6 → 0.7 → 0.8
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
The [`../upgrading/extension/upgrades/`](../upgrading/extension/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step
|
|
42
|
+
The [`../upgrading/extension/upgrades/`](../upgrading/extension/upgrades/) directories name the steps — read the chain off the directory names rather than deriving it arithmetically. Each directory is `<from>-to-<to>`. A step normally spans one stable minor (`0.7-to-0.8`) or one release candidate (`8.0.0-rc.1-to-8.0.0-rc.2`). When intermediate versions were not published, a guide may span a larger hop; follow the available directory chain rather than inventing missing steps. Moving onto the RC line from the last stable minor is a single step of its own (`0.17-to-8.0.0-rc.1`).
|
|
43
43
|
|
|
44
44
|
Apply each step in order, fully: bump, install, run instructions, check pins, validate, commit — before moving to the next. Halt the chain on the first failed step.
|
|
45
45
|
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
from: 8.0.0-rc.11
|
|
3
|
-
to: 8.0.0-rc.12
|
|
4
|
-
# The Prisma 7 contract source adds `prisma7Schema` and the `examples/prisma7-adoption` example.
|
|
5
|
-
# The surface itself is new, so there is nothing to translate for it; the entries below cover the
|
|
6
|
-
# changes it made to paths every Postgres project already uses.
|
|
7
|
-
# contract.d.ts now orders every collection the way contract.json does; a re-emit reorders, nothing else.
|
|
8
|
-
changes:
|
|
9
|
-
- id: params-only-sql-facade-prepare
|
|
10
|
-
summary: Replace injected SQL-builder preparation callbacks with params-only callbacks and lexical facade SQL access.
|
|
11
|
-
- id: postgres-target-owned-list-framing
|
|
12
|
-
summary: |
|
|
13
|
-
PostgreSQL list result decoding is target-owned; direct driver reads now expose raw array literals, and fixed-scale numeric arrays return database-normalized decimal text such as `"1.5000000000"`.
|
|
14
|
-
- id: psl-number-defaults-keep-digits
|
|
15
|
-
summary: |
|
|
16
|
-
A PSL number `@default` on a `Decimal` or `Numeric` column now emits as decimal text with every digit (`"10"`, `"1.50"`) instead of a JSON number. Re-emitting such a contract changes its storage hash, so re-sign databases signed with the old contract. `BigInt` and `UnboundedInt` defaults beyond 2^53 now emit, and `contract infer` prints such `BigInt` defaults as plain numbers.
|
|
17
|
-
detection:
|
|
18
|
-
glob: "**/*.prisma"
|
|
19
|
-
regex:
|
|
20
|
-
- '@default\(\[?-?(\d|NaN|Infinity)'
|
|
21
|
-
- id: postgres-verify-reads-more-default-spellings
|
|
22
|
-
summary: |
|
|
23
|
-
`db verify` now reads negative and cast numerals, enum literals cast to a type in another schema, zoneless `timestamp` literals, and `ARRAY[...]` list defaults as the values they are. Columns previously reported as drift verify clean; no contract or database change is needed.
|
|
24
|
-
- id: postgres-introspection-pinned-session
|
|
25
|
-
summary: |
|
|
26
|
-
Introspection now reads defaults, check constraints, index predicates, and policy text with `TimeZone = UTC`, `DateStyle = ISO, MDY`, and `IntervalStyle = postgres`, restoring the caller's settings. A contract inferred earlier from a server outside UTC that holds a `timestamptz` constant in such text shows that text once as a difference.
|
|
27
|
-
- id: contract-infer-prints-emittable-defaults
|
|
28
|
-
summary: |
|
|
29
|
-
`contract infer` now prints each column default in the form `contract emit` accepts: decimal text in quotes for `Decimal` and `Numeric`, plain digits for a large `BigInt`, and `dbgenerated(...)` for a list default holding a `NULL` element.
|
|
30
|
-
- id: source-load-failure-carries-diagnostics
|
|
31
|
-
summary: |
|
|
32
|
-
A contract source that fails to load now reports each finding in a `diagnostics` array on `CONTRACT.SOURCE_LOAD_FAILED`, alongside the existing `meta.diagnostics` and `meta.issues`.
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## `params-only-sql-facade-prepare`
|
|
36
|
-
|
|
37
|
-
Find calls to `prepare(declaration, callback)` on clients created by the Postgres or SQLite facade (`@prisma/orm-postgres/runtime`, `@prisma/orm-sqlite/runtime`, or their `@internal/postgres/runtime` and `@internal/sqlite/runtime` counterparts). Resolve the receiver and callback rather than rewriting every method named `prepare`: native SQLite `database.prepare(sql)` and SQL runtime's existing params-only preparation are different APIs and must remain unchanged.
|
|
38
|
-
|
|
39
|
-
Change callbacks from `(sql, params) => ...` to `(params) => ...`. Replace references bound to the removed `sql` callback argument with the same facade receiver's lexical `.sql` property. Preserve the params argument's name, declaration, SQL chain, row selection, filters and invocation target/options. For extracted callbacks, capture the same client in the enclosing scope; do not capture an invocation target or evaluate the callback twice. Update explicit callback type annotations to accept only the placeholder-params argument.
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
// Before
|
|
43
|
-
const query = await db.prepare({ id: 'pg/int4@1' }, (sql, params) =>
|
|
44
|
-
sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// After
|
|
48
|
-
const query = await db.prepare({ id: 'pg/int4@1' }, (params) =>
|
|
49
|
-
db.sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
50
|
-
);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Apply the same translation to SQLite's flat SQL facade (`sql.users` becomes `db.sql.users`), retaining its existing codec ids. Keep `.query(target, params, options?)` and SQL statistics `.execute(target, params, options?)` calls unchanged. Do not rewrite historical release notes, applied upgrade recipes, generated contracts or tests as part of this source translation.
|
|
54
|
-
|
|
55
|
-
## `postgres-target-owned-list-framing`
|
|
56
|
-
|
|
57
|
-
Review application code and snapshots that assert exact PostgreSQL list result spellings. Ordinary Prisma Next runtime reads still return JavaScript arrays, and builtin and enum lists now use the same raw-text-to-element-codec path. If you assert `Decimal[]` / `numeric[]` strings for fixed-scale columns, update those expectations to PostgreSQL's database-normalized scale: a `numeric(30,10)[]` element inserted as `1.5` reads as `"1.5000000000"`; scalar numeric decoding already follows this text-preserving policy. If you use lower-level Postgres driver direct-query rows, parse raw PostgreSQL array literal strings such as `'{a,b}'` instead of expecting registered builtin arrays to arrive as JavaScript arrays. Do not re-emit contracts solely for this change: codec ids, `typeParams`, and `CodecRef.many` stay unchanged.
|
|
58
|
-
|
|
59
|
-
## `psl-number-defaults-keep-digits`
|
|
60
|
-
|
|
61
|
-
In every PSL schema matched by `detection`, look for number defaults on fields typed `Decimal`, `Numeric`, `Numeric(...)`, or a `types {}` alias of one of them, including list fields. If there are none, this entry changes nothing. The schema itself needs no edit.
|
|
62
|
-
|
|
63
|
-
Before you re-emit: if a database was signed with a contract holding such a default with more digits than a JavaScript number holds (for example `12345678901234567890.123456789`), `db verify` and `db sign` report a default mismatch on that column.
|
|
64
|
-
|
|
65
|
-
Run the project's emit command (`prisma contract emit`, or the project's `contract:emit` script). In `contract.json`, each such default becomes decimal text: `@default(10)` becomes `"10"`, `@default(1.50)` becomes `"1.50"`, `@default(007)` becomes `"7"`, `@default(-0)` becomes `"0"`, a long value keeps every digit, and `@default(NaN)` becomes `"NaN"` instead of `null`. The storage hash changes. The column default in the database does not, so no migration is needed.
|
|
66
|
-
|
|
67
|
-
Then run `prisma db sign` against the regenerated contract for every database signed with the old one. Until you do, `db verify` reports a hash mismatch and the application logs `CONTRACT.MARKER_MISMATCH`.
|
|
68
|
-
|
|
69
|
-
`db init` can now create these defaults; before, it failed with `pg/numeric@1 database JSON value must be a decimal string`. `BigInt` and `UnboundedInt` defaults within ±(2^53 − 1) emit exactly as before. Larger ones now emit instead of failing, and `contract infer` prints such `BigInt` defaults as plain numbers instead of `dbgenerated(...)`.
|
|
70
|
-
|
|
71
|
-
## `postgres-verify-reads-more-default-spellings`
|
|
72
|
-
|
|
73
|
-
No code or schema edit. Run `prisma db verify` once against each Postgres database and read the result.
|
|
74
|
-
|
|
75
|
-
Postgres prints a column default in spellings the reader did not all recognise. It now reads a negative or cast numeral (`'-1'::integer`, `(5)::smallint`) as the number, an enum literal cast to a type in another schema (`'confidential'::auth.oauth_client_type`) as the enum value, a zoneless `timestamp` literal as that timestamp, and an `ARRAY[...]` default of text, boolean, integer, bigint, float, decimal, timestamp, or enum elements — with the casts Postgres prints, and an empty `VARCHAR(n)[]` — as the list. An element that is an expression or a function call still stays a raw expression.
|
|
76
|
-
|
|
77
|
-
The effect is one-way: columns that were reported as drift on these spellings now report nothing. No column that verified before starts failing. If a test pins the exact findings `db verify` returns for such a column, remove that expectation rather than adjusting it.
|
|
78
|
-
|
|
79
|
-
The same rendering is now used when planning a migration, so a list literal default is written with its cast (`ARRAY['1', '-2']::int8[]`). Update snapshots of planned DDL that hold the uncast form.
|
|
80
|
-
|
|
81
|
-
## `postgres-introspection-pinned-session`
|
|
82
|
-
|
|
83
|
-
No code or schema edit. This matters only if you have a committed contract that was inferred from a server whose session time zone was not UTC.
|
|
84
|
-
|
|
85
|
-
Every introspection read now runs with `TimeZone = UTC`, `DateStyle = ISO, MDY`, and `IntervalStyle = postgres`, and the caller's settings are restored afterwards, so the text read back no longer depends on the server, the role, or the caller. Postgres prints a `timestamptz` constant in the session time zone, so a check constraint or index predicate whose text contains one was recorded in that server's zone.
|
|
86
|
-
|
|
87
|
-
Run `prisma db verify`. If a check constraint or an index predicate is reported as different and the only difference is the time zone written into a `timestamptz` constant, that is this change. Re-emit and re-sign once; the new text is stable from then on. Column defaults are compared as instants where they can be, so most of them are unaffected.
|
|
88
|
-
|
|
89
|
-
## `contract-infer-prints-emittable-defaults`
|
|
90
|
-
|
|
91
|
-
No edit to an existing contract. This changes what `prisma contract infer` writes the next time you run it.
|
|
92
|
-
|
|
93
|
-
Each default is now printed in the form `contract emit` reads back, so an inferred `contract.prisma` emits without hand-editing:
|
|
94
|
-
|
|
95
|
-
- a `Decimal` or `Numeric` default is quoted decimal text (`@default("1.5")`), the only form that keeps every digit and survives `db init`;
|
|
96
|
-
- a `BigInt` default beyond ±(2^53 − 1) is printed as its digits instead of `dbgenerated(...)`;
|
|
97
|
-
- `NaN` and `Infinity` are printed as quoted text, which the float and numeric codecs accept;
|
|
98
|
-
- a list default holding a `NULL` element is printed as `dbgenerated(...)`, because no PSL list literal spells a null element. Earlier the default was dropped in silence and the column was emitted without it. `contract emit` stops at such a field with a diagnostic; edit the field or drop the default from the inferred file.
|
|
99
|
-
|
|
100
|
-
If you keep an inferred contract in version control, re-run `contract infer`, review the diff for these spellings, and re-emit. The stored defaults in the database do not change.
|
|
101
|
-
|
|
102
|
-
## `source-load-failure-carries-diagnostics`
|
|
103
|
-
|
|
104
|
-
Only for code or agents that read the CLI's `--json` output.
|
|
105
|
-
|
|
106
|
-
When a contract source fails to load, `CONTRACT.SOURCE_LOAD_FAILED` now carries a `diagnostics` array: one entry per finding, each with `code`, `summary`, `severity`, and, where the source gave a position, `where.path` and `where.line`. A finding whose source code is dotted (`PSL.PRISMA7_VIEW_UNSUPPORTED`) carries that code directly. A finding whose source code is an undotted legacy code (`PSL_INVALID_DECLARATION`) carries `CONTRACT.SOURCE_DIAGNOSTIC` with the original code in `meta.code` and at the start of the summary.
|
|
107
|
-
|
|
108
|
-
Nothing is removed: `meta.diagnostics` and `meta.issues` carry what they carried before. Read `diagnostics` in new code, and leave existing readers alone until you want the codes.
|
package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
from: 8.0.0-rc.11
|
|
3
|
-
to: 8.0.0-rc.12
|
|
4
|
-
# The Prisma 7 contract source adds `prisma7Schema` and `contract: ContractConfig` to
|
|
5
|
-
# `@prisma/orm-postgres/config`, and `diagnostics` to CliStructuredError. Both additive. It also
|
|
6
|
-
# moves the Postgres raw default parser out of the family `psl-infer` subpath (entry below). The
|
|
7
|
-
# Postgres default reader and the pinned introspection session change what users see, not any
|
|
8
|
-
# extension API; the app skill covers them.
|
|
9
|
-
# contract.d.ts now orders every collection the way contract.json does; a re-emit reorders, nothing else.
|
|
10
|
-
# Prepared include decoder specialization adds no consumer migration; retain existing entries below.
|
|
11
|
-
changes:
|
|
12
|
-
- id: expression-codec-on-return-type
|
|
13
|
-
summary: Move custom expression wrapper codec metadata to returnType.codec and remove the separate ExpressionImpl codec argument.
|
|
14
|
-
- id: shared-preparable-envelope
|
|
15
|
-
summary: Type ORM preparation descriptions with the shared compositional Preparable protocol and pass their contained plan to SQL runtime.
|
|
16
|
-
- id: params-only-sql-facade-prepare
|
|
17
|
-
summary: Replace injected SQL-builder preparation callbacks with params-only callbacks and lexical facade SQL access.
|
|
18
|
-
- id: postgres-list-element-codecs-receive-raw-strings
|
|
19
|
-
summary: |
|
|
20
|
-
PostgreSQL list decoding now parses array frames in the target and passes raw string elements to the scalar element codec; custom PostgreSQL codecs used in lists must accept those raw element spellings.
|
|
21
|
-
- id: preserve-prepared-reference-nullability
|
|
22
|
-
summary: Preserve declaration nullability when constructing or cloning PreparedParamRef AST nodes.
|
|
23
|
-
- id: preserve-orm-pagination-expressions
|
|
24
|
-
summary: Preserve expression-valued limit and offset when consuming ORM CollectionState.
|
|
25
|
-
- id: psl-infer-raw-default-parser-is-target-owned
|
|
26
|
-
summary: |
|
|
27
|
-
`parseRawDefault` is no longer exported from the `family/psl-infer` subpath; import `parsePostgresDefault` from `@prisma/orm-postgres/target/default-normalizer` instead.
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## `expression-codec-on-return-type`
|
|
31
|
-
|
|
32
|
-
For custom SQL `Expression` wrappers, move an existing top-level `codec` reference into `returnType.codec`, preserving the complete reference including `typeParams`. Read metadata through `codecOf(expression)` or `expression.returnType.codec`, not `expression.codec`. Keep the existing `returnType.codecId` and nullability; wrappers without an explicit reference continue to use the declared codec id fallback. Do not remove or relocate unrelated codec fields on AST nodes, storage declarations, runtime bindings or scope descriptors.
|
|
33
|
-
|
|
34
|
-
For direct `ExpressionImpl` construction, change `new ExpressionImpl(ast, returnType, codec, projectionAst)` to `new ExpressionImpl(ast, { ...returnType, codec }, projectionAst)`. When the removed codec argument was `undefined`, keep `returnType` unchanged and move any fourth projection argument to the third position. Preserve projection-only lowering separately from predicate and ordering ASTs.
|
|
35
|
-
|
|
36
|
-
## `shared-preparable-envelope`
|
|
37
|
-
|
|
38
|
-
Replace imports of SQL ORM client's `RowQuery` with `Preparable` from `@internal/sql-relational-core/plan`. Supply both type arguments as `Preparable<DbRow, Result>` and return `{ plan, consume }`, where `plan` is a `SqlQueryPlan<DbRow>` and `consume` returns the complete ORM result. Read AST, parameters and metadata through `description.plan`; pass `description.plan` rather than the description to SQL runtime preparation. Keep the consumer's mapping setup outside invocation-time code.
|
|
39
|
-
|
|
40
|
-
For integrations accepting both SQL and ORM callbacks, constrain the callback result with `Q extends SqlQueryPlan | Preparable<unknown, unknown>` and use SQL ORM client's `prepareQuery` and `PreparedFrom<Params, Q>`. Preserve the concrete `Q` so SQL row/statistics types and ORM all/first result types remain distinct. Do not add identity consumers to plain SQL plans.
|
|
41
|
-
|
|
42
|
-
## `preserve-orm-pagination-expressions`
|
|
43
|
-
|
|
44
|
-
Update extension code that reads or mirrors ORM `CollectionState.limit` and `offset`: these fields now contain relational-core `LimitOffsetValue | undefined` (`number | AnyExpression | undefined`), not just numbers. Forward them unchanged to the existing `SelectAst.withLimit` and `withOffset` methods. If processing numeric literals separately, narrow with `typeof value === 'number'`; preserve expression nodes rather than coercing, serializing or boxing them as literal parameters. Test presence against `undefined`, not truthiness, so zero limits and offsets survive. Keep grouped post-aggregation paging's separate numeric state unchanged.
|
|
45
|
-
|
|
46
|
-
## `preserve-prepared-reference-nullability`
|
|
47
|
-
|
|
48
|
-
Find code that constructs or clones `PreparedParamRef` from SQL relational-core's AST exports. When constructing a reference from a nullable declaration, pass its declared boolean nullability as the third argument to `PreparedParamRef.of(name, codec, nullable)` or `new PreparedParamRef(name, codec, nullable)`. When cloning an existing reference, preserve `ref.nullable`: `PreparedParamRef.of(ref.name, ref.codec, ref.nullable)`. Keep the name and complete codec reference unchanged, and keep constructing frozen class instances rather than spreading nodes into plain objects. Do not derive this flag from a column's nullability or an invocation's bound value.
|
|
49
|
-
|
|
50
|
-
## `params-only-sql-facade-prepare`
|
|
51
|
-
|
|
52
|
-
Find calls to `prepare(declaration, callback)` on clients created by the Postgres or SQLite facade (`@prisma/orm-postgres/runtime`, `@prisma/orm-sqlite/runtime`, or their `@internal/postgres/runtime` and `@internal/sqlite/runtime` counterparts). Resolve the receiver and callback rather than rewriting every method named `prepare`: native SQLite `database.prepare(sql)` and SQL runtime's existing params-only preparation are different APIs and must remain unchanged.
|
|
53
|
-
|
|
54
|
-
Change callbacks from `(sql, params) => ...` to `(params) => ...`. Replace references bound to the removed `sql` callback argument with the same facade receiver's lexical `.sql` property. Preserve the params argument's name, declaration, SQL chain, row selection, filters and invocation target/options. For extracted callbacks, capture the same client in the enclosing scope; do not capture an invocation target or evaluate the callback twice. Update explicit callback type annotations to accept only the placeholder-params argument.
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
// Before
|
|
58
|
-
const query = await db.prepare({ id: 'pg/int4@1' }, (sql, params) =>
|
|
59
|
-
sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
// After
|
|
63
|
-
const query = await db.prepare({ id: 'pg/int4@1' }, (params) =>
|
|
64
|
-
db.sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
65
|
-
);
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Apply the same translation to SQLite's flat SQL facade (`sql.users` becomes `db.sql.users`), retaining its existing codec ids. Keep `.query(target, params, options?)` and SQL statistics `.execute(target, params, options?)` calls unchanged. Do not rewrite historical release notes, applied upgrade recipes, generated contracts or tests as part of this source translation.
|
|
69
|
-
|
|
70
|
-
## `psl-infer-raw-default-parser-is-target-owned`
|
|
71
|
-
|
|
72
|
-
Find imports of `parseRawDefault` from `@prisma/orm-family-sql/family/psl-infer`, `@prisma/orm-postgres/family/psl-infer`, or `@prisma/orm-sqlite/family/psl-infer`. The function read Postgres default spellings, so it now lives in the Postgres target. Replace each import with `parsePostgresDefault` from `@prisma/orm-postgres/target/default-normalizer`. The signature is unchanged: `(rawDefault: string, nativeType?: string) => ColumnDefault | undefined`. It reads every spelling the old function read, plus the negative and cast numerals, cross-schema enum literals, zoneless `timestamp` literals, and `ARRAY[...]` lists added in this release, so a value that was `undefined` before may now be a literal.
|
|
73
|
-
|
|
74
|
-
The `parseRawDefault` option on `PslPrinterOptions` is unchanged; pass `parsePostgresDefault` there where you passed the old function.
|
|
75
|
-
|
|
76
|
-
## `postgres-list-element-codecs-receive-raw-strings`
|
|
77
|
-
|
|
78
|
-
Review PostgreSQL extension codecs whose descriptors can be used by `CodecRef.many` list columns. Inbound list framing is now target-owned: the target parses the Postgres array literal and invokes the scalar element codec for each non-null raw string element. Keep scalar direct-query compatibility as needed, but make the element `decode(wire, ctx)` accept the raw text spelling Postgres emits for that scalar value; the built-in numeric, boolean, integer, and float codecs accept both raw strings and native scalar wire values for this reason. Do not add a native-array fallback at the list-frame boundary, and do not add compatibility exports or codec-id aliases. `codecId`, `typeParams`, and emitted `CodecRef.many` shapes are unchanged.
|