@prisma/orm-mongo 8.0.0-rc.14-dev.35 → 8.0.0-rc.14-dev.37
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/dist/contract-builder.d.mts +1 -3
- package/dist/contract-builder.d.mts.map +1 -1
- package/package.json +8 -8
- package/skills/prisma-8/SKILL.md +1 -1
- package/skills/prisma-8/references/contract.md +1 -1
- package/skills/prisma-8/references/migration-model.md +1 -1
- package/skills/prisma-8/references/runtime.md +1 -1
|
@@ -55,8 +55,6 @@ interface EnumTypeHandle$1<Name extends string = string, Values extends readonly
|
|
|
55
55
|
readonly enumName: Name;
|
|
56
56
|
/** codecId from the codec passed to `enumType`. */
|
|
57
57
|
readonly codecId: string;
|
|
58
|
-
/** Ignored: the contract names the database type from the codec's data type. */
|
|
59
|
-
readonly nativeType?: string;
|
|
60
58
|
/** Ordered member list for lowering (name + value pairs). */
|
|
61
59
|
readonly enumMembers: readonly {
|
|
62
60
|
readonly name: string;
|
|
@@ -105,7 +103,7 @@ type CodecInput<CodecTypes extends CodecTypeMap, Codec extends {
|
|
|
105
103
|
* from `CodecTypes`, while `Name`, `Codec`, and the member tuple still infer
|
|
106
104
|
* from the call.
|
|
107
105
|
*/
|
|
108
|
-
type BoundEnumType<CodecTypes extends CodecTypeMap> = <const Name extends string, const Codec extends Pick<ColumnTypeDescriptor, 'codecId'
|
|
106
|
+
type BoundEnumType<CodecTypes extends CodecTypeMap> = <const Name extends string, const Codec extends Pick<ColumnTypeDescriptor, 'codecId'>, const Members extends readonly [EnumMember$1<string, CodecInput<CodecTypes, Codec>>, ...EnumMember$1<string, CodecInput<CodecTypes, Codec>>[]]>(name: Name, codec: Codec, ...members: Members) => EnumTypeHandle$1<Name, MembersToValues<[...Members]>, MembersToNames<[...Members]>, MembersAccessorMap<[...Members]>>;
|
|
109
107
|
//#endregion
|
|
110
108
|
//#region src/contract/enum-type.d.ts
|
|
111
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/contract-builder.d.mts"],"mappings":";;;;;;;;KAOK,yBAAyB;KACzB,yBAAyB;KACzB,eAAe,WAAW,kBAAkB,sBAAsB,iCAAiC,iBAAiB;KACpH,uBAAuB,KAAK,qBAAqB,iBAAiB;WAC5D;WACA;;KAEN,qBAAqB,KAAK,mBAAmB,iBAAiB;WACxD;WACA;;iBAEM,qBAAqB,mBAAmB,sBAAsB,YAAY,aAAa,sBAAsB;WACnH,QAAQ;WACR,QAAQ;;iBAEF,qBAAqB,mBAAmB,0BAA0B;WACxE,SAAS;WACT,eAAe;WACf,QAAQ;GAChB,UAAU,YAAY,UAAU,SAAS,iBAAiB,QAAQ,sBAAsB,aAAa;WAC7F,QAAQ;WACR,QAAQ;;;;;;;;;;;;UAYT,aAAa,qBAAqB;WACjC,MAAM;WACN,OAAO;;KAEb,gBAAgB,yBAAyB,+CAA+C,WAAW,UAAU,QAAQ,WAAW,2BAA2B,KAAK;KAChK,eAAe,yBAAyB,+CAA+C,WAAW,UAAU,QAAQ,WAAW,mBAAmB,cAAc;KAChK,mBAAmB,yBAAyB,+CAA+C,KAAK,mBAAmB,YAAY;cACtH;;UAEJ,iBAAiB,8BAA8B,wDAAwD,qDAAqD,mBAAmB,0BAA0B;;YAEvM;;WAED,UAAU;;WAEV;;WAEA
|
|
1
|
+
{"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/contract-builder.d.mts"],"mappings":";;;;;;;;KAOK,yBAAyB;KACzB,yBAAyB;KACzB,eAAe,WAAW,kBAAkB,sBAAsB,iCAAiC,iBAAiB;KACpH,uBAAuB,KAAK,qBAAqB,iBAAiB;WAC5D;WACA;;KAEN,qBAAqB,KAAK,mBAAmB,iBAAiB;WACxD;WACA;;iBAEM,qBAAqB,mBAAmB,sBAAsB,YAAY,aAAa,sBAAsB;WACnH,QAAQ;WACR,QAAQ;;iBAEF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
|
|
|
10
10
|
"skills"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@prisma/orm-family-mongo": "8.0.0-rc.14-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.14-dev.
|
|
15
|
-
"@prisma/orm-target-mongo": "8.0.0-rc.14-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.14-dev.
|
|
13
|
+
"@prisma/orm-family-mongo": "8.0.0-rc.14-dev.37",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.14-dev.37",
|
|
15
|
+
"@prisma/orm-target-mongo": "8.0.0-rc.14-dev.37",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.14-dev.37",
|
|
17
17
|
"mongodb-connection-string-url": "^7.0.1",
|
|
18
18
|
"pathe": "^2.0.3",
|
|
19
19
|
"tinyglobby": "^0.2.17"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@internal/mongo": "8.0.0-rc.14-dev.
|
|
23
|
-
"@repo/tsconfig": "8.0.0-rc.14-dev.
|
|
24
|
-
"@repo/tsdown": "8.0.0-rc.14-dev.
|
|
22
|
+
"@internal/mongo": "8.0.0-rc.14-dev.37",
|
|
23
|
+
"@repo/tsconfig": "8.0.0-rc.14-dev.37",
|
|
24
|
+
"@repo/tsdown": "8.0.0-rc.14-dev.37",
|
|
25
25
|
"tsdown": "0.22.14",
|
|
26
26
|
"typescript": "5.9.3"
|
|
27
27
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED
|
@@ -280,7 +280,7 @@ model User {
|
|
|
280
280
|
}
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
-
Emitted `contract.json` carries `domain.namespaces.<ns>.valueObjects.Address` with its field descriptors, and the `address` column lands as `codecId: "pg/jsonb@1"` / `
|
|
283
|
+
Emitted `contract.json` carries `domain.namespaces.<ns>.valueObjects.Address` with its field descriptors, and the `address` column lands as `codecId: "pg/jsonb@1"` / `dataType: "pg/jsonb"` in `storage`.
|
|
284
284
|
|
|
285
285
|
Canonical worked example: `examples/prisma-8-demo/src/prisma/contract.prisma`.
|
|
286
286
|
|
|
@@ -55,7 +55,7 @@ pnpm prisma migration ref delete <name>
|
|
|
55
55
|
| Command | Ref advancement |
|
|
56
56
|
|---|---|
|
|
57
57
|
| `db init` / `db update` (default URL) | Implicitly advance `db` (override the name with `--advance-ref <name>`; suppressed whenever `--db` is passed without `--advance-ref`, regardless of the URL — even `--db $DATABASE_URL` pointing at the default database) |
|
|
58
|
-
| `db sign` | Advances `db` after a successful signature (override the name with `--advance-ref <name>`; `--no-advance-ref` skips it, writing no ref and no snapshot); an existing ref is overwritten and the previous hash is reported in the human output (the JSON `
|
|
58
|
+
| `db sign` | Advances `db` after a successful signature (override the name with `--advance-ref <name>`; `--no-advance-ref` skips it, writing no ref and no snapshot); an existing ref is overwritten and the previous hash is reported in the human output (the JSON `advancedRefs` lists `{ space, name, hash }` for each contract space it advanced). `--db` does **not** suppress it, unlike init/update: sign never mutates the schema, and adoption is normally done via `--db` |
|
|
59
59
|
| `db migrate --advance-ref <name>` | The **only** apply-time advancement |
|
|
60
60
|
| plain `db migrate` | **Never advances anything** — deliberate: deploy and CI applies must not infer dev intent |
|
|
61
61
|
| `migration plan` | Never advances anything — chaining discipline is yours |
|
|
@@ -172,7 +172,7 @@ How connections read rows, and the `cursor` option on the serverless client (wit
|
|
|
172
172
|
|
|
173
173
|
## Workflow — Custom middleware (query log, slow-query warning)
|
|
174
174
|
|
|
175
|
-
The concept: a middleware is a plain object with `name`, `familyId: 'sql'`, and any of the hooks `beforeQuery`, `interceptQuery`, `afterQuery`. There is no separate telemetry package — observe queries with `afterQuery`, which fires once per execution after the rows are consumed, with `result.latencyMs`, `result.rowCount`, and `result.source` (`'driver'` or `'middleware'` for a cache hit). The `SqlMiddleware` type comes from `@prisma/orm-postgres/family-runtime`. `examples/prisma-8-demo/src/prisma/slow-query-warning.ts` is the canonical example:
|
|
175
|
+
The concept: a middleware is a plain object with `name`, `familyId: 'sql'`, and any of the hooks `beforeQuery`, `interceptQuery`, `afterQuery`, `beforeExecute`, `afterExecute`, `afterTransaction`. Row queries fire `afterQuery`; count-style writes fire `afterExecute`. `afterTransaction(plan, result, ctx)` is the last hook of every query whose before-hooks and parameter encoding succeeded (a query that fails in a before-hook or while encoding its parameters gets none), and fires once, when its effects are final: when the query ends outside a transaction, or when the enclosing transaction ends. `result.outcome` is `'committed'`, `'rolled-back'`, or `'unknown'` (a commit or statement that failed and may have landed, a row stream the caller stopped reading outside a transaction, or a committed transaction in which one of the queries failed). There is no separate telemetry package — observe queries with `afterQuery`, which fires once per execution after the rows are consumed, with `result.latencyMs`, `result.rowCount`, and `result.source` (`'driver'` or `'middleware'` for a cache hit). The `SqlMiddleware` type comes from `@prisma/orm-postgres/family-runtime`. `examples/prisma-8-demo/src/prisma/slow-query-warning.ts` is the canonical example:
|
|
176
176
|
|
|
177
177
|
```typescript
|
|
178
178
|
import type { SqlMiddleware } from '@prisma/orm-postgres/family-runtime';
|