@prisma/orm-family-sql 8.0.0-rc.9-dev.1 → 8.0.0-rc.9-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.
Files changed (155) hide show
  1. package/dist/{ast-PAXgfA8z.d.mts → ast-DuLukI6f.d.mts} +3 -3
  2. package/dist/{ast-PAXgfA8z.d.mts.map → ast-DuLukI6f.d.mts.map} +1 -1
  3. package/dist/{authoring-type-constructors-BD-XuavC-CB5uCmck.mjs → authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs} +2 -2
  4. package/dist/{authoring-type-constructors-BD-XuavC-CB5uCmck.mjs.map → authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs.map} +1 -1
  5. package/dist/builder.d.mts +2 -2
  6. package/dist/builder__runtime.d.mts +8 -8
  7. package/dist/builder__runtime.mjs +2 -2
  8. package/dist/builder__types.d.mts +2 -2
  9. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs → codec-descriptor-registry-ECZ4ohtG.mjs} +2 -2
  10. package/dist/{codec-descriptor-registry-N0dhtKaH.mjs.map → codec-descriptor-registry-ECZ4ohtG.mjs.map} +1 -1
  11. package/dist/{config-types-DHDQ3dST.mjs → config-types-AbijI3Ys.mjs} +2 -2
  12. package/dist/{config-types-DHDQ3dST.mjs.map → config-types-AbijI3Ys.mjs.map} +1 -1
  13. package/dist/{config-types-D9fdKG3g.d.mts → config-types-Bd3ud-mX.d.mts} +3 -3
  14. package/dist/{config-types-D9fdKG3g.d.mts.map → config-types-Bd3ud-mX.d.mts.map} +1 -1
  15. package/dist/{contract-builder-CZSaZ6Vi.mjs → contract-builder-DYDnIGyM.mjs} +24 -5
  16. package/dist/contract-builder-DYDnIGyM.mjs.map +1 -0
  17. package/dist/{contract-builder-CG_tGDbB.d.mts → contract-builder-De_sioHE.d.mts} +15 -3
  18. package/dist/contract-builder-De_sioHE.d.mts.map +1 -0
  19. package/dist/contract-emitter.mjs +1 -1
  20. package/dist/contract-psl.d.mts +1 -1
  21. package/dist/contract-psl.mjs +1 -1
  22. package/dist/contract-psl__provider.d.mts +1 -1
  23. package/dist/contract-psl__provider.mjs +3 -3
  24. package/dist/contract-psl__provider.mjs.map +1 -1
  25. package/dist/contract-ts.d.mts +3 -3
  26. package/dist/contract-ts.mjs +3 -3
  27. package/dist/contract-ts__config-types.d.mts +1 -1
  28. package/dist/contract-ts__config-types.mjs +1 -1
  29. package/dist/contract-ts__contract-builder.d.mts +2 -2
  30. package/dist/contract-ts__contract-builder.mjs +2 -2
  31. package/dist/contract.d.mts +3 -3
  32. package/dist/contract.mjs +3 -3
  33. package/dist/contract__types.d.mts +2 -2
  34. package/dist/contract__types.mjs +2 -2
  35. package/dist/contract__validators.d.mts +2 -2
  36. package/dist/contract__validators.mjs +2 -2
  37. package/dist/{control-DJi35XO2.mjs → control-CMYPT7Ek.mjs} +6 -6
  38. package/dist/{control-DJi35XO2.mjs.map → control-CMYPT7Ek.mjs.map} +1 -1
  39. package/dist/{control-adapter-C99J7aEF-gFfCQmwC.d.mts → control-adapter-C99J7aEF-GODO43Ai.d.mts} +5 -5
  40. package/dist/{control-adapter-C99J7aEF-gFfCQmwC.d.mts.map → control-adapter-C99J7aEF-GODO43Ai.d.mts.map} +1 -1
  41. package/dist/control-adapter-DzTFiMaG.d.mts +1 -0
  42. package/dist/{control-_b_fvUSh.d.mts → control-b-6t8eI_.d.mts} +9 -9
  43. package/dist/{control-_b_fvUSh.d.mts.map → control-b-6t8eI_.d.mts.map} +1 -1
  44. package/dist/{db-BhQdL6Za-DuaPJ5bQ.d.mts → db-BhQdL6Za-DubRGJvv.d.mts} +7 -7
  45. package/dist/{db-BhQdL6Za-DuaPJ5bQ.d.mts.map → db-BhQdL6Za-DubRGJvv.d.mts.map} +1 -1
  46. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts → ddl-types-CXx4vPz6-Dko-GTTj.d.mts} +3 -3
  47. package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts.map → ddl-types-CXx4vPz6-Dko-GTTj.d.mts.map} +1 -1
  48. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts → derived-checks-DPdD01O0-DNBs1ZDA.d.mts} +2 -2
  49. package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts.map → derived-checks-DPdD01O0-DNBs1ZDA.d.mts.map} +1 -1
  50. package/dist/{derived-checks-BzL102Q0-0nIMlEux.mjs → derived-checks-D_-1X7be-lGe8VdId.mjs} +37 -7
  51. package/dist/derived-checks-D_-1X7be-lGe8VdId.mjs.map +1 -0
  52. package/dist/{diff-ClD1mImE.d.mts → diff-CN1ou7vM.d.mts} +5 -5
  53. package/dist/{diff-ClD1mImE.d.mts.map → diff-CN1ou7vM.d.mts.map} +1 -1
  54. package/dist/{dist-ZK6oeI5e.mjs → dist-D5__KJs-.mjs} +2 -1
  55. package/dist/dist-D5__KJs-.mjs.map +1 -0
  56. package/dist/{expression-DmQbErXU.mjs → expression-B2Ox7zKM.mjs} +2 -2
  57. package/dist/{expression-DmQbErXU.mjs.map → expression-B2Ox7zKM.mjs.map} +1 -1
  58. package/dist/{expression-PL-Tra28.d.mts → expression-mku9I7Ue.d.mts} +5 -5
  59. package/dist/{expression-PL-Tra28.d.mts.map → expression-mku9I7Ue.d.mts.map} +1 -1
  60. package/dist/family.d.mts +9 -9
  61. package/dist/family.mjs +3 -3
  62. package/dist/family__control-adapter.d.mts +2 -2
  63. package/dist/family__control.d.mts +3 -3
  64. package/dist/family__control.mjs +2 -2
  65. package/dist/family__diff.d.mts +2 -2
  66. package/dist/family__diff.mjs +1 -1
  67. package/dist/family__ir.d.mts +1 -1
  68. package/dist/family__ir.mjs +1 -1
  69. package/dist/family__migration.d.mts +1 -1
  70. package/dist/family__pack.mjs +1 -1
  71. package/dist/family__runtime.d.mts +1 -1
  72. package/dist/{index-C5I8D-MB.d.mts → index-CLAshwKN.d.mts} +2 -2
  73. package/dist/{index-C5I8D-MB.d.mts.map → index-CLAshwKN.d.mts.map} +1 -1
  74. package/dist/{index-CrsJm0Rv.d.mts → index-DzBzeTAy.d.mts} +10 -10
  75. package/dist/{index-CrsJm0Rv.d.mts.map → index-DzBzeTAy.d.mts.map} +1 -1
  76. package/dist/{interpreter-BPl_7Cv5-B8FaNBLQ.mjs → interpreter-_KWQDsAm-B2goMgB0.mjs} +53 -7
  77. package/dist/interpreter-_KWQDsAm-B2goMgB0.mjs.map +1 -0
  78. package/dist/ir-I-xciGUH.mjs.map +1 -1
  79. package/dist/{ir-Bghjt-FG.d.mts → ir-R9GE8gsm.d.mts} +2 -2
  80. package/dist/{ir-Bghjt-FG.d.mts.map → ir-R9GE8gsm.d.mts.map} +1 -1
  81. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts → middleware-AhTz1BOW-CtQWS4mb.d.mts} +2 -2
  82. package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts.map → middleware-AhTz1BOW-CtQWS4mb.d.mts.map} +1 -1
  83. package/dist/middleware-Cev-ZFyS.d.mts +1 -0
  84. package/dist/{migration-Chb4Qg0T.d.mts → migration-Bhce5i_m.d.mts} +3 -3
  85. package/dist/{migration-Chb4Qg0T.d.mts.map → migration-Bhce5i_m.d.mts.map} +1 -1
  86. package/dist/operations.d.mts +1 -1
  87. package/dist/orm-client.d.mts +21 -27
  88. package/dist/orm-client.d.mts.map +1 -1
  89. package/dist/orm-client.mjs +2 -30
  90. package/dist/orm-client.mjs.map +1 -1
  91. package/dist/plan-C7VP7jOh.d.mts +2 -0
  92. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts → plan-CDxduYaN-B2kMLIQQ.d.mts} +3 -3
  93. package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts.map → plan-CDxduYaN-B2kMLIQQ.d.mts.map} +1 -1
  94. package/dist/{prepared-statement-9QpkE6JG-ti591XdQ.d.mts → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts} +16 -16
  95. package/dist/{prepared-statement-9QpkE6JG-ti591XdQ.d.mts.map → prepared-statement-9QpkE6JG-B9xqBu5T.d.mts.map} +1 -1
  96. package/dist/query-lane-context-CGdMIEuv.d.mts +1 -0
  97. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts} +4 -4
  98. package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts.map → query-lane-context-Qa-eddrE-BQV6J9nV.d.mts.map} +1 -1
  99. package/dist/relational-core.d.mts +11 -11
  100. package/dist/relational-core.mjs +1 -1
  101. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  102. package/dist/relational-core__ast.d.mts +3 -3
  103. package/dist/relational-core__codec-descriptor-registry.d.mts +3 -3
  104. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  105. package/dist/relational-core__contract-free.d.mts +3 -3
  106. package/dist/relational-core__expression.d.mts +1 -1
  107. package/dist/relational-core__expression.mjs +1 -1
  108. package/dist/relational-core__middleware.d.mts +2 -2
  109. package/dist/relational-core__plan.d.mts +3 -3
  110. package/dist/relational-core__query-lane-context.d.mts +2 -2
  111. package/dist/relational-core__types.d.mts +2 -2
  112. package/dist/{runtime-C88G8y1X.d.mts → runtime-CzCx0TKe.d.mts} +3 -3
  113. package/dist/{runtime-C88G8y1X.d.mts.map → runtime-CzCx0TKe.d.mts.map} +1 -1
  114. package/dist/runtime.d.mts +4 -4
  115. package/dist/runtime.mjs +2 -2
  116. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  117. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts → schema-differ-DpG_gnur-BICVtTHY.d.mts} +2 -2
  118. package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts.map → schema-differ-DpG_gnur-BICVtTHY.d.mts.map} +1 -1
  119. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs → schema-verify-C_PEdlAr-CmXrFuW1.mjs} +2 -2
  120. package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map → schema-verify-C_PEdlAr-CmXrFuW1.mjs.map} +1 -1
  121. package/dist/{sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs → sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs} +24 -5
  122. package/dist/sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs.map +1 -0
  123. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts} +2 -2
  124. package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts.map → sql-execution-plan--jKyLpe5-Bcz9QM2s.d.mts.map} +1 -1
  125. package/dist/{types-UcHa2cTe.d.mts → types-C36_3E6_.d.mts} +3 -2
  126. package/dist/types-C36_3E6_.d.mts.map +1 -0
  127. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts → types-CyxGtOOh-BJnoWm0f.d.mts} +8 -8
  128. package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts.map → types-CyxGtOOh-BJnoWm0f.d.mts.map} +1 -1
  129. package/dist/{types-CUsJrvEl.mjs → types-D0B65hip.mjs} +3 -2
  130. package/dist/types-D0B65hip.mjs.map +1 -0
  131. package/dist/types-DvsoMNLs.d.mts +1 -0
  132. package/dist/{types-IqZMLrFC-BfiR0oFc.d.mts → types-IqZMLrFC-BIRftuU7.d.mts} +4 -4
  133. package/dist/{types-IqZMLrFC-BfiR0oFc.d.mts.map → types-IqZMLrFC-BIRftuU7.d.mts.map} +1 -1
  134. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts → types-v3qxLLxo-Clw_yBAh.d.mts} +2 -2
  135. package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts.map → types-v3qxLLxo-Clw_yBAh.d.mts.map} +1 -1
  136. package/dist/{validators-Belo8QqM.d.mts → validators-CbqMxQfW.d.mts} +23 -4
  137. package/dist/validators-CbqMxQfW.d.mts.map +1 -0
  138. package/dist/{validators-CrWD6bSP.mjs → validators-DD98VrpC.mjs} +0 -0
  139. package/dist/validators-DD98VrpC.mjs.map +1 -0
  140. package/package.json +17 -17
  141. package/dist/contract-builder-CG_tGDbB.d.mts.map +0 -1
  142. package/dist/contract-builder-CZSaZ6Vi.mjs.map +0 -1
  143. package/dist/control-adapter-D-2mthVg.d.mts +0 -1
  144. package/dist/derived-checks-BzL102Q0-0nIMlEux.mjs.map +0 -1
  145. package/dist/dist-ZK6oeI5e.mjs.map +0 -1
  146. package/dist/interpreter-BPl_7Cv5-B8FaNBLQ.mjs.map +0 -1
  147. package/dist/middleware--TtoxUiW.d.mts +0 -1
  148. package/dist/plan-BHLdb0Z7.d.mts +0 -2
  149. package/dist/query-lane-context-XMvk7fmY.d.mts +0 -1
  150. package/dist/sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map +0 -1
  151. package/dist/types-B0msOnBM.d.mts +0 -1
  152. package/dist/types-CUsJrvEl.mjs.map +0 -1
  153. package/dist/types-UcHa2cTe.d.mts.map +0 -1
  154. package/dist/validators-Belo8QqM.d.mts.map +0 -1
  155. package/dist/validators-CrWD6bSP.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from "./types-Dt4e_jC--COeP8xzN.mjs";
