@prisma/orm-family-sql 8.0.0-rc.24-dev.40 → 8.0.0-rc.24-dev.41

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.
Files changed (150) hide show
  1. package/dist/{aggregate-descriptor-registry-oSsBuRHQ.mjs → aggregate-descriptor-registry-CRgsKIJY.mjs} +2 -2
  2. package/dist/{aggregate-descriptor-registry-oSsBuRHQ.mjs.map → aggregate-descriptor-registry-CRgsKIJY.mjs.map} +1 -1
  3. package/dist/{ast-BpFfUmb_.mjs → ast-B1GOjYn-.mjs} +2 -2
  4. package/dist/ast-B1GOjYn-.mjs.map +1 -0
  5. package/dist/{ast-DvD53wSW.d.mts → ast-DZnTuPWA.d.mts} +3 -3
  6. package/dist/{ast-DvD53wSW.d.mts.map → ast-DZnTuPWA.d.mts.map} +1 -1
  7. package/dist/builder.d.mts +3 -3
  8. package/dist/builder__runtime.d.mts +7 -7
  9. package/dist/builder__runtime.mjs +39 -23
  10. package/dist/builder__runtime.mjs.map +1 -1
  11. package/dist/builder__types.d.mts +5 -5
  12. package/dist/{codec-descriptor-registry-UiFDvDj4.mjs → codec-descriptor-registry-CQ9M2B3L.mjs} +4 -2
  13. package/dist/codec-descriptor-registry-CQ9M2B3L.mjs.map +1 -0
  14. package/dist/collection-methods-CO0bz9PJ.d.mts +1 -0
  15. package/dist/{collection-methods-As4pXm7B-3xgTSoyU.d.mts → collection-methods-HlRizYfF-DKdq47dN.d.mts} +3 -3
  16. package/dist/{collection-methods-As4pXm7B-3xgTSoyU.d.mts.map → collection-methods-HlRizYfF-DKdq47dN.d.mts.map} +1 -1
  17. package/dist/{config-types-CFByuvww.mjs → config-types-tSsDtIC-.mjs} +2 -2
  18. package/dist/{config-types-CFByuvww.mjs.map → config-types-tSsDtIC-.mjs.map} +1 -1
  19. package/dist/{contract-builder-DIb0oV8O.mjs → contract-builder-piV2RUop.mjs} +3 -3
  20. package/dist/{contract-builder-DIb0oV8O.mjs.map → contract-builder-piV2RUop.mjs.map} +1 -1
  21. package/dist/contract-prisma7__provider.mjs +5 -5
  22. package/dist/contract-psl.mjs +1 -1
  23. package/dist/contract-psl__attribute-specs.mjs +1 -1
  24. package/dist/contract-psl__provider.mjs +2 -2
  25. package/dist/contract-psl__provider.mjs.map +1 -1
  26. package/dist/contract-ts.mjs +3 -3
  27. package/dist/contract-ts__config-types.mjs +1 -1
  28. package/dist/contract-ts__contract-builder.mjs +2 -2
  29. package/dist/contract.mjs +1 -1
  30. package/dist/contract__validators.mjs +1 -1
  31. package/dist/{control-BdGTPj7m.mjs → control-Cxrfn6YO.mjs} +28 -16
  32. package/dist/control-Cxrfn6YO.mjs.map +1 -0
  33. package/dist/{control-BwL5tCj4.d.mts → control-DaBIvroP.d.mts} +6 -6
  34. package/dist/{control-BwL5tCj4.d.mts.map → control-DaBIvroP.d.mts.map} +1 -1
  35. package/dist/{control-adapter-0z3ce44U-BQ26ercw.d.mts → control-adapter-0z3ce44U-OE4VID0O.d.mts} +4 -4
  36. package/dist/{control-adapter-0z3ce44U-BQ26ercw.d.mts.map → control-adapter-0z3ce44U-OE4VID0O.d.mts.map} +1 -1
  37. package/dist/{control-adapter-DRLco_j0.d.mts → control-adapter-CC_Vys2q.d.mts} +2 -2
  38. package/dist/{control-adapter-DRLco_j0.d.mts.map → control-adapter-CC_Vys2q.d.mts.map} +1 -1
  39. package/dist/{db-by-MuHF2-B7uz_0VW.d.mts → db-by-MuHF2-Dz4IwRsO.d.mts} +10 -10
  40. package/dist/{db-by-MuHF2-B7uz_0VW.d.mts.map → db-by-MuHF2-Dz4IwRsO.d.mts.map} +1 -1
  41. package/dist/{ddl-types-D93zTpm9-DhSkpX0K.d.mts → ddl-types-BpNk9lrL-5rXDLalb.d.mts} +3 -3
  42. package/dist/{ddl-types-D93zTpm9-DhSkpX0K.d.mts.map → ddl-types-BpNk9lrL-5rXDLalb.d.mts.map} +1 -1
  43. package/dist/{derived-checks-9Ku2scaj-0iT0uU_6.mjs → derived-checks-9Ku2scaj-BkBpXofB.mjs} +2 -2
  44. package/dist/{derived-checks-9Ku2scaj-0iT0uU_6.mjs.map → derived-checks-9Ku2scaj-BkBpXofB.mjs.map} +1 -1
  45. package/dist/{diff-DZHlisyY.d.mts → diff-ox1r2eqR.d.mts} +2 -2
  46. package/dist/{diff-DZHlisyY.d.mts.map → diff-ox1r2eqR.d.mts.map} +1 -1
  47. package/dist/{exports-D4xgPPzV-B5oJAMdP.mjs → exports-D4xgPPzV-BWjldMmf.mjs} +4 -4
  48. package/dist/{exports-D4xgPPzV-B5oJAMdP.mjs.map → exports-D4xgPPzV-BWjldMmf.mjs.map} +1 -1
  49. package/dist/{expression-DYRYmkMl-BMKxN8Wf.d.mts → expression-CbgzZLXY-Bzqi0ZTM.d.mts} +4 -4
  50. package/dist/{expression-DYRYmkMl-BMKxN8Wf.d.mts.map → expression-CbgzZLXY-Bzqi0ZTM.d.mts.map} +1 -1
  51. package/dist/expression-DBDD1QR1.d.mts +2 -0
  52. package/dist/{expression-VJWwxbUB-BtNDaTCt.d.mts → expression-DKXV5hFJ-4ZqJOTJH.d.mts} +4 -4
  53. package/dist/expression-DKXV5hFJ-4ZqJOTJH.d.mts.map +1 -0
  54. package/dist/{expression-impl-C5Ha-fXs-CxXn8gDo.mjs → expression-impl-D9Le3c2y-MF0Fctq9.mjs} +3 -3
  55. package/dist/{expression-impl-C5Ha-fXs-CxXn8gDo.mjs.map → expression-impl-D9Le3c2y-MF0Fctq9.mjs.map} +1 -1
  56. package/dist/family.d.mts +6 -6
  57. package/dist/family.mjs +4 -4
  58. package/dist/family__control-adapter.d.mts +2 -2
  59. package/dist/family__control.d.mts +2 -2
  60. package/dist/family__control.mjs +2 -2
  61. package/dist/family__diff.d.mts +1 -1
  62. package/dist/family__ir.mjs +1 -1
  63. package/dist/family__migration.d.mts +1 -1
  64. package/dist/family__pack.mjs +2 -2
  65. package/dist/{functions-DGketpiK.mjs → functions-BV4CyVZ0.mjs} +3 -3
  66. package/dist/{functions-DGketpiK.mjs.map → functions-BV4CyVZ0.mjs.map} +1 -1
  67. package/dist/functions-CF7EOqOH.d.mts +1 -0
  68. package/dist/{generator-functions-Bze9nVHL-BK4YIqLK.mjs → generator-functions-Bze9nVHL-EURgrMFd.mjs} +3 -3
  69. package/dist/{generator-functions-Bze9nVHL-BK4YIqLK.mjs.map → generator-functions-Bze9nVHL-EURgrMFd.mjs.map} +1 -1
  70. package/dist/{index-CXtZjjgy.d.mts → index-Dlup-3Az.d.mts} +17 -17
  71. package/dist/{index-CXtZjjgy.d.mts.map → index-Dlup-3Az.d.mts.map} +1 -1
  72. package/dist/index-reference-j3KdvbVm.d.mts +1 -0
  73. package/dist/{index-reference-CjvRzUh1-CG0Ouv6i.d.mts → index-reference-kUL7aEBI-DYcs4N7J.d.mts} +3 -3
  74. package/dist/{index-reference-CjvRzUh1-CG0Ouv6i.d.mts.map → index-reference-kUL7aEBI-DYcs4N7J.d.mts.map} +1 -1
  75. package/dist/{interpreter-DoQwVOyS-jsuDJlaX.mjs → interpreter-CMHH_zlH-BOZVPx6S.mjs} +10 -10
  76. package/dist/interpreter-CMHH_zlH-BOZVPx6S.mjs.map +1 -0
  77. package/dist/{middleware-DzFPUERE-C6RrGmcp.d.mts → middleware-BZYekCO2-DeY82fwI.d.mts} +3 -3
  78. package/dist/{middleware-DzFPUERE-C6RrGmcp.d.mts.map → middleware-BZYekCO2-DeY82fwI.d.mts.map} +1 -1
  79. package/dist/middleware-Q-P3nMQA.d.mts +1 -0
  80. package/dist/{migration-BUWF9_Tx.d.mts → migration-aQa4CVb-.d.mts} +2 -2
  81. package/dist/{migration-BUWF9_Tx.d.mts.map → migration-aQa4CVb-.d.mts.map} +1 -1
  82. package/dist/orm-client.d.mts +17 -17
  83. package/dist/orm-client.mjs +21 -18
  84. package/dist/orm-client.mjs.map +1 -1
  85. package/dist/{plan-Dv6v5_y4-CGWEjfCv.d.mts → plan-Dd6M8olW-Dynb9vKp.d.mts} +3 -3
  86. package/dist/{plan-Dv6v5_y4-CGWEjfCv.d.mts.map → plan-Dd6M8olW-Dynb9vKp.d.mts.map} +1 -1
  87. package/dist/plan-G5_dBmgg.d.mts +2 -0
  88. package/dist/{psl-field-resolution-CpxUePg1-DIrhHYx0.mjs → psl-field-resolution-CpxUePg1-CTitB6W5.mjs} +3 -3
  89. package/dist/{psl-field-resolution-CpxUePg1-DIrhHYx0.mjs.map → psl-field-resolution-CpxUePg1-CTitB6W5.mjs.map} +1 -1
  90. package/dist/{query-lane-context-BetHj4j--D3S5nucp.d.mts → query-lane-context-D4U6ox8I-CGLC-1HK.d.mts} +5 -5
  91. package/dist/{query-lane-context-BetHj4j--D3S5nucp.d.mts.map → query-lane-context-D4U6ox8I-CGLC-1HK.d.mts.map} +1 -1
  92. package/dist/query-lane-context-TQxP0UjW.d.mts +1 -0
  93. package/dist/relational-core.d.mts +13 -13
  94. package/dist/relational-core.mjs +4 -4
  95. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  96. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  97. package/dist/relational-core__ast.d.mts +4 -4
  98. package/dist/relational-core__ast.mjs +3 -3
  99. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  100. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  101. package/dist/relational-core__collection-methods.d.mts +2 -2
  102. package/dist/relational-core__contract-free.d.mts +2 -2
  103. package/dist/relational-core__contract-free.mjs +13 -4
  104. package/dist/relational-core__contract-free.mjs.map +1 -1
  105. package/dist/relational-core__expression.d.mts +3 -3
  106. package/dist/relational-core__expression.mjs +1 -1
  107. package/dist/relational-core__functions.d.mts +2 -2
  108. package/dist/relational-core__functions.mjs +1 -1
  109. package/dist/relational-core__index-reference.d.mts +2 -2
  110. package/dist/relational-core__middleware.d.mts +2 -2
  111. package/dist/relational-core__plan.d.mts +3 -3
  112. package/dist/relational-core__query-lane-context.d.mts +2 -2
  113. package/dist/relational-core__types.d.mts +2 -2
  114. package/dist/runtime.d.mts +4 -4
  115. package/dist/runtime.mjs +1 -1
  116. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  117. package/dist/{sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs → sql-contract-serializer-sMY3prTx-C3OF1gr9.mjs} +2 -2
  118. package/dist/{sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs.map → sql-contract-serializer-sMY3prTx-C3OF1gr9.mjs.map} +1 -1
  119. package/dist/{sql-execution-plan-4OFBeONp-CLkDqMdz.d.mts → sql-execution-plan-BKmtONvF-bBXCQ0s1.d.mts} +3 -3
  120. package/dist/sql-execution-plan-BKmtONvF-bBXCQ0s1.d.mts.map +1 -0
  121. package/dist/{transaction-state-B4FVsvO7-DpvKYHSB.d.mts → transaction-state-B4FVsvO7-C0kgrpwC.d.mts} +9 -9
  122. package/dist/{transaction-state-B4FVsvO7-DpvKYHSB.d.mts.map → transaction-state-B4FVsvO7-C0kgrpwC.d.mts.map} +1 -1
  123. package/dist/{types-DEbNJhyS-CY7Ye2vN.d.mts → types-BseDMzbO-jM1a1F4N.d.mts} +5 -3
  124. package/dist/{types-DEbNJhyS-CY7Ye2vN.d.mts.map → types-BseDMzbO-jM1a1F4N.d.mts.map} +1 -1
  125. package/dist/{types-DzQmUrUm-ColHE4Av.mjs → types-BtItVHx6-BEDme1ZL.mjs} +15 -14
  126. package/dist/types-BtItVHx6-BEDme1ZL.mjs.map +1 -0
  127. package/dist/{types-CGr02DOy-CQsUdKCe.d.mts → types-CMSRIhJK-D0oiijer.d.mts} +6 -6
  128. package/dist/{types-CGr02DOy-CQsUdKCe.d.mts.map → types-CMSRIhJK-D0oiijer.d.mts.map} +1 -1
  129. package/dist/{types-CWvmfrfd-HPIh55bi.d.mts → types-CWvmfrfd-u6aEmYg4.d.mts} +2 -2
  130. package/dist/{types-CWvmfrfd-HPIh55bi.d.mts.map → types-CWvmfrfd-u6aEmYg4.d.mts.map} +1 -1
  131. package/dist/types-ClvFL9_q.d.mts +1 -0
  132. package/dist/{validators-CcR6gGf_.mjs → validators-_FcNfyor.mjs} +8 -5
  133. package/dist/validators-_FcNfyor.mjs.map +1 -0
  134. package/package.json +18 -18
  135. package/dist/ast-BpFfUmb_.mjs.map +0 -1
  136. package/dist/codec-descriptor-registry-UiFDvDj4.mjs.map +0 -1
  137. package/dist/collection-methods-CS1e16Ij.d.mts +0 -1
  138. package/dist/control-BdGTPj7m.mjs.map +0 -1
  139. package/dist/expression-Bz8uEh8W.d.mts +0 -2
  140. package/dist/expression-VJWwxbUB-BtNDaTCt.d.mts.map +0 -1
  141. package/dist/functions-gl3PL1so.d.mts +0 -1
  142. package/dist/index-reference-X_kA2mV8.d.mts +0 -1
  143. package/dist/interpreter-DoQwVOyS-jsuDJlaX.mjs.map +0 -1
  144. package/dist/middleware-CcDThETr.d.mts +0 -1
  145. package/dist/plan-BjX90QC6.d.mts +0 -2
  146. package/dist/query-lane-context-DgxWaKr-.d.mts +0 -1
  147. package/dist/sql-execution-plan-4OFBeONp-CLkDqMdz.d.mts.map +0 -1
  148. package/dist/types-BFCrGkhG.d.mts +0 -1
  149. package/dist/types-DzQmUrUm-ColHE4Av.mjs.map +0 -1
  150. package/dist/validators-CcR6gGf_.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { B as aggregateFnNames, U as frozenCodecRef, W as isAggregateFn } from "./types-DzQmUrUm-ColHE4Av.mjs";
