@prisma/orm-family-sql 0.17.0-dev.1 → 0.17.0-dev.2
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/aggregate-descriptor-registry-DPV4z8MS.mjs +111 -0
- package/dist/aggregate-descriptor-registry-DPV4z8MS.mjs.map +1 -0
- package/dist/{ast-DSuzmsWn.d.mts → ast--BZUAzN1.d.mts} +3 -4
- package/dist/ast--BZUAzN1.d.mts.map +1 -0
- package/dist/{ast-BstHjAoG.mjs → ast-DDAyIKdt.mjs} +2 -2
- package/dist/ast-DDAyIKdt.mjs.map +1 -0
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +14 -10
- package/dist/builder__runtime.d.mts.map +1 -1
- package/dist/builder__runtime.mjs +161 -107
- package/dist/builder__runtime.mjs.map +1 -1
- package/dist/builder__types.d.mts +2 -2
- package/dist/codec-types-B_xmJL2m-CC_Q-_u9.mjs +24 -0
- package/dist/codec-types-B_xmJL2m-CC_Q-_u9.mjs.map +1 -0
- package/dist/{config-types-47qB33rW.d.mts → config-types-DKKhWdzf.d.mts} +2 -2
- package/dist/{config-types-47qB33rW.d.mts.map → config-types-DKKhWdzf.d.mts.map} +1 -1
- package/dist/{contract-builder-MvJJrQ-5.d.mts → contract-builder-Cj-lKWgM.d.mts} +4 -4
- package/dist/{contract-builder-MvJJrQ-5.d.mts.map → contract-builder-Cj-lKWgM.d.mts.map} +1 -1
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl__provider.d.mts +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract.d.mts +6 -6
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__index-type-validation.d.mts +1 -1
- package/dist/contract__types.d.mts +3 -3
- package/dist/contract__validators.d.mts +1 -1
- package/dist/{control-BHmsZudH.d.mts → control-BqrVERXN.d.mts} +10 -10
- package/dist/{control-BHmsZudH.d.mts.map → control-BqrVERXN.d.mts.map} +1 -1
- package/dist/{control-adapter-C99J7aEF-C-17lFY8.d.mts → control-adapter-C99J7aEF-mjOpiO_9.d.mts} +6 -6
- package/dist/{control-adapter-C99J7aEF-C-17lFY8.d.mts.map → control-adapter-C99J7aEF-mjOpiO_9.d.mts.map} +1 -1
- package/dist/control-adapter-xEtAQKd9.d.mts +1 -0
- package/dist/{control-B7iS4jv4.mjs → control-mG3RlNzm.mjs} +2 -2
- package/dist/{control-B7iS4jv4.mjs.map → control-mG3RlNzm.mjs.map} +1 -1
- package/dist/{db-DhMsmBS--DKENDi3l.d.mts → db-B5PMfDDd-BiWfkubp.d.mts} +65 -32
- package/dist/db-B5PMfDDd-BiWfkubp.d.mts.map +1 -0
- package/dist/{ddl-types-rrMsf77U-DGctYf-T.d.mts → ddl-types-h_3_pXmq-QBLq6WbP.d.mts} +4 -5
- package/dist/ddl-types-h_3_pXmq-QBLq6WbP.d.mts.map +1 -0
- package/dist/{diff-DhlzHOMD.d.mts → diff-CIIMSaVD.d.mts} +5 -5
- package/dist/{diff-DhlzHOMD.d.mts.map → diff-CIIMSaVD.d.mts.map} +1 -1
- package/dist/{dist-DrScXbhq.mjs → dist-CYkK9Vbk.mjs} +55 -2
- package/dist/dist-CYkK9Vbk.mjs.map +1 -0
- package/dist/{expression-RUO52bJB.mjs → expression-Dhu3dLiu.mjs} +2 -2
- package/dist/{expression-RUO52bJB.mjs.map → expression-Dhu3dLiu.mjs.map} +1 -1
- package/dist/{expression-DIf8F4Mc.d.mts → expression-KPBpeH4T.d.mts} +5 -6
- package/dist/expression-KPBpeH4T.d.mts.map +1 -0
- package/dist/{factories-B7tA4y9D.d.mts → factories-MfcqTt5R.d.mts} +2 -2
- package/dist/{factories-B7tA4y9D.d.mts.map → factories-MfcqTt5R.d.mts.map} +1 -1
- package/dist/family.d.mts +9 -9
- package/dist/family.mjs +1 -1
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +1 -1
- package/dist/family__diff.d.mts +2 -2
- package/dist/family__ir.d.mts +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__runtime.d.mts +1 -1
- package/dist/{index-BgaTJRxj.d.mts → index-BZF7Wehu.d.mts} +3 -3
- package/dist/{index-BgaTJRxj.d.mts.map → index-BZF7Wehu.d.mts.map} +1 -1
- package/dist/{index-Bb9U36N4.d.mts → index-D_QTT11u.d.mts} +15 -16
- package/dist/index-D_QTT11u.d.mts.map +1 -0
- package/dist/{index-type-validation-DN0L2mqm.d.mts → index-type-validation-D_vuj-76.d.mts} +2 -2
- package/dist/{index-type-validation-DN0L2mqm.d.mts.map → index-type-validation-D_vuj-76.d.mts.map} +1 -1
- package/dist/{ir-B3bKMnGQ.d.mts → ir-Cvj3eU-K.d.mts} +2 -2
- package/dist/{ir-B3bKMnGQ.d.mts.map → ir-Cvj3eU-K.d.mts.map} +1 -1
- package/dist/lane-query-builder.d.mts +3 -3
- package/dist/middleware-ChwIEKBC.d.mts +1 -0
- package/dist/{middleware-B4XbF4d4-tfwBl6mX.d.mts → middleware-eb7YwdD4-D0M6ACQ-.d.mts} +3 -3
- package/dist/{middleware-B4XbF4d4-tfwBl6mX.d.mts.map → middleware-eb7YwdD4-D0M6ACQ-.d.mts.map} +1 -1
- package/dist/{migration-CW0ZJLxP.d.mts → migration-Dtyw2JeL.d.mts} +3 -3
- package/dist/{migration-CW0ZJLxP.d.mts.map → migration-Dtyw2JeL.d.mts.map} +1 -1
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +82 -39
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +157 -122
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{plan-BTD8xFfa-Dd_K-A1R.d.mts → plan-Bmp5R9sq-DKMRkx6Z.d.mts} +4 -4
- package/dist/plan-Bmp5R9sq-DKMRkx6Z.d.mts.map +1 -0
- package/dist/plan-mKgmSe0R.d.mts +2 -0
- package/dist/query-lane-context-Dcj4eXUl.d.mts +1 -0
- package/dist/{query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts → query-lane-context-DjyAyYht-HDNYE_oF.d.mts} +62 -6
- package/dist/query-lane-context-DjyAyYht-HDNYE_oF.d.mts.map +1 -0
- package/dist/relational-core.d.mts +12 -13
- package/dist/relational-core.mjs +4 -3
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +12 -0
- package/dist/relational-core__aggregate-descriptor-registry.d.mts.map +1 -0
- package/dist/relational-core__aggregate-descriptor-registry.mjs +2 -0
- package/dist/relational-core__ast.d.mts +3 -4
- package/dist/relational-core__ast.mjs +3 -2
- package/dist/relational-core__codec-descriptor-registry.d.mts +3 -3
- package/dist/relational-core__contract-free.d.mts +3 -4
- package/dist/relational-core__contract-free.d.mts.map +1 -1
- package/dist/relational-core__contract-free.mjs +1 -1
- package/dist/relational-core__contract-free.mjs.map +1 -1
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__expression.mjs +1 -1
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__plan.d.mts +3 -3
- package/dist/relational-core__query-lane-context.d.mts +3 -3
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{runtime-DNewRuec.d.mts → runtime-DXPO2ytG.d.mts} +2 -2
- package/dist/{runtime-DNewRuec.d.mts.map → runtime-DXPO2ytG.d.mts.map} +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +12 -3
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-differ-DpG_gnur-g5_iks8G.d.mts → schema-differ-DpG_gnur-zSwkxqxK.d.mts} +2 -2
- package/dist/{schema-differ-DpG_gnur-g5_iks8G.d.mts.map → schema-differ-DpG_gnur-zSwkxqxK.d.mts.map} +1 -1
- package/dist/{sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts → sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts} +3 -3
- package/dist/sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts.map +1 -0
- package/dist/{types-DIBA80mc-wf5wLmON.d.mts → types-BwePDa3m-BVrPIi8V.d.mts} +117 -5
- package/dist/types-BwePDa3m-BVrPIi8V.d.mts.map +1 -0
- package/dist/types-Cty2fvYD.d.mts +1 -0
- package/dist/{types-BgkZru_1-H7yfikSQ.mjs → types-D43EhRac-DOJmnq_t.mjs} +4 -21
- package/dist/types-D43EhRac-DOJmnq_t.mjs.map +1 -0
- package/dist/{types-CuDrWc5v-ISVXBmBs.d.mts → types-D_plAPEe-DqK5It_K.d.mts} +30 -4
- package/dist/types-D_plAPEe-DqK5It_K.d.mts.map +1 -0
- package/dist/{types-IqZMLrFC-DtdJNICr.d.mts → types-IqZMLrFC-C1Zu2oo9.d.mts} +5 -5
- package/dist/{types-IqZMLrFC-DtdJNICr.d.mts.map → types-IqZMLrFC-C1Zu2oo9.d.mts.map} +1 -1
- package/dist/{types-Dl20lxky-DC_jdA0T.d.mts → types-dD8JJfeD-BOvMw2Iu.d.mts} +9 -9
- package/dist/{types-Dl20lxky-DC_jdA0T.d.mts.map → types-dD8JJfeD-BOvMw2Iu.d.mts.map} +1 -1
- package/dist/{types-BchwQpmO.d.mts → types-wy2-Y8wQ.d.mts} +2 -2
- package/dist/{types-BchwQpmO.d.mts.map → types-wy2-Y8wQ.d.mts.map} +1 -1
- package/dist/{validators-CxeHhHrf.d.mts → validators-Ds_fvIs_.d.mts} +2 -2
- package/dist/{validators-CxeHhHrf.d.mts.map → validators-Ds_fvIs_.d.mts.map} +1 -1
- package/package.json +19 -18
- package/dist/ast-BstHjAoG.mjs.map +0 -1
- package/dist/ast-DSuzmsWn.d.mts.map +0 -1
- package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts +0 -116
- package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts.map +0 -1
- package/dist/control-adapter-4y1O8Ps3.d.mts +0 -1
- package/dist/db-DhMsmBS--DKENDi3l.d.mts.map +0 -1
- package/dist/ddl-types-rrMsf77U-DGctYf-T.d.mts.map +0 -1
- package/dist/dist-DrScXbhq.mjs.map +0 -1
- package/dist/expression-DIf8F4Mc.d.mts.map +0 -1
- package/dist/index-Bb9U36N4.d.mts.map +0 -1
- package/dist/middleware-ByRsXxxq.d.mts +0 -1
- package/dist/plan-BTD8xFfa-Dd_K-A1R.d.mts.map +0 -1
- package/dist/plan-Cm4jaoNM.d.mts +0 -2
- package/dist/query-lane-context-Bz8XJZ45.d.mts +0 -1
- package/dist/query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts.map +0 -1
- package/dist/sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts.map +0 -1
- package/dist/types-BgkZru_1-H7yfikSQ.mjs.map +0 -1
- package/dist/types-CuDrWc5v-ISVXBmBs.d.mts.map +0 -1
- package/dist/types-DIBA80mc-wf5wLmON.d.mts.map +0 -1
- package/dist/types-DMxc5KZa.d.mts +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { t as frozenCodecRef } from "./codec-types-B_xmJL2m-CC_Q-_u9.mjs";
|
|
2
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
|
+
import { aggregateDescriptorKey, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, settleAggregateOverloads } from "@prisma/orm-framework/components/components";
|
|
5
|
+
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.mjs
|
|
6
|
+
/** Structural validation of a contributed SQL aggregate descriptor: the declarative shape plus a callable lowering hook where one is declared. */
|
|
7
|
+
function isSqlAggregateDescriptor(value) {
|
|
8
|
+
if (!isAggregateDescriptor(value)) return false;
|
|
9
|
+
return !("lower" in value) || value.lower === void 0 || typeof value.lower === "function";
|
|
10
|
+
}
|
|
11
|
+
function namedOutputRef(output, input) {
|
|
12
|
+
return frozenCodecRef({
|
|
13
|
+
codecId: output.codecId,
|
|
14
|
+
...ifDefined("typeParams", output.typeParams?.(input))
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validate every contributed aggregate descriptor and settle its matches against the composed codec set.
|
|
19
|
+
*
|
|
20
|
+
* Validation covers the descriptor's own shape, a second claim on one `(operation, input)` pair, and two trait descriptors that both claim a registered codec for one operation — the last of which only a composed stack can detect, which is why it is settled here rather than at contribution.
|
|
21
|
+
*/
|
|
22
|
+
function buildSqlAggregateDescriptorRegistry(descriptors, codecDescriptors) {
|
|
23
|
+
const validated = [];
|
|
24
|
+
const claimedKeys = /* @__PURE__ */ new Set();
|
|
25
|
+
for (const candidate of descriptors) {
|
|
26
|
+
if (!isSqlAggregateDescriptor(candidate)) throw structuredError("RUNTIME.AGGREGATE_DESCRIPTOR_INVALID", `Contributed value ${describeCandidate(candidate)} is not a valid SQL aggregate descriptor.`, {
|
|
27
|
+
why: "Aggregate resolution reads a declared operation, input match, result codec, and nullability; a lowering hook, where present, must be callable.",
|
|
28
|
+
fix: "Declare `operation`, `input` (`none` / `any` / `codec` / `trait`), `output` (`self` / `codec`), and `nullable` on the descriptor.",
|
|
29
|
+
meta: { descriptor: describeCandidate(candidate) }
|
|
30
|
+
});
|
|
31
|
+
const key = aggregateDescriptorKey(candidate);
|
|
32
|
+
if (claimedKeys.has(key)) throw structuredError("RUNTIME.DUPLICATE_AGGREGATE_DESCRIPTOR", `Duplicate aggregate descriptor for '${key}'.`, {
|
|
33
|
+
why: "Each operation/input pair resolves to exactly one result codec, so exactly one component may claim it.",
|
|
34
|
+
fix: "Remove the duplicate target, adapter, or extension contribution.",
|
|
35
|
+
meta: { key }
|
|
36
|
+
});
|
|
37
|
+
claimedKeys.add(key);
|
|
38
|
+
validated.push(candidate);
|
|
39
|
+
}
|
|
40
|
+
const settled = settleAggregateOverloads(validated, codecDescriptors.values());
|
|
41
|
+
const ambiguity = settled.ambiguities[0];
|
|
42
|
+
if (ambiguity !== void 0) throw structuredError("RUNTIME.AMBIGUOUS_AGGREGATE_DESCRIPTOR", `Ambiguous aggregate descriptors for '${ambiguity.operation}' over codec '${ambiguity.codecId}': traits ${ambiguity.traits.join(", ")} all claim it.`, {
|
|
43
|
+
why: "A codec advertising several claimed traits leaves the result codec undetermined.",
|
|
44
|
+
fix: `Contribute an exact descriptor for '${ambiguity.operation}' over '${ambiguity.codecId}', or narrow the overlapping trait contributions.`,
|
|
45
|
+
meta: {
|
|
46
|
+
operation: ambiguity.operation,
|
|
47
|
+
codecId: ambiguity.codecId,
|
|
48
|
+
traits: ambiguity.traits
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
for (const descriptor of validated) {
|
|
52
|
+
const outputCodecId = descriptor.output.kind === "codec" ? descriptor.output.codecId : descriptor.input.kind === "codec" ? descriptor.input.codecId : void 0;
|
|
53
|
+
if (outputCodecId !== void 0 && codecDescriptors.descriptorFor(outputCodecId) === void 0) {
|
|
54
|
+
const key = aggregateDescriptorKey(descriptor);
|
|
55
|
+
throw structuredError("RUNTIME.AGGREGATE_OUTPUT_CODEC_MISSING", `Aggregate descriptor '${key}' names result codec '${outputCodecId}', which the composed stack does not register.`, {
|
|
56
|
+
why: "A resolved aggregate decodes its result through the declared codec; a codec the stack does not compose cannot decode anything.",
|
|
57
|
+
fix: "Register the codec on the composed stack, or declare a result codec the stack composes.",
|
|
58
|
+
meta: {
|
|
59
|
+
operation: descriptor.operation,
|
|
60
|
+
key,
|
|
61
|
+
outputCodecId
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const tables = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const [operation, entry] of settled.operations) tables.set(operation, {
|
|
68
|
+
withoutInput: resolveWithoutInput(operation, entry.noInput) ?? resolveWithoutInput(operation, entry.anyInput),
|
|
69
|
+
byCodecId: entry.byCodecId,
|
|
70
|
+
anyInput: entry.anyInput
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
resolve(operation, input) {
|
|
74
|
+
const table = tables.get(operation);
|
|
75
|
+
if (table === void 0) return void 0;
|
|
76
|
+
if (input === void 0) return table.withoutInput;
|
|
77
|
+
const descriptor = table.byCodecId.get(input.codecId) ?? table.anyInput;
|
|
78
|
+
if (descriptor === void 0) return void 0;
|
|
79
|
+
return {
|
|
80
|
+
operation,
|
|
81
|
+
output: descriptor.output.kind === "self" ? frozenCodecRef(input) : namedOutputRef(descriptor.output, input),
|
|
82
|
+
nullable: descriptor.nullable,
|
|
83
|
+
lower: descriptor.lower
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
*values() {
|
|
87
|
+
yield* validated;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the overload that answers a call carrying no input. Both kinds that qualify name their result codec outright, there being no input codec to reuse.
|
|
93
|
+
*/
|
|
94
|
+
function resolveWithoutInput(operation, descriptor) {
|
|
95
|
+
if (descriptor === void 0) return void 0;
|
|
96
|
+
if (!isNoInputAggregateDescriptor(descriptor) && !isAnyInputAggregateDescriptor(descriptor)) return;
|
|
97
|
+
return {
|
|
98
|
+
operation,
|
|
99
|
+
output: namedOutputRef(descriptor.output, void 0),
|
|
100
|
+
nullable: descriptor.nullable,
|
|
101
|
+
lower: descriptor.lower
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function describeCandidate(value) {
|
|
105
|
+
if (typeof value === "object" && value !== null && "operation" in value) return `'${String(value.operation)}'`;
|
|
106
|
+
return `of type ${typeof value}`;
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { isSqlAggregateDescriptor as n, buildSqlAggregateDescriptorRegistry as t };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=aggregate-descriptor-registry-DPV4z8MS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-descriptor-registry-DPV4z8MS.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.mjs"],"sourcesContent":["import { t as frozenCodecRef } from \"../codec-types-B_xmJL2m.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { aggregateDescriptorKey, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, settleAggregateOverloads } from \"@internal/framework-components/components\";\n//#region src/aggregate-descriptor.ts\n/** Structural validation of a contributed SQL aggregate descriptor: the declarative shape plus a callable lowering hook where one is declared. */\nfunction isSqlAggregateDescriptor(value) {\n\tif (!isAggregateDescriptor(value)) return false;\n\treturn !(\"lower\" in value) || value.lower === void 0 || typeof value.lower === \"function\";\n}\n//#endregion\n//#region src/aggregate-descriptor-registry.ts\nfunction namedOutputRef(output, input) {\n\treturn frozenCodecRef({\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams?.(input))\n\t});\n}\n/**\n* Validate every contributed aggregate descriptor and settle its matches against the composed codec set.\n*\n* Validation covers the descriptor's own shape, a second claim on one `(operation, input)` pair, and two trait descriptors that both claim a registered codec for one operation — the last of which only a composed stack can detect, which is why it is settled here rather than at contribution.\n*/\nfunction buildSqlAggregateDescriptorRegistry(descriptors, codecDescriptors) {\n\tconst validated = [];\n\tconst claimedKeys = /* @__PURE__ */ new Set();\n\tfor (const candidate of descriptors) {\n\t\tif (!isSqlAggregateDescriptor(candidate)) throw structuredError(\"RUNTIME.AGGREGATE_DESCRIPTOR_INVALID\", `Contributed value ${describeCandidate(candidate)} is not a valid SQL aggregate descriptor.`, {\n\t\t\twhy: \"Aggregate resolution reads a declared operation, input match, result codec, and nullability; a lowering hook, where present, must be callable.\",\n\t\t\tfix: \"Declare `operation`, `input` (`none` / `any` / `codec` / `trait`), `output` (`self` / `codec`), and `nullable` on the descriptor.\",\n\t\t\tmeta: { descriptor: describeCandidate(candidate) }\n\t\t});\n\t\tconst key = aggregateDescriptorKey(candidate);\n\t\tif (claimedKeys.has(key)) throw structuredError(\"RUNTIME.DUPLICATE_AGGREGATE_DESCRIPTOR\", `Duplicate aggregate descriptor for '${key}'.`, {\n\t\t\twhy: \"Each operation/input pair resolves to exactly one result codec, so exactly one component may claim it.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: { key }\n\t\t});\n\t\tclaimedKeys.add(key);\n\t\tvalidated.push(candidate);\n\t}\n\tconst settled = settleAggregateOverloads(validated, codecDescriptors.values());\n\tconst ambiguity = settled.ambiguities[0];\n\tif (ambiguity !== void 0) throw structuredError(\"RUNTIME.AMBIGUOUS_AGGREGATE_DESCRIPTOR\", `Ambiguous aggregate descriptors for '${ambiguity.operation}' over codec '${ambiguity.codecId}': traits ${ambiguity.traits.join(\", \")} all claim it.`, {\n\t\twhy: \"A codec advertising several claimed traits leaves the result codec undetermined.\",\n\t\tfix: `Contribute an exact descriptor for '${ambiguity.operation}' over '${ambiguity.codecId}', or narrow the overlapping trait contributions.`,\n\t\tmeta: {\n\t\t\toperation: ambiguity.operation,\n\t\t\tcodecId: ambiguity.codecId,\n\t\t\ttraits: ambiguity.traits\n\t\t}\n\t});\n\tfor (const descriptor of validated) {\n\t\tconst outputCodecId = descriptor.output.kind === \"codec\" ? descriptor.output.codecId : descriptor.input.kind === \"codec\" ? descriptor.input.codecId : void 0;\n\t\tif (outputCodecId !== void 0 && codecDescriptors.descriptorFor(outputCodecId) === void 0) {\n\t\t\tconst key = aggregateDescriptorKey(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.AGGREGATE_OUTPUT_CODEC_MISSING\", `Aggregate descriptor '${key}' names result codec '${outputCodecId}', which the composed stack does not register.`, {\n\t\t\t\twhy: \"A resolved aggregate decodes its result through the declared codec; a codec the stack does not compose cannot decode anything.\",\n\t\t\t\tfix: \"Register the codec on the composed stack, or declare a result codec the stack composes.\",\n\t\t\t\tmeta: {\n\t\t\t\t\toperation: descriptor.operation,\n\t\t\t\t\tkey,\n\t\t\t\t\toutputCodecId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tconst tables = /* @__PURE__ */ new Map();\n\tfor (const [operation, entry] of settled.operations) tables.set(operation, {\n\t\twithoutInput: resolveWithoutInput(operation, entry.noInput) ?? resolveWithoutInput(operation, entry.anyInput),\n\t\tbyCodecId: entry.byCodecId,\n\t\tanyInput: entry.anyInput\n\t});\n\treturn {\n\t\tresolve(operation, input) {\n\t\t\tconst table = tables.get(operation);\n\t\t\tif (table === void 0) return void 0;\n\t\t\tif (input === void 0) return table.withoutInput;\n\t\t\tconst descriptor = table.byCodecId.get(input.codecId) ?? table.anyInput;\n\t\t\tif (descriptor === void 0) return void 0;\n\t\t\treturn {\n\t\t\t\toperation,\n\t\t\t\toutput: descriptor.output.kind === \"self\" ? frozenCodecRef(input) : namedOutputRef(descriptor.output, input),\n\t\t\t\tnullable: descriptor.nullable,\n\t\t\t\tlower: descriptor.lower\n\t\t\t};\n\t\t},\n\t\t*values() {\n\t\t\tyield* validated;\n\t\t}\n\t};\n}\n/**\n* Resolve the overload that answers a call carrying no input. Both kinds that qualify name their result codec outright, there being no input codec to reuse.\n*/\nfunction resolveWithoutInput(operation, descriptor) {\n\tif (descriptor === void 0) return void 0;\n\tif (!isNoInputAggregateDescriptor(descriptor) && !isAnyInputAggregateDescriptor(descriptor)) return;\n\treturn {\n\t\toperation,\n\t\toutput: namedOutputRef(descriptor.output, void 0),\n\t\tnullable: descriptor.nullable,\n\t\tlower: descriptor.lower\n\t};\n}\nfunction describeCandidate(value) {\n\tif (typeof value === \"object\" && value !== null && \"operation\" in value) return `'${String(value.operation)}'`;\n\treturn `of type ${typeof value}`;\n}\n//#endregion\nexport { buildSqlAggregateDescriptorRegistry, isSqlAggregateDescriptor };\n\n//# sourceMappingURL=aggregate-descriptor-registry.mjs.map"],"mappings":";;;;;;AAMA,SAAS,yBAAyB,OAAO;CACxC,IAAI,CAAC,sBAAsB,KAAK,GAAG,OAAO;C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OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,OAAO,OAAO,IAAI,OAAO,MAAM,SAAS,EAAE;CAC5G,OAAO,WAAW,OAAO;AAC1B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./ddl-types-rrMsf77U-DGctYf-T.mjs";
|
|
1
|
+
import { m as AnyQueryAst, p as AnyParamRef, ut as LoweredStatement } from "./types-BwePDa3m-BVrPIi8V.mjs";
|
|
2
|
+
import "./ddl-types-h_3_pXmq-QBLq6WbP.mjs";
|
|
4
3
|
import { ContractMarkerRecord, JsonValue } from "@prisma/orm-framework/contract/types";
|
|
5
4
|
import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma/orm-framework/components/codec";
|
|
6
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -284,4 +283,4 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
|
|
|
284
283
|
declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
|
|
285
284
|
//#endregion
|
|
286
285
|
export { sqlTextDescriptor as $, SqlTimestampDescriptor as A, sqlCharRenderOutputType as B, SqlIntCodec as C, SqlTextCodec as D, SqlQueryable as E, compact as F, sqlFloatEncode as G, sqlFloatDecode as H, sqlCharColumn as I, sqlIntDecode as J, sqlFloatEncodeJson as K, sqlCharDecode as L, SqlVarcharCodec as M, SqlVarcharDescriptor as N, SqlTextDescriptor as O, collectOrderedParamRefs as P, sqlTextDecode as Q, sqlCharDescriptor as R, SqlFloatDescriptor as S, SqlQueryResult as T, sqlFloatDecodeJson as U, sqlFloatColumn as V, sqlFloatDescriptor as W, sqlIntEncode as X, sqlIntDescriptor as Y, sqlTextColumn as Z, SqlDriver as _, LowererContext as a, sqlTimestampEncode as at, SqlExplainResult as b, SQL_CHAR_CODEC_ID as c, sqlVarcharColumn as ct, SQL_TEXT_CODEC_ID as d, sqlVarcharEncode as dt, sqlTextEncode as et, SQL_TIMESTAMP_CODEC_ID as f, sqlVarcharRenderOutputType as ft, SqlConnection as g, SqlCharDescriptor as h, Lowerer as i, sqlTimestampDescriptor as it, SqlTransaction as j, SqlTimestampCodec as k, SQL_FLOAT_CODEC_ID as l, sqlVarcharDecode as lt, SqlCharCodec as m, AdapterProfile as n, sqlTimestampDecode as nt, MarkerReadResult as o, sqlTimestampEncodeJson as ot, SQL_VARCHAR_CODEC_ID as p, sqlIntColumn as q, AdapterTarget as r, sqlTimestampDecodeJson as rt, PreparedExecuteRequest as s, sqlTimestampRenderOutputType as st, Adapter as t, sqlTimestampColumn as tt, SQL_INT_CODEC_ID as u, sqlVarcharDescriptor as ut, SqlDriverState as v, SqlIntDescriptor as w, SqlFloatCodec as x, SqlExecuteRequest as y, sqlCharEncode as z };
|
|
287
|
-
//# sourceMappingURL=ast
|
|
286
|
+
//# sourceMappingURL=ast--BZUAzN1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast--BZUAzN1.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;;;;;;;;UAcU;WACC;WACA;;UAED;WACC;WACA;WACA;IACP;IACA,IAAI;;;UAGE,eAAe,MAAM;WACpB,MAAM,cAAc;WACpB;YACC;;UAEF,iBAAiB,MAAM;WACtB,MAAM,cAAc;;KAE1B;UACK,UAAU,yBAAyB;WAClC,QAAQ;EACjB,QAAQ,SAAS,WAAW;EAC5B,qBAAqB,QAAQ;EAC7B,SAAS;;UAED,sBAAsB;EAC9B,oBAAoB,QAAQ;;;;;;;EAO5B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAwBX,QAAQ,mBAAmB;;UAEnB,uBAAuB;EAC/B,UAAU;EACV,YAAY;;UAEJ;EACR,QAAQ,MAAM,yBAAyB,SAAS,oBAAoB,cAAc;EAClF,gBAAgB,MAAM,yBAAyB,SAAS,yBAAyB,cAAc;EAC/F,SA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AmB,KAAK,yBAAyB;;cAEtD,wBAAwB;cACxB,qBAAqB,SAAS,mEAAmE,WAAW,mBAAmB;;;iBAG5H,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;;;iBAWlD,wBAAwB,KAAK,cAAc,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as frozenCodecRef } from "./codec-types-B_xmJL2m-CC_Q-_u9.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { type } from "arktype";
|
|
4
4
|
import { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
@@ -322,4 +322,4 @@ const sqlTimestampColumn = (params = {}) => column(sqlTimestampDescriptor.factor
|
|
|
322
322
|
//#endregion
|
|
323
323
|
export { sqlFloatDescriptor as A, sqlTextEncode as B, sqlCharDecode as C, sqlFloatColumn as D, sqlCharRenderOutputType as E, sqlIntDescriptor as F, sqlTimestampEncode as G, sqlTimestampDecode as H, sqlIntEncode as I, sqlVarcharColumn as J, sqlTimestampEncodeJson as K, sqlTextColumn as L, sqlFloatEncodeJson as M, sqlIntColumn as N, sqlFloatDecode as O, sqlIntDecode as P, sqlVarcharRenderOutputType as Q, sqlTextDecode as R, sqlCharColumn as S, sqlCharEncode as T, sqlTimestampDecodeJson as U, sqlTimestampColumn as V, sqlTimestampDescriptor as W, sqlVarcharDescriptor as X, sqlVarcharDecode as Y, sqlVarcharEncode as Z, SqlTextDescriptor as _, SQL_FLOAT_CODEC_ID as a, SqlVarcharCodec as b, SQL_TIMESTAMP_CODEC_ID as c, SqlCharDescriptor as d, SqlFloatCodec as f, SqlTextCodec as g, SqlIntDescriptor as h, SQL_CHAR_CODEC_ID as i, sqlFloatEncode as j, sqlFloatDecodeJson as k, SQL_VARCHAR_CODEC_ID as l, SqlIntCodec as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlFloatDescriptor as p, sqlTimestampRenderOutputType as q, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharCodec as u, SqlTimestampCodec as v, sqlCharDescriptor as w, SqlVarcharDescriptor as x, SqlTimestampDescriptor as y, sqlTextDescriptor as z };
|
|
324
324
|
|
|
325
|
-
//# sourceMappingURL=ast-
|
|
325
|
+
//# sourceMappingURL=ast-DDAyIKdt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-DDAyIKdt.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { t as frozenCodecRef } from \"../codec-types-B_xmJL2m.mjs\";\nimport { a as ForeignKeyConstraint, c as PrimaryKeyConstraint, i as DdlNode, l as UniqueConstraint, n as DdlColumn, o as FunctionColumnDefault, r as DdlColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as isDdlNode } from \"../ddl-types-BMp2bWVS.mjs\";\nimport { A as PreparedParamRef, B as isWhereExpr, C as LiteralExpr, D as OrExpr, E as OperationExpr, F as SubqueryExpr, H as whereExprKinds, I as TableSource, L as UpdateAst, M as RawExpr, N as RawSqlExpr, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, V as queryAstKinds, _ as InsertAst, a as CastExpr, b as JsonArrayAggExpr, c as DeleteAst, d as DoUpdateSetConflictAction, f as EqColJoinOn, g as IdentifierRef, h as FunctionSource, i as CaseExpr, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst, z as isQueryAst } from \"../types-D43EhRac.mjs\";\nimport { n as compact, t as collectOrderedParamRefs } from \"../util-DQQgv2j1.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/ast/json-value-projection.ts\nvar JsonValueProjection = class {\n\tvalue;\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n\tfold(folder) {\n\t\treturn this.value.fold(folder);\n\t}\n\tcollectColumnRefs() {\n\t\treturn this.value.collectColumnRefs();\n\t}\n\tcollectParamRefs() {\n\t\treturn this.value.collectParamRefs();\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar CodecJsonValueProjection = class CodecJsonValueProjection extends JsonValueProjection {\n\tkind = \"codec\";\n\tcodec;\n\tconstructor(value, codec) {\n\t\tsuper(value);\n\t\tthis.codec = frozenCodecRef(codec);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.codec(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new CodecJsonValueProjection(this.value.rewrite(rewriter), this.codec);\n\t}\n};\nvar NativeJsonValueProjection = class NativeJsonValueProjection extends JsonValueProjection {\n\tkind = \"native\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.native(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new NativeJsonValueProjection(this.value.rewrite(rewriter));\n\t}\n};\nvar JsonDocumentProjection = class JsonDocumentProjection extends JsonValueProjection {\n\tkind = \"document\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.document(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new JsonDocumentProjection(this.value.rewrite(rewriter));\n\t}\n};\n//#endregion\n//#region src/ast/sql-codec-helpers.ts\nconst SQL_CHAR_CODEC_ID = \"sql/char@1\";\nconst SQL_VARCHAR_CODEC_ID = \"sql/varchar@1\";\nconst SQL_INT_CODEC_ID = \"sql/int@1\";\nconst SQL_FLOAT_CODEC_ID = \"sql/float@1\";\nconst SQL_TEXT_CODEC_ID = \"sql/text@1\";\nconst SQL_TIMESTAMP_CODEC_ID = \"sql/timestamp@1\";\nconst sqlCharEncode = (value) => value;\nconst sqlCharDecode = (wire) => wire.trimEnd();\nconst sqlCharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Char, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_CHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Char<${length}>`;\n};\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlVarcharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Varchar, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_VARCHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Varchar<${length}>`;\n};\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\n/**\n* JSON has no spelling for a non-finite number, and a database that holds one\n* emits it as a string — PostgreSQL writes `\"NaN\"` and `\"Infinity\"`. This\n* codec's application type is `number`, so both directions reject rather than\n* carry a value that type cannot hold.\n*/\nconst sqlFloatEncodeJson = (value) => {\n\tif (!Number.isFinite(value)) throw structuredError(\"RUNTIME.ENCODE_FAILED\", `${SQL_FLOAT_CODEC_ID} application value must be a finite number, got ${value}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn value;\n};\nconst sqlFloatDecodeJson = (json) => {\n\tif (typeof json !== \"number\" || !Number.isFinite(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a finite number for ${SQL_FLOAT_CODEC_ID}, got ${JSON.stringify(json)}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn json;\n};\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\nconst ZONELESS_ISO_TIMESTAMP = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,6})?$/;\nconst sqlTimestampEncode = (value) => value;\nconst sqlTimestampDecode = (wire) => wire;\n/**\n* A `timestamp` carries no zone, so its JSON form is the ISO rendering without a\n* trailing `Z` — `2026-01-02T03:04:05.678` — and {@link sqlTimestampDecodeJson}\n* reads that form back as UTC.\n*/\nconst sqlTimestampEncodeJson = (value) => value.toISOString().slice(0, -1);\nconst sqlTimestampDecodeJson = (json) => {\n\tif (typeof json !== \"string\") throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected ISO date string for sql/timestamp@1, got ${typeof json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\tif (!ZONELESS_ISO_TIMESTAMP.test(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a zone-less ISO date-time (YYYY-MM-DDTHH:MM:SS[.sss]) for sql/timestamp@1, got ${json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\tconst date = /* @__PURE__ */ new Date(`${json}Z`);\n\tif (Number.isNaN(date.getTime())) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Invalid ISO date string for sql/timestamp@1: ${json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\treturn date;\n};\nconst sqlTimestampRenderOutputType = (typeParams) => {\n\tconst precision = typeParams.precision;\n\tif (precision === void 0) return \"Timestamp\";\n\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"precision\" in typeParams for Timestamp, got ${String(precision)}`, { meta: {\n\t\tcodec: SQL_TIMESTAMP_CODEC_ID,\n\t\tparam: \"precision\",\n\t\treceived: String(precision)\n\t} });\n\treturn `Timestamp<${precision}>`;\n};\n//#endregion\n//#region src/ast/sql-codecs.ts\nconst lengthParamsSchema = type({ \"length?\": \"number.integer > 0\" });\nconst precisionParamsSchema = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nvar SqlTextCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlTextDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlTextCodec(this);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0, \"text\");\nvar SqlIntCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlIntDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"int\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlIntCodec(this);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0, \"int\");\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlFloatEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlFloatDecodeJson(json);\n\t}\n};\nvar SqlFloatDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_FLOAT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"float\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlFloatCodec(this);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0, \"float\");\nvar SqlCharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlCharDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_CHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"char\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlCharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlCharCodec(this);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params, \"char\");\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlVarcharDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_VARCHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"varchar\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlVarcharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlVarcharCodec(this);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, \"varchar\");\nvar SqlTimestampCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTimestampEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTimestampDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlTimestampEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlTimestampDecodeJson(json);\n\t}\n};\nvar SqlTimestampDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_TIMESTAMP_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\ttargetTypes = [\"timestamp\"];\n\tparamsSchema = precisionParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlTimestampRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlTimestampCodec(this);\n\t}\n};\nconst sqlTimestampDescriptor = new SqlTimestampDescriptor();\nconst sqlTimestampColumn = (params = {}) => column(sqlTimestampDescriptor.factory(params), sqlTimestampDescriptor.codecId, params, \"timestamp\");\n//#endregion\nexport { AggregateExpr, AndExpr, BinaryExpr, CaseExpr, CastExpr, CheckExpressionConstraint, CodecJsonValueProjection, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, collectOrderedParamRefs, compact, frozenCodecRef, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;AAQA,IAAI,sBAAsB,MAAM;CAC/B;CACA,YAAY,OAAO;EAClB,KAAK,QAAQ;CACd;CACA,KAAK,QAAQ;EACZ,OAAO,KAAK,MAAM,KAAK,MAAM;CAC9B;CACA,oBAAoB;EACnB,OAAO,KAAK,MAAM,kBAAkB;CACrC;CACA,mBAAmB;EAClB,OAAO,KAAK,MAAM,iBAAiB;CACpC;CACA,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,2BAA2B,MAAM,iCAAiC,oBAAoB;CACzF,OAAO;CACP;CACA,YAAY,OAAO,OAAO;EACzB,MAAM,KAAK;EACX,KAAK,QAAQ,eAAe,KAAK;EACjC,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EACf,OAAO,QAAQ,MAAM,IAAI;CAC1B;CACA,QAAQ,UAAU;EACjB,OAAO,IAAI,yBAAyB,KAAK,MAAM,QAAQ,QAAQ,GAAG,KAAK,KAAK;CAC7E;AACD;AACA,IAAI,4BAA4B,MAAM,kCAAkC,oBAAoB;CAC3F,OAAO;CACP,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EACf,OAAO,QAAQ,OAAO,IAAI;CAC3B;CACA,QAAQ,UAAU;EACjB,OAAO,IAAI,0BAA0B,KAAK,MAAM,QAAQ,QAAQ,CAAC;CAClE;AACD;AACA,IAAI,yBAAyB,MAAM,+BAA+B,oBAAoB;CACrF,OAAO;CACP,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EACf,OAAO,QAAQ,SAAS,IAAI;CAC7B;CACA,QAAQ,UAAU;EACjB,OAAO,IAAI,uBAAuB,KAAK,MAAM,QAAQ,QAAQ,CAAC;CAC/D;AACD;AAGA,MAAM,o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B;CAC5D,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,cAAc,CAAC,SAAS;CACxB,eAAe;CACf,iBAAiB,QAAQ;EACxB,OAAO,2BAA2B,MAAM;CACzC;CACA,QAAQ,SAAS;EAChB,aAAa,IAAI,gBAAgB,IAAI;CACtC;AACD;AACA,MAAM,uBAAuB,IAAI,qBAAqB;AACtD,MAAM,oBAAoB,SAAS,CAAC,MAAM,OAAO,qBAAqB,QAAQ,MAAM,GAAG,qBAAqB,SAAS,QAAQ,SAAS;AACtI,IAAI,oBAAoB,cAAc,UAAU;CAC/C,MAAM,OAAO,OAAO,MAAM;EACzB,OAAO,mBAAmB,KAAK;CAChC;CACA,MAAM,OAAO,MAAM,MAAM;EACxB,OAAO,mBAAmB,IAAI;CAC/B;CACA,WAAW,OAAO;EACjB,OAAO,uBAAuB,KAAK;CACpC;CACA,WAAW,MAAM;EAChB,OAAO,uBAAuB,IAAI;CACnC;AACD;AACA,IAAI,yBAAyB,cAAc,oBAAoB;CAC9D,UAAU;CACV,SAAS,CAAC,YAAY,OAAO;CAC7B,cAAc,CAAC,WAAW;CAC1B,eAAe;CACf,iBAAiB,QAAQ;EACxB,OAAO,6BAA6B,MAAM;CAC3C;CACA,QAAQ,SAAS;EAChB,aAAa,IAAI,kBAAkB,IAAI;CACxC;AACD;AACA,MAAM,yBAAyB,IAAI,uBAAuB;AAC1D,MAAM,sBAAsB,SAAS,CAAC,MAAM,OAAO,uBAAuB,QAAQ,MAAM,GAAG,uBAAuB,SAAS,QAAQ,WAAW"}
|
package/dist/builder.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Expression, u as ScopeField } from "./expression-
|
|
2
|
-
import { c as GroupedQuery, d as QueryContext, f as ResolveRow, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, v as TableProxy, x as UpdateQuery } from "./db-
|
|
1
|
+
import { a as Expression, u as ScopeField } from "./expression-KPBpeH4T.mjs";
|
|
2
|
+
import { c as GroupedQuery, d as QueryContext, f as ResolveRow, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, v as TableProxy, x as UpdateQuery } from "./db-B5PMfDDd-BiWfkubp.mjs";
|
|
3
3
|
export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
|
|
2
|
-
import "./types-
|
|
3
|
-
import { i as SqlOperationEntry } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import "./ast
|
|
6
|
-
import { a as Expression, o as RawCodecInferer, u as ScopeField } from "./expression-
|
|
7
|
-
import { a as FieldProxy, d as QueryContext, o as Functions, p as Scope, r as Db, t as AggregateFunctions, y as TableProxyContract } from "./db-
|
|
8
|
-
import { r as ExecutionContext } from "./query-lane-context-
|
|
9
|
-
import "./query-lane-context-
|
|
2
|
+
import "./types-wy2-Y8wQ.mjs";
|
|
3
|
+
import { i as SqlOperationEntry } from "./index-BZF7Wehu.mjs";
|
|
4
|
+
import { s as AnyExpression } from "./types-BwePDa3m-BVrPIi8V.mjs";
|
|
5
|
+
import "./ast--BZUAzN1.mjs";
|
|
6
|
+
import { a as Expression, o as RawCodecInferer, u as ScopeField } from "./expression-KPBpeH4T.mjs";
|
|
7
|
+
import { a as FieldProxy, d as QueryContext, o as Functions, p as Scope, r as Db, t as AggregateFunctions, y as TableProxyContract } from "./db-B5PMfDDd-BiWfkubp.mjs";
|
|
8
|
+
import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-DjyAyYht-HDNYE_oF.mjs";
|
|
9
|
+
import "./query-lane-context-Dcj4eXUl.mjs";
|
|
10
10
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
11
11
|
import { CodecRef } from "@prisma/orm-framework/components/codec";
|
|
12
12
|
//#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts
|
|
@@ -15,13 +15,17 @@ import { CodecRef } from "@prisma/orm-framework/components/codec";
|
|
|
15
15
|
* Runtime wrapper around a relational-core AST expression node. Carries ScopeField metadata (codecId, nullable) so aggregate-like combinators can propagate the input codec onto their result.
|
|
16
16
|
*
|
|
17
17
|
* `codec` records the column-bound {@link CodecRef} when the field-proxy knows the binding — both the namespaced form (`f.user.email` → `ColumnRef`) and the top-level shortcut (`f.email` → `IdentifierRef`) stamp the ref derived from contract storage. `codecOf(expression)` exposes it for operation implementations forwarding the ref to `toExpr`.
|
|
18
|
+
*
|
|
19
|
+
* `projectionAst` carries the descriptor-lowered rendering of the expression, where a target declares one (e.g. SQLite's `CAST(count(*) AS TEXT)`). Lowering exists to carry the value across the driver boundary, so only the projection site consumes it — predicate and ordering positions (`buildAst()`) keep the plain form, where the rendering would change SQL semantics.
|
|
18
20
|
*/
|
|
19
21
|
declare class ExpressionImpl<T extends ScopeField = ScopeField> implements Expression<T> {
|
|
20
22
|
private readonly ast;
|
|
23
|
+
private readonly projectionAst;
|
|
21
24
|
readonly returnType: T;
|
|
22
25
|
readonly codec: CodecRef | undefined;
|
|
23
|
-
constructor(ast: AnyExpression, returnType: T, codec?: CodecRef);
|
|
26
|
+
constructor(ast: AnyExpression, returnType: T, codec?: CodecRef, projectionAst?: AnyExpression);
|
|
24
27
|
buildAst(): AnyExpression;
|
|
28
|
+
buildProjectionAst(): AnyExpression;
|
|
25
29
|
}
|
|
26
30
|
//#endregion
|
|
27
31
|
//#region src/runtime/field-proxy.d.ts
|
|
@@ -29,7 +33,7 @@ declare function createFieldProxy<S extends Scope>(scope: S): FieldProxy<S>;
|
|
|
29
33
|
//#endregion
|
|
30
34
|
//#region src/runtime/functions.d.ts
|
|
31
35
|
declare function createFunctions<QC extends QueryContext>(operations: Readonly<Record<string, SqlOperationEntry>>, rawCodecInferer: RawCodecInferer): Functions<QC>;
|
|
32
|
-
declare function createAggregateFunctions<QC extends QueryContext>(operations: Readonly<Record<string, SqlOperationEntry>>, rawCodecInferer: RawCodecInferer): AggregateFunctions<QC>;
|
|
36
|
+
declare function createAggregateFunctions<QC extends QueryContext>(operations: Readonly<Record<string, SqlOperationEntry>>, rawCodecInferer: RawCodecInferer, aggregateRegistry: SqlAggregateDescriptorRegistry): AggregateFunctions<QC>;
|
|
33
37
|
//#endregion
|
|
34
38
|
//#region src/runtime/sql.d.ts
|
|
35
39
|
interface SqlOptions<C extends Contract<SqlStorage> & TableProxyContract> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder__runtime.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"builder__runtime.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAgBc,eAAe,UAAU,aAAa,uBAAuB,WAAW;mBACnE;mBACA;WACR,YAAY;WACZ,OAAO;EAChB,YAAY,KAAK,eAAe,YAAY,GAAG,QAAQ,UAAU,gBAAgB;EACjF,YAAY;EACZ,sBAAsB;;;;iBAIP,iBAAiB,UAAU,OAAO,OAAO,IAAI,WAAW;;;iBAGxD,gBAAgB,WAAW,cAAc,YAAY,SAAS,eAAe,qBAAqB,iBAAiB,kBAAkB,UAAU;iBAC/I,yBAAyB,WAAW,cAAc,YAAY,SAAS,eAAe,qBAAqB,iBAAiB,iBAAiB,mBAAmB,iCAAiC,mBAAmB;;;UAG3N,WAAW,UAAU,SAAS,cAAc;WAC3C,SAAS,iBAAiB;WAC1B,iBAAiB;;iBAEX,IAAI,UAAU,SAAS,cAAc,oBAAoB,SAAS,WAAW,KAAK,GAAG"}
|