2
2
  import { t as planFromAst } from "./plan-Dh0LbYIv-Crx5-ThG.mjs";
3
- import { invariant } from "@prisma/orm-framework/utils/assertions";
4
3
  import { runtimeError } from "@prisma/orm-framework/components/runtime";
4
+ import { invariant } from "@prisma/orm-framework/utils/assertions";
5
5
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/expression.mjs
6
6
  /**
7
7
  * Resolve a raw value or an Expression into an AST expression node.
@@ -149,4 +149,4 @@ var RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {
149
149
  //#endregion
150
150
  export { toExpr as a, param as i, codecOf as n, createRawSql as r, buildOperation as t };
151
151
 
152
- //# sourceMappingURL=expression-DmQbErXU.mjs.map
152
+ //# sourceMappingURL=expression-B2Ox7zKM.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression-DmQbErXU.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.mjs"],"sourcesContent":["import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from \"../types-Dt4e_jC-.mjs\";\nimport { t as planFromAst } from \"../plan-Dh0LbYIv.mjs\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/expression.ts\n/**\n* Resolve a raw value or an Expression into an AST expression node.\n*\n* When `value` is an Expression (duck-typed by its `buildAst` method), the AST it wraps is returned. Otherwise the value is embedded as a ParamRef tagged with the caller-supplied {@link CodecRef} (when known). The runtime resolves the ref via `contractCodecs.forCodecRef(codec)`; content-keyed memoisation collapses repeated lookups for the same logical column onto one shared codec.\n*\n* Operation implementations that compare a column-bound expression to a user value derive the column's {@link CodecRef} from the column-bound side (via {@link codecOf}) and forward it here so encode-side dispatch resolves to the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction toExpr(value, codec) {\n\tif (isExpressionLike(value)) return value.buildAst();\n\tif (codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_CODEC_REQUIRED\", `Cannot construct a ParamRef for a ${value === null ? \"null\" : typeof value} value without an explicit codec. Provide a CodecRef at the call site or use a column-bound builder path.`);\n\treturn ParamRef.of(value, { codec });\n}\n/**\n* Construct a `ParamRef` for a value whose codec identity is known at call time. Use this when interpolating a value into a raw SQL expression and the codec cannot be inferred from context — e.g. `param(myDate, { codecId: 'pg/timestamptz-temporal@1' })`.\n*/\nfunction param(value, opts) {\n\treturn ParamRef.of(value, { codec: { codecId: opts.codecId } });\n}\n/**\n* Derive the {@link CodecRef} carried by an expression-like value.\n*\n* Resolution order:\n* 1. `wrapper.codec` — explicit column-bound {@link CodecRef} stamped at field-proxy time.\n* 2. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.\n* 3. `{ codecId: wrapper.returnType.codecId }` — minimal ref derived from the expression's declared codec id (covers synthetic expressions like `count()` whose returnType has a known codec id but no explicit column binding).\n*\n* Returns `undefined` for raw scalar values (non-expression-like).\n*/\nfunction codecOf(value) {\n\tif (!isExpressionLike(value)) return void 0;\n\tconst wrapper = value;\n\tif (wrapper.codec) return wrapper.codec;\n\tif (wrapper.returnType?.codec) return wrapper.returnType.codec;\n\tif (wrapper.returnType?.codecId) return { codecId: wrapper.returnType.codecId };\n}\nfunction isExpressionLike(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Construct an OperationExpr AST node and wrap it as a typed Expression. Operation implementations use this to turn their user-facing arguments into the AST node the compilation pipeline eventually lowers to SQL.\n*/\nfunction buildOperation(spec) {\n\tconst [self, ...rest] = spec.args;\n\tconst op = new OperationExpr({\n\t\tmethod: spec.method,\n\t\tself,\n\t\targs: rest.length > 0 ? rest : void 0,\n\t\treturns: spec.returns,\n\t\tlowering: spec.lowering\n\t});\n\treturn {\n\t\treturnType: spec.returns,\n\t\tbuildAst: () => op\n\t};\n}\nfunction resolveInterpolation(adapter, value) {\n\tif (isExpressionLike(value)) return value.buildAst();\n\tif (value instanceof ParamRef) return value;\n\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"string\" || typeof value === \"boolean\" || value instanceof Uint8Array) return ParamRef.of(value, { codec: { codecId: adapter.inferCodec(value) } });\n\tthrow runtimeError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\");\n}\nfunction isRawRowQuery(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\" && \"build\" in value && typeof value.build === \"function\";\n}\nfunction templateParts(adapter, strings, values) {\n\tconst parts = [strings[0] ?? \"\"];\n\tvalues.forEach((value, i) => {\n\t\tif (isRawRowQuery(value)) parts.push(...value.buildAst().parts);\n\t\telse parts.push(resolveInterpolation(adapter, value));\n\t\tparts.push(strings[i + 1] ?? \"\");\n\t});\n\treturn parts;\n}\n/**\n* Normalizes each authored entry to a {@link RawQueryColumn}. The record is\n* assembled with `Object.fromEntries`, which defines each key as an own\n* property: a spec built at runtime with a `__proto__` key reaches the AST,\n* which refuses it by name, rather than silently setting the record's\n* prototype and leaving the column to vanish.\n*/\nfunction resolveRowSpec(spec) {\n\treturn Object.fromEntries(Object.entries(spec).map(([name, entry]) => [name, typeof entry === \"string\" ? {\n\t\tcodecId: entry,\n\t\tnullable: false\n\t} : {\n\t\tcodecId: entry.codecId,\n\t\tnullable: entry.nullable ?? false\n\t}]));\n}\nfunction createRawSql(adapter, planContext) {\n\tif (planContext === void 0) return (strings, ...values) => new RawSqlBuilderImpl(templateParts(adapter, strings, values));\n\tconst context = planContext;\n\treturn (strings, ...values) => new RawSqlStatementBuilderImpl(templateParts(adapter, strings, values), context);\n}\nvar RawSqlBuilderImpl = class {\n\tparts;\n\tconstructor(parts) {\n\t\tthis.parts = parts;\n\t}\n\treturns(spec) {\n\t\tconst codecId = typeof spec === \"string\" ? spec : spec.codecId;\n\t\tconst nullable = typeof spec === \"string\" ? false : spec.nullable ?? false;\n\t\tconst paramSpec = {\n\t\t\tcodecId,\n\t\t\tnullable\n\t\t};\n\t\tconst node = new RawExpr({\n\t\t\tparts: this.parts,\n\t\t\treturns: paramSpec\n\t\t});\n\t\treturn {\n\t\t\treturnType: {\n\t\t\t\tcodecId,\n\t\t\t\tnullable\n\t\t\t},\n\t\t\tbuildAst: () => node\n\t\t};\n\t}\n};\nvar RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {\n\tplanContext;\n\tconstructor(parts, planContext) {\n\t\tsuper(parts);\n\t\tthis.planContext = planContext;\n\t}\n\treturnsRow(spec) {\n\t\tconst node = RawQueryAst.rows(this.parts, resolveRowSpec(spec));\n\t\tconst result = node.result;\n\t\tinvariant(result.kind === \"rows\", \"RawQueryAst.rows built a non-rows result\");\n\t\treturn {\n\t\t\treturns: result.columns,\n\t\t\tbuildAst: () => node,\n\t\t\tbuild: () => this.planFor(node)\n\t\t};\n\t}\n\taffectedCount() {\n\t\tconst node = RawQueryAst.affectedCount(this.parts);\n\t\treturn { build: () => this.planFor(node) };\n\t}\n\tplanFor(node) {\n\t\treturn planFromAst(node, this.planContext.contract, this.planContext.laneId);\n\t}\n};\n//#endregion\nexport { buildOperation, codecOf, createRawSql, param, toExpr };\n\n//# sourceMappingURL=expression.mjs.map"],"mappings":"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"}
1
+ {"version":3,"file":"expression-B2Ox7zKM.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.mjs"],"sourcesContent":["import { E as OperationExpr, M as RawExpr, N as RawQueryAst, k as ParamRef } from \"../types-Dt4e_jC-.mjs\";\nimport { t as planFromAst } from \"../plan-Dh0LbYIv.mjs\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/expression.ts\n/**\n* Resolve a raw value or an Expression into an AST expression node.\n*\n* When `value` is an Expression (duck-typed by its `buildAst` method), the AST it wraps is returned. Otherwise the value is embedded as a ParamRef tagged with the caller-supplied {@link CodecRef} (when known). The runtime resolves the ref via `contractCodecs.forCodecRef(codec)`; content-keyed memoisation collapses repeated lookups for the same logical column onto one shared codec.\n*\n* Operation implementations that compare a column-bound expression to a user value derive the column's {@link CodecRef} from the column-bound side (via {@link codecOf}) and forward it here so encode-side dispatch resolves to the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction toExpr(value, codec) {\n\tif (isExpressionLike(value)) return value.buildAst();\n\tif (codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_CODEC_REQUIRED\", `Cannot construct a ParamRef for a ${value === null ? \"null\" : typeof value} value without an explicit codec. Provide a CodecRef at the call site or use a column-bound builder path.`);\n\treturn ParamRef.of(value, { codec });\n}\n/**\n* Construct a `ParamRef` for a value whose codec identity is known at call time. Use this when interpolating a value into a raw SQL expression and the codec cannot be inferred from context — e.g. `param(myDate, { codecId: 'pg/timestamptz-temporal@1' })`.\n*/\nfunction param(value, opts) {\n\treturn ParamRef.of(value, { codec: { codecId: opts.codecId } });\n}\n/**\n* Derive the {@link CodecRef} carried by an expression-like value.\n*\n* Resolution order:\n* 1. `wrapper.codec` — explicit column-bound {@link CodecRef} stamped at field-proxy time.\n* 2. `wrapper.returnType.codec` — scope-level codec when the scope was built from contract storage.\n* 3. `{ codecId: wrapper.returnType.codecId }` — minimal ref derived from the expression's declared codec id (covers synthetic expressions like `count()` whose returnType has a known codec id but no explicit column binding).\n*\n* Returns `undefined` for raw scalar values (non-expression-like).\n*/\nfunction codecOf(value) {\n\tif (!isExpressionLike(value)) return void 0;\n\tconst wrapper = value;\n\tif (wrapper.codec) return wrapper.codec;\n\tif (wrapper.returnType?.codec) return wrapper.returnType.codec;\n\tif (wrapper.returnType?.codecId) return { codecId: wrapper.returnType.codecId };\n}\nfunction isExpressionLike(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Construct an OperationExpr AST node and wrap it as a typed Expression. Operation implementations use this to turn their user-facing arguments into the AST node the compilation pipeline eventually lowers to SQL.\n*/\nfunction buildOperation(spec) {\n\tconst [self, ...rest] = spec.args;\n\tconst op = new OperationExpr({\n\t\tmethod: spec.method,\n\t\tself,\n\t\targs: rest.length > 0 ? rest : void 0,\n\t\treturns: spec.returns,\n\t\tlowering: spec.lowering\n\t});\n\treturn {\n\t\treturnType: spec.returns,\n\t\tbuildAst: () => op\n\t};\n}\nfunction resolveInterpolation(adapter, value) {\n\tif (isExpressionLike(value)) return value.buildAst();\n\tif (value instanceof ParamRef) return value;\n\tif (typeof value === \"number\" || typeof value === \"bigint\" || typeof value === \"string\" || typeof value === \"boolean\" || value instanceof Uint8Array) return ParamRef.of(value, { codec: { codecId: adapter.inferCodec(value) } });\n\tthrow runtimeError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\");\n}\nfunction isRawRowQuery(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\" && \"build\" in value && typeof value.build === \"function\";\n}\nfunction templateParts(adapter, strings, values) {\n\tconst parts = [strings[0] ?? \"\"];\n\tvalues.forEach((value, i) => {\n\t\tif (isRawRowQuery(value)) parts.push(...value.buildAst().parts);\n\t\telse parts.push(resolveInterpolation(adapter, value));\n\t\tparts.push(strings[i + 1] ?? \"\");\n\t});\n\treturn parts;\n}\n/**\n* Normalizes each authored entry to a {@link RawQueryColumn}. The record is\n* assembled with `Object.fromEntries`, which defines each key as an own\n* property: a spec built at runtime with a `__proto__` key reaches the AST,\n* which refuses it by name, rather than silently setting the record's\n* prototype and leaving the column to vanish.\n*/\nfunction resolveRowSpec(spec) {\n\treturn Object.fromEntries(Object.entries(spec).map(([name, entry]) => [name, typeof entry === \"string\" ? {\n\t\tcodecId: entry,\n\t\tnullable: false\n\t} : {\n\t\tcodecId: entry.codecId,\n\t\tnullable: entry.nullable ?? false\n\t}]));\n}\nfunction createRawSql(adapter, planContext) {\n\tif (planContext === void 0) return (strings, ...values) => new RawSqlBuilderImpl(templateParts(adapter, strings, values));\n\tconst context = planContext;\n\treturn (strings, ...values) => new RawSqlStatementBuilderImpl(templateParts(adapter, strings, values), context);\n}\nvar RawSqlBuilderImpl = class {\n\tparts;\n\tconstructor(parts) {\n\t\tthis.parts = parts;\n\t}\n\treturns(spec) {\n\t\tconst codecId = typeof spec === \"string\" ? spec : spec.codecId;\n\t\tconst nullable = typeof spec === \"string\" ? false : spec.nullable ?? false;\n\t\tconst paramSpec = {\n\t\t\tcodecId,\n\t\t\tnullable\n\t\t};\n\t\tconst node = new RawExpr({\n\t\t\tparts: this.parts,\n\t\t\treturns: paramSpec\n\t\t});\n\t\treturn {\n\t\t\treturnType: {\n\t\t\t\tcodecId,\n\t\t\t\tnullable\n\t\t\t},\n\t\t\tbuildAst: () => node\n\t\t};\n\t}\n};\nvar RawSqlStatementBuilderImpl = class extends RawSqlBuilderImpl {\n\tplanContext;\n\tconstructor(parts, planContext) {\n\t\tsuper(parts);\n\t\tthis.planContext = planContext;\n\t}\n\treturnsRow(spec) {\n\t\tconst node = RawQueryAst.rows(this.parts, resolveRowSpec(spec));\n\t\tconst result = node.result;\n\t\tinvariant(result.kind === \"rows\", \"RawQueryAst.rows built a non-rows result\");\n\t\treturn {\n\t\t\treturns: result.columns,\n\t\t\tbuildAst: () => node,\n\t\t\tbuild: () => this.planFor(node)\n\t\t};\n\t}\n\taffectedCount() {\n\t\tconst node = RawQueryAst.affectedCount(this.parts);\n\t\treturn { build: () => this.planFor(node) };\n\t}\n\tplanFor(node) {\n\t\treturn planFromAst(node, this.planContext.contract, this.planContext.laneId);\n\t}\n};\n//#endregion\nexport { buildOperation, codecOf, createRawSql, param, toExpr };\n\n//# sourceMappingURL=expression.mjs.map"],"mappings":"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"}
@@ -1,10 +1,10 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import { S as QueryOperationReturn } from "./types-BDUG29Df-LE85dIXP.mjs";
3
- import "./types-UcHa2cTe.mjs";
4
- import { t as SqlLoweringSpec } from "./index-C5I8D-MB.mjs";
5
- import { Ct as RawQueryColumn, St as RawQueryAst, T as CodecRef$1, Tt as RawSqlLiteral, _t as ParamRef, s as AnyExpression } from "./types-v3qxLLxo-DCeKv7yY.mjs";
3
+ import "./types-C36_3E6_.mjs";
4
+ import { t as SqlLoweringSpec } from "./index-CLAshwKN.mjs";
5
+ import { Ct as RawQueryColumn, St as RawQueryAst, T as CodecRef$1, Tt as RawSqlLiteral, _t as ParamRef, s as AnyExpression } from "./types-v3qxLLxo-Clw_yBAh.mjs";
6
6
  import { l as SqlStatementStats } from "./driver-types-BQtRkOJ0-Bv2RPSfr.mjs";