1
+ import { B as aggregateFnNames, U as frozenCodecRef, W as isAggregateFn } from "./types-BtItVHx6-BEDme1ZL.mjs";
2
2
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { aggregateDescriptorKey, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, settleAggregateOverloads } from "@prisma/orm-framework/components/components";
@@ -123,4 +123,4 @@ function describeCandidate(value) {
123
123
  //#endregion
124
124
  export { isSqlAggregateDescriptor as n, buildSqlAggregateDescriptorRegistry as t };
125
125
 
126
- //# sourceMappingURL=aggregate-descriptor-registry-oSsBuRHQ.mjs.map
126
+ //# sourceMappingURL=aggregate-descriptor-registry-CRgsKIJY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"aggregate-descriptor-registry-oSsBuRHQ.mjs","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.mjs"],"sourcesContent":["import { B as aggregateFnNames, U as isAggregateFn, X as frozenCodecRef } from \"../types-DzQmUrUm.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/** The descriptor's own answer for a result set carrying no row, carried into resolution unchanged. */\nfunction resultNullability(descriptor) {\n\treturn descriptor.nullable ? { nullable: true } : {\n\t\tnullable: false,\n\t\temptyResultWire: descriptor.emptyResultWire\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, the lowering rule — an operation outside the closed SQL aggregate alphabet must carry a `lower` hook, there being no plain `AggregateExpr` form for it — 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 — plus, for a non-nullable result, the empty-result value; 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, adding `emptyResultWire` where `nullable` is false.\",\n\t\t\tmeta: { descriptor: describeCandidate(candidate) }\n\t\t});\n\t\tconst key = aggregateDescriptorKey(candidate);\n\t\tif (!isAggregateFn(candidate.operation) && candidate.lower === void 0) throw structuredError(\"RUNTIME.AGGREGATE_LOWERING_MISSING\", `Aggregate descriptor '${key}' declares operation '${candidate.operation}', which is outside the SQL aggregate alphabet (${[...aggregateFnNames].join(\", \")}) and carries no lowering hook.`, {\n\t\t\twhy: \"An operation in the alphabet lowers to a plain aggregate call; renderers know no other operation, so any other name must build its expression through a `lower` hook from existing nodes.\",\n\t\t\tfix: \"Declare a `lower` hook on the descriptor, or use an operation name from the SQL aggregate alphabet.\",\n\t\t\tmeta: {\n\t\t\t\toperation: candidate.operation,\n\t\t\t\tkey\n\t\t\t}\n\t\t});\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\t...resultNullability(descriptor),\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\t...resultNullability(descriptor),\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;CAC1C,OAAO,EAAE,WAAW,UAAU,MAAM,UAAU,KAAK,KAAK,OAAO,MAAM,UAAU;AAChF;AAGA,SAAS,eAAe,QAAQ,OAAO;CACtC,OAAO,eAAe;EACrB,SAAS,OAAO;EAChB,GAAG,UAAU,cAAc,OAAO,aAAa,KAAK,CAAC;CACtD,CAAC;AACF;;AAEA,SAAS,kBAAkB,YAAY;CACtC,OAAO,WAAW,WAAW,EAAE,UAAU,KAAK,IAAI;EACjD,UAAU;EACV,iBAAiB,WAAW;CAC7B;AACD;;;;;;AAMA,SAAS,oCAAoC,aAAa,kBAAkB;CAC3E,MAAM,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AAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,OAAO,OAAO,IAAI,OAAO,MAAM,SAAS,EAAE;CAC5G,OAAO,WAAW,OAAO;AAC1B"}
1
+ {"version":3,"file":"aggregate-descriptor-registry-CRgsKIJY.mjs","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.mjs"],"sourcesContent":["import { B as aggregateFnNames, U as isAggregateFn, Z as frozenCodecRef } from \"../types-BtItVHx6.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/** The descriptor's own answer for a result set carrying no row, carried into resolution unchanged. */\nfunction resultNullability(descriptor) {\n\treturn descriptor.nullable ? { nullable: true } : {\n\t\tnullable: false,\n\t\temptyResultWire: descriptor.emptyResultWire\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, the lowering rule — an operation outside the closed SQL aggregate alphabet must carry a `lower` hook, there being no plain `AggregateExpr` form for it — 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 — plus, for a non-nullable result, the empty-result value; 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, adding `emptyResultWire` where `nullable` is false.\",\n\t\t\tmeta: { descriptor: describeCandidate(candidate) }\n\t\t});\n\t\tconst key = aggregateDescriptorKey(candidate);\n\t\tif (!isAggregateFn(candidate.operation) && candidate.lower === void 0) throw structuredError(\"RUNTIME.AGGREGATE_LOWERING_MISSING\", `Aggregate descriptor '${key}' declares operation '${candidate.operation}', which is outside the SQL aggregate alphabet (${[...aggregateFnNames].join(\", \")}) and carries no lowering hook.`, {\n\t\t\twhy: \"An operation in the alphabet lowers to a plain aggregate call; renderers know no other operation, so any other name must build its expression through a `lower` hook from existing nodes.\",\n\t\t\tfix: \"Declare a `lower` hook on the descriptor, or use an operation name from the SQL aggregate alphabet.\",\n\t\t\tmeta: {\n\t\t\t\toperation: candidate.operation,\n\t\t\t\tkey\n\t\t\t}\n\t\t});\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\t...resultNullability(descriptor),\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\t...resultNullability(descriptor),\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;CAC1C,OAAO,EAAE,WAAW,UAAU,MAAM,UAAU,KAAK,KAAK,OAAO,MAAM,UAAU;AAChF;AAGA,SAAS,eAAe,QAAQ,OAAO;CACtC,OAAO,eAAe;EACrB,SAAS,OAAO;EAChB,GAAG,UAAU,cAAc,OAAO,aAAa,KAAK,CAAC;CACtD,CAAC;AACF;;AAEA,SAAS,kBAAkB,YAAY;CACtC,OAAO,WAAW,WAAW,EAAE,UAAU,KAAK,IAAI;EACjD,UAAU;EACV,iBAAiB,WAAW;CAC7B;AACD;;;;;;AAMA,SAAS,oCAAoC,aAAa,kBA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A,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,OAAO,OAAO,IAAI,OAAO,MAAM,SAAS,EAAE;CAC5G,OAAO,WAAW,OAAO;AAC1B"}
@@ -1,4 +1,4 @@
1
- import { U as frozenCodecRef } from "./types-DzQmUrUm-ColHE4Av.mjs";
1
+ import { U as frozenCodecRef } from "./types-BtItVHx6-BEDme1ZL.mjs";
2
2
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { withoutTrailing } from "@prisma/orm-framework/utils/text";
@@ -375,4 +375,4 @@ const sqlRawColumn = (sql) => column(sqlRawDescriptor.factory({ sql }), sqlRawDe
375
375
  //#endregion
376
376
  export { sqlCharDecode as A, sqlIntEncode as B, encodeLiteralDefault as C, lockWaitPolicyOf as D, lockStrengthCapabilities as E, sqlFloatDescriptor as F, sqlTextDescriptor as G, sqlRawDescriptor as H, sqlFloatEncode as I, sqlVarcharDecode as J, sqlTextEncode as K, sqlIntColumn as L, sqlCharEncode as M, sqlFloatColumn as N, missingCapability as O, sqlFloatDecode as P, sqlIntDecode as R, encodeListLiteralDefault as S, lockOptionCapabilities as T, sqlTextColumn as U, sqlRawColumn as V, sqlTextDecode as W, sqlVarcharEncode as X, sqlVarcharDescriptor as Y, SqlRawDescriptor as _, SQL_FLOAT_CODEC_ID as a, SqlVarcharCodec as b, SQL_TEXT_CODEC_ID as c, SqlCharDescriptor as d, SqlFloatCodec as f, SqlRawCodec as g, SqlIntDescriptor as h, SQL_CHAR_CODEC_ID as i, sqlCharDescriptor as j, sqlCharColumn as k, SQL_VARCHAR_CODEC_ID as l, SqlIntCodec as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlFloatDescriptor as p, sqlVarcharColumn as q, NativeJsonValueProjection as r, SQL_RAW_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharCodec as u, SqlTextCodec as v, lockIncompatible as w, SqlVarcharDescriptor as x, SqlTextDescriptor as y, sqlIntDescriptor as z };
377
377
 
378
- //# sourceMappingURL=ast-BpFfUmb_.mjs.map
378
+ //# sourceMappingURL=ast-B1GOjYn-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-B1GOjYn-.mjs","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { A as ParamRef, B as aggregateFnNames, C as LiteralExpr, D as OperationExpr, E as NullCheckExpr, F as SelectAst, G as isOrderByNulls, H as collectTableSources, I as SubqueryExpr, J as queryAstKinds, K as isQueryAst, L as TableSource, M as ProjectionItem, N as RawExpr, O as OrExpr, P as RawQueryAst, R as UpdateAst, S as ListExpression, T as NotExpr, U as isAggregateFn, V as checkLimitOffset, W as isOrderByDirection, X as whereExprKinds, Y as refuseReservedResultColumn, Z as frozenCodecRef, _ 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 PreparedParamRef, k as OrderByItem, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, q as isWhereExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as LockingClause, x as JsonObjectExpr, y as JoinAst, z as WindowFuncExpr } from \"../types-BtItVHx6.mjs\";\nimport { a as DdlColumn, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as CheckExpressionConstraint, l as FunctionColumnDefault, n as opaqueSql, o as DdlColumnDefault, p as isDdlNode, r as renderOpaqueSql, s as DdlNode, t as OpaqueSql, u as LiteralColumnDefault } from \"../opaque-sql-Dset3kln.mjs\";\nimport { n as compact, r as isAggregateProjection, t as collectOrderedParamRefs } from \"../util-DixeJBri.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { CodecDescriptorTemplateImpl, CodecImpl, SAFE_INTEGER_RANGE, codecForRef, column, floatToJson, readContractValue, readJsonFloat, readJsonInteger } from \"@internal/framework-components/codec\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { withoutTrailing } from \"@internal/utils/text\";\n//#region src/ast/ddl-default.ts\n/**\n* Reads a column's literal default as a value of the column's data type, converts it with the column's codec, built with its type parameters, and writes it with `toWire` for the DDL renderer to inline. `undefined` when no codec descriptor has the column's codec id, so the renderer inlines the value as written.\n*\n* A `Date` is the one authored value JSON has no notation for, so the codec reads it into a value of the column's type with `toDataTypeValue`, and the Date it reads back from that value is encoded: the type and the codec check it as they check any other default. A `null` the type or codec refuses is SQL NULL, because SQL NULL has no stored form of its own; a type that stores `null` (a JSON type) makes it the JSON value null. Any other value either refuses is a `CONTRACT.DEFAULT_INVALID` naming the column.\n*/\nasync function encodeLiteralDefault(codecLookup, codecRef, value, where) {\n\tconst codec = codecForRef(codecLookup, codecRef);\n\tif (codec === void 0) return void 0;\n\tconst refused = (cause) => refusedDefault(where, codecRef.codecId, value, void 0, cause);\n\tif (value instanceof Date) return encodeDate(codec, value, refused);\n\treturn encodeWithCodec(codec, codecRef, value, refused);\n}\nasync function encodeDate(codec, value, refused) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = codec.fromDataTypeValue(codec.toDataTypeValue(value));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tthrow refused(error);\n\t}\n\treturn {\n\t\tkind: \"wire\",\n\t\twire: await codec.toWire(decoded, {})\n\t};\n}\n/**\n* Reads and encodes each element of a list column's literal default with the column's codec, as {@link encodeLiteralDefault} does a single value, so a `null` element the codec refuses is SQL NULL. `undefined` when no codec descriptor has the column's codec id. An element the codec refuses is a `CONTRACT.DEFAULT_INVALID` naming the column and the element's 1-based position.\n*/\nasync function encodeListLiteralDefault(codecLookup, codecRef, elements, where) {\n\tconst codec = codecForRef(codecLookup, codecRef);\n\tif (codec === void 0) return void 0;\n\treturn Promise.all(elements.map((element, index) => encodeWithCodec(codec, codecRef, element, (cause) => refusedDefault(where, codecRef.codecId, element, index + 1, cause))));\n}\nasync function encodeWithCodec(codec, codecRef, value, refused) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = readContractValue(codec, value, codecRef.typeParams);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tif (value === null) return { kind: \"sql-null\" };\n\t\tthrow refused(error);\n\t}\n\treturn {\n\t\tkind: \"wire\",\n\t\twire: await codec.toWire(decoded, {})\n\t};\n}\nfunction refusedDefault(where, codecId, value, elementPosition, cause) {\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\treturn structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a ${subject} its codec ${codecId} refuses: ${reason}`, {\n\t\twhy: \"A contract.json that an earlier version emitted, or a migration.ts it planned, can hold a default that this version's codec refuses, and so can either file after a hand edit.\",\n\t\tfix: \"If contract.json holds the default, emit the contract again with this version, and correct the default in the contract source if emit refuses it. If a migration.ts sets it, correct it in that file.\",\n\t\tcause,\n\t\tmeta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\tcodecId,\n\t\t\tvalue,\n\t\t\t...ifDefined(\"elementPosition\", elementPosition),\n\t\t\treason: \"codec-refused-default\"\n\t\t}\n\t});\n}\n//#endregion\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/locking.ts\n/** The `ORM.LOCK_INCOMPATIBLE` error for a lock refused because of `conflict`. */\nfunction lockIncompatible(conflict, message) {\n\treturn structuredError(\"ORM.LOCK_INCOMPATIBLE\", message, { meta: { conflict } });\n}\n/** The capability each lock strength needs. */\nconst lockStrengthCapabilities = {\n\tforUpdate: { sql: { forUpdate: true } },\n\tforNoKeyUpdate: { postgres: { forNoKeyUpdate: true } },\n\tforShare: { sql: { forShare: true } },\n\tforKeyShare: { postgres: { forKeyShare: true } }\n};\n/** The capability each locking option needs; the wait-policy keys equal the `LockWaitPolicy` values. */\nconst lockOptionCapabilities = {\n\tof: { sql: { lockOf: true } },\n\tnowait: { sql: { lockNowait: true } },\n\tskipLocked: { sql: { lockSkipLocked: true } }\n};\n/** The first flag in `requirement` that `capabilities` does not report as `true`, as `group.flag`. */\nfunction missingCapability(capabilities, requirement) {\n\tfor (const [group, flags] of Object.entries(requirement)) for (const flag of Object.keys(flags)) if (capabilities[group]?.[flag] !== true) return `${group}.${flag}`;\n}\n/** Turns `{ nowait, skipLocked }` into a wait policy, refusing both together with `ORM.ARGUMENT_INVALID`. */\nfunction lockWaitPolicyOf(methodName, options) {\n\tif (options?.nowait && options.skipLocked) throw structuredError(\"ORM.ARGUMENT_INVALID\", `${methodName}() takes nowait or skipLocked, not both`, { meta: { method: methodName } });\n\tif (options?.nowait) return \"nowait\";\n\tif (options?.skipLocked) return \"skipLocked\";\n}\n//#endregion\n//#region src/ast/sql-codec-helpers.ts\n/**\n* Shared encode/decode constants and codec id literals for the five SQL base codecs (`sql/char@1`, `sql/varchar@1`, `sql/int@1`, `sql/float@1`, `sql/text@1`).\n*\n* The codec implementations live in `sql-codecs.ts` (TML-2357). This module retains only the conversion helpers the codec methods compose with — keeping a single source of truth for non-trivial conversions while the codec methods provide the framework-required `Promise<…>` boundary.\n*/\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_RAW_CODEC_ID = \"sql/raw@1\";\nconst sqlCharEncode = (value) => value;\n/** A `character` value as the database returns it, without the spaces that pad it to its length. Only spaces pad it, so a trailing tab or newline is part of the value. */\nconst sqlCharDecode = (wire) => withoutTrailing(wire, \" \");\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\n//#endregion\n//#region src/ast/sql-codecs.ts\n/** A family codec has no data type of its own, so only a target that adapts it, naming its data type, builds its codec. A column helper below names the codec for a contract; the target's adapted descriptor builds it. */\nfunction unadapted(codecId) {\n\tthrow new InternalError(`${codecId} is a SQL family template. A target adapts it with its own data type and builds its codecs; the template builds none.`);\n}\nvar SqlTextCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlTextDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"string\";\n\tcodecId = SQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0);\nvar SqlIntCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\t/** A `number` holds an integer exactly only within the safe integer range. */\n\tfromDataTypeValue(value) {\n\t\treturn readJsonInteger(this.id, value.value, SAFE_INTEGER_RANGE);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlIntDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"number\";\n\tcodecId = SQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0);\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn readJsonFloat(this.id, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(floatToJson(input));\n\t}\n};\nvar SqlFloatDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"number\";\n\tcodecId = SQL_FLOAT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0);\nvar SqlCharCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlCharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"string\";\n\tcodecId = SQL_CHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params);\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"string\";\n\tcodecId = SQL_VARCHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params);\nfunction isJsonValue(value) {\n\tif (value === null) return true;\n\tswitch (typeof value) {\n\t\tcase \"string\":\n\t\tcase \"boolean\": return true;\n\t\tcase \"number\": return Number.isFinite(value);\n\t\tcase \"object\":\n\t\t\tif (Array.isArray(value)) return value.every(isJsonValue);\n\t\t\treturn Object.getPrototypeOf(value) === Object.prototype && Object.values(value).every(isJsonValue);\n\t\tdefault: return false;\n\t}\n}\n/**\n* The codec of a raw column, whose type no other data type claims. Values pass through unchanged and\n* are typed `unknown`, since nothing is known about them beyond what the database returns. A raw\n* column has no literal values, but that is its data type's rule: the data type's reader refuses\n* every value, so `toDataTypeValue` refuses every literal. ADR 273.\n*/\nvar SqlRawCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\tif (isJsonValue(input)) return this.dataTypeValueOf(input);\n\t\tthrow structuredError(\"RUNTIME.ENCODE_FAILED\", `${this.id} writes only JSON values as JSON`, { meta: { codecId: this.id } });\n\t}\n};\nvar SqlRawDescriptor = class extends CodecDescriptorTemplateImpl {\n\tjsonType = \"any\";\n\tcodecId = SQL_RAW_CODEC_ID;\n\ttraits = [];\n\tenumRefusal = \"A raw column has a type Prisma does not interpret, so no member can be written as one of its values. No enum can use the raw codec; use a text enum instead.\";\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlRawDescriptor = new SqlRawDescriptor();\nconst sqlRawColumn = (sql) => column(sqlRawDescriptor.factory({ sql }), sqlRawDescriptor.codecId, { sql });\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, LockingClause, NativeJsonValueProjection, NotExpr, NullCheckExpr, OpaqueSql, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawQueryAst, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlRawCodec, SqlRawDescriptor, SqlTextCodec, SqlTextDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, aggregateFnNames, checkLimitOffset, collectOrderedParamRefs, collectTableSources, compact, encodeListLiteralDefault, encodeLiteralDefault, frozenCodecRef, isAggregateFn, isAggregateProjection, isDdlNode, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, lockIncompatible, lockOptionCapabilities, lockStrengthCapabilities, lockWaitPolicyOf, missingCapability, opaqueSql, queryAstKinds, refuseReservedResultColumn, renderOpaqueSql, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlRawColumn, sqlRawDescriptor, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;;;;;;;;AAcA,eAAe,qBAAqB,aAAa,UAAU,OAAO,OAAO;CACxE,MAAM,QAAQ,YAAY,aAAa,QAAQ;CAC/C,IAAI,UAAU,KAAK,GAAG,OAAO,KAAK;CAClC,MAAM,WAAW,UAAU,eAAe,OAAO,SAAS,SAAS,OAAO,KAAK,GAAG,KAAK;CACvF,IAAI,iBAAiB,MAAM,OAAO,WAAW,OAAO,OAAO,OAAO;CAClE,OAAO,gBAAgB,OAAO,UAAU,OAAO,OAAO;AACvD;AACA,eAAe,WAAW,OAAO,OAAO,SAAS;CAChD,IAAI;CACJ,IAAI;EACH,UAAU,MAAM,kBAAkB,MAAM,gBAAgB,KAAK,CAAC;CAC/D,SAAS,OAAO;EACf,IAAI,gBAAgB,KAAK,GAAG,MAAM;EAClC,MAAM,QAAQ,KAAK;CACpB;CACA,OAAO;EACN,MAAM;EACN,MAAM,MAAM,MAAM,OAAO,SAAS,CAAC,CAAC;CACrC;AACD;;;;AAIA,eAAe,yBAAyB,aAAa,UAAU,UAAU,OAAO;CAC/E,MAAM,QAAQ,YAAY,aAAa,QAAQ;CAC/C,IAAI,UAAU,KAAK,GAAG,OAAO,KAAK;CAClC,OAAO,QAAQ,IAAI,SAAS,KAAK,SAAS,UAAU,gBAAgB,OAAO,UAAU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Y,OAAO;CAC3B,IAAI,UAAU,MAAM,OAAO;CAC3B,QAAQ,OAAO,OAAf;EACC,KAAK;EACL,KAAK,WAAW,OAAO;EACvB,KAAK,UAAU,OAAO,OAAO,SAAS,KAAK;EAC3C,KAAK;GACJ,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,MAAM,WAAW;GACxD,OAAO,OAAO,eAAe,KAAK,MAAM,OAAO,aAAa,OAAO,OAAO,KAAK,CAAC,CAAC,MAAM,WAAW;EACnG,SAAS,OAAO;CACjB;AACD;;;;;;;AAOA,IAAI,cAAc,cAAc,UAAU;CACzC,MAAM,OAAO,OAAO,MAAM;EACzB,OAAO;CACR;CACA,MAAM,SAAS,MAAM,MAAM;EAC1B,OAAO;CACR;CACA,kBAAkB,OAAO;EACxB,OAAO,MAAM;CACd;CACA,gBAAgB,OAAO;EACtB,IAAI,YAAY,KAAK,GAAG,OAAO,KAAK,gBAAgB,KAAK;EACzD,MAAM,gBAAgB,yBAAyB,GAAG,KAAK,GAAG,mCAAmC,EAAE,MAAM,EAAE,SAAS,KAAK,GAAG,EAAE,CAAC;CAC5H;AACD;AACA,IAAI,mBAAmB,cAAc,4BAA4B;CAChE,WAAW;CACX,UAAU;CACV,SAAS,CAAC;CACV,cAAc;CACd,eAAe,KAAK;CACpB,QAAQ,SAAS;EAChB,aAAa,UAAU,KAAK,OAAO;CACpC;AACD;AACA,MAAM,mBAAmB,IAAI,iBAAiB;AAC9C,MAAM,gBAAgB,QAAQ,OAAO,iBAAiB,QAAQ,EAAE,IAAI,CAAC,GAAG,iBAAiB,SAAS,EAAE,IAAI,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Dt as ProjectionItem, E as CodecRef$1, ft as LockWaitPolicy, gt as LoweredStatement, h as AnyQueryAst, m as AnyParamRef } from "./types-DEbNJhyS-CY7Ye2vN.mjs";
1
+ import { Dt as ProjectionItem, E as CodecRef$1, ft as LockWaitPolicy, gt as LoweredStatement, h as AnyQueryAst, m as AnyParamRef } from "./types-BseDMzbO-jM1a1F4N.mjs";
2
2
  import { c as SqlQueryable } from "./driver-types-DFz7U-LT-DaVdVhU9.mjs";
3
- import "./ddl-types-D93zTpm9-DhSkpX0K.mjs";
3
+ import "./ddl-types-BpNk9lrL-5rXDLalb.mjs";
4
4
  import { StructuredError } from "@prisma/orm-framework/utils/structured-error";
5
5
  import { ColumnDefaultLiteralInputValue, ContractMarkerRecord, JsonValue } from "@prisma/orm-framework/contract/types";
6
6
  import { CodecCallContext, CodecDescriptorTemplateImpl, CodecImpl, CodecInstanceContext, CodecLookupWithDescriptors, DataTypeValue } from "@prisma/orm-framework/components/codec";
@@ -293,4 +293,4 @@ declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyPar
293
293
  declare function isAggregateProjection(item: ProjectionItem): boolean;
294
294
  //#endregion
295
295
  export { sqlIntDescriptor as $, SqlTextDescriptor as A, lockStrengthCapabilities as B, SqlFloatCodec as C, SqlRawCodec as D, SqlIntDescriptor as E, encodeListLiteralDefault as F, sqlCharDescriptor as G, missingCapability as H, encodeLiteralDefault as I, sqlFloatDecode as J, sqlCharEncode as K, isAggregateProjection as L, SqlVarcharDescriptor as M, collectOrderedParamRefs as N, SqlRawDescriptor as O, compact as P, sqlIntDecode as Q, lockIncompatible as R, SqlCharDescriptor as S, SqlIntCodec as T, sqlCharColumn as U, lockWaitPolicyOf as V, sqlCharDecode as W, sqlFloatEncode as X, sqlFloatDescriptor as Y, sqlIntColumn as Z, SQL_INT_CODEC_ID as _, EncodedLiteralDefault as a, sqlTextDescriptor as at, SQL_VARCHAR_CODEC_ID as b, LockOptionCapabilities as c, sqlVarcharDecode as ct, LockWaitRequest as d, sqlIntEncode as et, Lowerer as f, SQL_FLOAT_CODEC_ID as g, SQL_CHAR_CODEC_ID as h, CapabilityRequirement as i, sqlTextDecode as it, SqlVarcharCodec as j, SqlTextCodec as k, LockStrengthCapabilities as l, sqlVarcharDescriptor as lt, MarkerReadResult as m, AdapterProfile as n, sqlRawDescriptor as nt, LiteralDefaultColumn as o, sqlTextEncode as ot, LowererContext as p, sqlFloatColumn as q, AdapterTarget as r, sqlTextColumn as rt, LockConflict as s, sqlVarcharColumn as st, Adapter as t, sqlRawColumn as tt, LockWaitOptions as u, sqlVarcharEncode as ut, SQL_RAW_CODEC_ID as v, SqlFloatDescriptor as w, SqlCharCodec as x, SQL_TEXT_CODEC_ID as y, lockOptionCapabilities as z };
296
- //# sourceMappingURL=ast-DvD53wSW.d.mts.map
296
+ //# sourceMappingURL=ast-DZnTuPWA.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ast-DvD53wSW.d.mts","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;KAOK;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,KAAK,SAAS,eAAe,eAAe;;;;UAIrH,QAAQ,eAAe,qBAAqB,QAAQ;WACnD,SAAS;EAClB,MAAM,KAAK,KAAK,SAAS,eAAe,aAAa;;;;;KAKlD;WACM;;WAEA;WACA;;;UAGD;WACC;WACA;;;;;;;iBAOM,qBAAqB,aAAa,KAAK,8CAA8C,UAAU,YAAU,OAAO,gCAAgC,OAAO,uBAAuB,QAAQ;;;;iBAItL,yBAAyB,aAAa,KAAK,8CAA8C,UAAU,YAAU,mBAAmB,aAAa,OAAO,uBAAuB,iBAAiB;;;;KAIxM;;iBAEY,iBAAiB,UAAU,cAAc,kBAAkB;;KAEvE;YACO;cACE;;;;cAIA;WACH;aACE;eACE;;;WAGJ;aACE;eACE;;;WAGJ;aACE;eACE;;;WAGJ;aACE;eACE;;;;;cAKD;WACH;aACE;eACE;;;WAGJ;aACE;eACE;;;WA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ACzB,gBAAgB,gBAAgB;;cAEpB,0BAA0B,4BAA4B;WACzD;WACA;WACA;WACA;EACT,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,mBAAmB;cACnB,gBAAgB,SAAS,gEAAgE,WAAW,cAAc;cAClH,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MAAM,mBAAqB;EACjD,SAAS,cAAc,MAAM,mBAAqB;EAClD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,6BAA6B,4BAA4B;WAC5D;WACA;WACA;WACA;EACT,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,sBAAsB;cACtB,mBAAmB,SAAS,gEAAgE,WAAW,iBAAiB;KACjI;WACM;;;;;;;;cAQG,oBAAoB,iBAAiB;EACjD,OAAO,gBAAgB,MAAM,mBAAqB;EAClD,SAAS,eAAe,MAAM,mBAAqB;EACnD,kBAAkB,OAAO;EACzB,gBAAgB,iBAAiB;;cAErB,yBAAyB,4BAA4B;WACxD;WACA;WACA;WACA;WACA;EACT,QAAQ,SAAS,aAAa,KAAK,yBAAyB;;cAEhD,kBAAkB;cAClB,eAAe,+DAA+D,WAAW;EACrG;;;;iBAIe,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;iBASlD,wBAAwB,KAAK,cAAc,cAAc;;iBAEzD,sBAAsB,MAAM"}
1
+ {"version":3,"file":"ast-DZnTuPWA.d.mts","names":[],"sources":["../../../../2-sql-family/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;KAOK;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,KAAK,SAAS,eAAe,eAAe;;;;UAIrH,QAAQ,eAAe,qB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BAIe,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;iBASlD,wBAAwB,KAAK,cAAc,cAAc;;iBAEzD,sBAAsB,MAAM"}
@@ -1,4 +1,4 @@
1
- import { A as Subquery, O as ScopeField, l as Expression, u as Functions } from "./expression-DYRYmkMl-BMKxN8Wf.mjs";
2
- import "./functions-gl3PL1so.mjs";
3
- import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-by-MuHF2-B7uz_0VW.mjs";
1
+ import { A as Subquery, O as ScopeField, l as Expression, u as Functions } from "./expression-CbgzZLXY-Bzqi0ZTM.mjs";
2
+ import "./functions-CF7EOqOH.mjs";
3
+ import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-by-MuHF2-Dz4IwRsO.mjs";
4
4
  export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
@@ -1,13 +1,13 @@
1
1
  import { l as SqlStorage } from "./sql-storage-B_AM6tU1-BOPQxXo7.mjs";
2
2
  import "./types-CXRxo_TK.mjs";
3
3
  import { i as SqlOperationEntry } from "./index-BWWwt5hB.mjs";
4
- import { F as createFunctions, m as RawCodecInferer } from "./expression-DYRYmkMl-BMKxN8Wf.mjs";
5
- import { t as ExpressionImpl } from "./expression-VJWwxbUB-BtNDaTCt.mjs";
6
- import "./expression-Bz8uEh8W.mjs";
7
- import "./functions-gl3PL1so.mjs";
8
- import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-by-MuHF2-B7uz_0VW.mjs";
9
- import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-BetHj4j--D3S5nucp.mjs";
10
- import "./query-lane-context-DgxWaKr-.mjs";
4
+ import { F as createFunctions, m as RawCodecInferer } from "./expression-CbgzZLXY-Bzqi0ZTM.mjs";
5
+ import { t as ExpressionImpl } from "./expression-DKXV5hFJ-4ZqJOTJH.mjs";
6
+ import "./expression-DBDD1QR1.mjs";
7
+ import "./functions-CF7EOqOH.mjs";
8
+ import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-by-MuHF2-Dz4IwRsO.mjs";
9
+ import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-D4U6ox8I-CGLC-1HK.mjs";
10
+ import "./query-lane-context-TQxP0UjW.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
12
12
  //#region ../../../2-sql-family/4-lanes/sql-builder/dist/runtime/index.d.mts
13
13
  //#region src/runtime/field-proxy.d.ts
@@ -1,9 +1,9 @@
1
- import { A as ParamRef, F as SelectAst, G as isOrderByDirection, K as isOrderByNulls, L as TableSource, M as ProjectionItem, R as UpdateAst, W as isAggregateFn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, t as AggregateExpr, w as LockingClause, y as JoinAst } from "./types-DzQmUrUm-ColHE4Av.mjs";
1
+ import { A as ParamRef, F as SelectAst, G as isOrderByDirection, K as isOrderByNulls, L as TableSource, M as ProjectionItem, R as UpdateAst, W as isAggregateFn, X as refuseReservedResultColumn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, t as AggregateExpr, w as LockingClause, y as JoinAst } from "./types-BtItVHx6-BEDme1ZL.mjs";
2
2
  import { r as isAggregateProjection, t as collectOrderedParamRefs } from "./util-DixeJBri-Cad7x5ec.mjs";
3
- import { D as lockWaitPolicyOf, E as lockStrengthCapabilities, T as lockOptionCapabilities, w as lockIncompatible } from "./ast-BpFfUmb_.mjs";
4
- import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-C5Ha-fXs-CxXn8gDo.mjs";
5
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-UiFDvDj4.mjs";
6
- import { t as createFunctions } from "./functions-DGketpiK.mjs";
3
+ import { D as lockWaitPolicyOf, E as lockStrengthCapabilities, T as lockOptionCapabilities, w as lockIncompatible } from "./ast-B1GOjYn-.mjs";
4
+ import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-D9Le3c2y-MF0Fctq9.mjs";
5
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-CQ9M2B3L.mjs";
6
+ import { t as createFunctions } from "./functions-BV4CyVZ0.mjs";
7
7
  import { t as createIndexReferences } from "./index-reference-BQSrkRfT.mjs";
8
8
  import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
9
9
  //#region ../../../2-sql-family/4-lanes/sql-builder/dist/runtime/index.mjs
@@ -477,10 +477,14 @@ function tableToScope(alias, table, options) {
477
477
  namespaces: { [alias]: fields }
478
478
  };
479
479
  }
480
+ /** The field `table` owns under `name`; an inherited property such as `constructor` is no field. */
481
+ function ownScopeField(table, name) {
482
+ return Object.hasOwn(table, name) ? table[name] : void 0;
483
+ }
480
484
  function mergeScopes(a, b) {
481
485
  const topLevel = {};
482
- for (const [k, v] of Object.entries(a.topLevel)) if (!(k in b.topLevel)) topLevel[k] = v;
483
- for (const [k, v] of Object.entries(b.topLevel)) if (!(k in a.topLevel)) topLevel[k] = v;
486
+ for (const [k, v] of Object.entries(a.topLevel)) if (!Object.hasOwn(b.topLevel, k)) topLevel[k] = v;
487
+ for (const [k, v] of Object.entries(b.topLevel)) if (!Object.hasOwn(a.topLevel, k)) topLevel[k] = v;
484
488
  return {
485
489
  topLevel,
486
490
  namespaces: {
@@ -544,7 +548,7 @@ function resolveSelectArgs(args, scope, ctx) {
544
548
  };
545
549
  if (typeof args[0] === "string" && (args.length === 1 || typeof args[1] !== "function")) {
546
550
  for (const colName of args) {
547
- const field = scope.topLevel[colName];
551
+ const field = ownScopeField(scope.topLevel, colName);
548
552
  if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope`, { meta: { column: colName } });
549
553
  projections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), codecRefOf(field, ctx)));
550
554
  newRowFields[colName] = field;
@@ -558,6 +562,7 @@ function resolveSelectArgs(args, scope, ctx) {
558
562
  const alias = args[0];
559
563
  const exprFn = args[1];
560
564
  const fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);
565
+ refuseReservedResultColumn(alias, "select");
561
566
  const result = exprFn(createFieldProxy(scope), fns);
562
567
  const field = result.returnType;
563
568
  projections.push(ProjectionItem.of(alias, projectionAstOf(result), codecRefOf(field, ctx)));
@@ -572,6 +577,7 @@ function resolveSelectArgs(args, scope, ctx) {
572
577
  const fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);
573
578
  const record = callbackFn(createFieldProxy(scope), fns);
574
579
  for (const [key, expr] of Object.entries(record)) {
580
+ refuseReservedResultColumn(key, "select");
575
581
  const field = expr.returnType;
576
582
  projections.push(ProjectionItem.of(key, projectionAstOf(expr), codecRefOf(field, ctx)));
577
583
  newRowFields[key] = field;
@@ -590,7 +596,8 @@ function resolveOrderBy(arg, options, scope, rowFields, ctx, useAggregateFns) {
590
596
  if (nulls !== void 0 && !isOrderByNulls(nulls)) throw structuredError("ORM.ARGUMENT_INVALID", "orderBy nulls must be \"first\" or \"last\"", { meta: { nulls: String(nulls) } });
591
597
  const toOrderByItem = (expr) => new OrderByItem(expr, direction, nulls);
592
598
  if (typeof arg === "string") {
593
- if (!(arg in orderByScopeOf(scope, rowFields).topLevel)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${arg}" not found in scope for orderBy`, { meta: { column: arg } });
599
+ const combined = orderByScopeOf(scope, rowFields);
600
+ if (!Object.hasOwn(combined.topLevel, arg)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${arg}" not found in scope for orderBy`, { meta: { column: arg } });
594
601
  return toOrderByItem(IdentifierRef.of(arg));
595
602
  }
596
603
  if (typeof arg === "function") {
@@ -604,7 +611,7 @@ function resolveGroupBy(args, scope, rowFields, ctx) {
604
611
  if (typeof args[0] === "string") {
605
612
  const combined = orderByScopeOf(scope, rowFields);
606
613
  return args.map((colName) => {
607
- if (!(colName in combined.topLevel)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope for groupBy`, { meta: { column: colName } });
614
+ if (!Object.hasOwn(combined.topLevel, colName)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope for groupBy`, { meta: { column: colName } });
608
615
  return IdentifierRef.of(colName);
609
616
  });
610
617
  }
@@ -623,7 +630,7 @@ function resolveDistinctOn(args, scope, rowFields, ctx) {
623
630
  }
624
631
  const combined = orderByScopeOf(scope, rowFields);
625
632
  return args.map((colName) => {
626
- if (!(colName in combined.topLevel)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope for distinctOn`, { meta: { column: colName } });
633
+ if (!Object.hasOwn(combined.topLevel, colName)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope for distinctOn`, { meta: { column: colName } });
627
634
  return IdentifierRef.of(colName);
628
635
  });
629
636
  }
@@ -844,11 +851,20 @@ function mergeWriteAnnotations(current, annotations) {
844
851
  for (const annotation of annotations) next.set(annotation.namespace, annotation);
845
852
  return next;
846
853
  }
854
+ /** Stores `value` as an own key of `target`, so a key named `__proto__` is a key rather than the prototype. */
855
+ function defineOwn(target, key, value) {
856
+ Object.defineProperty(target, key, {
857
+ value,
858
+ enumerable: true,
859
+ writable: true,
860
+ configurable: true
861
+ });
862
+ }
847
863
  function buildParamValues(values, namespaceId, table, tableName, op, ctx) {
848
864
  const params = {};
849
865
  for (const [col, value] of Object.entries(values)) {
850
- const codec = table.columns[col] ? codecRefFor(ctx, namespaceId, tableName, col) : void 0;
851
- params[col] = ParamRef.of(value, codec ? { codec } : void 0);
866
+ const codec = Object.hasOwn(table.columns, col) ? codecRefFor(ctx, namespaceId, tableName, col) : void 0;
867
+ defineOwn(params, col, ParamRef.of(value, codec ? { codec } : void 0));
852
868
  }
853
869
  for (const def of ctx.applyMutationDefaults({
854
870
  op,
@@ -856,14 +872,14 @@ function buildParamValues(values, namespaceId, table, tableName, op, ctx) {
856
872
  entry: tableName,
857
873
  values
858
874
  })) {
859
- const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
860
- params[def.field] = ParamRef.of(def.value, codec ? { codec } : void 0);
875
+ const codec = Object.hasOwn(table.columns, def.field) ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
876
+ defineOwn(params, def.field, ParamRef.of(def.value, codec ? { codec } : void 0));
861
877
  }
862
878
  return params;
863
879
  }
864
880
  function buildReturningProjections(tableName, columns, rowFields, ctx) {
865
881
  return columns.map((col) => {
866
- const field = rowFields[col];
882
+ const field = Object.hasOwn(rowFields, col) ? rowFields[col] : void 0;
867
883
  return ProjectionItem.of(col, ColumnRef.of(tableName, col), field === void 0 ? void 0 : codecRefOf(field, ctx));
868
884
  });
869
885
  }
@@ -873,7 +889,7 @@ function evaluateWhere(whereCallback, scope, queryOperationTypes, rawCodecInfere
873
889
  function evaluateUpdateCallback(callback, scope, queryOperationTypes, rawCodecInferer) {
874
890
  const result = callback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer));
875
891
  const set = {};
876
- for (const [col, expr] of Object.entries(result)) if (expr !== void 0) set[col] = expr.buildAst();
892
+ for (const [col, expr] of Object.entries(result)) if (expr !== void 0) defineOwn(set, col, expr.buildAst());
877
893
  return set;
878
894
  }
879
895
  function buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {
@@ -883,9 +899,9 @@ function buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {
883
899
  namespace: namespaceId,
884
900
  entry: tableName,
885
901
  values: exprs
886
- })) if (!(def.field in set)) {
887
- const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
888
- set[def.field] = ParamRef.of(def.value, ifDefined("codec", codec));
902
+ })) if (!Object.hasOwn(set, def.field)) {
903
+ const codec = Object.hasOwn(table.columns, def.field) ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
904
+ defineOwn(set, def.field, ParamRef.of(def.value, ifDefined("codec", codec)));
889
905
  }
890
906
  return set;
891
907
  }
@@ -914,7 +930,7 @@ var InsertQueryImpl = class InsertQueryImpl extends BuilderBase {
914
930
  returning = this._gate({ sql: { returning: true } }, "returning", (...columns) => {
915
931
  const newRowFields = {};
916
932
  for (const col of columns) {
917
- const field = this.#scope.topLevel[col];
933
+ const field = ownScopeField(this.#scope.topLevel, col);
918
934
  if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${col}" not found in scope`, { meta: { column: col } });
919
935
  newRowFields[col] = field;
920
936
  }
@@ -968,7 +984,7 @@ var UpdateQueryImpl = class UpdateQueryImpl extends BuilderBase {
968
984
  returning = this._gate({ sql: { returning: true } }, "returning", (...columns) => {
969
985
  const newRowFields = {};
970
986
  for (const col of columns) {
971
- const field = this.#scope.topLevel[col];
987
+ const field = ownScopeField(this.#scope.topLevel, col);
972
988
  if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${col}" not found in scope`, { meta: { column: col } });
973
989
  newRowFields[col] = field;
974
990
  }
@@ -1015,7 +1031,7 @@ var DeleteQueryImpl = class DeleteQueryImpl extends BuilderBase {
1015
1031
  returning = this._gate({ sql: { returning: true } }, "returning", (...columns) => {
1016
1032
  const newRowFields = {};
1017
1033
  for (const col of columns) {
1018
- const field = this.#scope.topLevel[col];
1034
+ const field = ownScopeField(this.#scope.topLevel, col);
1019
1035
  if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${col}" not found in scope`, { meta: { column: col } });
1020
1036
  newRowFields[col] = field;
1021
1037
  }