@prisma/orm-family-sql 8.0.0-rc.12-dev.15 → 8.0.0-rc.12-dev.17
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/{authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs → authoring-type-constructors-C1ogrr_x-BZQc95SF.mjs} +2 -2
- package/dist/{authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs.map → authoring-type-constructors-C1ogrr_x-BZQc95SF.mjs.map} +1 -1
- package/dist/builder__runtime.d.mts +2 -2
- package/dist/builder__runtime.mjs +7 -7
- package/dist/builder__runtime.mjs.map +1 -1
- package/dist/{config-types-Dqe0LWuW.mjs → config-types-DlxXpXqA.mjs} +2 -2
- package/dist/{config-types-Dqe0LWuW.mjs.map → config-types-DlxXpXqA.mjs.map} +1 -1
- package/dist/{contract-builder-CojarVwS.mjs → contract-builder-3vURlaBN.mjs} +11 -12
- package/dist/contract-builder-3vURlaBN.mjs.map +1 -0
- package/dist/{contract-builder-C2VKBKK5.d.mts → contract-builder-Ct1IMc8_.d.mts} +311 -282
- package/dist/contract-builder-Ct1IMc8_.d.mts.map +1 -0
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-prisma7__provider.mjs +2 -2
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-ts.d.mts +1 -1
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/{control-DftpYMXw.d.mts → control-BKwzdenn.d.mts} +4 -4
- package/dist/{control-DftpYMXw.d.mts.map → control-BKwzdenn.d.mts.map} +1 -1
- package/dist/{control-BoloIwBt.mjs → control-BcWypsQy.mjs} +3 -3
- package/dist/{control-BoloIwBt.mjs.map → control-BcWypsQy.mjs.map} +1 -1
- package/dist/{derived-checks-BiClpWj6-Czjj2esH.mjs → derived-checks-Bsrdb2Wk-D4UfM06W.mjs} +93 -33
- package/dist/derived-checks-Bsrdb2Wk-D4UfM06W.mjs.map +1 -0
- package/dist/{diff-CHX4XHhC.d.mts → diff-B2b34L_E.d.mts} +4 -4
- package/dist/{diff-CHX4XHhC.d.mts.map → diff-B2b34L_E.d.mts.map} +1 -1
- package/dist/{dist-D5__KJs-.mjs → dist-U61NPKN3.mjs} +2 -2
- package/dist/{dist-D5__KJs-.mjs.map → dist-U61NPKN3.mjs.map} +1 -1
- package/dist/family.d.mts +6 -6
- package/dist/family.mjs +2 -2
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +1 -1
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.mjs +1 -1
- package/dist/family__runtime.d.mts +1 -1
- package/dist/family__runtime.mjs +1 -1
- package/dist/{index-C10GDLBQ.d.mts → index-B-CraAhf.d.mts} +4 -4
- package/dist/{index-C10GDLBQ.d.mts.map → index-B-CraAhf.d.mts.map} +1 -1
- package/dist/{interpreter-BrW0_y8Q-Dl5e-p7f.mjs → interpreter-BrW0_y8Q-ChkFlzaN.mjs} +2 -2
- package/dist/{interpreter-BrW0_y8Q-Dl5e-p7f.mjs.map → interpreter-BrW0_y8Q-ChkFlzaN.mjs.map} +1 -1
- package/dist/{migration-BwA1d1OP.d.mts → migration-9GrLWqGg.d.mts} +2 -2
- package/dist/{migration-BwA1d1OP.d.mts.map → migration-9GrLWqGg.d.mts.map} +1 -1
- package/dist/orm-client.d.mts +6 -6
- package/dist/orm-client.mjs +10 -10
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{prepared-statement-B6zvhJej-Dl488oBR.d.mts → prepared-statement-BHSj2pDk-CRzjNpcv.d.mts} +9 -26
- package/dist/prepared-statement-BHSj2pDk-CRzjNpcv.d.mts.map +1 -0
- package/dist/query-lane-context-BcXiJasG.d.mts +1 -0
- package/dist/{query-lane-context-Bi1GUXHp-Bo4OTjhW.d.mts → query-lane-context-D6o9YrEV-bouFPM6u.d.mts} +5 -31
- package/dist/query-lane-context-D6o9YrEV-bouFPM6u.d.mts.map +1 -0
- package/dist/relational-core.d.mts +4 -4
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__codec-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__query-lane-context.d.mts +3 -3
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{runtime-DYpzLADy.d.mts → runtime-DgOeosYa.d.mts} +5 -6
- package/dist/runtime-DgOeosYa.d.mts.map +1 -0
- package/dist/{runtime-DzmRvRj_.mjs → runtime-Z3nD7ix1.mjs} +4 -4
- package/dist/{runtime-DzmRvRj_.mjs.map → runtime-Z3nD7ix1.mjs.map} +1 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +7 -85
- package/dist/runtime.mjs.map +1 -1
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-DpG_gnur-CXVM1Oed.d.mts → schema-differ-DpG_gnur-B_rj2WAH.d.mts} +2 -2
- package/dist/{schema-differ-DpG_gnur-CXVM1Oed.d.mts.map → schema-differ-DpG_gnur-B_rj2WAH.d.mts.map} +1 -1
- package/dist/{types-BFPRCYGW-BheztqYQ.d.mts → types-BFPRCYGW-DWAEoFj7.d.mts} +2 -2
- package/dist/{types-BFPRCYGW-BheztqYQ.d.mts.map → types-BFPRCYGW-DWAEoFj7.d.mts.map} +1 -1
- package/dist/types-BvTYXSiS.d.mts +1 -0
- package/dist/{types-Bcujdkdw-2SDajXRo.d.mts → types-DFJNPLXY-vp6AGe5e.d.mts} +3 -3
- package/dist/{types-Bcujdkdw-2SDajXRo.d.mts.map → types-DFJNPLXY-vp6AGe5e.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/contract-builder-C2VKBKK5.d.mts.map +0 -1
- package/dist/contract-builder-CojarVwS.mjs.map +0 -1
- package/dist/derived-checks-BiClpWj6-Czjj2esH.mjs.map +0 -1
- package/dist/prepared-statement-B6zvhJej-Dl488oBR.d.mts.map +0 -1
- package/dist/query-lane-context-Bi1GUXHp-Bo4OTjhW.d.mts.map +0 -1
- package/dist/query-lane-context-CJNBt8cm.d.mts +0 -1
- package/dist/runtime-DYpzLADy.d.mts.map +0 -1
- package/dist/types-nNy0nND_.d.mts +0 -1
|
@@ -8,17 +8,17 @@ import { n as SqlQueryPlan } from "./plan-B7g2kDfQ-Bw0784x6.mjs";
|
|
|
8
8
|
import { a as CodecValue, i as CodecTypesBase, l as RawCodecInferer, o as Expression, t as AffectedCount } from "./expression-BPoA5eEl.mjs";
|
|
9
9
|
import { t as SqlExecutionPlan } from "./sql-execution-plan-Db0j752I-CI5WbdLi.mjs";
|
|
10
10
|
import "./plan-DiT00Rg8.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import "./query-lane-context-
|
|
11
|
+
import { n as ExecutionContext } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
12
|
+
import "./query-lane-context-BcXiJasG.mjs";
|
|
13
|
+
import { h as RuntimeScope } from "./types-DFJNPLXY-vp6AGe5e.mjs";
|
|
14
|
+
import "./types-BvTYXSiS.mjs";
|
|
13
15
|
import { i as SqlParamRefMutator } from "./middleware-CuGBptK0-C88HCnh5.mjs";
|
|
14
16
|
import "./middleware-aoqicpDI.mjs";
|
|
15
|
-
import { h as RuntimeScope } from "./types-Bcujdkdw-2SDajXRo.mjs";
|
|
16
|
-
import "./types-nNy0nND_.mjs";
|
|
17
17
|
import { Contract, JsonValue, PlanMeta } from "@prisma/orm-framework/contract/types";
|
|
18
|
-
import { AfterExecuteResult, AfterQueryResult, AsyncIterableResult, ExecuteInterceptResult, ExecutionPlan, QueryInterceptResult, RuntimeCore, RuntimeExecuteOptions, RuntimeLog, RuntimeMiddleware, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
|
|
18
|
+
import { AfterExecuteResult, AfterQueryResult, AsyncIterableResult, ExecuteInterceptResult, ExecutionPlan, MutationDefaultGeneratorContributor, QueryInterceptResult, RuntimeCore, RuntimeExecuteOptions, RuntimeLog, RuntimeMiddleware, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
|
|
19
19
|
import { AnyCodecDescriptor, CodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
20
20
|
import { ExecutionStack, RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeTargetDescriptor, RuntimeTargetInstance } from "@prisma/orm-framework/components/execution";
|
|
21
|
-
//#region ../../../2-sql/5-runtime/dist/prepared-statement-
|
|
21
|
+
//#region ../../../2-sql/5-runtime/dist/prepared-statement-BHSj2pDk.d.mts
|
|
22
22
|
//#region src/codecs/encoding.d.ts
|
|
23
23
|
interface ParamMetadata {
|
|
24
24
|
readonly codec: CodecRef$1 | undefined;
|
|
@@ -273,26 +273,9 @@ type RuntimeParameterizedCodecDescriptor<P = Record<string, unknown>> = CodecDes
|
|
|
273
273
|
/**
|
|
274
274
|
* Contributor protocol for SQL components (target, adapter, extension pack). The unified `codecs:` slot returns the full {@link CodecDescriptor} list — non-parameterized and parameterized descriptors live side-by-side in the same array. The framework dispatches every codec id through the unified descriptor map without branching on parameterization.
|
|
275
275
|
*/
|
|
276
|
-
interface SqlStaticContributions {
|
|
276
|
+
interface SqlStaticContributions extends Pick<MutationDefaultGeneratorContributor, 'mutationDefaultGenerators'> {
|
|
277
277
|
readonly codecs: () => ReadonlyArray<AnyCodecDescriptor>;
|
|
278
278
|
readonly queryOperations?: () => SqlOperationDescriptors;
|
|
279
|
-
readonly mutationDefaultGenerators?: () => ReadonlyArray<RuntimeMutationDefaultGenerator>;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Scope across which a generator's value is constant.
|
|
283
|
-
*
|
|
284
|
-
* - `'field'` — one value per defaulting site (one column, one row). Cache strategy: no cache; call per defaulting site. Right for per-row identifiers (UUIDs, CUIDs, ULIDs, nanoid, ksuid).
|
|
285
|
-
* - `'row'` — one value across all defaulting sites of one row of one operation. Cache strategy: per-call cache keyed by `generatorId`. Right for correlation ids stamped into multiple columns of one row.
|
|
286
|
-
* - `'query'` — one value across all rows and columns of one ORM operation. Cache strategy: caller-provided cache keyed by `generatorId`. Right for `timestampNow` (a single timestamp per bulk insert/update).
|
|
287
|
-
*/
|
|
288
|
-
type GeneratorStability = 'field' | 'row' | 'query';
|
|
289
|
-
interface RuntimeMutationDefaultGenerator {
|
|
290
|
-
readonly id: string;
|
|
291
|
-
readonly generate: (params?: Record<string, unknown>) => unknown;
|
|
292
|
-
/**
|
|
293
|
-
* Scope across which the generator's value is constant. The framework derives the cache strategy from this declaration; generator authors never need to know about cache keys. See `GeneratorStability` for the per-value semantics.
|
|
294
|
-
*/
|
|
295
|
-
readonly stability: GeneratorStability;
|
|
296
279
|
}
|
|
297
280
|
interface SqlRuntimeTargetDescriptor<TTargetId extends string = string, TTargetInstance extends RuntimeTargetInstance<'sql', TTargetId> = RuntimeTargetInstance<'sql', TTargetId>> extends RuntimeTargetDescriptor<'sql', TTargetId, TTargetInstance>, SqlStaticContributions {}
|
|
298
281
|
interface SqlRuntimeAdapterDescriptor<TTargetId extends string = string, TAdapterInstance extends RuntimeAdapterInstance<'sql', TTargetId> = SqlRuntimeAdapterInstance<TTargetId>> extends RuntimeAdapterDescriptor<'sql', TTargetId, TAdapterInstance>, SqlStaticContributions {
|
|
@@ -529,5 +512,5 @@ declare class PreparedExecutionImpl<Params> implements PreparedExecution<Params>
|
|
|
529
512
|
execute(target: RuntimeQueryable, params: Params, options?: RuntimeExecuteOptions): Promise<SqlStatementStats>;
|
|
530
513
|
}
|
|
531
514
|
//#endregion
|
|
532
|
-
export {
|
|
533
|
-
//# sourceMappingURL=prepared-statement-
|
|
515
|
+
export { SqlRuntimeAdapterDescriptor as A, VerifyMarkerOption as B, RuntimeQueryable as C, SqlExecutionStackWithDriver as D, SqlExecutionStack as E, SqlRuntimeExtensionInstance as F, preparedStatementExecute as G, createSqlExecutionStack as H, SqlRuntimeTargetDescriptor as I, preparedStatementQuery as K, SqlStaticContributions as L, SqlRuntimeBase as M, SqlRuntimeDriverInstance as N, SqlMiddleware as O, SqlRuntimeExtensionDescriptor as P, TelemetryOutcome as R, RuntimeParameterizedCodecDescriptor as S, RuntimeTransaction as T, deriveParamMetadata as U, createExecutionContext as V, encodeParamsWithMetadata as W, PreparedStatementQueryTarget as _, DeclaredNullable as a, RuntimeFamilyAdapter as b, ParamsFromDeclaration as c, PreparedExecutionImpl as d, PreparedFor as f, PreparedStatementInternals as g, PreparedStatementImpl as h, DeclaredCodecId as i, SqlRuntimeAdapterInstance as j, SqlMiddlewareContext as k, PrepareCallback as l, PreparedStatementExecuteTarget as m, ConnectionProvider as n, MarkerReader as o, PreparedStatement as p, withTransaction as q, Declaration as r, ParamSpec as s, BindSiteParams as t, PreparedExecution as u, Runtime as v, RuntimeTelemetryEvent as w, RuntimeOptions as x, RuntimeConnection as y, TransactionContext as z };
|
|
516
|
+
//# sourceMappingURL=prepared-statement-BHSj2pDk-CRzjNpcv.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepared-statement-BHSj2pDk-CRzjNpcv.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/prepared-statement-BHSj2pDk.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;UAaU;WACC,OAAO;WACP;;iBAEM,oBAAoB,KAAK,uBAAuB;iBAChD,yBAAyB,4BAA4B,mBAAmB,iBAAiB,KAAK,qBAAqB,iBAAiB,wBAAwB;;;UAGnK,6BAA6B;WAC5B,UAAU,SAAS;;;;;;UAMpB;WACC,KAAK;WACL,MAAM;;UAEP,cAAc,kBAAkB,0BAA0B,iCAAiC,kBAAkB,kBAAkB,mBAAmB;WACjJ;;;;;;;;;;;;;;;;;;;EAmBT,eAAe,OAAO,WAAW,KAAK,uBAAuB,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AuB,YAAY,KAAK,QAAQ;;;UAGhH;WACC;WACA,KAAK;WACL,MAAM;WACN,gBAAgB;WAChB,eAAe;WACf,wBAAwB;;cAErB,sBAAsB,QAAQ,gBAAgB,kBAAkB,QAAQ,MAAM;WACjF;WACA,KAAK;WACL,MAAM;WACN,gBAAgB;WAChB,eAAe;WACf,wBAAwB;EACjC,YAAY,WAAW;EACvB,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ,UAAU,wBAAwB,oBAAoB;;;;;;;;;;cAU1F,sBAAsB,mBAAmB,kBAAkB,SAAS;WACvE;WACA,KAAK;WACL,MAAM;WACN,gBAAgB;WAChB,eAAe;WACf,wBAAwB;EACjC,YAAY,WAAW;EACvB,QAAQ,QAAQ,kBAAkB,QAAQ,QAAQ,UAAU,wBAAwB,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
@@ -3,9 +3,10 @@ import "./types-C36_3E6_.mjs";
|
|
|
3
3
|
import { a as SqlOperationRegistry } from "./index-Cef8iy1o.mjs";
|
|
4
4
|
import { c as AnyExpression, k as ContractCodecRegistry } from "./types-Yui2yFf6-TP-oRDTX.mjs";
|
|
5
5
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
6
|
+
import { MutationDefaults } from "@prisma/orm-framework/components/runtime";
|
|
6
7
|
import { CodecDescriptor, CodecRef } from "@prisma/orm-framework/components/codec";
|
|
7
8
|
import { AggregateDescriptor, AggregateResultNullability } from "@prisma/orm-framework/components/components";
|
|
8
|
-
//#region ../../../2-sql/4-lanes/relational-core/dist/query-lane-context-
|
|
9
|
+
//#region ../../../2-sql/4-lanes/relational-core/dist/query-lane-context-D6o9YrEV.d.mts
|
|
9
10
|
//#region src/aggregate-descriptor.d.ts
|
|
10
11
|
/**
|
|
11
12
|
* What a lowering hook is handed: the expression being aggregated (absent for operations that consume no value) and the codec of that expression.
|
|
@@ -94,35 +95,12 @@ interface SqlAggregateDescriptorRegistry {
|
|
|
94
95
|
* Registry of initialized type helpers from storage.types. Each key is a type name from storage.types, and the value is the resolved codec materialized once for that named instance via `descriptor.factory(typeParams)(ctx)` (or the raw `StorageTypeInstance` metadata for codec ids whose descriptor isn't registered).
|
|
95
96
|
*/
|
|
96
97
|
type TypeHelperRegistry = Record<string, unknown>;
|
|
97
|
-
type MutationDefaultsOp = 'create' | 'update';
|
|
98
|
-
type AppliedMutationDefault = {
|
|
99
|
-
readonly column: string;
|
|
100
|
-
readonly value: unknown;
|
|
101
|
-
};
|
|
102
|
-
type MutationDefaultsOptions = {
|
|
103
|
-
readonly op: MutationDefaultsOp;
|
|
104
|
-
readonly table: string;
|
|
105
|
-
/**
|
|
106
|
-
* Namespace of the target table. Execution-default refs are namespace-scoped,
|
|
107
|
-
* so only defaults declared for `(namespace, table)` are applied — this is what
|
|
108
|
-
* disambiguates same-named tables across namespaces. Required so the coordinate
|
|
109
|
-
* is always part of the match; a missing namespace is a caller bug, not a
|
|
110
|
-
* silent degrade to table-name-only matching.
|
|
111
|
-
*/
|
|
112
|
-
readonly namespace: string;
|
|
113
|
-
readonly values: Record<string, unknown>;
|
|
114
|
-
/**
|
|
115
|
-
* Per-ORM-operation cache for generators that declare `stability: 'query'`. The caller passes the same `Map` across every `applyMutationDefaults` invocation in one bulk operation; the framework keys by `generatorId` so the same value is reused across all rows and columns. Generators with `stability: 'row'` use a fresh per-call cache the framework manages internally; generators with `stability: 'field'` skip caching
|
|
116
|
-
* entirely. Omit to make every call independent (degrades `'query'` to per-call behavior).
|
|
117
|
-
*/
|
|
118
|
-
readonly defaultValueCache?: Map<string, unknown>;
|
|
119
|
-
};
|
|
120
98
|
/**
|
|
121
99
|
* Minimal context interface for SQL query lanes.
|
|
122
100
|
*
|
|
123
101
|
* Lanes only need contract, operations, and codecs to build typed ASTs and attach operation builders. This interface explicitly excludes runtime concerns like adapters, connection management, and transaction state.
|
|
124
102
|
*/
|
|
125
|
-
interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> {
|
|
103
|
+
interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends MutationDefaults {
|
|
126
104
|
readonly contract: TContract;
|
|
127
105
|
/**
|
|
128
106
|
* Contract-bound codec registry built once at context-construction time by walking the contract's columns and resolving each through its descriptor's factory. Runtime dispatch (`encodeParam` / `decodeRow`) resolves codecs via `forCodecRef(ref)` — the single dispatch shape for AST-bound codec resolution.
|
|
@@ -141,11 +119,7 @@ interface ExecutionContext<TContract extends Contract<SqlStorage> = Contract<Sql
|
|
|
141
119
|
* Type helper registry for parameterized types. Schema builders expose these helpers via schema.types.
|
|
142
120
|
*/
|
|
143
121
|
readonly types: TypeHelperRegistry;
|
|
144
|
-
/**
|
|
145
|
-
* Applies execution-time mutation defaults for the given table. Returns the applied defaults (caller-provided values always win).
|
|
146
|
-
*/
|
|
147
|
-
applyMutationDefaults(options: MutationDefaultsOptions): ReadonlyArray<AppliedMutationDefault>;
|
|
148
122
|
}
|
|
149
123
|
//#endregion
|
|
150
|
-
export {
|
|
151
|
-
//# sourceMappingURL=query-lane-context-
|
|
124
|
+
export { SqlAggregateDescriptorRegistry as a, TypeHelperRegistry as c, SqlAggregateDescriptor as i, isSqlAggregateDescriptor as l, ExecutionContext as n, SqlAggregateLowering as o, ResolvedSqlAggregate as r, SqlAggregateLoweringContext as s, CodecDescriptorRegistry as t };
|
|
125
|
+
//# sourceMappingURL=query-lane-context-D6o9YrEV-bouFPM6u.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-lane-context-D6o9YrEV-bouFPM6u.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/query-lane-context-D6o9YrEV.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,MAAM;WACN,YAAY;;;;;;;KAOlB,wBAAwB,SAAS,gCAAgC;;;;;;;;KAQjE,yBAAyB;WACnB,QAAQ;;;iBAGF,yBAAyB,iBAAiB,SAAS;;;;;;UAM1D;;;;EAIR,cAAc,kBAAkB;;;;;;;;;;;;;;EAchC,kBAAkB,qBAAqB,eAAe,iBAAiB;;;;EAIvE,UAAU,iBAAiB;;;;EAI3B,aAAa,8BAA8B;;;;;;;KAOxC,uBAAuB;WACjB;WACA,QAAQ;WACR,OAAO;;;;;;;UAOR;;;;;;EAMR,QAAQ,mBAAmB,QAAQ,WAAW;;EAE9C,UAAU,iBAAiB;;;;;KAKxB,qBAAqB;;;;;;UAMhB,iBAAiB,kBAAkB,SAAS,cAAc,SAAS,qBAAqB;WACvF,UAAU;;;;WAIV,gBAAgB;;;;WAIhB,kBAAkB;;;;WAIlB,sBAAsB;WACtB,iBAAiB;;;;WAIjB,OAAO"}
|
|
@@ -6,8 +6,8 @@ import { n as SqlQueryPlan, r as planFromAst, t as Preparable } from "./plan-B7g
|
|
|
6
6
|
import { C as buildOperation, D as param, E as isExpression, O as toExpr, S as TraitExpression, T as createRawSql, _ as RawSqlStatementBuilder, a as CodecValue, b as ScalarListExpression, c as RawAffectedCountQuery, d as RawRow, f as RawRowQuery, g as RawSqlInterpolation, h as RawSqlBuilder, i as CodecTypesBase, l as RawCodecInferer, m as RawRowSpecEntry, n as BuildOperationSpec, o as Expression, p as RawRowSpec, r as CodecExpression, s as NoReservedRowColumn, t as AffectedCount, u as RawPlanContext, v as RawSqlStatementTag, w as codecOf, x as ScopeField, y as RawSqlTag } from "./expression-BPoA5eEl.mjs";
|
|
7
7
|
import { t as SqlExecutionPlan } from "./sql-execution-plan-Db0j752I-CI5WbdLi.mjs";
|
|
8
8
|
import "./plan-DiT00Rg8.mjs";
|
|
9
|
-
import { a as
|
|
10
|
-
import "./query-lane-context-
|
|
9
|
+
import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
10
|
+
import "./query-lane-context-BcXiJasG.mjs";
|
|
11
|
+
import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-DFJNPLXY-vp6AGe5e.mjs";
|
|
11
12
|
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-CuGBptK0-C88HCnh5.mjs";
|
|
12
|
-
|
|
13
|
-
export { Adapter, AdapterProfile, AdapterTarget, AffectedCount, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyCodecDescriptorTemplate, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AppliedMutationDefault, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec$1 as Codec, type CodecCallContext$1 as CodecCallContext, type CodecDescriptor$1 as CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, type CodecRef$1 as CodecRef, type CodecTrait$1 as CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecJson, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, IntegerStep, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, MutationDefaultsOp, MutationDefaultsOptions, NativeJsonValueProjection, NoReservedRowColumn, NotExpr, NullCheckExpr, NumberClassification, NumberClassifierSpec, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, OrderByNulls, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, Preparable, PreparedExecuteRequest, PreparedParamRef, PreparedStatementHandle, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawAffectedCountQuery, RawCodecInferer, RawExpr, RawPlanContext, RawQueryAst, RawQueryColumn, RawQueryResult, RawRow, RawRowQuery, RawRowSpec, RawRowSpecEntry, RawSqlBuilder, RawSqlInterpolation, RawSqlLiteral, RawSqlStatementBuilder, RawSqlStatementTag, RawSqlTag, ResolvedSqlAggregate, type RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlAggregateDescriptorRegistry, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryable, SqlStatementStats, SqlTextCodec, SqlTextDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, aggregateFnNames, buildOperation, canonicalNumeralText, codecOf, collectOrderedParamRefs, compact, createNumberClassifier, createRawSql, createSqlParamRefMutator, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isExpression, isNonFiniteText, isNumeralText, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, numeralText, param, parseJsonBody, planFromAst, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
|
|
13
|
+
export { Adapter, AdapterProfile, AdapterTarget, AffectedCount, AggregateCountFn, AggregateExpr, AggregateFn, AggregateOpFn, AndExpr, AnyCodecDescriptor, AnyCodecDescriptorTemplate, AnyDdlColumnDefault, AnyExpression, AnyFromSource, AnyInsertOnConflictAction, AnyInsertValue, AnyJsonValueProjection, AnyOperationArg, AnyParamRef, AnyQueryAst, AstRewriter, BinaryExpr, BinaryOp, BuildOperationSpec, BuildOptions, BuildParamsMap, CaseBranch, CaseExpr, CastExpr, CheckExpressionConstraint, Codec$1 as Codec, type CodecCallContext$1 as CodecCallContext, type CodecDescriptor$1 as CodecDescriptor, CodecDescriptorRegistry, CodecExpression, CodecJsonValueProjection, type CodecRef$1 as CodecRef, type CodecTrait$1 as CodecTrait, CodecTypes, CodecTypesBase, CodecValue, ColumnRef, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, ContractCodecRegistry, DdlColumn, DdlColumnDefault, DdlColumnDefaultVisitor, DdlColumnRenderContext, DdlNode, DdlTableConstraint, DefaultValueExpr, DeleteAst, DerivedTableSource, DescriptorCodecId, DescriptorCodecInput, DescriptorCodecJson, DescriptorCodecTraits, Direction, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExecutionContext, ExistsExpr, Expr, ExprVisitor, Expression, ExpressionFolder, ExpressionRewriter, ExpressionSource, ExtractCodecTypes, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, FunctionSourceAlias, IdentifierRef, InsertAst, InsertOnConflict, InsertValue, IntegerStep, JoinAst, JoinOnExpr, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectEntry, JsonObjectExpr, JsonValueProjectionVisitor, LimitOffsetValue, ListExpression, LiteralColumnDefault, LiteralExpr, LoweredParam, LoweredStatement, Lowerer, LowererContext, META, MarkerReadResult, Meta, ModelDef, ModelMetadata, NativeJsonValueProjection, NoReservedRowColumn, NotExpr, NullCheckExpr, NumberClassification, NumberClassifierSpec, OperationExpr, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrExpr, OrderByItem, OrderByNulls, ParamRef, type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, Preparable, PreparedExecuteRequest, PreparedParamRef, PreparedStatementHandle, PrimaryKeyConstraint, ProjectionExpr, ProjectionItem, RawAffectedCountQuery, RawCodecInferer, RawExpr, RawPlanContext, RawQueryAst, RawQueryColumn, RawQueryResult, RawRow, RawRowQuery, RawRowSpec, RawRowSpecEntry, RawSqlBuilder, RawSqlInterpolation, RawSqlLiteral, RawSqlStatementBuilder, RawSqlStatementTag, RawSqlTag, ResolvedSqlAggregate, type RuntimeScope, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, ScalarListExpression, ScopeField, SelectAst, SelectAstOptions, SqlAggregateDescriptorRegistry, SqlBuilderOptions, SqlCharCodec, SqlCharDescriptor, SqlCodecCallContext, SqlCodecInstanceContext, SqlColumnRef, SqlConnection, SqlDriver, SqlDriverState, SqlExecuteRequest, type SqlExecutionPlan, SqlExplainResult, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, type SqlOrmPlan, type SqlParamRefMutator, type SqlParamRefMutatorInternal, SqlPlan, SqlQueryPlan, SqlQueryable, SqlStatementStats, SqlTextCodec, SqlTextDescriptor, SqlTransaction, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableDef, TableKey, TableMetadata, TableRef, TableSource, TablesOf, ToWhereExpr, TraitExpression, TypeHelperRegistry, UniqueConstraint, UpdateAst, WhereArg, WindowFn, WindowFuncExpr, aggregateFnNames, buildOperation, canonicalNumeralText, codecOf, collectOrderedParamRefs, compact, createNumberClassifier, createRawSql, createSqlParamRefMutator, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isExpression, isNonFiniteText, isNumeralText, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, numeralText, param, parseJsonBody, planFromAst, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, toExpr, whereExprKinds };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as SqlAggregateDescriptorRegistry, i as SqlAggregateDescriptor, l as isSqlAggregateDescriptor, o as SqlAggregateLowering, s as SqlAggregateLoweringContext, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
2
2
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.d.mts
|
|
3
3
|
//#region src/aggregate-descriptor-registry.d.ts
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
|
|
2
2
|
import "./types-C36_3E6_.mjs";
|
|
3
3
|
import { o as AnyCodecDescriptor$1 } from "./types-Yui2yFf6-TP-oRDTX.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
5
5
|
import { CodecRef } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.d.mts
|
|
7
7
|
//#region src/codec-descriptor-registry.d.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import "./query-lane-context-
|
|
3
|
-
export {
|
|
1
|
+
import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
2
|
+
import "./query-lane-context-BcXiJasG.mjs";
|
|
3
|
+
export { CodecDescriptorRegistry, ExecutionContext, ResolvedSqlAggregate, SqlAggregateDescriptorRegistry, TypeHelperRegistry };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-DFJNPLXY-vp6AGe5e.mjs";
|
|
2
|
+
import "./types-BvTYXSiS.mjs";
|
|
3
3
|
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, Expr, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, type RuntimeScope, SqlBuilderOptions, type SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "./resolve-storage-table-Nyrgk4h8.mjs";
|
|
2
|
-
import { S as RuntimeMutationDefaultGenerator } from "./prepared-statement-B6zvhJej-Dl488oBR.mjs";
|
|
3
|
-
import "./index-C10GDLBQ.mjs";
|
|
4
2
|
import { ResolvedDomainModel, UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from "@prisma/orm-framework/contract/types";
|
|
3
|
+
import { RuntimeMutationDefaultGenerator } from "@prisma/orm-framework/components/runtime";
|
|
5
4
|
import { RuntimeFamilyDescriptor, RuntimeFamilyInstance } from "@prisma/orm-framework/components/execution";
|
|
6
5
|
//#region ../../../2-sql/9-family/dist/runtime.d.mts
|
|
7
6
|
//#region src/core/runtime-instance.d.ts
|
|
@@ -37,11 +36,11 @@ declare const sqlRuntimeFamilyDescriptor: RuntimeFamilyDescriptor<'sql', SqlRunt
|
|
|
37
36
|
* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`
|
|
38
37
|
* semantics: one `new Date()` per lowered mutation, not per row.
|
|
39
38
|
*
|
|
40
|
-
* Lives in
|
|
41
|
-
* `timestamp-now-generator.ts` (descriptor +
|
|
42
|
-
* free of
|
|
39
|
+
* Lives in its own module, exported only through `exports/runtime.ts`,
|
|
40
|
+
* so the control-plane `timestamp-now-generator.ts` (descriptor +
|
|
41
|
+
* authoring presets) stays free of runtime-plane imports.
|
|
43
42
|
*/
|
|
44
43
|
declare function timestampNowRuntimeGenerator(): RuntimeMutationDefaultGenerator;
|
|
45
44
|
//#endregion
|
|
46
45
|
export { timestampNowRuntimeGenerator as a, sqlRuntimeFamilyDescriptor as i, UNBOUND_DOMAIN_NAMESPACE_ID as n, resolveDomainModel as r, ResolvedDomainModel as t };
|
|
47
|
-
//# sourceMappingURL=runtime-
|
|
46
|
+
//# sourceMappingURL=runtime-DgOeosYa.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-DgOeosYa.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;UAaU,iCAAiC;;;;;;;;;;;cAW7B,4BAA4B,+BAA+B;;;;;;;;;;;;;;;;;iBAiBxD,gCAAgC"}
|
|
@@ -37,9 +37,9 @@ Object.freeze(sqlRuntimeFamilyDescriptor);
|
|
|
37
37
|
* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`
|
|
38
38
|
* semantics: one `new Date()` per lowered mutation, not per row.
|
|
39
39
|
*
|
|
40
|
-
* Lives in
|
|
41
|
-
* `timestamp-now-generator.ts` (descriptor +
|
|
42
|
-
* free of
|
|
40
|
+
* Lives in its own module, exported only through `exports/runtime.ts`,
|
|
41
|
+
* so the control-plane `timestamp-now-generator.ts` (descriptor +
|
|
42
|
+
* authoring presets) stays free of runtime-plane imports.
|
|
43
43
|
*/
|
|
44
44
|
function timestampNowRuntimeGenerator() {
|
|
45
45
|
return {
|
|
@@ -52,4 +52,4 @@ var runtime_default = sqlRuntimeFamilyDescriptor;
|
|
|
52
52
|
//#endregion
|
|
53
53
|
export { timestampNowRuntimeGenerator as i, resolveDomainModel as n, runtime_default as r, UNBOUND_DOMAIN_NAMESPACE_ID as t };
|
|
54
54
|
|
|
55
|
-
//# sourceMappingURL=runtime-
|
|
55
|
+
//# sourceMappingURL=runtime-Z3nD7ix1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-
|
|
1
|
+
{"version":3,"file":"runtime-Z3nD7ix1.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.mjs"],"sourcesContent":["import { TIMESTAMP_NOW_GENERATOR_ID } from \"@internal/framework-components/authoring\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from \"@internal/contract/types\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\n//#region src/core/runtime-instance.ts\n/**\n* Creates a SQL execution-plane family instance.\n*\n* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n*/\nfunction createSqlRuntimeFamilyInstance() {\n\treturn { familyId: \"sql\" };\n}\n//#endregion\n//#region src/core/runtime-descriptor.ts\n/**\n* SQL execution-plane family descriptor.\n*\n* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n*\n* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n*/\nconst sqlRuntimeFamilyDescriptor = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tcreate() {\n\t\treturn createSqlRuntimeFamilyInstance();\n\t}\n};\nObject.freeze(sqlRuntimeFamilyDescriptor);\n//#endregion\n//#region src/core/timestamp-now-runtime-generator.ts\n/**\n* Builds the canonical runtime-plane generator for the wall-clock-now\n* mutation default. Returns `new Date()`; semantics are target-agnostic\n* so all SQL targets share this single implementation.\n*\n* Declares `stability: 'query'` so a single ORM bulk operation\n* (e.g. `createAll([...])`) shares one timestamp across every row and\n* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`\n* semantics: one `new Date()` per lowered mutation, not per row.\n*\n* Lives in its own module, exported only through `exports/runtime.ts`,\n* so the control-plane `timestamp-now-generator.ts` (descriptor +\n* authoring presets) stays free of runtime-plane imports.\n*/\nfunction timestampNowRuntimeGenerator() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tgenerate: () => /* @__PURE__ */ new Date(),\n\t\tstability: \"query\"\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = sqlRuntimeFamilyDescriptor;\n//#endregion\nexport { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AASA,SAAS,iCAAiC;CACzC,OAAO,EAAE,UAAU,MAAM;AAC1B;;;;;;;;;AAWA,MAAM,6BAA6B;CAClC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;EACR,OAAO,+BAA+B;CACvC;AACD;AACA,OAAO,OAAO,0BAA0B;;;;;;;;;;;;;;;AAiBxC,SAAS,+BAA+B;CACvC,OAAO;EACN,IAAI;EACJ,gCAAgC,IAAI,KAAK;EACzC,WAAW;CACZ;AACD;AAGA,IAAI,kBAAkB"}
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as MarkerReadResult } from "./ast-B9jF6tRJ.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
4
|
-
import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-
|
|
5
|
-
export { type AfterExecuteResult, type AfterQueryResult, type BindSiteParams, type BudgetsOptions, type ConnectionProvider, type Declaration, type DeclaredCodecId, type DeclaredNullable, type ExecuteInterceptResult, type ExecutionContext, type
|
|
2
|
+
import { c as TypeHelperRegistry, n as ExecutionContext } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
|
|
3
|
+
import { A as SqlRuntimeAdapterDescriptor, B as VerifyMarkerOption, C as RuntimeQueryable, D as SqlExecutionStackWithDriver, E as SqlExecutionStack, F as SqlRuntimeExtensionInstance, H as createSqlExecutionStack, I as SqlRuntimeTargetDescriptor, L as SqlStaticContributions, M as SqlRuntimeBase, N as SqlRuntimeDriverInstance, O as SqlMiddleware, P as SqlRuntimeExtensionDescriptor, R as TelemetryOutcome, S as RuntimeParameterizedCodecDescriptor, T as RuntimeTransaction, U as deriveParamMetadata, V as createExecutionContext, W as encodeParamsWithMetadata, a as DeclaredNullable, b as RuntimeFamilyAdapter, c as ParamsFromDeclaration, d as PreparedExecutionImpl, f as PreparedFor, g as PreparedStatementInternals, h as PreparedStatementImpl, i as DeclaredCodecId, j as SqlRuntimeAdapterInstance, k as SqlMiddlewareContext, l as PrepareCallback, n as ConnectionProvider, o as MarkerReader, p as PreparedStatement, q as withTransaction, r as Declaration, s as ParamSpec, t as BindSiteParams, u as PreparedExecution, v as Runtime, w as RuntimeTelemetryEvent, x as RuntimeOptions, y as RuntimeConnection, z as TransactionContext } from "./prepared-statement-BHSj2pDk-CRzjNpcv.mjs";
|
|
4
|
+
import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-B-CraAhf.mjs";
|
|
5
|
+
export { type AfterExecuteResult, type AfterQueryResult, type BindSiteParams, type BudgetsOptions, type ConnectionProvider, type Declaration, type DeclaredCodecId, type DeclaredNullable, type ExecuteInterceptResult, type ExecutionContext, type LintsOptions, type Log, type MarkerReadResult, type MarkerReader, type ParamSpec, type ParamsFromDeclaration, type PrepareCallback, type PreparedExecution, PreparedExecutionImpl, type PreparedFor, type PreparedStatement, PreparedStatementImpl, type PreparedStatementInternals, type QueryInterceptResult, type Runtime, type RuntimeConnection, type RuntimeFamilyAdapter, type RuntimeOptions, type RuntimeParameterizedCodecDescriptor, type RuntimeQueryable, type RuntimeTelemetryEvent, type RuntimeTransaction, type SqlExecutionStack, type SqlExecutionStackWithDriver, type SqlMiddleware, type SqlMiddlewareContext, type SqlRuntimeAdapterDescriptor, type SqlRuntimeAdapterInstance, SqlRuntimeBase, type SqlRuntimeDriverInstance, type SqlRuntimeExtensionDescriptor, type SqlRuntimeExtensionInstance, type SqlRuntimeTargetDescriptor, type SqlStaticContributions, type TelemetryOutcome, type TransactionContext, type TypeHelperRegistry, type VerifyMarkerOption, budgets, createAstCodecRegistry, createExecutionContext, createSqlExecutionStack, deriveParamMetadata, encodeParamsWithMetadata, extractCodecIds, lints, lowerSqlPlan, validateCodecRegistryCompleteness, validateContractCodecMappings, withTransaction };
|
package/dist/runtime.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { isStructuredError } from "@prisma/orm-framework/utils/structured-error"
|
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import { assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
11
11
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
12
|
-
import { AsyncIterableResult, RuntimeCore, checkAborted, checkMiddlewareCompatibility, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
12
|
+
import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
13
13
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
14
14
|
import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
|
|
15
15
|
import { materializeCodec, resolveCodecDescriptorOrThrow } from "@prisma/orm-framework/components/codec";
|
|
@@ -17,7 +17,7 @@ import { checkContractComponentRequirements, mergeCapabilityMatrices } from "@pr
|
|
|
17
17
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
18
18
|
import { createExecutionStack } from "@prisma/orm-framework/components/execution";
|
|
19
19
|
import { hashContent } from "@prisma/orm-framework/utils/hash-content";
|
|
20
|
-
//#region ../../../2-sql/5-runtime/dist/exports-
|
|
20
|
+
//#region ../../../2-sql/5-runtime/dist/exports-CCSITeUw.mjs
|
|
21
21
|
/**
|
|
22
22
|
* Build an {@link AstCodecResolver} bound to a descriptor registry and a per-call instance-context factory.
|
|
23
23
|
*
|
|
@@ -557,7 +557,7 @@ function validateTypeParams(typeParams, descriptor, context) {
|
|
|
557
557
|
typeParams
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
|
-
return result.value;
|
|
560
|
+
return blindCast(result.value);
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
563
563
|
* Collect every {@link CodecDescriptor} contributed by the SQL stack and partition into "parameterized" vs "non-parameterized" via the descriptor's own {@link CodecDescriptorImpl.isParameterized} getter: a descriptor is parameterized when it has a `paramsSchema`.
|
|
@@ -572,7 +572,7 @@ function collectCodecDescriptors(contributors) {
|
|
|
572
572
|
if (seen.has(descriptor.codecId)) throw runtimeError("RUNTIME.DUPLICATE_CODEC", `Duplicate codec descriptor for codecId '${descriptor.codecId}'.`, { codecId: descriptor.codecId });
|
|
573
573
|
seen.add(descriptor.codecId);
|
|
574
574
|
all.push(descriptor);
|
|
575
|
-
if (descriptor.isParameterized) parameterized.set(descriptor.codecId, descriptor);
|
|
575
|
+
if (descriptor.isParameterized) parameterized.set(descriptor.codecId, blindCast(descriptor));
|
|
576
576
|
}
|
|
577
577
|
return {
|
|
578
578
|
all,
|
|
@@ -705,7 +705,7 @@ function buildContractCodecRegistry(contract, codecDescriptors) {
|
|
|
705
705
|
const instanceTypeParams = typeInstance.typeParams;
|
|
706
706
|
const key = refKeyOf(instanceTypeParams !== void 0 && Object.keys(instanceTypeParams).length > 0 ? {
|
|
707
707
|
codecId: typeInstance.codecId,
|
|
708
|
-
typeParams: instanceTypeParams
|
|
708
|
+
typeParams: blindCast(instanceTypeParams)
|
|
709
709
|
} : { codecId: typeInstance.codecId });
|
|
710
710
|
const sites = typeRefSites.get(typeName) ?? [];
|
|
711
711
|
const existing = usedAtByKey.get(key);
|
|
@@ -754,84 +754,6 @@ function buildContractCodecRegistry(contract, codecDescriptors) {
|
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
756
|
}
|
|
757
|
-
function assertMutationDefaultGeneratorsAvailable(contract, generatorRegistry) {
|
|
758
|
-
const defaults = contract.execution?.mutations.defaults ?? [];
|
|
759
|
-
if (defaults.length === 0) return;
|
|
760
|
-
const missing = /* @__PURE__ */ new Set();
|
|
761
|
-
for (const mutationDefault of defaults) for (const phase of [mutationDefault.onCreate, mutationDefault.onUpdate]) {
|
|
762
|
-
if (!phase) continue;
|
|
763
|
-
if (phase.kind === "generator" && !generatorRegistry.has(phase.id)) missing.add(phase.id);
|
|
764
|
-
}
|
|
765
|
-
if (missing.size === 0) return;
|
|
766
|
-
const ids = Array.from(missing);
|
|
767
|
-
throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract requires mutation default generator(s) ${ids.map((id) => `'${id}'`).join(", ")}, but no runtime component provides them.`, { ids });
|
|
768
|
-
}
|
|
769
|
-
function collectMutationDefaultGenerators(contributors) {
|
|
770
|
-
const generators = /* @__PURE__ */ new Map();
|
|
771
|
-
const owners = /* @__PURE__ */ new Map();
|
|
772
|
-
for (const contributor of contributors) {
|
|
773
|
-
const nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];
|
|
774
|
-
for (const generator of nextGenerators) {
|
|
775
|
-
const existingOwner = owners.get(generator.id);
|
|
776
|
-
if (existingOwner !== void 0) throw runtimeError("RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR", `Duplicate mutation default generator '${generator.id}'.`, {
|
|
777
|
-
id: generator.id,
|
|
778
|
-
existingOwner,
|
|
779
|
-
incomingOwner: contributor.id
|
|
780
|
-
});
|
|
781
|
-
generators.set(generator.id, generator);
|
|
782
|
-
owners.set(generator.id, contributor.id);
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
return generators;
|
|
786
|
-
}
|
|
787
|
-
function computeExecutionDefaultValue(spec, generatorRegistry) {
|
|
788
|
-
switch (spec.kind) {
|
|
789
|
-
case "generator": {
|
|
790
|
-
const generator = generatorRegistry.get(spec.id);
|
|
791
|
-
if (!generator) throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract references mutation default generator '${spec.id}' but no runtime component provides it.`, { id: spec.id });
|
|
792
|
-
return generator.generate(spec.params);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
function applyMutationDefaults(contract, generatorRegistry, options) {
|
|
797
|
-
const defaults = contract.execution?.mutations.defaults ?? [];
|
|
798
|
-
if (defaults.length === 0) return [];
|
|
799
|
-
const isEmptyUpdate = options.op === "update" && Object.keys(options.values).length === 0;
|
|
800
|
-
const applied = [];
|
|
801
|
-
const appliedColumns = /* @__PURE__ */ new Set();
|
|
802
|
-
const rowCache = /* @__PURE__ */ new Map();
|
|
803
|
-
for (const mutationDefault of defaults) {
|
|
804
|
-
if (mutationDefault.ref.entry !== options.table) continue;
|
|
805
|
-
if (mutationDefault.ref.namespace !== options.namespace) continue;
|
|
806
|
-
const defaultSpec = options.op === "create" ? mutationDefault.onCreate : mutationDefault.onUpdate;
|
|
807
|
-
if (!defaultSpec) continue;
|
|
808
|
-
if (isEmptyUpdate) continue;
|
|
809
|
-
const columnName = mutationDefault.ref.field;
|
|
810
|
-
if (Object.hasOwn(options.values, columnName) || appliedColumns.has(columnName)) continue;
|
|
811
|
-
applied.push({
|
|
812
|
-
column: columnName,
|
|
813
|
-
value: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)
|
|
814
|
-
});
|
|
815
|
-
appliedColumns.add(columnName);
|
|
816
|
-
}
|
|
817
|
-
return applied;
|
|
818
|
-
}
|
|
819
|
-
function resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {
|
|
820
|
-
if (spec.kind !== "generator") return computeExecutionDefaultValue(spec, generatorRegistry);
|
|
821
|
-
const cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);
|
|
822
|
-
if (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);
|
|
823
|
-
if (cache.has(spec.id)) return cache.get(spec.id);
|
|
824
|
-
const value = computeExecutionDefaultValue(spec, generatorRegistry);
|
|
825
|
-
cache.set(spec.id, value);
|
|
826
|
-
return value;
|
|
827
|
-
}
|
|
828
|
-
function scopedCache(stability, rowCache, queryCache) {
|
|
829
|
-
switch (stability) {
|
|
830
|
-
case "row": return rowCache;
|
|
831
|
-
case "query": return queryCache;
|
|
832
|
-
default: return;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
757
|
function createExecutionContext(options) {
|
|
836
758
|
const { stack, driver } = options;
|
|
837
759
|
assertExecutionStackContractRequirements(options.contract, stack);
|
|
@@ -861,7 +783,7 @@ function createExecutionContext(options) {
|
|
|
861
783
|
assertColumnCodecIntegrity(contract.storage, codecDescriptors);
|
|
862
784
|
const aggregateDescriptors = buildSqlAggregateDescriptorRegistry(collectAggregateDescriptorContributions(contributors), codecDescriptors);
|
|
863
785
|
const mutationDefaultGeneratorRegistry = collectMutationDefaultGenerators(contributors);
|
|
864
|
-
assertMutationDefaultGeneratorsAvailable(contract, mutationDefaultGeneratorRegistry);
|
|
786
|
+
assertMutationDefaultGeneratorsAvailable(contract.execution, mutationDefaultGeneratorRegistry);
|
|
865
787
|
if (parameterizedCodecDescriptors.size > 0) validateColumnTypeParams(contract.storage, parameterizedCodecDescriptors);
|
|
866
788
|
const types = initializeTypeHelpers(contract.storage, documentScopedCodecTypes(contract), parameterizedCodecDescriptors);
|
|
867
789
|
return {
|
|
@@ -871,7 +793,7 @@ function createExecutionContext(options) {
|
|
|
871
793
|
aggregateDescriptors,
|
|
872
794
|
queryOperations: queryOperationRegistry,
|
|
873
795
|
types,
|
|
874
|
-
applyMutationDefaults: (options) => applyMutationDefaults(contract, mutationDefaultGeneratorRegistry, options)
|
|
796
|
+
applyMutationDefaults: (options) => applyMutationDefaults(contract.execution, mutationDefaultGeneratorRegistry, options)
|
|
875
797
|
};
|
|
876
798
|
}
|
|
877
799
|
const sqlNativeArrayListDecoder = async (wireValue, decodeElement) => {
|