7
- import { t as SqlQueryPlan } from "./plan-CDxduYaN-pLIyyJaB.mjs";
7
+ import { t as SqlQueryPlan } from "./plan-CDxduYaN-B2kMLIQQ.mjs";
8
8
  import { Contract } from "@prisma/orm-framework/contract/types";
9
9
  import { ParamSpec } from "@prisma/orm-framework/operations";
10
10
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts
@@ -263,4 +263,4 @@ declare function createRawSql(adapter: RawCodecInferer, planContext: RawPlanCont
263
263
  declare function createRawSql(adapter: RawCodecInferer): RawSqlTag;
264
264
  //#endregion
265
265
  export { buildOperation as C, toExpr as D, param as E, TraitExpression as S, createRawSql as T, RawSqlStatementBuilder as _, CodecValue as a, ScalarListExpression as b, RawAffectedCountQuery as c, RawRow as d, RawRowQuery as f, RawSqlInterpolation as g, RawSqlBuilder as h, CodecTypesBase as i, RawCodecInferer as l, RawRowSpecEntry as m, BuildOperationSpec as n, Expression as o, RawRowSpec as p, CodecExpression as r, NoReservedRowColumn as s, AffectedCount as t, RawPlanContext as u, RawSqlStatementTag as v, codecOf as w, ScopeField as x, RawSqlTag as y };
266
- //# sourceMappingURL=expression-PL-Tra28.d.mts.map
266
+ //# sourceMappingURL=expression-mku9I7Ue.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression-PL-Tra28.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts"],"mappings":";;;;;;;;;;;KAQK;EACH;EACA;;;;;;;;EAQA;;;;EAIA,QAAQ;;KAEL,iBAAiB;WACX;WACA;;;;;KAKN,WAAW,UAAU,cAAc;WAC7B,YAAY;EACrB,YAAY;;KAET,kBAAkB,WAAW;WACvB;IACP,+CAA+C,WAAW,cAAc,GAAG;WACpE,cAAc;KACpB,iCAAiC,KAAK,2BAA2B;KACjE,WAAW,KAAK;;;;;KAKhB,WAAW,wBAAwB,0BAA0B,WAAW;WAClE;OACJ,sBAAsB,KAAK,GAAG,6BAA6B,WAAW;;;;;;;;;;;;;;;KAexE,gBAAgB,wBAAwB,0BAA0B,WAAW;WACvE;MACL;EACJ,SAAS;EACT,UAAU;EACV;KACG,WAAW,SAAS,UAAU;;;;;;;KAO9B,qBAAqB,wBAAwB,4BAA4B;EAC5E,SAAS;EACT,UAAU;EACV;;;;;;;KAOG,gBAAgB,kCAAkC,0BAA0B,WAAW;WACjF;MACL,gBAAgB,kBAAkB,IAAI,SAAS,UAAU;;;;;;;;iBAQ9C,OAAO,gBAAgB,QAAQ,aAAW;;;;iBAI1C,MAAM,GAAG,OAAO,GAAG;EAClC;IACE;;;;;;;;;;;iBAWa,QAAQ,iBAAiB;UAChC,mBAAmB,UAAU;WAC5B;;;;WAIA,gBAAgB,kBAAkB;WAClC,SAAS,IAAI;WACb,UAAU;;;;;iBAKJ,eAAe,UAAU,YAAY,MAAM,mBAAmB,KAAK,WAAW;;;;;;;;;;;;;UAarF;EACR,WAAW,OAAO;;;UAGV;EACR,QAAQ,kBAAkB,MAAM,IAAI;IAClC,SAAS;IACT;;EAEF,QAAQ,kBAAkB,2BAA2B;aAC1C,SAAS;aACT,WAAW;MAClB;IACF,SAAS;IACT,UAAU;;;;;;;;;KAST;WACM;WACA;;;;;;;;;KASN;WACM;;;KAGN,aAAa,SAAS,eAAe,oBAAoB;;;;;;KAMzD,OAAO,aAAa,0BAA0B,WAAW;;;;;UAKpD;WACC,UAAU,SAAS;WACnB;;;;;;;;;;UAUD,YAAY,eAAe,aAAa,SAAS,eAAe,mBAAmB,SAAS,eAAe;;;;;;;;;WAS1G,SAAS;EAClB,YAAY;EACZ,SAAS,aAAa;;cAEV;;;;;;;;;;UAUJ,sBAAsB;YACpB;;;;;;;;UAQF;EACR,SAAS,aAAa;;;;;;;UAOd,+BAA+B;EACvC,WAAW,aAAa,YAAY,MAAM,OAAO,YAAY,OAAO;EACpE,iBAAiB;;;KAGd,aAAa,SAAS,yBAAyB,QAAQ,0BAA0B;;KAEjF,sBAAsB,SAAS,yBAAyB,QAAQ,0BAA0B;;KAE1F,uBAAuB,WAAW,cAAc,WAAW;;KAE3D,sBAAsB,uBAAuB;;;;;;;;iBAQjC,aAAa,SAAS,iBAAiB,aAAa,iBAAiB;iBACrE,aAAa,SAAS,kBAAkB"}
1
+ {"version":3,"file":"expression-mku9I7Ue.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts"],"mappings":";;;;;;;;;;;KAQK;EACH;EACA;;;;;;;;EAQA;;;;EAIA,QAAQ;;KAEL,iBAAiB;WACX;WACA;;;;;KAKN,WAAW,UAAU,cAAc;WAC7B,YAAY;EACrB,YAAY;;KAET,kBAAkB,WAAW;WACvB;IACP,+CAA+C,WAAW,cAAc,GAAG;WACpE,cAAc;KACpB,iCAAiC,KAAK,2BAA2B;KACjE,WAAW,KAAK;;;;;KAKhB,WAAW,wBAAwB,0BAA0B,WAAW;WAClE;OACJ,sBAAsB,KAAK,GAAG,6BAA6B,WAAW;;;;;;;;;;;;;;;KAexE,gBAAgB,wBAAwB,0BAA0B,WAAW;WACvE;MACL;EACJ,SAAS;EACT,UAAU;EACV;KACG,WAAW,SAAS,UAAU;;;;;;;KAO9B,qBAAqB,wBAAwB,4BAA4B;EAC5E,SAAS;EACT,UAAU;EACV;;;;;;;KAOG,gBAAgB,kCAAkC,0BAA0B,WAAW;WACjF;MACL,gBAAgB,kBAAkB,IAAI,SAAS,UAAU;;;;;;;;iBAQ9C,OAAO,gBAAgB,QAAQ,aAAW;;;;iBAI1C,MAAM,GAAG,OAAO,GAAG;EAClC;IACE;;;;;;;;;;;iBAWa,QAAQ,iBAAiB;UAChC,mBAAmB,UAAU;WAC5B;;;;WAIA,gBAAgB,kBAAkB;WAClC,SAAS,IAAI;WACb,UAAU;;;;;iBAKJ,eAAe,UAAU,YAAY,MAAM,mBAAmB,KAAK,WAAW;;;;;;;;;;;;;UAarF;EACR,WAAW,OAAO;;;UAGV;EACR,QAAQ,kBAAkB,MAAM,IAAI;IAClC,SAAS;IACT;;EAEF,QAAQ,kBAAkB,2BAA2B;aAC1C,SAAS;aACT,WAAW;MAClB;IACF,SAAS;IACT,UAAU;;;;;;;;;KAST;WACM;WACA;;;;;;;;;KASN;WACM;;;KAGN,aAAa,SAAS,eAAe,oBAAoB;;;;;;KAMzD,OAAO,aAAa,0BAA0B,WAAW;;;;;UAKpD;WACC,UAAU,SAAS;WACnB;;;;;;;;;;UAUD,YAAY,eAAe,aAAa,SAAS,eAAe,mBAAmB,SAAS,eAAe;;;;;;;;;WAS1G,SAAS;EAClB,YAAY;EACZ,SAAS,aAAa;;cAEV;;;;;;;;;;UAUJ,sBAAsB;YACpB;;;;;;;;UAQF;EACR,SAAS,aAAa;;;;;;;UAOd,+BAA+B;EACvC,WAAW,aAAa,YAAY,MAAM,OAAO,YAAY,OAAO;EACpE,iBAAiB;;;KAGd,aAAa,SAAS,yBAAyB,QAAQ,0BAA0B;;KAEjF,sBAAsB,SAAS,yBAAyB,QAAQ,0BAA0B;;KAE1F,uBAAuB,WAAW,cAAc,WAAW;;KAE3D,sBAAsB,uBAAuB;;;;;;;;iBAQjC,aAAa,SAAS,iBAAiB,aAAa,iBAAiB;iBACrE,aAAa,SAAS,kBAAkB"}
package/dist/family.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
- import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-gFfCQmwC.mjs";
3
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-BfiR0oFc.mjs";
4
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DFAtGezx.mjs";
5
- import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-_b_fvUSh.mjs";
6
- import "./control-adapter-D-2mthVg.mjs";
7
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-ClD1mImE.mjs";
8
- import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-Bghjt-FG.mjs";
9
- import { t as SqlMigration } from "./migration-Chb4Qg0T.mjs";
2
+ import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-GODO43Ai.mjs";
3
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-BIRftuU7.mjs";
4
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-BICVtTHY.mjs";
5
+ import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-b-6t8eI_.mjs";
6
+ import "./control-adapter-DzTFiMaG.mjs";
7
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-CN1ou7vM.mjs";
8
+ import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-R9GE8gsm.mjs";
9
+ import { t as SqlMigration } from "./migration-Bhce5i_m.mjs";
10
10
  import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toEnumName, y as toFieldName } from "./psl-infer-CCAD6FWA.mjs";
11
- import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-C88G8y1X.mjs";
11
+ import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CzCx0TKe.mjs";
12
12
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
13
13
  export { type CodecControlHooks, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultRenderer, type DefaultResolver, type EnumInfo, type EnumNamespaceSchemaResolver, type ExecuteRequestLowerer, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type InferredRelations, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type NativeTypeNormalizer, type PlanFieldEventOperationsOptions, type PslPrinterOptions, type PslTypeMap, type PslTypeReference, type PslTypeResolution, type RelationField, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SuppressionRecord, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, parseRawDefault, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, verifySqlSchemaByDiff };
package/dist/family.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
- import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
3
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs";
2
+ import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-CmXrFuW1.mjs";
3
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs";
4
4
  import { n as parseContractMarkerRow } from "./verify-ChiDeTk8-HEewdjrM.mjs";
5
5
  import { a as temporalStringAuthoringPresets, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, o as timestampNowControlDescriptor, r as temporalCodecPreset } from "./timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs";
6
- import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-DJi35XO2.mjs";
6
+ import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-CMYPT7Ek.mjs";
7
7
  import { t as arraysEqual } from "./diff-B16bL_IR.mjs";
8
8
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
9
9
  import { t as SqlMigration } from "./migration-CK4oePIo.mjs";
@@ -1,3 +1,3 @@
1
- import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-gFfCQmwC.mjs";
2
- import "./control-adapter-D-2mthVg.mjs";
1
+ import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-GODO43Ai.mjs";
2
+ import "./control-adapter-DzTFiMaG.mjs";
3
3
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,4 +1,4 @@
1
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-BfiR0oFc.mjs";
2
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DFAtGezx.mjs";
3
- import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-_b_fvUSh.mjs";
1
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-BIRftuU7.mjs";
2
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-BICVtTHY.mjs";
3
+ import { A as partitionCallsByControlPolicy, B as temporalStringAuthoringPresets, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, V as timestampNowControlDescriptor, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-b-6t8eI_.mjs";
4
4
  export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type DefaultResolver, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor };
@@ -1,4 +1,4 @@
1
- import { o as extractCodecControlHooks } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
1
+ import { o as extractCodecControlHooks } from "./schema-verify-C_PEdlAr-CmXrFuW1.mjs";
2
2
  import { a as temporalStringAuthoringPresets, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, o as timestampNowControlDescriptor, r as temporalCodecPreset } from "./timestamp-now-generator-BZnBo7IC-DbN5Apqe.mjs";
3
- import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, s as control_default, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-DJi35XO2.mjs";
3
+ import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, s as control_default, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-CMYPT7Ek.mjs";
4
4
  export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowControlDescriptor };
@@ -1,3 +1,3 @@
1
- import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-gFfCQmwC.mjs";
2
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-ClD1mImE.mjs";
1
+ import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-GODO43Ai.mjs";
2
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-CN1ou7vM.mjs";
3
3
  export { type NativeTypeNormalizer, type SqlDiffVerdict, type SqlDiffVerdictInput, type StorageTypeVerdict, type StorageTypeVerdictInput, type VerifySqlSchemaByDiffInput, arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
1
+ import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-CmXrFuW1.mjs";
2
2
  import { t as arraysEqual } from "./diff-B16bL_IR.mjs";
3
3
  export { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,2 +1,2 @@
1
- import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-Bghjt-FG.mjs";
1
+ import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-R9GE8gsm.mjs";
2
2
  export { SqlContractSerializer, SqlContractSerializerBase, type SqlEntityHydrationFactory, SqlSchemaVerifierBase };
@@ -1,3 +1,3 @@
1
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs";
1
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-Bxu4a5oQ-D0lKpb4a.mjs";
2
2
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
3
3
  export { SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase };
@@ -1,2 +1,2 @@
1
- import { t as SqlMigration } from "./migration-Chb4Qg0T.mjs";
1
+ import { t as SqlMigration } from "./migration-Bhce5i_m.mjs";
2
2
  export { SqlMigration as Migration };
@@ -1,5 +1,5 @@
1
1
  import { s as sqlAttributeSpecs } from "./sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs";
2
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-BD-XuavC-CB5uCmck.mjs";
2
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-BD-XuavC-Dh-K7Ocl.mjs";
3
3
  //#region ../../../2-sql/9-family/dist/pack.mjs
4
4
  const sqlFamilyPack = {
5
5
  kind: "family",
@@ -1,3 +1,3 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
- import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-C88G8y1X.mjs";
2
+ import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CzCx0TKe.mjs";
3
3
  export { type ResolvedDomainModel, type ResolvedStorageTable, UNBOUND_DOMAIN_NAMESPACE_ID, sqlRuntimeFamilyDescriptor as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };
@@ -1,5 +1,5 @@
1
1
  import { w as QueryOperationTypeEntry } from "./types-BDUG29Df-LE85dIXP.mjs";
2
- import "./types-UcHa2cTe.mjs";
2
+ import "./types-C36_3E6_.mjs";
3
3
  import { OperationDescriptor, OperationDescriptors, OperationRegistry } from "@prisma/orm-framework/operations";
4
4
  //#region ../../../2-sql/1-core/operations/dist/index.d.mts
5
5
  //#region src/index.d.ts
@@ -22,4 +22,4 @@ type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;
22
22
  declare function createSqlOperationRegistry(): SqlOperationRegistry;
23
23
  //#endregion
24
24
  export { SqlOperationRegistry as a, SqlOperationEntry as i, SqlOperationDescriptor as n, createSqlOperationRegistry as o, SqlOperationDescriptors as r, SqlLoweringSpec as t };
25
- //# sourceMappingURL=index-C5I8D-MB.d.mts.map
25
+ //# sourceMappingURL=index-CLAshwKN.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-C5I8D-MB.d.mts","names":[],"sources":["../../../../2-sql/1-core/operations/dist/index.d.mts"],"mappings":";;;;;UAGU;WACC;WACA;WACA;;;;;;;;;KASN,oBAAoB;KACpB,yBAAyB,oBAAoB;KAC7C,0BAA0B,qBAAqB;KAC/C,uBAAuB,kBAAkB;iBAC7B,8BAA8B"}
1
+ {"version":3,"file":"index-CLAshwKN.d.mts","names":[],"sources":["../../../../2-sql/1-core/operations/dist/index.d.mts"],"mappings":";;;;;UAGU;WACC;WACA;WACA;;;;;;;;;KASN,oBAAoB;KACpB,yBAAyB,oBAAoB;KAC7C,0BAA0B,qBAAqB;KAC/C,uBAAuB,kBAAkB;iBAC7B,8BAA8B"}
@@ -1,13 +1,13 @@
1
1
  import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
- import "./types-UcHa2cTe.mjs";
3
- import { O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-v3qxLLxo-DCeKv7yY.mjs";
4
- import { t as Adapter } from "./ast-PAXgfA8z.mjs";
5
- import { t as SqlQueryPlan } from "./plan-CDxduYaN-pLIyyJaB.mjs";
6
- import { t as SqlExecutionPlan } from "./sql-execution-plan--jKyLpe5-CMGhgO0M.mjs";
7
- import "./plan-BHLdb0Z7.mjs";
8
- import { n as CodecDescriptorRegistry } from "./query-lane-context-Qa-eddrE-kuZ8Z86-.mjs";
9
- import "./query-lane-context-XMvk7fmY.mjs";
10
- import { k as SqlMiddleware } from "./prepared-statement-9QpkE6JG-ti591XdQ.mjs";
2
+ import "./types-C36_3E6_.mjs";
3
+ import { O as ContractCodecRegistry, m as AnyQueryAst, ut as LoweredStatement } from "./types-v3qxLLxo-Clw_yBAh.mjs";
4
+ import { t as Adapter } from "./ast-DuLukI6f.mjs";
5
+ import { t as SqlQueryPlan } from "./plan-CDxduYaN-B2kMLIQQ.mjs";
6
+ import { t as SqlExecutionPlan } from "./sql-execution-plan--jKyLpe5-Bcz9QM2s.mjs";
7
+ import "./plan-C7VP7jOh.mjs";
8
+ import { n as CodecDescriptorRegistry } from "./query-lane-context-Qa-eddrE-BQV6J9nV.mjs";
9
+ import "./query-lane-context-CGdMIEuv.mjs";
10
+ import { k as SqlMiddleware } from "./prepared-statement-9QpkE6JG-B9xqBu5T.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
12
12
  import { AfterExecuteResult as AfterExecuteResult$1, AfterQueryResult as AfterQueryResult$1, ExecuteInterceptResult as ExecuteInterceptResult$1, QueryInterceptResult as QueryInterceptResult$1, RuntimeLog as Log } from "@prisma/orm-framework/components/runtime";
13
13
  //#region ../../../2-sql/5-runtime/dist/index.d.mts
@@ -81,4 +81,4 @@ interface LintsOptions {
81
81
  declare function lints(options?: LintsOptions): SqlMiddleware;
82
82
  //#endregion
83
83
  export { LintsOptions as a, budgets as c, lints as d, lowerSqlPlan as f, ExecuteInterceptResult$1 as i, createAstCodecRegistry as l, validateContractCodecMappings as m, AfterQueryResult$1 as n, Log as o, validateCodecRegistryCompleteness as p, BudgetsOptions as r, QueryInterceptResult$1 as s, AfterExecuteResult$1 as t, extractCodecIds as u };
84
- //# sourceMappingURL=index-CrsJm0Rv.d.mts.map
84
+ //# sourceMappingURL=index-DzBzeTAy.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CrsJm0Rv.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
1
+ {"version":3,"file":"index-DzBzeTAy.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,aAAa,0BAA0B;;;iBAG9D,gBAAgB,UAAU,SAAS,cAAc;iBACjD,8BAA8B,UAAU,yBAAyB,UAAU,SAAS;iBACpF,kCAAkC,UAAU,yBAAyB,UAAU,SAAS;;;;;;;;;;;;iBAYxF,aAAa,KAAK,SAAS,QAAQ,aAAa,SAAS,aAAa,mBAAmB,UAAU,SAAS,aAAa,WAAW,aAAa,OAAO,iBAAiB;;;UAGhL;WACC;WACA;WACA,YAAY;WACZ;WACA;aACE;aACA;;;iBAGI,QAAQ,UAAU,iBAAiB;;;UAG1C;WACC;aACE;aACA;aACA;aACA;aACA;;WAEF;;;;;;;;;;;;;;;;iBAgBM,MAAM,UAAU,eAAe"}
@@ -1,6 +1,6 @@
1
1
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
2
2
  import { a as interpretFieldAttribute, i as findModelAttributeNode, n as fieldSpecContext, o as interpretModelAttribute, r as findFieldAttributeNode, s as sqlAttributeSpecs, t as PSL_CHECK_ON_STI_VARIANT } from "./sql-attribute-specs-BbZ53xbF-CiX6O5aY.mjs";
3
- import { n as buildSqlContractFromDefinition } from "./derived-checks-BzL102Q0-0nIMlEux.mjs";
3
+ import { n as buildSqlContractFromDefinition } from "./derived-checks-D_-1X7be-lGe8VdId.mjs";
4
4
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
5
5
  import { hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, validateAuthoringHelperArguments } from "@prisma/orm-framework/components/authoring";
6
6
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -10,8 +10,10 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
10
  import { blindCast } from "@prisma/orm-framework/utils/casts";
11
11
  import { findBlockDescriptor, keywordPslSpan, nodePslSpan } from "@prisma/orm-framework/psl-parser";
12
12
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
13
+ import { resolveToOneRelationNullable } from "@prisma/orm-framework/contract-authoring";
14
+ import { consumeInvalidFkPairing, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic } from "@prisma/orm-framework/psl-parser/interpret";
13
15
  import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
14
- //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-BPl_7Cv5.mjs
16
+ //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-_KWQDsAm.mjs
15
17
  function contractError(code, message, options) {
16
18
  return structuredError(code, message, options);
17
19
  }
@@ -1399,9 +1401,6 @@ const REFERENTIAL_ACTION_MAP = {
1399
1401
  setNull: "setNull",
1400
1402
  setDefault: "setDefault"
1401
1403
  };
1402
- function fkRelationPairKey(declaringModelName, targetModelName) {
1403
- return `${declaringModelName}::${targetModelName}`;
1404
- }
1405
1404
  function normalizeReferentialAction(actionToken) {
1406
1405
  return REFERENTIAL_ACTION_MAP[actionToken];
1407
1406
  }
@@ -1444,6 +1443,7 @@ function indexFkRelations(input) {
1444
1443
  toTable: relation.targetTableName,
1445
1444
  ...ifDefined("toNamespaceId", relation.targetNamespaceId),
1446
1445
  cardinality: "N:1",
1446
+ nullable: relation.nullable,
1447
1447
  on: {
1448
1448
  parentTable: relation.declaringTableName,
1449
1449
  parentColumns: relation.localColumns,
@@ -1619,6 +1619,7 @@ function applyBackrelationCandidates(input) {
1619
1619
  const pairMatches = input.fkRelationsByPair.get(pairKey) ?? [];
1620
1620
  const matches = candidate.relationName ? pairMatches.filter((relation) => relation.relationName === candidate.relationName) : [...pairMatches];
1621
1621
  if (matches.length === 0) {
1622
+ if (consumeInvalidFkPairing(candidate, pairKey, input.invalidFkPairings)) continue;
1622
1623
  if (candidate.isList) {
1623
1624
  const { pairs: junctionPairs, nearMisses } = findJunctionFkPairs({
1624
1625
  candidate,
@@ -1677,12 +1678,22 @@ function applyBackrelationCandidates(input) {
1677
1678
  continue;
1678
1679
  }
1679
1680
  }
1681
+ if (!candidate.isList && !candidate.field.optional) input.diagnostics.push(requiredOneToOneBackrelationDiagnostic({
1682
+ modelName: candidate.modelName,
1683
+ field: candidate.field,
1684
+ targetModelName: candidate.targetModelName,
1685
+ sourceId: input.sourceId,
1686
+ recordNoun: "row"
1687
+ }));
1680
1688
  relationsForModel(input.modelRelations, candidate.modelName).push({
1681
1689
  fieldName: candidate.field.name,
1682
1690
  toModel: matched.declaringModelName,
1683
1691
  toTable: matched.declaringTableName,
1684
1692
  ...ifDefined("toNamespaceId", matched.declaringNamespaceId),
1685
- cardinality: candidate.isList ? "1:N" : "1:1",
1693
+ ...candidate.isList ? { cardinality: "1:N" } : {
1694
+ cardinality: "1:1",
1695
+ nullable: true
1696
+ },
1686
1697
  on: {
1687
1698
  parentTable: candidate.tableName,
1688
1699
  parentColumns: matched.referencedColumns,
@@ -2049,6 +2060,22 @@ function composedBlockKeywords(authoringContributions) {
2049
2060
  function relationAttributeDeclaresOwningSide(relationAttribute) {
2050
2061
  return getNamedArgument(relationAttribute, "fields") !== void 0 || getNamedArgument(relationAttribute, "references") !== void 0;
2051
2062
  }
2063
+ function relationNullabilityMismatch(relationField, localColumns, resolvedFields) {
2064
+ return resolveToOneRelationNullable({
2065
+ declaredNullable: relationField.optional,
2066
+ localFieldNullability: resolvedFields.filter((resolvedField) => localColumns.includes(resolvedField.columnName)).map((resolvedField) => resolvedField.nullable),
2067
+ ownsReference: true
2068
+ }).contradiction !== void 0;
2069
+ }
2070
+ function relationNullabilityMismatchDiagnostic(modelName, relationAttribute, sourceId) {
2071
+ const fieldLabel = `Relation field "${modelName}.${relationAttribute.field.name}"`;
2072
+ return {
2073
+ code: "PSL_RELATION_NULLABILITY_MISMATCH",
2074
+ message: relationAttribute.field.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with "?" or remove "?" from "${relationAttribute.field.name}".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add "?" to "${relationAttribute.field.name}" or make those fields required.`,
2075
+ sourceId,
2076
+ span: relationAttribute.field.span
2077
+ };
2078
+ }
2052
2079
  function buildModelNodeFromPsl(input) {
2053
2080
  const { model, mapping, sourceId, diagnostics } = input;
2054
2081
  const tableName = mapping.tableName;
@@ -2416,6 +2443,7 @@ function buildModelNodeFromPsl(input) {
2416
2443
  throw new InternalError(`Model attribute "@@${modelAttribute.name}" is registered but has no interpreter branch`);
2417
2444
  }
2418
2445
  const resultFkRelationMetadata = [];
2446
+ const resultInvalidFkPairings = [];
2419
2447
  const resultCrossSpaceRelations = [];
2420
2448
  for (const relationAttribute of relationAttributes) {
2421
2449
  const { typeName: fieldTypeName, typeNamespaceId: fieldTypeNamespaceId, typeContractSpaceId: fieldTypeContractSpaceId } = relationAttribute.field;
@@ -2472,6 +2500,10 @@ function buildModelNodeFromPsl(input) {
2472
2500
  entityLabel: `Relation field "${model.name}.${relationAttribute.field.name}"`
2473
2501
  });
2474
2502
  if (!localColumns) continue;
2503
+ if (relationNullabilityMismatch(relationAttribute.field, localColumns, resolvedFields)) {
2504
+ diagnostics.push(relationNullabilityMismatchDiagnostic(model.name, relationAttribute, sourceId));
2505
+ continue;
2506
+ }
2475
2507
  const referencedColumns = parsedRelation.references;
2476
2508
  if (localColumns.length !== referencedColumns.length) {
2477
2509
  diagnostics.push({
@@ -2522,6 +2554,7 @@ function buildModelNodeFromPsl(input) {
2522
2554
  toModel: fieldTypeName,
2523
2555
  toTable: crossTargetTableName,
2524
2556
  cardinality: "N:1",
2557
+ nullable: relationAttribute.field.optional,
2525
2558
  spaceId: fieldTypeContractSpaceId,
2526
2559
  namespaceId: crossTargetNamespaceId,
2527
2560
  on: {
@@ -2591,6 +2624,14 @@ function buildModelNodeFromPsl(input) {
2591
2624
  entityLabel: `Relation field "${model.name}.${relationAttribute.field.name}"`
2592
2625
  });
2593
2626
  if (!localColumns) continue;
2627
+ if (relationNullabilityMismatch(relationAttribute.field, localColumns, resolvedFields)) {
2628
+ diagnostics.push(relationNullabilityMismatchDiagnostic(model.name, relationAttribute, sourceId));
2629
+ resultInvalidFkPairings.push({
2630
+ pairKey: fkRelationPairKey(model.name, targetMapping.model.name),
2631
+ ...ifDefined("relationName", parsedRelation.name)
2632
+ });
2633
+ continue;
2634
+ }
2594
2635
  const referencedColumns = mapFieldNamesToColumns({
2595
2636
  modelName: targetMapping.model.name,
2596
2637
  fieldNames: parsedRelation.references,
@@ -2635,6 +2676,7 @@ function buildModelNodeFromPsl(input) {
2635
2676
  targetTableName: targetMapping.tableName,
2636
2677
  ...ifDefined("targetNamespaceId", targetNamespaceId),
2637
2678
  ...ifDefined("relationName", parsedRelation.name),
2679
+ nullable: relationAttribute.field.optional,
2638
2680
  localColumns,
2639
2681
  referencedColumns
2640
2682
  });
@@ -2665,6 +2707,7 @@ function buildModelNodeFromPsl(input) {
2665
2707
  ...ifDefined("control", controlPolicy)
2666
2708
  },
2667
2709
  fkRelationMetadata: resultFkRelationMetadata,
2710
+ invalidFkPairings: resultInvalidFkPairings,
2668
2711
  crossSpaceRelations: resultCrossSpaceRelations,
2669
2712
  backrelationCandidates: resultBackrelationCandidates,
2670
2713
  resolvedFields,
@@ -3265,6 +3308,7 @@ function interpretPslDocumentToSqlContract(input) {
3265
3308
  for (const mapping of modelMappingsByCoordinate.values()) modelMappings.set(mapping.model.name, mapping);
3266
3309
  const modelNodes = [];
3267
3310
  const fkRelationMetadata = [];
3311
+ const invalidFkPairings = [];
3268
3312
  const backrelationCandidates = [];
3269
3313
  const modelResolvedFields = /* @__PURE__ */ new Map();
3270
3314
  const crossSpaceRelationsByModel = /* @__PURE__ */ new Map();
@@ -3307,6 +3351,7 @@ function interpretPslDocumentToSqlContract(input) {
3307
3351
  namespaceId
3308
3352
  } : result.modelNode);
3309
3353
  fkRelationMetadata.push(...result.fkRelationMetadata);
3354
+ invalidFkPairings.push(...result.invalidFkPairings);
3310
3355
  backrelationCandidates.push(...result.backrelationCandidates);
3311
3356
  modelResolvedFields.set(coordinate, result.resolvedFields);
3312
3357
  if (result.crossSpaceRelations.length > 0) {
@@ -3336,6 +3381,7 @@ function interpretPslDocumentToSqlContract(input) {
3336
3381
  applyBackrelationCandidates({
3337
3382
  backrelationCandidates,
3338
3383
  fkRelationsByPair,
3384
+ invalidFkPairings,
3339
3385
  fkRelationsByDeclaringModel,
3340
3386
  modelIdColumns,
3341
3387
  modelUniqueColumnSets,
@@ -3452,4 +3498,4 @@ function interpretPslDocumentToSqlContract(input) {
3452
3498
  //#endregion
3453
3499
  export { interpretPslDocumentToSqlContract as t };
3454
3500
 
3455
- //# sourceMappingURL=interpreter-BPl_7Cv5-B8FaNBLQ.mjs.map
3501
+ //# sourceMappingURL=interpreter-_KWQDsAm-B2goMgB0.mjs.map