@prisma/orm-family-sql 8.0.0-rc.17-dev.3 → 8.0.0-rc.17-dev.4

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 (267) hide show
  1. package/dist/{ast-DUU5OVjo.mjs → ast-De8XGuVW.mjs} +2 -2
  2. package/dist/{ast-DUU5OVjo.mjs.map → ast-De8XGuVW.mjs.map} +1 -1
  3. package/dist/{ast-Bmb-2vbO.d.mts → ast-Dp6lQXUX.d.mts} +3 -3
  4. package/dist/{ast-Bmb-2vbO.d.mts.map → ast-Dp6lQXUX.d.mts.map} +1 -1
  5. package/dist/{authored-check-naming-C8_TvzU6.d.mts → authored-check-naming-CK6T_Dfh.d.mts} +2 -2
  6. package/dist/{authored-check-naming-C8_TvzU6.d.mts.map → authored-check-naming-CK6T_Dfh.d.mts.map} +1 -1
  7. package/dist/{authored-check-naming-BBdhHujS.mjs → authored-check-naming-CO3GA46Y.mjs} +3 -3
  8. package/dist/{authored-check-naming-BBdhHujS.mjs.map → authored-check-naming-CO3GA46Y.mjs.map} +1 -1
  9. package/dist/{authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts → authoring-entity-types-CZ-vdwYS-BQPeBSla.d.mts} +2 -2
  10. package/dist/{authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts.map → authoring-entity-types-CZ-vdwYS-BQPeBSla.d.mts.map} +1 -1
  11. package/dist/{authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs → authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs} +2 -2
  12. package/dist/{authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs.map → authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs.map} +1 -1
  13. package/dist/builder.d.mts +2 -2
  14. package/dist/builder__runtime.d.mts +9 -9
  15. package/dist/builder__runtime.mjs +129 -2
  16. package/dist/builder__runtime.mjs.map +1 -1
  17. package/dist/builder__types.d.mts +3 -3
  18. package/dist/{check-constraint-B7qGu6rc-agxAjKLG.d.mts → check-constraint-B7qGu6rc-CBVYAMwG.d.mts} +2 -2
  19. package/dist/{check-constraint-B7qGu6rc-agxAjKLG.d.mts.map → check-constraint-B7qGu6rc-CBVYAMwG.d.mts.map} +1 -1
  20. package/dist/{codec-descriptor-registry-CdIIOkuE.mjs → codec-descriptor-registry-CYK0Wzja.mjs} +2 -2
  21. package/dist/{codec-descriptor-registry-CdIIOkuE.mjs.map → codec-descriptor-registry-CYK0Wzja.mjs.map} +1 -1
  22. package/dist/{config-types-DB6gRJ5K.d.mts → config-types-Ci51fcnp.d.mts} +4 -4
  23. package/dist/{config-types-DB6gRJ5K.d.mts.map → config-types-Ci51fcnp.d.mts.map} +1 -1
  24. package/dist/{config-types-D0sxpKAN.mjs → config-types-DsRO_uxd.mjs} +3 -3
  25. package/dist/{config-types-D0sxpKAN.mjs.map → config-types-DsRO_uxd.mjs.map} +1 -1
  26. package/dist/{contract-builder-tEax3I2q.mjs → contract-builder-DEtvdts6.mjs} +15 -9
  27. package/dist/contract-builder-DEtvdts6.mjs.map +1 -0
  28. package/dist/{contract-builder-V5pFHDv3.d.mts → contract-builder-DWQhH8FQ.d.mts} +21 -13
  29. package/dist/contract-builder-DWQhH8FQ.d.mts.map +1 -0
  30. package/dist/contract-emitter.mjs +1 -1
  31. package/dist/contract-prisma7__provider.d.mts +2 -2
  32. package/dist/contract-prisma7__provider.mjs +8 -8
  33. package/dist/contract-psl.d.mts +3 -3
  34. package/dist/contract-psl.mjs +1 -1
  35. package/dist/contract-psl__attribute-specs.d.mts +2 -2
  36. package/dist/contract-psl__attribute-specs.mjs +1 -1
  37. package/dist/contract-psl__provider.d.mts +2 -2
  38. package/dist/contract-psl__provider.mjs +3 -3
  39. package/dist/contract-ts.d.mts +5 -5
  40. package/dist/contract-ts.mjs +3 -3
  41. package/dist/contract-ts__config-types.d.mts +1 -1
  42. package/dist/contract-ts__config-types.mjs +1 -1
  43. package/dist/contract-ts__contract-builder.d.mts +4 -4
  44. package/dist/contract-ts__contract-builder.mjs +2 -2
  45. package/dist/{contract-view-C1xX3yIj.d.mts → contract-view-CijuTaer.d.mts} +2 -2
  46. package/dist/{contract-view-C1xX3yIj.d.mts.map → contract-view-CijuTaer.d.mts.map} +1 -1
  47. package/dist/contract.d.mts +19 -19
  48. package/dist/contract.mjs +14 -14
  49. package/dist/contract__authored-check-naming.d.mts +1 -1
  50. package/dist/contract__authored-check-naming.mjs +1 -1
  51. package/dist/contract__contract-view.d.mts +1 -1
  52. package/dist/contract__data-type.mjs +1 -1
  53. package/dist/contract__entity-kinds.d.mts +1 -1
  54. package/dist/contract__entity-kinds.mjs +1 -1
  55. package/dist/contract__factories.d.mts +1 -1
  56. package/dist/contract__factories.mjs +1 -1
  57. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  58. package/dist/contract__foreign-key-materialization.mjs +2 -2
  59. package/dist/contract__index-naming.d.mts +1 -1
  60. package/dist/contract__index-naming.mjs +1 -1
  61. package/dist/contract__index-type-validation.d.mts +2 -2
  62. package/dist/contract__index-type-validation.mjs +1 -1
  63. package/dist/contract__index-types.d.mts +3 -3
  64. package/dist/contract__index-types.mjs +2 -2
  65. package/dist/contract__resolve-storage-table.d.mts +1 -1
  66. package/dist/contract__types.d.mts +7 -7
  67. package/dist/contract__types.mjs +3 -3
  68. package/dist/contract__validators.d.mts +1 -1
  69. package/dist/contract__validators.mjs +2 -2
  70. package/dist/{control-C5Yy0n3w.mjs → control-4kwMnHYO.mjs} +13 -13
  71. package/dist/{control-C5Yy0n3w.mjs.map → control-4kwMnHYO.mjs.map} +1 -1
  72. package/dist/{control-B3Mb21Md.d.mts → control-BK2oKZmT.d.mts} +16 -16
  73. package/dist/{control-B3Mb21Md.d.mts.map → control-BK2oKZmT.d.mts.map} +1 -1
  74. package/dist/{control-adapter-CkFfBVei-BLYeKcLW.d.mts → control-adapter-CkFfBVei-DH5DAObc.d.mts} +8 -8
  75. package/dist/{control-adapter-CkFfBVei-BLYeKcLW.d.mts.map → control-adapter-CkFfBVei-DH5DAObc.d.mts.map} +1 -1
  76. package/dist/control-adapter-DB7MPI5L.d.mts +1 -0
  77. package/dist/{data-type-CAPmGXg9.mjs → data-type-C_PI_Jsa.mjs} +2 -2
  78. package/dist/{data-type-CAPmGXg9.mjs.map → data-type-C_PI_Jsa.mjs.map} +1 -1
  79. package/dist/{db-D7R5zKiH-P7Tg4ZXk.d.mts → db-DB1FVK1P-DbwoL7vg.d.mts} +48 -11
  80. package/dist/db-DB1FVK1P-DbwoL7vg.d.mts.map +1 -0
  81. package/dist/{ddl-types-DtKZjNtN-CByECwns.d.mts → ddl-types-DtKZjNtN-CwtcEWLd.d.mts} +3 -3
  82. package/dist/{ddl-types-DtKZjNtN-CByECwns.d.mts.map → ddl-types-DtKZjNtN-CwtcEWLd.d.mts.map} +1 -1
  83. package/dist/{derived-checks-D5zdlyyh-CPofdm1W.mjs → derived-checks-CfXjGvNH-CrXoMrPU.mjs} +22 -32
  84. package/dist/derived-checks-CfXjGvNH-CrXoMrPU.mjs.map +1 -0
  85. package/dist/{derived-checks-DpPkO6Dt-D3M7YEr2.d.mts → derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts} +3 -3
  86. package/dist/{derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map → derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts.map} +1 -1
  87. package/dist/{diff-CBqsNkxe.d.mts → diff-l4-qJpTV.d.mts} +8 -8
  88. package/dist/{diff-CBqsNkxe.d.mts.map → diff-l4-qJpTV.d.mts.map} +1 -1
  89. package/dist/{dist-Dm_hQ-hh.mjs → dist-D8EkCena.mjs} +2 -2
  90. package/dist/{dist-Dm_hQ-hh.mjs.map → dist-D8EkCena.mjs.map} +1 -1
  91. package/dist/{entity-kinds-O3V1K26U-B8TUrsX2.mjs → entity-kinds-DDTkNIr9-DJ2EIO94.mjs} +5 -5
  92. package/dist/{entity-kinds-O3V1K26U-B8TUrsX2.mjs.map → entity-kinds-DDTkNIr9-DJ2EIO94.mjs.map} +1 -1
  93. package/dist/{entity-kinds--HvqT50S.d.mts → entity-kinds-DqUYen0Y.d.mts} +5 -5
  94. package/dist/{entity-kinds--HvqT50S.d.mts.map → entity-kinds-DqUYen0Y.d.mts.map} +1 -1
  95. package/dist/{expression-DE893va7.d.mts → expression-CvXfXCGs.d.mts} +7 -7
  96. package/dist/{expression-DE893va7.d.mts.map → expression-CvXfXCGs.d.mts.map} +1 -1
  97. package/dist/{factories-DzLBAAvj.d.mts → factories-BVIVyHQU.d.mts} +4 -4
  98. package/dist/{factories-DzLBAAvj.d.mts.map → factories-BVIVyHQU.d.mts.map} +1 -1
  99. package/dist/{factories-Bp41Aity.mjs → factories-CScqMnFk.mjs} +3 -3
  100. package/dist/{factories-Bp41Aity.mjs.map → factories-CScqMnFk.mjs.map} +1 -1
  101. package/dist/family.d.mts +13 -13
  102. package/dist/family.mjs +6 -6
  103. package/dist/family__control-adapter.d.mts +2 -2
  104. package/dist/family__control.d.mts +4 -4
  105. package/dist/family__control.mjs +3 -3
  106. package/dist/family__diff.d.mts +2 -2
  107. package/dist/family__diff.mjs +1 -1
  108. package/dist/family__ir.d.mts +1 -1
  109. package/dist/family__ir.mjs +1 -1
  110. package/dist/family__migration.d.mts +1 -1
  111. package/dist/family__pack.d.mts +1 -1
  112. package/dist/family__pack.mjs +2 -2
  113. package/dist/family__psl-build.mjs +1 -1
  114. package/dist/family__psl-infer.d.mts +1 -1
  115. package/dist/family__psl-infer.mjs +1 -1
  116. package/dist/family__runtime.d.mts +2 -2
  117. package/dist/{foreign-key-materialization-D0Ltg78T.d.mts → foreign-key-materialization-DBYDet74.d.mts} +6 -4
  118. package/dist/foreign-key-materialization-DBYDet74.d.mts.map +1 -0
  119. package/dist/{foreign-key-materialization-Cv3q8Pix.mjs → foreign-key-materialization-DyoakLGY.mjs} +16 -7
  120. package/dist/foreign-key-materialization-DyoakLGY.mjs.map +1 -0
  121. package/dist/{index-oNRBExeI.d.mts → index-BzAG1PFV.d.mts} +11 -11
  122. package/dist/{index-oNRBExeI.d.mts.map → index-BzAG1PFV.d.mts.map} +1 -1
  123. package/dist/{index-CnpTmyXs.d.mts → index-We-mbWnZ.d.mts} +3 -3
  124. package/dist/{index-CnpTmyXs.d.mts.map → index-We-mbWnZ.d.mts.map} +1 -1
  125. package/dist/{index-equivalence-DswCiq5l-C7wLMPwF.mjs → index-equivalence-DswCiq5l-_gF1Un8p.mjs} +2 -2
  126. package/dist/{index-equivalence-DswCiq5l-C7wLMPwF.mjs.map → index-equivalence-DswCiq5l-_gF1Un8p.mjs.map} +1 -1
  127. package/dist/{index-naming-Cj1Anq-T-NX841eiU.mjs → index-naming-BOcJT1B3-CeEoP8t3.mjs} +7 -5
  128. package/dist/index-naming-BOcJT1B3-CeEoP8t3.mjs.map +1 -0
  129. package/dist/{index-naming-UEtT94f5.d.mts → index-naming-C7pme5Pj.d.mts} +4 -3
  130. package/dist/index-naming-C7pme5Pj.d.mts.map +1 -0
  131. package/dist/index-type-validation-Bcme_Ust.mjs +42 -0
  132. package/dist/index-type-validation-Bcme_Ust.mjs.map +1 -0
  133. package/dist/index-type-validation-D7-fPxIJ.d.mts +16 -0
  134. package/dist/index-type-validation-D7-fPxIJ.d.mts.map +1 -0
  135. package/dist/index-types-ByX8MLso.d.mts +1 -0
  136. package/dist/index-types-H1O43iYT-ONvDbszL.d.mts +66 -0
  137. package/dist/index-types-H1O43iYT-ONvDbszL.d.mts.map +1 -0
  138. package/dist/index-types-pC_5vADQ-TTUXAfmL.mjs +95 -0
  139. package/dist/index-types-pC_5vADQ-TTUXAfmL.mjs.map +1 -0
  140. package/dist/{interpreter-DlG-2o64-DmykcFbp.mjs → interpreter-DlG-2o64-CDb20sM1.mjs} +7 -7
  141. package/dist/{interpreter-DlG-2o64-DmykcFbp.mjs.map → interpreter-DlG-2o64-CDb20sM1.mjs.map} +1 -1
  142. package/dist/{ir-BPrf_vgX.d.mts → ir-OBn7ct21.d.mts} +3 -3
  143. package/dist/{ir-BPrf_vgX.d.mts.map → ir-OBn7ct21.d.mts.map} +1 -1
  144. package/dist/middleware-FHkIPvYR.d.mts +1 -0
  145. package/dist/{middleware-mLwvcOLS-SaqhgsmA.d.mts → middleware-mLwvcOLS-wIYSKgog.d.mts} +2 -2
  146. package/dist/{middleware-mLwvcOLS-SaqhgsmA.d.mts.map → middleware-mLwvcOLS-wIYSKgog.d.mts.map} +1 -1
  147. package/dist/{migration-C_J49WKy.d.mts → migration-DEK3Hxlo.d.mts} +4 -4
  148. package/dist/{migration-C_J49WKy.d.mts.map → migration-DEK3Hxlo.d.mts.map} +1 -1
  149. package/dist/{naming-C1OcnGJg-DB1o9TS6.d.mts → naming-BcD36g9T-DFyaudUa.d.mts} +3 -10
  150. package/dist/{naming-C1OcnGJg-DB1o9TS6.d.mts.map → naming-BcD36g9T-DFyaudUa.d.mts.map} +1 -1
  151. package/dist/{naming-DkG_OegU-DpENNdZX.mjs → naming-CT8tRisJ-DLHKo0Hm.mjs} +9 -10
  152. package/dist/{naming-DkG_OegU-DpENNdZX.mjs.map → naming-CT8tRisJ-DLHKo0Hm.mjs.map} +1 -1
  153. package/dist/operations.d.mts +1 -1
  154. package/dist/orm-client.d.mts +15 -15
  155. package/dist/orm-client.mjs +3 -3
  156. package/dist/{pack-DZtuLikU.d.mts → pack-D3L1b4Ag.d.mts} +2 -2
  157. package/dist/{pack-DZtuLikU.d.mts.map → pack-D3L1b4Ag.d.mts.map} +1 -1
  158. package/dist/plan-_8dKi13Q.d.mts +2 -0
  159. package/dist/{plan-cGEaSXHv-BeW-cC5v.d.mts → plan-cGEaSXHv-j0w37mVT.d.mts} +4 -4
  160. package/dist/{plan-cGEaSXHv-BeW-cC5v.d.mts.map → plan-cGEaSXHv-j0w37mVT.d.mts.map} +1 -1
  161. package/dist/{prepared-statement-YtgdlN7e-CI1fD5IM.d.mts → prepared-statement-YtgdlN7e-D4MSU3i0.d.mts} +16 -16
  162. package/dist/{prepared-statement-YtgdlN7e-CI1fD5IM.d.mts.map → prepared-statement-YtgdlN7e-D4MSU3i0.d.mts.map} +1 -1
  163. package/dist/{psl-build-B5iMVWHu.mjs → psl-build-DTE03hcr.mjs} +2 -2
  164. package/dist/{psl-build-B5iMVWHu.mjs.map → psl-build-DTE03hcr.mjs.map} +1 -1
  165. package/dist/{psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts → psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts} +2 -2
  166. package/dist/{psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts.map → psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts.map} +1 -1
  167. package/dist/{psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs → psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs} +4 -4
  168. package/dist/{psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs.map → psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs.map} +1 -1
  169. package/dist/{psl-infer-B0yuv-j_.mjs → psl-infer-DHO72J_m.mjs} +2 -2
  170. package/dist/{psl-infer-B0yuv-j_.mjs.map → psl-infer-DHO72J_m.mjs.map} +1 -1
  171. package/dist/{psl-infer-DkPZJnUM.d.mts → psl-infer-DsHE9xAU.d.mts} +3 -3
  172. package/dist/{psl-infer-DkPZJnUM.d.mts.map → psl-infer-DsHE9xAU.d.mts.map} +1 -1
  173. package/dist/{query-lane-context-CJoNBspB-CR_n8DNB.d.mts → query-lane-context-CJoNBspB--ieuKEei.d.mts} +5 -5
  174. package/dist/{query-lane-context-CJoNBspB-CR_n8DNB.d.mts.map → query-lane-context-CJoNBspB--ieuKEei.d.mts.map} +1 -1
  175. package/dist/query-lane-context-DNt2DeQu.d.mts +1 -0
  176. package/dist/relational-core.d.mts +11 -11
  177. package/dist/relational-core.mjs +1 -1
  178. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  179. package/dist/relational-core__ast.d.mts +3 -3
  180. package/dist/relational-core__ast.mjs +1 -1
  181. package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
  182. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  183. package/dist/relational-core__contract-free.d.mts +3 -3
  184. package/dist/relational-core__expression.d.mts +1 -1
  185. package/dist/relational-core__middleware.d.mts +2 -2
  186. package/dist/relational-core__plan.d.mts +3 -3
  187. package/dist/relational-core__query-lane-context.d.mts +2 -2
  188. package/dist/relational-core__types.d.mts +2 -2
  189. package/dist/{resolve-storage-table-B7m9cFy4.d.mts → resolve-storage-table-wSUswl-4.d.mts} +3 -3
  190. package/dist/{resolve-storage-table-B7m9cFy4.d.mts.map → resolve-storage-table-wSUswl-4.d.mts.map} +1 -1
  191. package/dist/{runtime-Ca7PVQcJ.d.mts → runtime-BHJXmBhw.d.mts} +2 -2
  192. package/dist/{runtime-Ca7PVQcJ.d.mts.map → runtime-BHJXmBhw.d.mts.map} +1 -1
  193. package/dist/runtime.d.mts +4 -4
  194. package/dist/runtime.mjs +2 -2
  195. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  196. package/dist/{schema-differ-CqWOkoW9-BABSAGGB.d.mts → schema-differ-CqWOkoW9-DQkzKV8b.d.mts} +5 -5
  197. package/dist/{schema-differ-CqWOkoW9-BABSAGGB.d.mts.map → schema-differ-CqWOkoW9-DQkzKV8b.d.mts.map} +1 -1
  198. package/dist/schema-ir.d.mts +1 -1
  199. package/dist/schema-ir.mjs +1 -1
  200. package/dist/schema-ir__naming.d.mts +1 -1
  201. package/dist/schema-ir__naming.mjs +1 -1
  202. package/dist/schema-ir__types.d.mts +2 -2
  203. package/dist/schema-ir__types.mjs +1 -1
  204. package/dist/{schema-verify-DIfHSB4I-Dx3Tq9hf.mjs → schema-verify-DIfHSB4I-k8l0LZZB.mjs} +4 -4
  205. package/dist/{schema-verify-DIfHSB4I-Dx3Tq9hf.mjs.map → schema-verify-DIfHSB4I-k8l0LZZB.mjs.map} +1 -1
  206. package/dist/{serialized-index-C26m_DWu-CnNi8WAI.mjs → serialized-index-C26m_DWu-BjU519sW.mjs} +3 -3
  207. package/dist/{serialized-index-C26m_DWu-CnNi8WAI.mjs.map → serialized-index-C26m_DWu-BjU519sW.mjs.map} +1 -1
  208. package/dist/{serialized-index-CrgG8ct1-D64Figsu.d.mts → serialized-index-CrgG8ct1-DDfHKUEK.d.mts} +3 -3
  209. package/dist/{serialized-index-CrgG8ct1-D64Figsu.d.mts.map → serialized-index-CrgG8ct1-DDfHKUEK.d.mts.map} +1 -1
  210. package/dist/{sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs → sql-contract-serializer-DDaAVCQr-CGG0I8ur.mjs} +5 -5
  211. package/dist/{sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs.map → sql-contract-serializer-DDaAVCQr-CGG0I8ur.mjs.map} +1 -1
  212. package/dist/{sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts → sql-execution-plan-C7XauPPu-eskZJbmm.d.mts} +2 -2
  213. package/dist/{sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts.map → sql-execution-plan-C7XauPPu-eskZJbmm.d.mts.map} +1 -1
  214. package/dist/{sql-index-ByAAE7K8-DPkZtr7t.d.mts → sql-index-ByAAE7K8-BpbPBWPD.d.mts} +2 -2
  215. package/dist/{sql-index-ByAAE7K8-DPkZtr7t.d.mts.map → sql-index-ByAAE7K8-BpbPBWPD.d.mts.map} +1 -1
  216. package/dist/{sql-storage-BTlJLUID-O6fBB_am.d.mts → sql-storage-BTlJLUID-CGy3wuH4.d.mts} +2 -2
  217. package/dist/{sql-storage-BTlJLUID-O6fBB_am.d.mts.map → sql-storage-BTlJLUID-CGy3wuH4.d.mts.map} +1 -1
  218. package/dist/{storage-table-B7OSPl3G-EOodFPzq.mjs → storage-table-B7OSPl3G-p1j6AjMS.mjs} +2 -2
  219. package/dist/{storage-table-B7OSPl3G-EOodFPzq.mjs.map → storage-table-B7OSPl3G-p1j6AjMS.mjs.map} +1 -1
  220. package/dist/{storage-table-WXeVNycx-tlFMnbig.d.mts → storage-table-WXeVNycx-BCwDhdq5.d.mts} +4 -4
  221. package/dist/{storage-table-WXeVNycx-tlFMnbig.d.mts.map → storage-table-WXeVNycx-BCwDhdq5.d.mts.map} +1 -1
  222. package/dist/types-BCPHaykc.d.mts +1 -0
  223. package/dist/{types-BJQcLx-8-DY221fiX.d.mts → types-BJQcLx-8-BHNxJ_df.d.mts} +10 -10
  224. package/dist/{types-BJQcLx-8-DY221fiX.d.mts.map → types-BJQcLx-8-BHNxJ_df.d.mts.map} +1 -1
  225. package/dist/{types-CzxOObSY-DEfjmbj1.d.mts → types-CzxOObSY-CxZ_bdVi.d.mts} +9 -9
  226. package/dist/{types-CzxOObSY-DEfjmbj1.d.mts.map → types-CzxOObSY-CxZ_bdVi.d.mts.map} +1 -1
  227. package/dist/{types-Cz_bcUWN-CC3lFQOi.mjs → types-D0GFxty0-CP8b4dR3.mjs} +4 -4
  228. package/dist/{types-Cz_bcUWN-CC3lFQOi.mjs.map → types-D0GFxty0-CP8b4dR3.mjs.map} +1 -1
  229. package/dist/{types-DFZhLz18-C_h0u-Zx.d.mts → types-DFZhLz18-Msi8wwig.d.mts} +6 -6
  230. package/dist/{types-DFZhLz18-C_h0u-Zx.d.mts.map → types-DFZhLz18-Msi8wwig.d.mts.map} +1 -1
  231. package/dist/{types-CLsPsUiw-Db1BsN9R.d.mts → types-DIZSW9JI-DNUF-RnL.d.mts} +3 -3
  232. package/dist/{types-CLsPsUiw-Db1BsN9R.d.mts.map → types-DIZSW9JI-DNUF-RnL.d.mts.map} +1 -1
  233. package/dist/{types-C7oOtFcJ.mjs → types-DXrO0fxT.mjs} +2 -2
  234. package/dist/{types-C7oOtFcJ.mjs.map → types-DXrO0fxT.mjs.map} +1 -1
  235. package/dist/types-DqSCaTK3.d.mts +1 -0
  236. package/dist/{types-Sh5HuaZE-B_FQUPng.d.mts → types-Sh5HuaZE-CqThc46M.d.mts} +2 -2
  237. package/dist/{types-Sh5HuaZE-B_FQUPng.d.mts.map → types-Sh5HuaZE-CqThc46M.d.mts.map} +1 -1
  238. package/dist/{types-BURWzacK.d.mts → types-Uv3oTMAb.d.mts} +7 -7
  239. package/dist/{types-BURWzacK.d.mts.map → types-Uv3oTMAb.d.mts.map} +1 -1
  240. package/dist/{validators-oyDG5mVX.mjs → validators-CIfn8ezs.mjs} +5 -5
  241. package/dist/{validators-oyDG5mVX.mjs.map → validators-CIfn8ezs.mjs.map} +1 -1
  242. package/dist/{validators-Cr_FFJAG.d.mts → validators-COcD3_iw.d.mts} +3 -3
  243. package/dist/{validators-Cr_FFJAG.d.mts.map → validators-COcD3_iw.d.mts.map} +1 -1
  244. package/package.json +18 -18
  245. package/dist/contract-builder-V5pFHDv3.d.mts.map +0 -1
  246. package/dist/contract-builder-tEax3I2q.mjs.map +0 -1
  247. package/dist/control-adapter-BXQ29_fa.d.mts +0 -1
  248. package/dist/db-D7R5zKiH-P7Tg4ZXk.d.mts.map +0 -1
  249. package/dist/derived-checks-D5zdlyyh-CPofdm1W.mjs.map +0 -1
  250. package/dist/foreign-key-materialization-Cv3q8Pix.mjs.map +0 -1
  251. package/dist/foreign-key-materialization-D0Ltg78T.d.mts.map +0 -1
  252. package/dist/index-naming-Cj1Anq-T-NX841eiU.mjs.map +0 -1
  253. package/dist/index-naming-UEtT94f5.d.mts.map +0 -1
  254. package/dist/index-type-validation-B925ye4q.d.mts +0 -10
  255. package/dist/index-type-validation-B925ye4q.d.mts.map +0 -1
  256. package/dist/index-type-validation-COH4d78M.mjs +0 -17
  257. package/dist/index-type-validation-COH4d78M.mjs.map +0 -1
  258. package/dist/index-types-CNhHgKHi.d.mts +0 -1
  259. package/dist/index-types-DJQ_xwaE.mjs +0 -40
  260. package/dist/index-types-DJQ_xwaE.mjs.map +0 -1
  261. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +0 -31
  262. package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +0 -1
  263. package/dist/middleware-DwaZ6s12.d.mts +0 -1
  264. package/dist/plan-Dhl03MtT.d.mts +0 -2
  265. package/dist/query-lane-context-BaoHpLsE.d.mts +0 -1
  266. package/dist/types-D6XuABFQ.d.mts +0 -1
  267. package/dist/types-DLjT0ADz.d.mts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derived-checks-CfXjGvNH-CrXoMrPU.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-CfXjGvNH.mjs"],"sourcesContent":["import { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { flushAuthoringWarnings, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { CheckConstraint, Index, SqlStorage, StorageTable, applyFkDefaults, checkConstraintInputFromSerialized, isMaterializedSqlNamespace, resolvedTypeParams, toStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, coreHash, crossRef, effectiveControlPolicy } from \"@internal/contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { codecForRef, enumRefusalOf } from \"@internal/framework-components/codec\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { lowerAuthoredCheck } from \"@internal/sql-contract/authored-check-naming\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { dataTypeParams, sqlDataTypeOfCodec, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { tableEntityKind, valueSetEntityKind } from \"@internal/sql-contract/entity-kinds\";\nimport { materializeForeignKeysAndIndexes } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { lowerAuthoredIndex } from \"@internal/sql-contract/index-naming\";\nimport { validateIndexTypes } from \"@internal/sql-contract/index-type-validation\";\nimport { indexTypeRegistryOf } from \"@internal/sql-contract/index-types\";\nimport { validateStorageSemantics } from \"@internal/sql-contract/validators\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\nimport { composeCheckWirePrefix, computeCheckContentHash, derivedCheckPrefixes } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/contract-definition.ts\n/**\n* Whether a field is stored in a list column. A list of scalars is; a list of value objects is not, because it is stored in one column whose value is the whole list, as one JSON array.\n*/\nfunction storedAsListColumn(field) {\n\treturn field.list && !field.typedByValueObject;\n}\n/** Whether a field or member is typed by a value object. */\nfunction isValueObjectMember(field) {\n\treturn \"valueObjectName\" in field;\n}\n//#endregion\n//#region src/to-one-nullability-message.ts\nfunction toOneNullabilityContradictionMessage(location, contradiction) {\n\treturn contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`;\n}\n//#endregion\n//#region src/build-contract.ts\n/**\n* The codec that encodes one column's default, built with the column's own `typeParams`, because a parameterized codec checks its params when it encodes and reads a default. Only a column has params; every other encode site takes the representative instance.\n*/\nfunction columnCodec(codecId, typeParams, codecLookup) {\n\treturn codecForRef(codecLookup, {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t});\n}\n/** Encodes a value the contract stores, and reads it back with the codec, which refuses a value its column would not hold. */\nfunction encodeViaCodec(value, codec) {\n\tif (codec) {\n\t\tconst json = codec.encodeJson(value);\n\t\tcodec.decodeJson(json);\n\t\treturn json;\n\t}\n\treturn blindCast(value);\n}\nfunction defaultRefusal(site, cause, elementPosition) {\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a ${subject} that its codec refuses: ${reason}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"codec-refused-default\",\n\t\t\t...ifDefined(\"elementPosition\", elementPosition)\n\t\t}\n\t});\n}\nfunction encodeDefaultValue(value, codec, site, elementPosition) {\n\ttry {\n\t\treturn encodeViaCodec(value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tthrow defaultRefusal(site, cause, elementPosition);\n\t}\n}\nfunction codecForDefault(codecLookup, resolveCodec, site) {\n\tconst codec = buildCodecForDefault(codecLookup, resolveCodec, site);\n\tif (codec === void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a default, but no pack in the contract declares its codec \"${site.codecId}\", so the default cannot be checked. List the pack that owns the codec in \\`extensions\\`.`, { meta: {\n\t\tmodelName: site.modelName,\n\t\tfieldName: site.fieldName,\n\t\tcodecId: site.codecId,\n\t\treason: \"codec-not-found\"\n\t} });\n\treturn codec;\n}\nfunction buildCodecForDefault(codecLookup, resolveCodec, site) {\n\ttry {\n\t\treturn resolveCodec(codecLookup);\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"RUNTIME.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its codec does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName,\n\t\t\t\tcodecId: site.codecId,\n\t\t\t\treason: \"type-params-invalid\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction encodeColumnDefault(defaultInput, codecLookup, resolveCodec, site, many = false, elementNullable = false) {\n\tif (defaultInput.kind === \"function\") return {\n\t\tkind: \"function\",\n\t\texpression: defaultInput.expression\n\t};\n\tif (\"canonical\" in defaultInput && defaultInput.canonical === true) return {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(defaultInput.value)\n\t};\n\tif (many) {\n\t\tif (!Array.isArray(defaultInput.value)) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" is a list field, so its default is an array; received ${typeof defaultInput.value}. Call .many() before .default().`, { meta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"list-default-not-array\"\n\t\t} });\n\t\tconst codec = codecForDefault(codecLookup, resolveCodec, site);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: defaultInput.value.map((element, index) => {\n\t\t\t\tif (element !== null) return encodeDefaultValue(element, codec, site, index + 1);\n\t\t\t\tif (elementNullable) return null;\n\t\t\t\tthrow new InternalError(\"Literal default on a strict list column cannot contain null elements.\");\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: encodeDefaultValue(defaultInput.value, codecForDefault(codecLookup, resolveCodec, site), site)\n\t};\n}\nfunction assertStorageSemantics(contract, indexTypeRegistry, codecLookup) {\n\tconst semanticErrors = validateStorageSemantics(contract.storage);\n\tif (semanticErrors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, { meta: { errors: semanticErrors } });\n\tvalidateIndexTypes(contract, indexTypeRegistry, (codecId) => codecLookup.descriptorFor(codecId)?.traits);\n}\nfunction assertKnownTargetModel(modelsByName, modelsByCoordinate, sourceModelName, targetModelName, targetNamespaceId, context) {\n\tconst targetModel = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? modelsByCoordinate.get(`${targetNamespaceId}:${targetModelName}`) : modelsByName.get(targetModelName);\n\tif (!targetModel) {\n\t\tconst qualified = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? `${targetNamespaceId}.${targetModelName}` : targetModelName;\n\t\tthrow contractError(\"CONTRACT.MODEL_UNKNOWN\", `${context} on model \"${sourceModelName}\" references unknown model \"${qualified}\"`, { meta: {\n\t\t\tsourceModel: sourceModelName,\n\t\t\ttargetModel: qualified,\n\t\t\tcontext\n\t\t} });\n\t}\n\treturn targetModel;\n}\nfunction assertTargetTableMatches(sourceModelName, targetModel, referencedTableName, context) {\n\tif (targetModel.tableName !== referencedTableName) throw contractError(\"CONTRACT.TABLE_MISMATCH\", `${context} on model \"${sourceModelName}\" references table \"${referencedTableName}\" but model \"${targetModel.modelName}\" maps to \"${targetModel.tableName}\"`, { meta: {\n\t\tsourceModel: sourceModelName,\n\t\treferencedTable: referencedTableName,\n\t\tmappedTable: targetModel.tableName,\n\t\tcontext\n\t} });\n}\n/**\n* Resolves a deferred entity-ref column descriptor (e.g. a `pg.enum(handle)`\n* column) against the field's now-known owning namespace: attaches the\n* storage `valueSet` ref the collected entity's derived value-set is stored\n* under. `typeParams.typeName` stays bare here — schema\n* qualification (e.g. `auth.aal_level`) is a target concern applied in the\n* next step, `qualifyColumnDescriptor`. A descriptor with no `entityRef` (the\n* ordinary case) passes through unchanged.\n*/\nfunction resolveEntityRefDescriptor(descriptor, namespaceId) {\n\tconst entityRef = descriptor.entityRef;\n\tif (entityRef === void 0) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\tvalueSet: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: entityRef.entityName\n\t\t}\n\t};\n}\n/**\n* Structural check for a target that contributes a `qualifyColumnType` hook\n* on its authoring contributions. Duck-typed (mirroring\n* `contract-psl`'s `hasColumnFromEntityHook`) so the SQL family stays blind\n* to the target's qualification logic and no framework/family interface has\n* to name the hook.\n*/\nfunction hasColumnTypeQualifier(authoring) {\n\treturn \"qualifyColumnType\" in authoring && typeof authoring.qualifyColumnType === \"function\";\n}\n/**\n* Structural check for a target that contributes a `renderCheckExpressions`\n* hook, duck-typed for the same reason {@link hasColumnTypeQualifier} is: the\n* SQL family stays blind to the target's predicate syntax.\n*/\nfunction hasCheckExpressionRenderer(authoring) {\n\treturn \"renderCheckExpressions\" in authoring && typeof authoring.renderCheckExpressions === \"function\";\n}\nfunction resolveCheckExpressionRenderer(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasCheckExpressionRenderer(authoring) ? authoring.renderCheckExpressions : void 0;\n}\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* Refuses a member whose codec reads its stored value back as a different value from the one written.\n* The contract's types name the member as written, while the runtime reads the stored value, so the\n* two must be the same value. A member with no literal type has nothing to contradict. The caller\n* has already read the stored value back once, so the codec takes it.\n*/\nfunction assertStoredAsWritten(enumName, member, stored, codec) {\n\tif (!hasLiteralType(member.value)) return;\n\tconst readBack = codec.decodeJson(stored);\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return;\n\tconst writeAs = hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored);\n\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${enumName}\"): member \"${member.name}\" is written ${canonicalStringify(member.value)}, but the column stores ${JSON.stringify(stored)}. Write the member as ${writeAs}.`, { meta: {\n\t\tenumName,\n\t\tmember: member.name,\n\t\treason: \"member-not-stored-as-written\"\n\t} });\n}\n/** A member's value in the form the enum's codec stores it. A member the codec refuses is a `CONTRACT.ENUM_INVALID` naming the enum and the member. */\nfunction encodeEnumMember(handle, member, codec) {\n\ttry {\n\t\treturn encodeViaCodec(member.value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\") member \"${member.name}\" has a value its codec ${handle.codecId} refuses: ${reason}`, {\n\t\t\tfix: \"Give the member a value the codec takes, or type the enum with a codec that takes it.\",\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tenumName: handle.enumName,\n\t\t\t\tmember: member.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\treason: \"codec-refused-member\"\n\t\t\t}\n\t\t});\n\t}\n}\n/**\n* Each member's value in the form the enum's codec stores it, read back by the codec. A codec an\n* enum cannot use, a member the codec refuses, a member written differently from how it is stored,\n* and two members that store the same value are each a `CONTRACT.ENUM_INVALID`.\n*/\nfunction encodeEnumMembers(handle, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(handle.codecId);\n\tconst enumRefusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (enumRefusal !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): an enum cannot use the codec ${handle.codecId}. ${enumRefusal}`, {\n\t\tfix: \"Type the enum with another codec.\",\n\t\tmeta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tcodecId: handle.codecId,\n\t\t\treason: \"codec-not-for-enums\"\n\t\t}\n\t});\n\tconst codec = codecLookup.get(handle.codecId);\n\tconst memberByStoredValue = /* @__PURE__ */ new Map();\n\treturn handle.enumMembers.map((member) => {\n\t\tconst value = encodeEnumMember(handle, member, codec);\n\t\tif (codec !== void 0) assertStoredAsWritten(handle.enumName, member, value, codec);\n\t\tconst key = canonicalStringify(value);\n\t\tconst earlier = memberByStoredValue.get(key);\n\t\tif (earlier !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): members \"${earlier}\" and \"${member.name}\" both store ${JSON.stringify(value)}. Member values must be unique as the column stores them.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tmembers: [earlier, member.name],\n\t\t\treason: \"duplicate-member-value\"\n\t\t} });\n\t\tmemberByStoredValue.set(key, member.name);\n\t\treturn {\n\t\t\tname: member.name,\n\t\t\tvalue\n\t\t};\n\t});\n}\n/**\n* The member values a membership check must enforce, encoded exactly as the\n* column stores them. Membership predicates support strings and finite numbers.\n*/\nfunction checkMemberValues(handle, codecLookup) {\n\tconst encoded = encodeEnumMembers(handle, codecLookup).map((member) => member.value);\n\tconst values = [];\n\tfor (const value of encoded) {\n\t\tif (typeof value !== \"string\" && !(typeof value === \"number\" && Number.isFinite(value))) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): CHECK constraint members must encode to strings or finite numbers.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\treason: \"unsupported-member-value\"\n\t\t} });\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\n/**\n* Resolves a field's authored `noCheck` kinds against its column shape:\n* the bare form (`[]`) becomes every kind the shape derives, and a named\n* kind that can never apply to the shape is an authoring error\n* (`CONTRACT.CHECK_OPTOUT_INVALID`). Returns the concrete kinds in\n* canonical ascending order — the only form the contract persists.\n*/\nfunction resolveNoCheckKinds(input) {\n\tconst derivable = [];\n\tif (input.many && !input.elementNullable) derivable.push(\"elementNotNull\");\n\tif (input.isDomainEnum) derivable.push(\"membership\");\n\tconst subject = `Field \"${input.modelName}.${input.fieldName}\"`;\n\tconst meta = {\n\t\tmodelName: input.modelName,\n\t\tfieldName: input.fieldName\n\t};\n\tif (input.kinds.length === 0) {\n\t\tif (derivable.length === 0) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck() waives nothing — this column's shape derives no generated checks.`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"no-derivable-checks\"\n\t\t} });\n\t\treturn derivable;\n\t}\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const kind of input.kinds) {\n\t\tif (seen.has(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") names the same kind twice.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"duplicate-kind\"\n\t\t} });\n\t\tseen.add(kind);\n\t\tif (!derivable.includes(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") does not apply — ${kind === \"membership\" ? \"membership checks are derived only from enumType() value sets\" : \"element-non-null checks are derived only for lists whose elements are semantically non-null\"}.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"inapplicable-kind\"\n\t\t} });\n\t}\n\treturn [...input.kinds].sort();\n}\n/**\n* Names the target's rendered checks and lowers them into contract entities.\n*\n* Naming is composed family-side ({@link composeCheckWirePrefix}) rather than\n* by the target, and suffixed with the predicate's content hash. Composing\n* family-side is what makes the truncation safe — two prefixes that truncate\n* alike still differ in their hashes, and the family can see that the\n* (table, column, kind) triple they were built from is unique per table,\n* rather than having to assume something about SQL text it declares itself\n* unable to read.\n*/\nfunction lowerRenderedChecks(tableName, candidates) {\n\treturn candidates.map((candidate) => new CheckConstraint({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: composeCheckWirePrefix(tableName, candidate.columnName, candidate.kind),\n\t\t\thash: computeCheckContentHash(candidate.expression)\n\t\t},\n\t\texpression: candidate.expression\n\t}));\n}\nfunction resolveColumnTypeQualifier(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasColumnTypeQualifier(authoring) ? authoring.qualifyColumnType : void 0;\n}\n/**\n* Applies the target's `qualifyColumnType` hook to a scalar column descriptor.\n* A descriptor whose codec the target leaves unchanged passes through untouched.\n*/\nfunction qualifyColumnDescriptor(descriptor, namespaceId, qualify) {\n\tif (qualify === void 0) return descriptor;\n\tconst qualified = qualify({\n\t\tcodecId: descriptor.codecId,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams)\n\t}, namespaceId);\n\tif (qualified.typeParams === descriptor.typeParams) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\t...ifDefined(\"typeParams\", qualified.typeParams)\n\t};\n}\n/**\n* Records a deferred column's entity-ref into the namespace-scoped collection\n* accumulator (`namespaceId → entityKind → entityName`) — folded into the same\n* namespace assembly `deriveEntityValueSets`/`entries.<kind>` step as the\n* entities-channel attachments, so a column-collected entity gets its\n* value-set the same way an entities-channel one does.\n*\n* The same handle reused by many columns in one namespace is normal (a native\n* enum type backs any number of columns) and records the identical entity once.\n* Two *different* entity instances sharing a name+kind in one namespace is a\n* name collision — the emitted `entries.valueSet.<name>` could only reflect one\n* of them, silently mismatching the other column's type/cast. PSL hard-errors\n* on the equivalent (`PSL_DUPLICATE_DECLARATION`); the TS path rejects it too.\n*/\nfunction collectEntityFromColumn(collected, namespaceId, entityRef) {\n\tconst forNs = collected[namespaceId] ?? {};\n\tconst forKind = forNs[entityRef.entityKind] ?? {};\n\tconst existing = forKind[entityRef.entityName];\n\tif (existing !== void 0 && existing !== entityRef.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${entityRef.entityKind}\" entities named \"${entityRef.entityName}\" in namespace \"${namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\tkind: entityRef.entityKind,\n\t\tname: entityRef.entityName,\n\t\tnamespaceId\n\t} });\n\tforKind[entityRef.entityName] = entityRef.entity;\n\tforNs[entityRef.entityKind] = forKind;\n\tcollected[namespaceId] = forNs;\n}\n/**\n* Merges a namespace's entities-channel attachments (lowered from the\n* `entities` handle list, carried on `ContractDefinition.attachedEntities`)\n* with the entities collected from that namespace's deferred entity-ref\n* columns. A column-collected entity that shadows a *different* attached\n* entity of the same kind+name (or vice-versa) is the same name-collision bug\n* `collectEntityFromColumn` guards against across columns, so it is rejected\n* the same way — by entity identity, so the same handle attached and used by\n* a column does not throw.\n*/\nfunction mergeColumnAndAttachedEntities(namespaceId, attached, columnCollected) {\n\tif (attached === void 0) return columnCollected;\n\tif (columnCollected === void 0) return attached;\n\tconst kinds = /* @__PURE__ */ new Set([...Object.keys(attached), ...Object.keys(columnCollected)]);\n\tconst result = {};\n\tfor (const kind of kinds) {\n\t\tconst attachedForKind = attached[kind];\n\t\tconst columnForKind = columnCollected[kind];\n\t\tfor (const [name, entity] of Object.entries(columnForKind ?? {})) {\n\t\t\tconst existing = attachedForKind?.[name];\n\t\t\tif (existing !== void 0 && existing !== entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${kind}\" entities named \"${name}\" in namespace \"${namespaceId}\" — a column-referenced entity conflicts with an attached one; pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t}\n\t\tresult[kind] = {\n\t\t\t...attachedForKind,\n\t\t\t...columnForKind\n\t\t};\n\t}\n\treturn result;\n}\nfunction resolveModelNamespaceId(model, modelNameToNamespaceId, defaultNamespaceId) {\n\tif (model.namespaceId !== void 0 && model.namespaceId.length > 0) return model.namespaceId;\n\treturn modelNameToNamespaceId.get(model.modelName) ?? defaultNamespaceId;\n}\nfunction toOneRelationNullable(semanticModel, relation) {\n\tconst location = `Relation \"${semanticModel.modelName}.${relation.fieldName}\"`;\n\tif (relation.nullable === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} with cardinality \"${relation.cardinality}\" must state whether it is nullable`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-missing\"\n\t} });\n\tconst localColumns = relation.on.parentColumns;\n\tconst { contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: semanticModel.fields.filter((field) => localColumns.includes(field.columnName)).map((field) => field.nullable),\n\t\townsReference: relation.cardinality === \"N:1\"\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", relation.cardinality === \"N:1\" ? toOneNullabilityContradictionMessage(location, contradiction) : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn relation.nullable;\n}\nfunction buildThroughDescriptor(through, tableNamespaceByName, targetModel, modelName, fieldName, defaultNamespaceId) {\n\tif (!tableNamespaceByName.has(through.table)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `buildSqlContractFromDefinition: junction table \"${through.table}\" for relation \"${modelName}.${fieldName}\" is not a declared model.`, { meta: {\n\t\tsourceModel: modelName,\n\t\trelationName: fieldName,\n\t\tjunctionTable: through.table\n\t} });\n\tconst namespaceId = through.namespaceId ?? defaultNamespaceId;\n\treturn {\n\t\ttable: through.table,\n\t\tnamespaceId,\n\t\tparentColumns: through.parentColumns,\n\t\tchildColumns: through.childColumns,\n\t\ttargetColumns: targetColumnsForJunction(targetModel, fieldName)\n\t};\n}\nfunction targetColumnsForJunction(targetModel, fieldName) {\n\tconst primaryKeyColumns = targetModel.id?.columns;\n\tif (primaryKeyColumns && primaryKeyColumns.length > 0) return primaryKeyColumns;\n\tconst firstUnique = targetModel.uniques?.find((u) => u.columns.length > 0);\n\tif (firstUnique) return firstUnique.columns;\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `M:N target model \"${targetModel.modelName}\" (relation field \"${fieldName}\") has no primary id or unique key to derive junction targetColumns.`, { meta: {\n\t\tmodelName: targetModel.modelName,\n\t\treason: \"no-key-for-junction-target-columns\"\n\t} });\n}\nfunction validateColumnTypeParams(dataType, typeParams, site) {\n\ttry {\n\t\tvalidateSqlTypeParams(dataType, dataTypeParams(dataType, typeParams));\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its data type does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName\n\t\t\t}\n\t\t});\n\t}\n}\nfunction buildStorageColumn(field, enumRefs, modelName, storageTypes, lookups) {\n\tconst { codecLookup } = lookups;\n\tconst { descriptor } = field;\n\tconst codecId = descriptor.codecId;\n\tconst isListColumn = storedAsListColumn({\n\t\tlist: field.many === true,\n\t\ttypedByValueObject: isValueObjectMember(field)\n\t});\n\tconst noCheck = isValueObjectMember(field) ? void 0 : field.noCheck;\n\tconst typeParams = resolvedTypeParams(descriptor, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(codecId, lookups);\n\tvalidateColumnTypeParams(dataType, typeParams, {\n\t\tmodelName,\n\t\tfieldName: field.fieldName\n\t});\n\tconst encodedDefault = field.default !== void 0 ? encodeColumnDefault(field.default, codecLookup, (lookup) => columnCodec(codecId, typeParams, lookup), {\n\t\tmodelName,\n\t\tfieldName: field.fieldName,\n\t\tcodecId\n\t}, isListColumn, field.elementNullable === true) : void 0;\n\tinvariant(enumRefs === void 0 || descriptor.valueSet === void 0, `Field \"${modelName}.${field.fieldName}\" is typed by a domain enum and also carries a storage value set from its type constructor.`);\n\tconst valueSet = enumRefs?.storage ?? descriptor.valueSet;\n\treturn {\n\t\tdataType: dataType.id,\n\t\tcodecId,\n\t\tnullable: field.nullable,\n\t\tmany: isListColumn ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"noCheck\", noCheck && [...noCheck].sort()),\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams),\n\t\t...ifDefined(\"default\", encodedDefault),\n\t\t...ifDefined(\"typeRef\", descriptor.typeRef),\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n}\n/**\n* The refs of a field typed by an authored enum: the domain enum and its storage value set. Authored enums are registered in the default namespace, whatever namespace the field's model is in.\n*/\nfunction enumValueSetRefs(enumHandle, defaultNamespaceId) {\n\tif (enumHandle === void 0) return void 0;\n\tconst common = {\n\t\tnamespaceId: defaultNamespaceId,\n\t\tentityName: enumHandle.enumName\n\t};\n\treturn {\n\t\tdomain: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\t...common\n\t\t},\n\t\tstorage: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\t...common\n\t\t}\n\t};\n}\nfunction buildDomainField(field, defaultNamespaceId, storageTypes) {\n\tif (isValueObjectMember(field)) return {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: field.valueObjectName\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false\n\t};\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: field.descriptor.codecId,\n\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(field.descriptor, storageTypes))\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"valueSet\", enumValueSetRefs(field.enumTypeHandle, defaultNamespaceId)?.domain)\n\t};\n}\nfunction collectStorageNamespaceCoordinateIds(definition) {\n\tconst ids = /* @__PURE__ */ new Set();\n\tids.add(definition.target.defaultNamespaceId);\n\tfor (const id of definition.namespaces ?? []) if (id.length > 0) ids.add(id);\n\tfor (const model of definition.models) if (model.namespaceId !== void 0 && model.namespaceId.length > 0) ids.add(model.namespaceId);\n\tfor (const id of Object.keys(definition.attachedEntities ?? {})) if (id.length > 0) ids.add(id);\n\treturn ids;\n}\n/**\n* Entry kinds the framework assembler itself manages (`table` from models,\n* `valueSet` from `enums` and attached-entity value-set derivation). A\n* pack-attached entity claiming one of these would silently clobber or be\n* clobbered by the managed slot, so it is rejected outright.\n*/\nconst MANAGED_ENTRY_KINDS = /* @__PURE__ */ new Set([tableEntityKind.kind, valueSetEntityKind.kind]);\nfunction assertNoManagedEntityKinds(namespaceId, entitiesForNs) {\n\tif (entitiesForNs === void 0) return;\n\tfor (const kind of Object.keys(entitiesForNs)) if (MANAGED_ENTRY_KINDS.has(kind)) throw contractError(\"CONTRACT.ENTITY_KIND_INVALID\", `buildSqlContractFromDefinition: attached entity in namespace \"${namespaceId}\" declares entry kind \"${kind}\", which is managed by the framework (table/valueSet) and cannot be attached.`, { meta: {\n\t\tentityKind: kind,\n\t\tnamespaceId\n\t} });\n}\n/**\n* Walks the flat `entityTypes` namespace tree contributed by the target pack\n* and every extension pack, indexing descriptors by their `discriminator` —\n* the same string a pack entity's entries-map key (`entries.<kind>`) uses.\n* Mirrors `contract-psl`'s `buildEntityTypesByDiscriminator`, recomposed here\n* from the packs `ContractDefinition` already carries (`target` +\n* `extensions`) since the TS assembler has no single pre-merged\n* `AuthoringContributions` input to read the way the PSL interpreter does.\n*/\nfunction collectEntityTypeDescriptorsByDiscriminator(definition) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst walk = (namespace) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse walk(value);\n\t};\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walk(entityTypes);\n\t}\n\treturn result;\n}\n/**\n* Derives value-sets for every pack entity declared in one namespace,\n* reusing the same `SqlValueSetDerivingEntityTypeOutput.deriveValueSet` hook\n* `contract-psl`'s `lowerExtensionBlocksForNamespace` folds into\n* `entries.valueSet` on the PSL path — so a TS-attached entity (e.g. a\n* native enum) gets its value-set the same way. Entity kinds with no\n* registered descriptor, or whose descriptor output doesn't derive a\n* value-set, contribute nothing.\n*/\nfunction deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator) {\n\tif (entitiesForNs === void 0) return void 0;\n\tlet result;\n\tfor (const [kind, entitiesByName] of Object.entries(entitiesForNs)) {\n\t\tconst descriptor = entityTypesByDiscriminator.get(kind);\n\t\tif (descriptor === void 0) continue;\n\t\tfor (const [name, entity] of Object.entries(entitiesByName)) {\n\t\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\t\tif (derivedValueSet === void 0) continue;\n\t\t\tresult ??= {};\n\t\t\tresult[name] = derivedValueSet;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Merges a namespace's `enumType()`-derived value-sets with its pack-entity-\n* derived value-sets. Both land in the same `entries.valueSet[name]` slot —\n* which drives value-set → codec typing and the domain-enum CHECK — so a\n* same-named entry in both would let one silently overwrite the other and\n* corrupt whichever column resolves against it. The same collision class the\n* `mergeColumnAndAttachedEntities` guard rejects; the PSL path already hard-errors\n* on the equivalent (`interpretPslDocumentToSqlContract`). Reject it here too.\n*/\nfunction mergeNamespaceValueSets(namespaceId, enumValueSets, packValueSets) {\n\tif (enumValueSets !== void 0 && packValueSets !== void 0) {\n\t\tfor (const name of Object.keys(packValueSets)) if (Object.hasOwn(enumValueSets, name)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: value-set \"${name}\" in namespace \"${namespaceId}\" is derived from both an enum and a pack entity — names must be unique per namespace.`, { meta: {\n\t\t\tkind: \"valueSet\",\n\t\t\tname,\n\t\t\tnamespaceId\n\t\t} });\n\t}\n\treturn {\n\t\t...enumValueSets,\n\t\t...packValueSets\n\t};\n}\nfunction ensureUnboundNamespaceSlot(namespaces, createNamespace) {\n\tif (Object.hasOwn(namespaces, UNBOUND_NAMESPACE_ID)) return namespaces;\n\tconst unbound = createNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: { table: {} }\n\t});\n\treturn {\n\t\t[UNBOUND_NAMESPACE_ID]: unbound,\n\t\t...namespaces\n\t};\n}\nconst DERIVABLE_CHECK_KINDS = [\"membership\", \"elementNotNull\"];\n/**\n* Which of `columnNames` could have produced `prefix` for some\n* {@link CheckKind} — the reverse of {@link derivedCheckPrefixes}, used only\n* to name the collision in `CONTRACT.CHECK_NAME_RESERVED`'s message. Callers\n* already know `prefix` is a member of `derivedCheckPrefixes(tableName,\n* columnNames)`, so the result is never empty.\n*/\nfunction columnsProducingCheckPrefix(tableName, columnNames, prefix) {\n\treturn columnNames.filter((columnName) => DERIVABLE_CHECK_KINDS.some((kind) => composeCheckWirePrefix(tableName, columnName, kind) === prefix));\n}\nfunction buildSqlContractFromDefinition(definition, codecLookup, dataTypeLookup) {\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup\n\t};\n\tconst target = definition.target.targetId;\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst indexTypeRegistry = indexTypeRegistryOf(definition.target, Object.values(definition.extensions ?? {}));\n\tconst qualifyColumnType = resolveColumnTypeQualifier(definition.target);\n\tconst renderCheckExpressions = resolveCheckExpressionRenderer(definition.target);\n\tconst targetFamily = \"sql\";\n\tconst resolveNamespaceId = (m) => m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId;\n\tconst modelsByName = new Map(definition.models.map((m) => [m.modelName, m]));\n\tconst tableNamespaceByName = new Map(definition.models.map((m) => [m.tableName, m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId]));\n\tconst modelsByCoordinate = new Map(definition.models.map((m) => [`${resolveNamespaceId(m)}:${m.modelName}`, m]));\n\tconst tablesByNamespace = {};\n\tconst authoringWarnings = [...definition.warnings ?? []];\n\tconst modelNameToNamespaceId = /* @__PURE__ */ new Map();\n\tconst executionDefaults = [];\n\tconst modelsByNamespace = {};\n\tconst collectedColumnEntities = {};\n\tconst rootEntries = [];\n\tfor (const semanticModel of definition.models) {\n\t\tconst tableName = semanticModel.tableName;\n\t\tconst namespaceId = semanticModel.namespaceId !== void 0 && semanticModel.namespaceId.length > 0 ? semanticModel.namespaceId : defaultNamespaceId;\n\t\tmodelNameToNamespaceId.set(semanticModel.modelName, namespaceId);\n\t\tif (!semanticModel.sharesBaseTable) rootEntries.push({\n\t\t\ttableName,\n\t\t\tnamespaceId,\n\t\t\tref: crossRef(semanticModel.modelName, namespaceId)\n\t\t});\n\t\tconst columns = {};\n\t\tconst fieldToColumn = {};\n\t\tconst domainFields = {};\n\t\tconst checksForTable = [];\n\t\tconst derivesChecks = effectiveControlPolicy(semanticModel.control, definition.defaultControlPolicy) === \"managed\";\n\t\tfor (const field of semanticModel.fields) {\n\t\t\tconst executionDefaultPhases = field.executionDefaults?.onCreate || field.executionDefaults?.onUpdate ? field.executionDefaults : void 0;\n\t\t\tif (executionDefaultPhases) {\n\t\t\t\tif (field.default !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" cannot define both default and executionDefaults.`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"default-and-executionDefaults\"\n\t\t\t\t} });\n\t\t\t\tif (field.nullable) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" is filled on write by a generated default (a preset such as temporal.createdAt() or an id generator), so it cannot be optional; remove .optional().`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"nullable-with-executionDefaults\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tconst enumHandle = !isValueObjectMember(field) ? field.enumTypeHandle : void 0;\n\t\t\tlet resolvedField = field;\n\t\t\tif (!isValueObjectMember(field)) {\n\t\t\t\tlet descriptor = field.descriptor;\n\t\t\t\tconst entityRef = descriptor.entityRef;\n\t\t\t\tif (entityRef !== void 0) {\n\t\t\t\t\tcollectEntityFromColumn(collectedColumnEntities, namespaceId, entityRef);\n\t\t\t\t\tdescriptor = resolveEntityRefDescriptor(descriptor, namespaceId);\n\t\t\t\t}\n\t\t\t\tdescriptor = qualifyColumnDescriptor(descriptor, namespaceId, qualifyColumnType);\n\t\t\t\tif (descriptor !== field.descriptor) resolvedField = {\n\t\t\t\t\t...field,\n\t\t\t\t\tdescriptor\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!isValueObjectMember(resolvedField) && resolvedField.noCheck !== void 0) {\n\t\t\t\tconst { noCheck: authoredNoCheck, ...withoutNoCheck } = resolvedField;\n\t\t\t\tresolvedField = derivesChecks ? {\n\t\t\t\t\t...withoutNoCheck,\n\t\t\t\t\tnoCheck: resolveNoCheckKinds({\n\t\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\t\tkinds: authoredNoCheck,\n\t\t\t\t\t\tmany: resolvedField.many === true,\n\t\t\t\t\t\telementNullable: resolvedField.elementNullable === true,\n\t\t\t\t\t\tisDomainEnum: enumHandle !== void 0\n\t\t\t\t\t})\n\t\t\t\t} : withoutNoCheck;\n\t\t\t}\n\t\t\tconst column = buildStorageColumn(resolvedField, enumValueSetRefs(enumHandle, defaultNamespaceId), semanticModel.modelName, definition.storageTypes ?? {}, lookups);\n\t\t\tconst columnMany = column.many ?? false;\n\t\t\tcolumns[field.columnName] = column;\n\t\t\tfieldToColumn[field.fieldName] = field.columnName;\n\t\t\tif (renderCheckExpressions !== void 0 && derivesChecks) {\n\t\t\t\tconst waivedKinds = !isValueObjectMember(resolvedField) ? resolvedField.noCheck : void 0;\n\t\t\t\tchecksForTable.push(...lowerRenderedChecks(tableName, renderCheckExpressions({\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumnName: field.columnName,\n\t\t\t\t\tmany: columnMany !== false,\n\t\t\t\t\telementNullable: columnMany !== false && columnMany.elementNullable,\n\t\t\t\t\tmemberValues: enumHandle !== void 0 ? checkMemberValues(enumHandle, codecLookup) : void 0\n\t\t\t\t}).filter((candidate) => !(waivedKinds?.includes(candidate.kind) ?? false))));\n\t\t\t}\n\t\t\tdomainFields[field.fieldName] = buildDomainField(resolvedField, defaultNamespaceId, definition.storageTypes ?? {});\n\t\t\tif (executionDefaultPhases) executionDefaults.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: namespaceId,\n\t\t\t\t\tentry: tableName,\n\t\t\t\t\tfield: field.columnName\n\t\t\t\t},\n\t\t\t\t...ifDefined(\"onCreate\", executionDefaultPhases.onCreate),\n\t\t\t\t...ifDefined(\"onUpdate\", executionDefaultPhases.onUpdate)\n\t\t\t});\n\t\t}\n\t\tconst authoringForeignKeys = (semanticModel.foreignKeys ?? []).map((fk) => {\n\t\t\tif (fk.references.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? defaultNamespaceId;\n\t\t\t\treturn {\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\t\ttableName,\n\t\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t\t},\n\t\t\t\t\ttarget: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\t\tcolumns: fk.references.columns,\n\t\t\t\t\t\tspaceId: fk.references.spaceId\n\t\t\t\t\t},\n\t\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, fk.references.model, fk.references.namespaceId, \"Foreign key\");\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, fk.references.table, \"Foreign key\");\n\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? (targetModel.namespaceId !== void 0 && targetModel.namespaceId.length > 0 ? targetModel.namespaceId : defaultNamespaceId);\n\t\t\treturn {\n\t\t\t\tsource: {\n\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\tcolumns: fk.references.columns\n\t\t\t\t},\n\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t};\n\t\t});\n\t\tif (semanticModel.sharesBaseTable && semanticModel.checks && semanticModel.checks.length > 0) throw contractError(\"CONTRACT.CHECK_ON_STI_VARIANT\", `Model \"${semanticModel.modelName}\" declares a check constraint but shares its base model's storage table (single-table inheritance) and has no table of its own to declare it on. Declare the check on the base model instead.`, { meta: {\n\t\t\ttableName,\n\t\t\tmodelName: semanticModel.modelName\n\t\t} });\n\t\tif (!semanticModel.sharesBaseTable) {\n\t\t\tconst uniques = (semanticModel.uniques ?? []).map((u) => ({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name)\n\t\t\t}));\n\t\t\tconst declaredIndexes = (semanticModel.indexes ?? []).map((i) => ({\n\t\t\t\tnamedByUser: i.name !== void 0 || i.map !== void 0,\n\t\t\t\tindex: lowerAuthoredIndex(tableName, blindCast({\n\t\t\t\t\t...ifDefined(\"columns\", i.columns),\n\t\t\t\t\t...ifDefined(\"expression\", i.expression),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tmap: i.map,\n\t\t\t\t\tname: i.name,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options\n\t\t\t\t}), authoringWarnings, indexTypeRegistry)\n\t\t\t}));\n\t\t\tif (semanticModel.checks !== void 0 && semanticModel.checks.length > 0) {\n\t\t\t\tconst tableColumnNames = Object.keys(columns);\n\t\t\t\tconst reservedCheckPrefixes = derivedCheckPrefixes(tableName, tableColumnNames);\n\t\t\t\tfor (const authoredCheck of semanticModel.checks) {\n\t\t\t\t\tconst lowered = lowerAuthoredCheck(tableName, authoredCheck, authoringWarnings);\n\t\t\t\t\tif (lowered.naming.kind === \"wire\" && reservedCheckPrefixes.has(lowered.naming.prefix)) {\n\t\t\t\t\t\tconst collidingColumns = columnsProducingCheckPrefix(tableName, tableColumnNames, lowered.naming.prefix);\n\t\t\t\t\t\tconst columnList = collidingColumns.map((name) => `\"${name}\"`).join(\", \");\n\t\t\t\t\t\tthrow contractError(\"CONTRACT.CHECK_NAME_RESERVED\", `Check \"${lowered.naming.prefix}\" on table \"${tableName}\": this name's prefix matches the shape a derived enforcement check would use for column${collidingColumns.length === 1 ? \"\" : \"s\"} ${columnList} of this table, so it can't be told apart from one. Choose a different name.`, { meta: {\n\t\t\t\t\t\t\ttableName,\n\t\t\t\t\t\t\tprefix: lowered.naming.prefix,\n\t\t\t\t\t\t\tcollidingColumns\n\t\t\t\t\t\t} });\n\t\t\t\t\t}\n\t\t\t\t\tchecksForTable.push(new CheckConstraint(lowered));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst primaryKey = semanticModel.id ? {\n\t\t\t\tcolumns: semanticModel.id.columns,\n\t\t\t\t...ifDefined(\"name\", semanticModel.id.name)\n\t\t\t} : void 0;\n\t\t\tconst { foreignKeys, indexes } = materializeForeignKeysAndIndexes({\n\t\t\t\ttableName,\n\t\t\t\tforeignKeys: authoringForeignKeys,\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\twarnings: authoringWarnings,\n\t\t\t\tindexTypes: indexTypeRegistry\n\t\t\t});\n\t\t\tconst tableInput = {\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"control\", semanticModel.control),\n\t\t\t\tuniques,\n\t\t\t\tindexes: indexes.map((i) => new Index(i)),\n\t\t\t\tforeignKeys,\n\t\t\t\t...primaryKey ? { primaryKey } : {},\n\t\t\t\t...checksForTable.length > 0 ? { checks: checksForTable } : {}\n\t\t\t};\n\t\t\tlet nsTables = tablesByNamespace[namespaceId];\n\t\t\tif (nsTables === void 0) {\n\t\t\t\tnsTables = {};\n\t\t\t\ttablesByNamespace[namespaceId] = nsTables;\n\t\t\t}\n\t\t\tif (nsTables[tableName] !== void 0) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: duplicate table \"${tableName}\" in namespace \"${namespaceId}\".`, { meta: {\n\t\t\t\tkind: \"table\",\n\t\t\t\tname: tableName,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t\tnsTables[tableName] = tableInput;\n\t\t}\n\t\tconst storageFields = {};\n\t\tfor (const [fieldName, columnName] of Object.entries(fieldToColumn)) storageFields[fieldName] = { column: columnName };\n\t\tconst columnToField = new Map(Object.entries(fieldToColumn).map(([field, col]) => [col, field]));\n\t\tconst modelRelations = {};\n\t\tfor (const relation of semanticModel.relations ?? []) {\n\t\t\tif (relation.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = relation.namespaceId ?? defaultNamespaceId;\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto: crossRef(relation.toModel, targetNamespaceId, relation.spaceId),\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\t\t\ttargetFields: relation.on.childColumns\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, relation.toModel, relation.toNamespaceId, \"Relation\");\n\t\t\tinvariant(relation.toTable !== void 0, `Relation \"${semanticModel.modelName}.${relation.fieldName}\" is local but carries no target table; only cross-space relations may leave it unset.`);\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, relation.toTable, \"Relation\");\n\t\t\tconst targetColumnToField = new Map(targetModel.fields.map((f) => [f.columnName, f.fieldName]));\n\t\t\tconst to = crossRef(relation.toModel, relation.toNamespaceId !== void 0 && relation.toNamespaceId.length > 0 ? relation.toNamespaceId : resolveModelNamespaceId(targetModel, modelNameToNamespaceId, defaultNamespaceId));\n\t\t\tconst on = {\n\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\ttargetFields: relation.on.childColumns.map((col) => targetColumnToField.get(col) ?? col)\n\t\t\t};\n\t\t\tif (relation.cardinality === \"N:M\") {\n\t\t\t\tif (!relation.through) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${semanticModel.modelName}.${relation.fieldName}\" with cardinality \"N:M\" requires through metadata`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\trelationName: relation.fieldName,\n\t\t\t\t\treason: \"many-to-many-missing-through\"\n\t\t\t\t} });\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto,\n\t\t\t\t\tcardinality: \"N:M\",\n\t\t\t\t\ton,\n\t\t\t\t\tthrough: buildThroughDescriptor(relation.through, tableNamespaceByName, targetModel, semanticModel.modelName, relation.fieldName, defaultNamespaceId)\n\t\t\t\t};\n\t\t\t} else if (relation.cardinality === \"1:N\") modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: \"1:N\",\n\t\t\t\ton\n\t\t\t};\n\t\t\telse modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: relation.cardinality,\n\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\ton\n\t\t\t};\n\t\t}\n\t\tlet namespaceModels = modelsByNamespace[namespaceId];\n\t\tif (namespaceModels === void 0) {\n\t\t\tnamespaceModels = {};\n\t\t\tmodelsByNamespace[namespaceId] = namespaceModels;\n\t\t}\n\t\tnamespaceModels[semanticModel.modelName] = {\n\t\t\tstorage: {\n\t\t\t\ttable: tableName,\n\t\t\t\tnamespaceId,\n\t\t\t\tfields: storageFields\n\t\t\t},\n\t\t\tfields: domainFields,\n\t\t\trelations: modelRelations\n\t\t};\n\t}\n\tconst rootTableNameCounts = /* @__PURE__ */ new Map();\n\tfor (const entry of rootEntries) rootTableNameCounts.set(entry.tableName, (rootTableNameCounts.get(entry.tableName) ?? 0) + 1);\n\tconst roots = {};\n\tfor (const entry of rootEntries) {\n\t\tconst key = (rootTableNameCounts.get(entry.tableName) ?? 0) > 1 ? `${entry.namespaceId}.${entry.tableName}` : entry.tableName;\n\t\troots[key] = entry.ref;\n\t}\n\tconst rawStorageTypes = definition.storageTypes ?? {};\n\tconst documentTypes = Object.fromEntries(Object.entries(rawStorageTypes).map(([name, entry]) => [name, toStorageTypeInstance({\n\t\tcodecId: entry.codecId,\n\t\tdataType: sqlDataTypeOfCodec(entry.codecId, lookups).id,\n\t\ttypeParams: entry.typeParams\n\t})]));\n\tconst namespaceCoordinateIds = collectStorageNamespaceCoordinateIds(definition);\n\tconst domainEnumsByNs = {};\n\tconst storageValueSetsByNs = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclarationKey: enumName,\n\t\t\treason: \"key-name-mismatch\"\n\t\t} });\n\t\tconst nsId = defaultNamespaceId;\n\t\tlet domainSlot = domainEnumsByNs[nsId];\n\t\tif (domainSlot === void 0) {\n\t\t\tdomainSlot = {};\n\t\t\tdomainEnumsByNs[nsId] = domainSlot;\n\t\t}\n\t\tconst storedMembers = encodeEnumMembers(handle, codecLookup);\n\t\tdomainSlot[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: storedMembers\n\t\t};\n\t\tlet storageSlot = storageValueSetsByNs[nsId];\n\t\tif (storageSlot === void 0) {\n\t\t\tstorageSlot = {};\n\t\t\tstorageValueSetsByNs[nsId] = storageSlot;\n\t\t}\n\t\tstorageSlot[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: storedMembers.map((member) => member.value)\n\t\t};\n\t}\n\tconst { createNamespace } = definition;\n\tconst entityTypesByDiscriminator = collectEntityTypeDescriptorsByDiscriminator(definition);\n\tconst namespaces = Object.fromEntries([...namespaceCoordinateIds].sort().map((id) => {\n\t\tconst entitiesForNs = mergeColumnAndAttachedEntities(id, definition.attachedEntities?.[id], collectedColumnEntities[id]);\n\t\tassertNoManagedEntityKinds(id, entitiesForNs);\n\t\tconst enumValueSetEntries = storageValueSetsByNs[id];\n\t\tconst packValueSetEntries = deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator);\n\t\tconst valueSetEntries = enumValueSetEntries !== void 0 || packValueSetEntries !== void 0 ? mergeNamespaceValueSets(id, enumValueSetEntries, packValueSetEntries) : void 0;\n\t\tconst nsInput = {\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\ttable: tablesByNamespace[id] ?? {},\n\t\t\t\t...entitiesForNs,\n\t\t\t\t...valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0 ? { valueSet: valueSetEntries } : {}\n\t\t\t}\n\t\t};\n\t\treturn [id, createNamespace(nsInput)];\n\t}));\n\tconst storageWithoutHash = {\n\t\t...Object.keys(documentTypes).length > 0 ? { types: documentTypes } : {},\n\t\tnamespaces: defaultNamespaceId === UNBOUND_NAMESPACE_ID ? ensureUnboundNamespaceSlot(namespaces, createNamespace) : namespaces\n\t};\n\tconst storageHash = definition.storageHash ? coreHash(definition.storageHash) : computeStorageHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tstorage: blindCast(storageWithoutHash),\n\t\t...sqlContractCanonicalizationHooks\n\t});\n\tconst storage = new SqlStorage({\n\t\t...storageWithoutHash,\n\t\tstorageHash\n\t});\n\tconst extensionNamespaces = definition.extensions ? Object.values(definition.extensions).map((pack) => pack.id) : void 0;\n\tconst extensions = { ...definition.extensions || {} };\n\tif (extensionNamespaces) {\n\t\tfor (const namespace of extensionNamespaces) if (!Object.hasOwn(extensions, namespace)) extensions[namespace] = {};\n\t}\n\tconst capabilities = mergeCapabilityMatrices({}, [definition.target, ...Object.values(definition.extensions ?? {})]);\n\tconst profileHash = computeProfileHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tcapabilities: {}\n\t});\n\tconst executionWithHash = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: executionDefaults\n\t});\n\tconst valueObjects = definition.valueObjects && definition.valueObjects.length > 0 ? Object.fromEntries(definition.valueObjects.map((vo) => [vo.name, { fields: Object.fromEntries(vo.fields.map((f) => [f.fieldName, buildDomainField(f, defaultNamespaceId, definition.storageTypes ?? {})])) }])) : void 0;\n\tconst domainNamespaceIds = new Set(Object.keys(modelsByNamespace));\n\tif (domainNamespaceIds.size === 0) domainNamespaceIds.add(defaultNamespaceId);\n\tif (valueObjects !== void 0) domainNamespaceIds.add(defaultNamespaceId);\n\tfor (const nsId of Object.keys(domainEnumsByNs)) domainNamespaceIds.add(nsId);\n\tconst domainNamespaces = Object.fromEntries([...domainNamespaceIds].sort().map((namespaceId) => {\n\t\tconst modelsInNs = modelsByNamespace[namespaceId] ?? {};\n\t\tconst enumsInNs = domainEnumsByNs[namespaceId];\n\t\treturn [namespaceId, {\n\t\t\tmodels: modelsInNs,\n\t\t\t...namespaceId === defaultNamespaceId && valueObjects !== void 0 ? { valueObjects } : {},\n\t\t\t...enumsInNs !== void 0 && Object.keys(enumsInNs).length > 0 ? { enum: enumsInNs } : {}\n\t\t}];\n\t}));\n\tconst contract = {\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\tdomain: { namespaces: domainNamespaces },\n\t\troots,\n\t\tstorage,\n\t\t...executionWithHash ? { execution: executionWithHash } : {},\n\t\textensions,\n\t\tcapabilities,\n\t\tprofileHash,\n\t\tmeta: {}\n\t};\n\tassertStorageSemantics(contract, indexTypeRegistry, codecLookup);\n\tflushAuthoringWarnings(authoringWarnings);\n\treturn contract;\n}\n//#endregion\n//#region src/derived-checks.ts\n/**\n* The one step every SQL contract specifier funnels its loaded contract\n* through: stamp the specifier's default control policy, then strip derived\n* checks from every table the stamped policy leaves non-managed. Composing the\n* two here is what keeps the managed-only consequence from being skipped on\n* any specifier route.\n*/\nfunction applySqlSpecifierControlPolicy(contract, defaultControlPolicy, createNamespace) {\n\treturn stripDerivedChecksFromNonManagedTables(applySpecifierDefaultControlPolicy(contract, defaultControlPolicy), createNamespace);\n}\n/**\n* Removes generated enforcement checks from every table whose effective\n* control policy is not `managed`.\n*\n* A check is derived iff its wire prefix is one derivation would produce for\n* some column of its table — {@link derivedCheckPrefixes} enumerates that\n* set. Wire-naming alone no longer identifies derivation: an authored\n* `name:` check (`@@check` / `check()`) is wire-named too, so a bare\n* `check.prefix === undefined` test would delete an author's own constraint\n* from every non-`managed` table. The prefix-shape rule tests against the\n* table's own columns instead of the naming mode, so an authored check with\n* an unrelated prefix survives.\n*\n* The rule is weaker than recomputing the content hash `contract infer`\n* uses: that needs `postgresRenderCheckExpressions` to know what a kind\n* renders, and this funnel has no target descriptor to reach it through. It\n* can only ask whether some column could have produced a prefix of this\n* shape, not whether this exact column produced this exact check. The gap\n* that opens — an authored name that collides with a derived-prefix shape —\n* is closed at authoring time instead: such a name is rejected\n* (`CONTRACT.CHECK_NAME_RESERVED`) before it ever reaches storage.\n*\n* Why derivation stops at the namespace boundary: the contract *describes* an\n* external schema, it does not *prescribe* enforcement for it. Deriving a check\n* for a table Prisma 8 never creates declares a constraint the live database\n* has no reason to carry, and `external` fails verify on a declared shape the\n* database lacks — an unfixable failure, since no plan may emit DDL there\n* either.\n*\n* This is the post-build half of the rule. Authoring skips derivation for a\n* table whose policy is known in the source; this pass catches the policy a\n* contract *specifier* applies after the contract is already built, which is\n* the only signal a pack like the Supabase extension gives. Specifiers reach\n* it through `applySqlSpecifierControlPolicy` above.\n*\n* Returns the contract unchanged (same reference) when nothing is stripped.\n* When something is, the storage hash is recomputed — the stripped contract\n* describes different storage.\n*/\nfunction stripDerivedChecksFromNonManagedTables(contract, createNamespace) {\n\tconst storage = contract.storage;\n\tif (!isSqlStorageShaped(storage)) return contract;\n\tlet anyStripped = false;\n\tconst namespaces = {};\n\tfor (const [namespaceId, namespace] of Object.entries(storage.namespaces)) {\n\t\tif (!isMaterializedSqlNamespace(namespace)) return contract;\n\t\tconst tables = namespace.entries[\"table\"];\n\t\tif (tables === void 0) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tlet namespaceStripped = false;\n\t\tconst nextTables = {};\n\t\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\t\tconst stripped = StorageTable.is(table) ? withoutDerivedChecks(tableName, table, contract.defaultControlPolicy) : table;\n\t\t\tif (stripped !== table) namespaceStripped = true;\n\t\t\tnextTables[tableName] = stripped;\n\t\t}\n\t\tif (!namespaceStripped) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tanyStripped = true;\n\t\tnamespaces[namespaceId] = createNamespace({\n\t\t\tid: namespace.id,\n\t\t\tentries: {\n\t\t\t\t...namespace.entries,\n\t\t\t\ttable: nextTables\n\t\t\t}\n\t\t});\n\t}\n\tif (!anyStripped) return contract;\n\tconst storageWithoutHash = {\n\t\tnamespaces,\n\t\t...ifDefined(\"types\", storage.types)\n\t};\n\treturn {\n\t\t...contract,\n\t\tstorage: new SqlStorage({\n\t\t\t...storageWithoutHash,\n\t\t\tstorageHash: computeStorageHash({\n\t\t\t\ttarget: contract.target,\n\t\t\t\ttargetFamily: contract.targetFamily,\n\t\t\t\tstorage: storageWithoutHash,\n\t\t\t\t...sqlContractCanonicalizationHooks\n\t\t\t})\n\t\t})\n\t};\n}\n/**\n* Structural stand-in for `instanceof SqlStorage`: like the checks it wraps, a\n* storage instance can arrive from a realm whose IR classes are a separate\n* copy (the dist e2e shape), where an `instanceof` test would miss.\n*/\nfunction isSqlStorageShaped(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"namespaces\" in x)) return false;\n\treturn typeof x.namespaces === \"object\" && x.namespaces !== null;\n}\n/** The table itself when it keeps every check, a rebuilt one when it does not. */\nfunction withoutDerivedChecks(tableName, table, contractDefault) {\n\tconst checks = table.checks;\n\tif (checks === void 0 || checks.length === 0) return table;\n\tif (effectiveControlPolicy(table.control, contractDefault) === \"managed\") return table;\n\tconst columnNames = Object.keys(table.columns);\n\tinvariant(columnNames.length > 0, `withoutDerivedChecks: table \"${tableName}\" carries checks but its column map is empty. The caller must pass the table's real, complete column set — an empty or partial map makes every check misclassify as non-derived and survive the strip.`);\n\tconst derivedPrefixes = derivedCheckPrefixes(tableName, columnNames);\n\tconst kept = checks.filter((check) => check.prefix === void 0 || !derivedPrefixes.has(check.prefix));\n\tif (kept.length === checks.length) return table;\n\treturn new StorageTable({\n\t\tcolumns: table.columns,\n\t\tuniques: table.uniques,\n\t\tindexes: table.indexes,\n\t\tforeignKeys: table.foreignKeys,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey),\n\t\t...ifDefined(\"control\", table.control),\n\t\t...kept.length > 0 ? { checks: kept.map((check) => checkConstraintInputFromSerialized({\n\t\t\tname: check.name,\n\t\t\t...ifDefined(\"prefix\", check.prefix),\n\t\t\texpression: check.expression\n\t\t})) } : {}\n\t});\n}\n//#endregion\nexport { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, contractError as o, toOneNullabilityContradictionMessage as r, applySqlSpecifierControlPolicy as t };\n\n//# sourceMappingURL=derived-checks-CfXjGvNH.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,SAAS,mBAAmB,OAAO;CAClC,OAAO,MAAM,QAAQ,CAAC,MAAM;AAC7B;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,qBAAqB;AAC7B;AAGA,SAAS,qCAAqC,UAAU,eAAe;CACtE,OAAO,kBAAkB,sBAAsB,GAAG,SAAS,8DAA8D,GAAG,SAAS;AACtI;;;;AAMA,SAAS,YAAY,SAAS,YAAY,aAAa;CACtD,OAAO,YAAY,aAAa;EAC/B;EACA,GAAG,UAAU,cAAc,eAAe,KAAK,IAAI,KAAK,IAAI,UAAU,UAAU,CAAC;CAClF,CAAC;AACF;;AAEA,SAAS,eAAe,OAAO,OAAO;CACrC,IAAI,OAAO;EACV,MAAM,OAAO,MAAM,WAAW,KAAK;EACnC,MAAM,WAAW,IAAI;EACrB,OAAO;CACR;CACA,OAAO,UAAU,KAAK;AACvB;AACA,SAAS,eAAe,MAAM,OAAO,iBAAiB;CACrD,MAAM,UAAU,oBAAoB,KAAK,IAAI,YAAY,oBAAoB,gBAAgB;CAC7F,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACpE,OAAO,cAAc,4BAA4B,UAAU,KAAK,UAAU,GAAG,KAAK,UAAU,UAAU,QAAQ,2BAA2B,UAAU;EAClJ;EACA,MAAM;GACL,WAAW,KAAK;GAChB,WAAW,KAAK;GAChB,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UAAU,MAAM,WAAW,KAAK,KAAK,CAAC,gBAAgB,IAAI,MAAM,MAAM,CAAC;CACnG,IAAI,KAAK,WAAW,OAAO,QAAQ,OAAO;CAC1C,OAAO,IAAI,aAAa;EACvB,SAAS,MAAM;EACf,SAAS,MAAM;EACf,SAAS,MAAM;EACf,aAAa,MAAM;EACnB,GAAG,UAAU,cAAc,MAAM,UAAU;EAC3C,GAAG,UAAU,WAAW,MAAM,OAAO;EACrC,GAAG,KAAK,SAAS,IAAI,EAAE,QAAQ,KAAK,KAAK,UAAU,mCAAmC;GACrF,MAAM,MAAM;GACZ,GAAG,UAAU,UAAU,MAAM,MAAM;GACnC,YAAY,MAAM;EACnB,CAAC,CAAC,EAAE,IAAI,CAAC;CACV,CAAC;AACF"}
@@ -1,5 +1,5 @@
1
- import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-BTlJLUID-O6fBB_am.mjs";
2
- import "./types-BURWzacK.mjs";
1
+ import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
2
+ import "./types-Uv3oTMAb.mjs";
3
3
  import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
4
4
  //#region ../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DpPkO6Dt.d.mts
5
5
  //#region src/derived-checks.d.ts
@@ -18,4 +18,4 @@ type SqlNamespaceFactory = (input: SqlNamespaceInput) => SqlNamespaceBase;
18
18
  declare function applySqlSpecifierControlPolicy(contract: Contract, defaultControlPolicy: ControlPolicy | undefined, createNamespace: SqlNamespaceFactory): Contract;
19
19
  //#endregion
20
20
  export { applySqlSpecifierControlPolicy as n, SqlNamespaceFactory as t };
21
- //# sourceMappingURL=derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map
21
+ //# sourceMappingURL=derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"derived-checks-DpPkO6Dt-D3M7YEr2.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DpPkO6Dt.d.mts"],"mappings":";;;;;;;;;KAOK,uBAAuB,OAAO,sBAAsB;;;;;;;;iBAQxC,+BAA+B,UAAU,UAAU,sBAAsB,2BAA2B,iBAAiB,sBAAsB"}
1
+ {"version":3,"file":"derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DpPkO6Dt.d.mts"],"mappings":";;;;;;;;;KAOK,uBAAuB,OAAO,sBAAsB;;;;;;;;iBAQxC,+BAA+B,UAAU,UAAU,sBAAsB,2BAA2B,iBAAiB,sBAAsB"}
@@ -1,10 +1,10 @@
1
- import { l as SqlStorage } from "./sql-storage-BTlJLUID-O6fBB_am.mjs";
2
- import "./types-BURWzacK.mjs";
3
- import { y as SqlSchemaIRNode } from "./types-CLsPsUiw-Db1BsN9R.mjs";
4
- import "./types-D6XuABFQ.mjs";
5
- import "./control-adapter-CkFfBVei-BLYeKcLW.mjs";
6
- import { n as CodecControlHooks } from "./types-CzxOObSY-DEfjmbj1.mjs";
7
- import { t as SqlSchemaDiffFn } from "./schema-differ-CqWOkoW9-BABSAGGB.mjs";
1
+ import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
2
+ import "./types-Uv3oTMAb.mjs";
3
+ import { y as SqlSchemaIRNode } from "./types-DIZSW9JI-DNUF-RnL.mjs";
4
+ import "./types-DqSCaTK3.mjs";
5
+ import "./control-adapter-CkFfBVei-DH5DAObc.mjs";
6
+ import { n as CodecControlHooks } from "./types-CzxOObSY-CxZ_bdVi.mjs";
7
+ import { t as SqlSchemaDiffFn } from "./schema-differ-CqWOkoW9-DQkzKV8b.mjs";
8
8
  import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
9
9
  import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
10
10
  import { DiffSubjectGranularity, SchemaDiffIssue, VerifierIssueCategory, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
@@ -101,4 +101,4 @@ interface VerifySqlSchemaByDiffInput {
101
101
  declare function verifySqlSchemaByDiff(input: VerifySqlSchemaByDiffInput): VerifyDatabaseSchemaResult;
102
102
  //#endregion
103
103
  export { VerifySqlSchemaByDiffInput as a, computeSqlDiffVerdict as c, StorageTypeVerdictInput as i, computeStorageTypeVerdict as l, SqlDiffVerdictInput as n, classifyDiffSubjectGranularity as o, StorageTypeVerdict as r, classifySqlDiffIssue as s, SqlDiffVerdict as t, verifySqlSchemaByDiff as u };
104
- //# sourceMappingURL=diff-CBqsNkxe.d.mts.map
104
+ //# sourceMappingURL=diff-l4-qJpTV.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff-CBqsNkxe.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
1
+ {"version":3,"file":"diff-l4-qJpTV.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
@@ -1,4 +1,4 @@
1
- import { d as resolvedTypeParams } from "./types-C7oOtFcJ.mjs";
1
+ import { d as resolvedTypeParams } from "./types-DXrO0fxT.mjs";
2
2
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
3
3
  import { UNBOUND_NAMESPACE_ID, entityAt } from "@prisma/orm-framework/components/ir";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
@@ -435,4 +435,4 @@ function generateStorageNamespacesType(namespaces) {
435
435
  //#endregion
436
436
  export { sqlEmission as t };
437
437
 
438
- //# sourceMappingURL=dist-Dm_hQ-hh.mjs.map
438
+ //# sourceMappingURL=dist-D8EkCena.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-Dm_hQ-hh.mjs","names":[],"sources":["../../../../2-sql/3-tooling/emitter/dist/index.mjs"],"sourcesContent":["import { renderValueSetType, serializeNamespaceId, serializeObjectKey, serializeValue } from \"@internal/emitter/domain-type-generation\";\nimport { isSafeTypeExpression } from \"@internal/emitter/type-expression-safety\";\nimport { settleAggregateOverloads } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { resolvedTypeParams } from \"@internal/sql-contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/errors.ts\nfunction sqlEmitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction sqlEmitterValidationError(message, meta) {\n\treturn sqlEmitterError(\"CONTRACT.VALIDATION_FAILED\", message, {\n\t\twhy: \"The contract given to the SQL emitter failed structural validation.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta\n\t});\n}\n//#endregion\n//#region src/index.ts\n/**\n* Render the aggregate result map from the overloads the stack contributes, settled against the codecs it contributes.\n*\n* Every emitted row is keyed by a contributed codec, whichever rung settled it. Trait fallbacks reach only the contributed codecs to begin with, and an exact overload naming an uncontributed codec is dropped here — settling keeps such a row, because naming a codec id is a claim that stands on its own and the runtime honours it for whatever ref reaches it, but a target may register codecs its adapter withholds, and an emitted type over one of those would advertise availability no contract can use.\n*\n* Only the two rungs that name a codec are materialized; the input-agnostic overload stays a single row, which a consumer reads when no per-codec row claims its input.\n*/\nfunction generateAggregateTypes(options) {\n\tconst descriptors = options?.aggregateDescriptors ?? [];\n\tconst codecs = options?.codecDescriptors ?? [];\n\tif (descriptors.length === 0) return \"Record<string, never>\";\n\tconst contributedIds = new Set(codecs.map((codec) => codec.codecId));\n\tconst settled = settleAggregateOverloads(descriptors, codecs);\n\tconst ambiguity = settled.ambiguities[0];\n\tif (ambiguity !== void 0) throw sqlEmitterError(\"CONTRACT.AGGREGATE_DESCRIPTOR_AMBIGUOUS\", `Aggregate '${ambiguity.operation}' has no single result type over codec '${ambiguity.codecId}': traits ${ambiguity.traits.join(\", \")} all claim it.`, {\n\t\twhy: \"Emitted result types must name one codec per aggregate and input.\",\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\treturn `{ ${[...settled.operations].sort(([left], [right]) => left.localeCompare(right)).map(([operation, entry]) => {\n\t\tconst members = [`readonly byCodec: { ${[...entry.byCodecId].filter(([codecId]) => contributedIds.has(codecId)).sort(([left], [right]) => left.localeCompare(right)).map(([codecId, descriptor]) => {\n\t\t\treturn `readonly ${serializeObjectKey(codecId)}: ${renderAggregateResult(descriptor, codecId, contributedIds)}`;\n\t\t}).join(\"; \")} }`];\n\t\tconst withoutInput = entry.noInput ?? entry.anyInput;\n\t\tif (withoutInput !== void 0) members.push(`readonly withoutInput: ${renderAggregateResult(withoutInput, void 0, contributedIds)}`);\n\t\tif (entry.anyInput !== void 0) members.push(`readonly anyInput: ${renderAggregateResult(entry.anyInput, void 0, contributedIds)}`);\n\t\treturn `readonly ${serializeObjectKey(operation)}: { ${members.join(\"; \")} }`;\n\t}).join(\"; \")} }`;\n}\n/** One row of the map: the codec the result carries, and whether it can be null. A `self` result carries the codec of the input it was resolved for. */\nfunction renderAggregateResult(descriptor, inputCodecId, contributedIds) {\n\tconst output = descriptor.output.kind === \"self\" ? inputCodecId : descriptor.output.codecId;\n\tif (output === void 0) throw sqlEmitterError(\"CONTRACT.AGGREGATE_DESCRIPTOR_AMBIGUOUS\", `Aggregate '${descriptor.operation}' declares its own input's codec as its result but answers calls that carry no input.`, {\n\t\twhy: \"A result that reuses its input needs an input to reuse.\",\n\t\tfix: \"Name the result codec on the descriptor.\",\n\t\tmeta: { operation: descriptor.operation }\n\t});\n\tif (!contributedIds.has(output)) throw sqlEmitterError(\"CONTRACT.AGGREGATE_OUTPUT_CODEC_MISSING\", `Aggregate '${descriptor.operation}' names result codec '${output}', which the stack does not contribute.`, {\n\t\twhy: \"An emitted result type names a codec in the contract codec map; a codec the stack does not contribute has no emitted type to name.\",\n\t\tfix: \"Contribute the codec, or declare a result codec the stack contributes.\",\n\t\tmeta: {\n\t\t\toperation: descriptor.operation,\n\t\t\toutputCodecId: output\n\t\t}\n\t});\n\treturn `{ readonly output: ${serializeValue(output)}; readonly nullable: ${descriptor.nullable} }`;\n}\nfunction serializeTypeParamsLiteral(params) {\n\tif (!params || Object.keys(params).length === 0) return \"Record<string, never>\";\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(params)) entries.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\treturn `{ ${entries.join(\"; \")} }`;\n}\nconst sqlEmission = {\n\tid: \"sql\",\n\tvalidateTypes(contract, _ctx) {\n\t\tconst storage = contract.storage;\n\t\tif (!storage?.namespaces) return;\n\t\tconst typeIdRegex = /^([^/]+)\\/([^@]+)@(\\d+)$/;\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [colName, colUnknown] of Object.entries(table.columns)) {\n\t\t\tconst codecId = colUnknown.codecId;\n\t\t\tif (!codecId) throw sqlEmitterValidationError(`Column \"${colName}\" in table \"${tableName}\" is missing codecId`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tif (!codecId.match(typeIdRegex)?.[1]) throw sqlEmitterValidationError(`Column \"${colName}\" in table \"${tableName}\" has invalid codec ID format \"${codecId}\". Expected format: ns/name@version`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName,\n\t\t\t\tcodecId\n\t\t\t});\n\t\t}\n\t},\n\tvalidateStructure(contract) {\n\t\tif (contract.targetFamily !== \"sql\") throw sqlEmitterValidationError(`Expected targetFamily \"sql\", got \"${contract.targetFamily}\"`, { targetFamily: contract.targetFamily });\n\t\tconst storage = contract.storage;\n\t\tif (!storage?.namespaces) throw sqlEmitterValidationError(\"SQL contract must have storage.namespaces\", {});\n\t\tconst tableNamesSeenAcrossNamespaces = /* @__PURE__ */ new Map();\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) for (const tableName of Object.keys(ns.entries.table ?? {})) {\n\t\t\tconst existingNs = tableNamesSeenAcrossNamespaces.get(tableName);\n\t\t\tif (existingNs !== void 0 && existingNs !== nsId) throw sqlEmitterError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate table name \"${tableName}\" in namespaces \"${existingNs}\" and \"${nsId}\"`, {\n\t\t\t\twhy: \"Two SQL namespaces declare a table with the same name, which is ambiguous for emission.\",\n\t\t\t\tfix: \"Rename one of the tables so every table name is unique across namespaces.\",\n\t\t\t\tmeta: {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tnamespaces: [existingNs, nsId]\n\t\t\t\t}\n\t\t\t});\n\t\t\ttableNamesSeenAcrossNamespaces.set(tableName, nsId);\n\t\t}\n\t\tconst tableNames = /* @__PURE__ */ new Set();\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const t of Object.keys(ns.entries.table ?? {})) tableNames.add(t);\n\t\tfor (const [namespaceId, domainNs] of Object.entries(contract.domain.namespaces)) {\n\t\t\tconst models = domainNs.models;\n\t\t\tfor (const [modelName, model] of Object.entries(models)) {\n\t\t\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\t\t\tif (!model.storage?.table) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.table`, { model: qualifiedName });\n\t\t\t\tif (!model.storage.namespaceId) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.namespaceId`, { model: qualifiedName });\n\t\t\t\tif (model.storage.namespaceId !== namespaceId) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" storage.namespaceId \"${model.storage.namespaceId}\" does not match domain namespace \"${namespaceId}\"`, {\n\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\tstorageNamespaceId: model.storage.namespaceId,\n\t\t\t\t\tdomainNamespaceId: namespaceId\n\t\t\t\t});\n\t\t\t\tconst tableName = model.storage.table;\n\t\t\t\tconst table = entityAt(storage, {\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: tableName\n\t\t\t\t});\n\t\t\t\tif (!table) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" references non-existent table \"${namespaceId}.${tableName}\"`, {\n\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\ttable: `${namespaceId}.${tableName}`\n\t\t\t\t});\n\t\t\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\t\t\tconst storageFields = model.storage.fields;\n\t\t\t\tif (!storageFields || Object.keys(storageFields).length === 0) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.fields`, { model: qualifiedName });\n\t\t\t\tfor (const [fieldName, field] of Object.entries(storageFields)) {\n\t\t\t\t\tif (!field.column) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" is missing column property`, {\n\t\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\t\tfield: fieldName\n\t\t\t\t\t});\n\t\t\t\t\tif (!columnNames.has(field.column)) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" references non-existent column \"${field.column}\" in table \"${tableName}\"`, {\n\t\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\t\tfield: fieldName,\n\t\t\t\t\t\tcolumn: field.column,\n\t\t\t\t\t\ttable: tableName\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!model.relations || typeof model.relations !== \"object\") throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing required field \"relations\" (must be an object)`, { model: qualifiedName });\n\t\t\t}\n\t\t}\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) {\n\t\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\t\tif (!Array.isArray(table.uniques)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"uniques\" (must be an array)`, { table: tableName });\n\t\t\tif (!Array.isArray(table.indexes)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"indexes\" (must be an array)`, { table: tableName });\n\t\t\tif (!Array.isArray(table.foreignKeys)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"foreignKeys\" (must be an array)`, { table: tableName });\n\t\t\tif (table.primaryKey) {\n\t\t\t\tfor (const colName of table.primaryKey.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" primaryKey references non-existent column \"${colName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor (const unique of table.uniques) for (const colName of unique.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" unique constraint references non-existent column \"${colName}\"`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tfor (const index of table.indexes) for (const colName of index.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" index references non-existent column \"${colName}\"`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tfor (const fk of table.foreignKeys) {\n\t\t\t\tfor (const colName of fk.source.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent column \"${colName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName\n\t\t\t\t});\n\t\t\t\tconst referencedTable = entityAt(storage, {\n\t\t\t\t\tnamespaceId: fk.target.namespaceId,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: fk.target.tableName\n\t\t\t\t});\n\t\t\t\tif (!referencedTable) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent table \"${fk.target.tableName}\" in namespace \"${fk.target.namespaceId}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\ttargetTable: fk.target.tableName,\n\t\t\t\t\ttargetNamespace: fk.target.namespaceId\n\t\t\t\t});\n\t\t\t\tconst referencedColumnNames = new Set(Object.keys(referencedTable.columns));\n\t\t\t\tfor (const colName of fk.target.columns) if (!referencedColumnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent column \"${colName}\" in table \"${fk.target.tableName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName,\n\t\t\t\t\ttargetTable: fk.target.tableName\n\t\t\t\t});\n\t\t\t\tif (fk.source.columns.length !== fk.target.columns.length) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey column count (${fk.source.columns.length}) does not match referenced column count (${fk.target.columns.length})`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tsourceColumnCount: fk.source.columns.length,\n\t\t\t\t\ttargetColumnCount: fk.target.columns.length\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\tgenerateStorageType(contract, storageHashTypeName) {\n\t\tconst storage = contract.storage;\n\t\tconst namespacesType = generateStorageNamespacesType(storage.namespaces);\n\t\tconst docTypes = generateDocumentScopedStorageTypesType(storage.types);\n\t\treturn `{ readonly namespaces: ${namespacesType}${docTypes === void 0 ? \"\" : `; readonly types: ${docTypes}`}; readonly storageHash: ${storageHashTypeName} }`;\n\t},\n\tgenerateModelStorageType(_modelName, model) {\n\t\tconst sqlModel = model;\n\t\tconst tableName = sqlModel.storage.table;\n\t\tconst storageFields = sqlModel.storage.fields;\n\t\tconst storageParts = [`readonly table: ${serializeValue(tableName)}`, `readonly namespaceId: ${serializeValue(sqlModel.storage.namespaceId)}`];\n\t\tif (Object.keys(storageFields).length > 0) {\n\t\t\tconst fieldParts = [];\n\t\t\tfor (const [fieldName, field] of Object.entries(storageFields)) fieldParts.push(`readonly ${serializeObjectKey(fieldName)}: { readonly column: ${serializeValue(field.column)} }`);\n\t\t\tstorageParts.push(`readonly fields: { ${fieldParts.join(\"; \")} }`);\n\t\t}\n\t\treturn `{ ${storageParts.join(\"; \")} }`;\n\t},\n\tresolveFieldValueSet(_modelName, fieldName, model, contract) {\n\t\tconst sqlModel = blindCast(model);\n\t\tconst storageField = sqlModel.storage?.fields?.[fieldName];\n\t\tif (!storageField) return void 0;\n\t\tconst storage = blindCast(contract.storage);\n\t\tif (!storage) return void 0;\n\t\tconst storageNamespaceId = sqlModel.storage.namespaceId;\n\t\tif (!storageNamespaceId) return void 0;\n\t\tconst column = entityAt(storage, {\n\t\t\tnamespaceId: storageNamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: sqlModel.storage.table\n\t\t})?.columns[storageField.column];\n\t\tif (!column?.valueSet) return void 0;\n\t\tconst valueSet = entityAt(storage, {\n\t\t\tnamespaceId: column.valueSet.namespaceId,\n\t\t\tentityKind: column.valueSet.entityKind,\n\t\t\tentityName: column.valueSet.entityName\n\t\t});\n\t\tif (!valueSet) return void 0;\n\t\treturn {\n\t\t\tencodedValues: valueSet.values,\n\t\t\tcodecId: column.codecId\n\t\t};\n\t},\n\tgetStorageTypeExports(contract, codecLookup) {\n\t\tconst storage = blindCast(contract.storage);\n\t\tif (!storage?.namespaces) return void 0;\n\t\tconst outputMap = generateStorageColumnTypesMap(storage, \"output\", codecLookup);\n\t\tconst inputMap = generateStorageColumnTypesMap(storage, \"input\", codecLookup);\n\t\treturn [`export type StorageColumnTypes = ${outputMap};`, `export type StorageColumnInputTypes = ${inputMap};`].join(\"\\n\");\n\t},\n\tgetFamilyImports(resolveImportSpecifier) {\n\t\treturn [\n\t\t\t\"import type {\",\n\t\t\t\" ContractWithTypeMaps,\",\n\t\t\t\" RelationKeys,\",\n\t\t\t\" TypeMaps as TypeMapsType,\",\n\t\t\t`} from '${resolveImportSpecifier(\"@internal/sql-contract/types\")}';`\n\t\t];\n\t},\n\tgetFamilyTypeAliases(options) {\n\t\tconst queryOperationAliases = (options?.queryOperationTypeImports ?? []).filter((imp) => imp.named === \"QueryOperationTypes\").map((imp) => `${imp.alias}<CodecTypes>`);\n\t\treturn [\n\t\t\t\"export type LaneCodecTypes = CodecTypes;\",\n\t\t\t`export type QueryOperationTypes = ${queryOperationAliases.length > 0 ? queryOperationAliases.join(\" & \") : \"Record<string, never>\"};`,\n\t\t\t`export type AggregateTypes = ${generateAggregateTypes(options)};`,\n\t\t\t\"type DefaultLiteralValue<CodecId extends string, Encoded> =\",\n\t\t\t\" CodecId extends keyof CodecTypes\",\n\t\t\t\" ? Encoded extends CodecTypes[CodecId][\\\"json\\\"]\",\n\t\t\t\" ? Encoded\",\n\t\t\t\" : CodecTypes[CodecId][\\\"json\\\"]\",\n\t\t\t\" : Encoded;\"\n\t\t].join(\"\\n\");\n\t},\n\tgetTypeMapsExpression() {\n\t\treturn \"TypeMapsType<CodecTypes, QueryOperationTypes, FieldOutputTypes, FieldInputTypes, StorageColumnTypes, StorageColumnInputTypes, AggregateTypes>\";\n\t},\n\tgetContractWrapper(contractBaseName, typeMapsName) {\n\t\treturn [\n\t\t\t`export type Contract = ContractWithTypeMaps<${contractBaseName}, ${typeMapsName}>;`,\n\t\t\t\"\",\n\t\t\t\"export type Namespaces = Contract['storage']['namespaces'];\"\n\t\t].join(\"\\n\");\n\t}\n};\nfunction renderRefinedCodecType(column, side, params, codecLookup) {\n\tif (codecLookup && params) {\n\t\tconst rendered = side === \"output\" ? codecLookup.renderOutputTypeFor(column.codecId, params) : codecLookup.renderInputTypeFor?.(column.codecId, params);\n\t\tif (rendered && isSafeTypeExpression(rendered)) return rendered;\n\t}\n\treturn `CodecTypes[${serializeValue(column.codecId)}][${serializeValue(side)}]`;\n}\nfunction computeColumnType(storage, column, side, codecLookup) {\n\tlet base;\n\tif (column.valueSet) {\n\t\tconst valueSet = entityAt(storage, {\n\t\t\tnamespaceId: column.valueSet.namespaceId,\n\t\t\tentityKind: column.valueSet.entityKind,\n\t\t\tentityName: column.valueSet.entityName\n\t\t});\n\t\tbase = valueSet ? renderValueSetType(valueSet.values, column.codecId, side, codecLookup) : void 0;\n\t}\n\tif (base === void 0) base = renderRefinedCodecType(column, side, resolvedTypeParams(column, storage.types), codecLookup);\n\tif (column.many !== false) base = `ReadonlyArray<${column.many.elementNullable ? `${base} | null` : base}>`;\n\treturn column.nullable ? `${base} | null` : base;\n}\nfunction generateStorageColumnTypesMap(storage, side, codecLookup) {\n\tconst namespaceEntries = Object.entries(storage.namespaces ?? {}).sort(([a], [b]) => a.localeCompare(b));\n\tif (namespaceEntries.length === 0) return \"Record<string, never>\";\n\tconst nsParts = [];\n\tfor (const [nsId, ns] of namespaceEntries) {\n\t\tconst tables = blindCast(ns.entries.table ?? {});\n\t\tconst tableEntries = Object.entries(tables).sort(([a], [b]) => a.localeCompare(b));\n\t\tconst tableParts = [];\n\t\tfor (const [tableName, table] of tableEntries) {\n\t\t\tconst colEntries = Object.entries(table.columns).sort(([a], [b]) => a.localeCompare(b));\n\t\t\tconst colParts = [];\n\t\t\tfor (const [colName, col] of colEntries) {\n\t\t\t\tconst colType = computeColumnType(storage, col, side, codecLookup);\n\t\t\t\tcolParts.push(`readonly ${serializeObjectKey(colName)}: ${colType}`);\n\t\t\t}\n\t\t\tconst colMap = colParts.length > 0 ? `{ ${colParts.join(\"; \")} }` : \"{}\";\n\t\t\ttableParts.push(`readonly ${serializeObjectKey(tableName)}: ${colMap}`);\n\t\t}\n\t\tconst tableMap = tableParts.length > 0 ? `{ ${tableParts.join(\"; \")} }` : \"{}\";\n\t\tnsParts.push(`readonly ${serializeObjectKey(nsId)}: ${tableMap}`);\n\t}\n\treturn `{ ${nsParts.join(\"; \")} }`;\n}\nfunction generateDocumentScopedStorageTypesType(types) {\n\tif (!types || Object.keys(types).length === 0) return;\n\tconst typeEntries = [];\n\tfor (const [typeName, typeInstance] of Object.entries(types)) {\n\t\tconst codecInstanceShape = typeInstance;\n\t\tif (typeof codecInstanceShape.codecId !== \"string\" || typeof codecInstanceShape.dataType !== \"string\") throw sqlEmitterError(\"CONTRACT.TYPE_UNKNOWN\", `Unknown storage type kind for \"${typeName}\" in document-scoped storage.types; expected a codec-instance triple.`, {\n\t\t\twhy: \"A storage.types entry is not a codec-instance triple, so its column type cannot be emitted.\",\n\t\t\tfix: \"Regenerate the contract from its authoring source; storage.types entries must carry codecId and dataType.\",\n\t\t\tmeta: { type: typeName }\n\t\t});\n\t\tconst codecId = serializeValue(codecInstanceShape.codecId);\n\t\tconst dataType = serializeValue(codecInstanceShape.dataType);\n\t\tconst typeParamsStr = serializeTypeParamsLiteral(codecInstanceShape.typeParams);\n\t\ttypeEntries.push(`readonly ${serializeObjectKey(typeName)}: { readonly kind: \"codec-instance\"; readonly codecId: ${codecId}; readonly dataType: ${dataType}; readonly typeParams: ${typeParamsStr} }`);\n\t}\n\treturn `{ ${typeEntries.join(\"; \")} }`;\n}\n/**\n* Literalizes the `valueSet` entries slot — a core SQL entity kind (alongside\n* `table`), not a pack-contributed one, so naming it here isn't a\n* family→target layering leak. This is the only non-`table` entries slot with\n* a type-level consumer (`db.nativeEnums`, `packages/3-extensions/postgres`):\n* pack-contributed slots (`role`, `policy`, `native_enum`, …) have none and\n* are not emitted.\n*/\nfunction generateValueSetBlockType(valueSets) {\n\treturn `{ ${Object.entries(valueSets).sort(([a], [b]) => a.localeCompare(b)).map(([name, valueSet]) => `readonly ${serializeObjectKey(name)}: ${serializeValue(valueSet)}`).join(\"; \")} }`;\n}\nfunction namespaceSerializedKind(ns) {\n\tconst kind = ns.kind;\n\tif (kind === \"schema\") return `readonly kind: \"${ns.id === UNBOUND_NAMESPACE_ID ? \"postgres-unbound-schema\" : \"postgres-schema\"}\"`;\n\tif (typeof kind === \"string\") return `readonly kind: ${serializeValue(kind)}`;\n\tthrow sqlEmitterError(\"CONTRACT.NAMESPACE_INVALID\", `Namespace '${ns.id}' has no string kind — all namespaces must be target concretions with a defined kind property.`, {\n\t\twhy: \"The namespace is not a target concretion, so the emitter cannot serialize its kind.\",\n\t\tfix: \"Regenerate the contract with a target pack that materializes every namespace as a target concretion.\",\n\t\tmeta: { namespace: ns.id }\n\t});\n}\nfunction generateTableLiteralType(table) {\n\tconst columns = [];\n\tfor (const [colName, col] of Object.entries(table.columns)) {\n\t\tconst nullable = col.nullable ? \"true\" : \"false\";\n\t\tconst dataType = serializeValue(col.dataType);\n\t\tconst codecId = serializeValue(col.codecId);\n\t\tconst defaultSpec = col.default ? col.default.kind === \"literal\" ? `; readonly default: { readonly kind: \"literal\"; readonly value: DefaultLiteralValue<${codecId}, ${serializeValue(col.default.value)}> }` : `; readonly default: { readonly kind: \"function\"; readonly expression: ${serializeValue(col.default.expression)} }` : \"\";\n\t\tconst typeParamsSpec = col.typeParams && Object.keys(col.typeParams).length > 0 ? `; readonly typeParams: ${serializeTypeParamsLiteral(col.typeParams)}` : \"\";\n\t\tconst typeRefSpec = col.typeRef ? `; readonly typeRef: ${serializeValue(col.typeRef)}` : \"\";\n\t\tconst manySpec = col.many === false ? \"; readonly many: false\" : `; readonly many: { readonly elementNullable: ${col.many.elementNullable} }`;\n\t\tcolumns.push(`readonly ${serializeObjectKey(colName)}: { readonly dataType: ${dataType}; readonly codecId: ${codecId}; readonly nullable: ${nullable}${defaultSpec}${typeParamsSpec}${typeRefSpec}${manySpec} }`);\n\t}\n\tconst tableParts = [`columns: { ${columns.join(\"; \")} }`];\n\tif (table.primaryKey) {\n\t\tconst pkParts = [`readonly columns: readonly [${table.primaryKey.columns.map((c) => serializeValue(c)).join(\", \")}]`];\n\t\tif (table.primaryKey.name) pkParts.push(`readonly name: ${serializeValue(table.primaryKey.name)}`);\n\t\ttableParts.push(`primaryKey: { ${pkParts.join(\"; \")} }`);\n\t}\n\tconst uniques = table.uniques.map((u) => {\n\t\tconst parts = [`readonly columns: readonly [${u.columns.map((c) => serializeValue(c)).join(\", \")}]`];\n\t\tif (u.name) parts.push(`readonly name: ${serializeValue(u.name)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`uniques: readonly [${uniques}]`);\n\tconst indexes = table.indexes.map((i) => {\n\t\tconst parts = [`readonly name: ${serializeValue(i.name)}`];\n\t\tif (i.prefix !== void 0) parts.push(`readonly prefix: ${serializeValue(i.prefix)}`);\n\t\tif (i.columns !== void 0) parts.push(`readonly columns: readonly [${i.columns.map((c) => serializeValue(c)).join(\", \")}]`);\n\t\tif (i.expression !== void 0) parts.push(`readonly expression: ${serializeValue(i.expression)}`);\n\t\tif (i.where !== void 0) parts.push(`readonly where: ${serializeValue(i.where)}`);\n\t\tparts.push(`readonly unique: ${i.unique}`);\n\t\tif (i.type !== void 0) parts.push(`readonly type: ${serializeValue(i.type)}`);\n\t\tif (i.options !== void 0) parts.push(`readonly options: ${serializeValue(i.options)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`indexes: readonly [${indexes}]`);\n\tconst fks = table.foreignKeys.map((fk) => {\n\t\tconst srcCols = fk.source.columns.map((c) => serializeValue(c)).join(\", \");\n\t\tconst tgtCols = fk.target.columns.map((c) => serializeValue(c)).join(\", \");\n\t\tconst srcRef = `{ readonly namespaceId: ${serializeNamespaceId(String(fk.source.namespaceId))}; readonly tableName: ${serializeValue(fk.source.tableName)}; readonly columns: readonly [${srcCols}] }`;\n\t\tconst tgtRef = `{ readonly namespaceId: ${serializeNamespaceId(String(fk.target.namespaceId))}; readonly tableName: ${serializeValue(fk.target.tableName)}; readonly columns: readonly [${tgtCols}] }`;\n\t\tconst parts = [`readonly source: ${srcRef}`, `readonly target: ${tgtRef}`];\n\t\tif (fk.name) parts.push(`readonly name: ${serializeValue(fk.name)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`foreignKeys: readonly [${fks}]`);\n\treturn `{ ${tableParts.join(\"; \")} }`;\n}\nfunction generateTablesMapType(tables) {\n\tconst tableEntries = [];\n\tfor (const [tableName, table] of Object.entries(tables).sort(([a], [b]) => a.localeCompare(b))) tableEntries.push(`readonly ${serializeObjectKey(tableName)}: ${generateTableLiteralType(table)}`);\n\tif (tableEntries.length === 0) return \"{}\";\n\treturn `{ ${tableEntries.join(\"; \")} }`;\n}\nfunction generateStorageNamespacesType(namespaces) {\n\tconst entries = Object.entries(namespaces ?? {}).sort(([a], [b]) => a.localeCompare(b));\n\tif (entries.length === 0) return \"Record<string, never>\";\n\tconst parts = [];\n\tfor (const [name, ns] of entries) {\n\t\tconst kindSuffix = `; ${namespaceSerializedKind(ns)}`;\n\t\tconst entriesParts = [`readonly table: ${generateTablesMapType(ns.entries.table ?? {})}`];\n\t\tconst valueSetEntries = ns.entries.valueSet;\n\t\tif (valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0) entriesParts.push(`readonly valueSet: ${generateValueSetBlockType(valueSetEntries)}`);\n\t\tconst entriesType = `{ ${entriesParts.join(\"; \")} }`;\n\t\tparts.push(`readonly ${serializeObjectKey(name)}: { readonly id: ${serializeValue(ns.id)}${kindSuffix}; readonly entries: ${entriesType} }`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\n//#endregion\nexport { sqlEmission };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,gBAAgB,MAAM,SAAS,SAAS;CAChD,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AACA,SAAS,0BAA0B,SAAS,MAAM;CACjD,OAAO,gBAAgB,8BAA8B,SAAS;EAC7D,KAAK;EACL,KAAK;EACL;CACD,CAAC;AACF;;;;;;;;AAUA,SAAS,uBAAuB,SAAS;CACxC,MAAM,cAAc,SAAS,wBAAwB,CAAC;CACtD,MAAM,SAAS,SAAS,oBAAoB,CAAC;CAC7C,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,MAAM,iBAAiB,IAAI,IAAI,OAAO,KAAK,UAAU,MAAM,OAAO,CAAC;CACnE,MAAM,UAAU,yBAAyB,aAAa,MAAM;CAC5D,MAAM,YAAY,QAAQ,YAAY;CACtC,IAAI,cAAc,KAAK,GAAG,MAAM,gBAAgB,2CAA2C,cAAc,UAAU,UAAU,0CAA0C,UAAU,QAAQ,YAAY,UAAU,OAA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C,mBAAmB,sBAAsB,GAAG,QAAQ,SAAS,CAAC,CAAC,GAAG;EACxF,MAAM,kBAAkB,GAAG,QAAQ;EACnC,IAAI,oBAAoB,KAAK,KAAK,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS,GAAG,aAAa,KAAK,sBAAsB,0BAA0B,eAAe,GAAG;EAC/J,MAAM,cAAc,KAAK,aAAa,KAAK,IAAI,EAAE;EACjD,MAAM,KAAK,YAAY,mBAAmB,IAAI,EAAE,mBAAmB,eAAe,GAAG,EAAE,IAAI,WAAW,sBAAsB,YAAY,GAAG;CAC5I;CACA,OAAO,KAAK,MAAM,KAAK,IAAI,EAAE;AAC9B"}
1
+ {"version":3,"file":"dist-D8EkCena.mjs","names":[],"sources":["../../../../2-sql/3-tooling/emitter/dist/index.mjs"],"sourcesContent":["import { renderValueSetType, serializeNamespaceId, serializeObjectKey, serializeValue } from \"@internal/emitter/domain-type-generation\";\nimport { isSafeTypeExpression } from \"@internal/emitter/type-expression-safety\";\nimport { settleAggregateOverloads } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { resolvedTypeParams } from \"@internal/sql-contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/errors.ts\nfunction sqlEmitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction sqlEmitterValidationError(message, meta) {\n\treturn sqlEmitterError(\"CONTRACT.VALIDATION_FAILED\", message, {\n\t\twhy: \"The contract given to the SQL emitter failed structural validation.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta\n\t});\n}\n//#endregion\n//#region src/index.ts\n/**\n* Render the aggregate result map from the overloads the stack contributes, settled against the codecs it contributes.\n*\n* Every emitted row is keyed by a contributed codec, whichever rung settled it. Trait fallbacks reach only the contributed codecs to begin with, and an exact overload naming an uncontributed codec is dropped here — settling keeps such a row, because naming a codec id is a claim that stands on its own and the runtime honours it for whatever ref reaches it, but a target may register codecs its adapter withholds, and an emitted type over one of those would advertise availability no contract can use.\n*\n* Only the two rungs that name a codec are materialized; the input-agnostic overload stays a single row, which a consumer reads when no per-codec row claims its input.\n*/\nfunction generateAggregateTypes(options) {\n\tconst descriptors = options?.aggregateDescriptors ?? [];\n\tconst codecs = options?.codecDescriptors ?? [];\n\tif (descriptors.length === 0) return \"Record<string, never>\";\n\tconst contributedIds = new Set(codecs.map((codec) => codec.codecId));\n\tconst settled = settleAggregateOverloads(descriptors, codecs);\n\tconst ambiguity = settled.ambiguities[0];\n\tif (ambiguity !== void 0) throw sqlEmitterError(\"CONTRACT.AGGREGATE_DESCRIPTOR_AMBIGUOUS\", `Aggregate '${ambiguity.operation}' has no single result type over codec '${ambiguity.codecId}': traits ${ambiguity.traits.join(\", \")} all claim it.`, {\n\t\twhy: \"Emitted result types must name one codec per aggregate and input.\",\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\treturn `{ ${[...settled.operations].sort(([left], [right]) => left.localeCompare(right)).map(([operation, entry]) => {\n\t\tconst members = [`readonly byCodec: { ${[...entry.byCodecId].filter(([codecId]) => contributedIds.has(codecId)).sort(([left], [right]) => left.localeCompare(right)).map(([codecId, descriptor]) => {\n\t\t\treturn `readonly ${serializeObjectKey(codecId)}: ${renderAggregateResult(descriptor, codecId, contributedIds)}`;\n\t\t}).join(\"; \")} }`];\n\t\tconst withoutInput = entry.noInput ?? entry.anyInput;\n\t\tif (withoutInput !== void 0) members.push(`readonly withoutInput: ${renderAggregateResult(withoutInput, void 0, contributedIds)}`);\n\t\tif (entry.anyInput !== void 0) members.push(`readonly anyInput: ${renderAggregateResult(entry.anyInput, void 0, contributedIds)}`);\n\t\treturn `readonly ${serializeObjectKey(operation)}: { ${members.join(\"; \")} }`;\n\t}).join(\"; \")} }`;\n}\n/** One row of the map: the codec the result carries, and whether it can be null. A `self` result carries the codec of the input it was resolved for. */\nfunction renderAggregateResult(descriptor, inputCodecId, contributedIds) {\n\tconst output = descriptor.output.kind === \"self\" ? inputCodecId : descriptor.output.codecId;\n\tif (output === void 0) throw sqlEmitterError(\"CONTRACT.AGGREGATE_DESCRIPTOR_AMBIGUOUS\", `Aggregate '${descriptor.operation}' declares its own input's codec as its result but answers calls that carry no input.`, {\n\t\twhy: \"A result that reuses its input needs an input to reuse.\",\n\t\tfix: \"Name the result codec on the descriptor.\",\n\t\tmeta: { operation: descriptor.operation }\n\t});\n\tif (!contributedIds.has(output)) throw sqlEmitterError(\"CONTRACT.AGGREGATE_OUTPUT_CODEC_MISSING\", `Aggregate '${descriptor.operation}' names result codec '${output}', which the stack does not contribute.`, {\n\t\twhy: \"An emitted result type names a codec in the contract codec map; a codec the stack does not contribute has no emitted type to name.\",\n\t\tfix: \"Contribute the codec, or declare a result codec the stack contributes.\",\n\t\tmeta: {\n\t\t\toperation: descriptor.operation,\n\t\t\toutputCodecId: output\n\t\t}\n\t});\n\treturn `{ readonly output: ${serializeValue(output)}; readonly nullable: ${descriptor.nullable} }`;\n}\nfunction serializeTypeParamsLiteral(params) {\n\tif (!params || Object.keys(params).length === 0) return \"Record<string, never>\";\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(params)) entries.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\treturn `{ ${entries.join(\"; \")} }`;\n}\nconst sqlEmission = {\n\tid: \"sql\",\n\tvalidateTypes(contract, _ctx) {\n\t\tconst storage = contract.storage;\n\t\tif (!storage?.namespaces) return;\n\t\tconst typeIdRegex = /^([^/]+)\\/([^@]+)@(\\d+)$/;\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const [colName, colUnknown] of Object.entries(table.columns)) {\n\t\t\tconst codecId = colUnknown.codecId;\n\t\t\tif (!codecId) throw sqlEmitterValidationError(`Column \"${colName}\" in table \"${tableName}\" is missing codecId`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tif (!codecId.match(typeIdRegex)?.[1]) throw sqlEmitterValidationError(`Column \"${colName}\" in table \"${tableName}\" has invalid codec ID format \"${codecId}\". Expected format: ns/name@version`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName,\n\t\t\t\tcodecId\n\t\t\t});\n\t\t}\n\t},\n\tvalidateStructure(contract) {\n\t\tif (contract.targetFamily !== \"sql\") throw sqlEmitterValidationError(`Expected targetFamily \"sql\", got \"${contract.targetFamily}\"`, { targetFamily: contract.targetFamily });\n\t\tconst storage = contract.storage;\n\t\tif (!storage?.namespaces) throw sqlEmitterValidationError(\"SQL contract must have storage.namespaces\", {});\n\t\tconst tableNamesSeenAcrossNamespaces = /* @__PURE__ */ new Map();\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) for (const tableName of Object.keys(ns.entries.table ?? {})) {\n\t\t\tconst existingNs = tableNamesSeenAcrossNamespaces.get(tableName);\n\t\t\tif (existingNs !== void 0 && existingNs !== nsId) throw sqlEmitterError(\"CONTRACT.NAME_DUPLICATE\", `Duplicate table name \"${tableName}\" in namespaces \"${existingNs}\" and \"${nsId}\"`, {\n\t\t\t\twhy: \"Two SQL namespaces declare a table with the same name, which is ambiguous for emission.\",\n\t\t\t\tfix: \"Rename one of the tables so every table name is unique across namespaces.\",\n\t\t\t\tmeta: {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tnamespaces: [existingNs, nsId]\n\t\t\t\t}\n\t\t\t});\n\t\t\ttableNamesSeenAcrossNamespaces.set(tableName, nsId);\n\t\t}\n\t\tconst tableNames = /* @__PURE__ */ new Set();\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const t of Object.keys(ns.entries.table ?? {})) tableNames.add(t);\n\t\tfor (const [namespaceId, domainNs] of Object.entries(contract.domain.namespaces)) {\n\t\t\tconst models = domainNs.models;\n\t\t\tfor (const [modelName, model] of Object.entries(models)) {\n\t\t\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\t\t\tif (!model.storage?.table) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.table`, { model: qualifiedName });\n\t\t\t\tif (!model.storage.namespaceId) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.namespaceId`, { model: qualifiedName });\n\t\t\t\tif (model.storage.namespaceId !== namespaceId) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" storage.namespaceId \"${model.storage.namespaceId}\" does not match domain namespace \"${namespaceId}\"`, {\n\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\tstorageNamespaceId: model.storage.namespaceId,\n\t\t\t\t\tdomainNamespaceId: namespaceId\n\t\t\t\t});\n\t\t\t\tconst tableName = model.storage.table;\n\t\t\t\tconst table = entityAt(storage, {\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: tableName\n\t\t\t\t});\n\t\t\t\tif (!table) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" references non-existent table \"${namespaceId}.${tableName}\"`, {\n\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\ttable: `${namespaceId}.${tableName}`\n\t\t\t\t});\n\t\t\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\t\t\tconst storageFields = model.storage.fields;\n\t\t\t\tif (!storageFields || Object.keys(storageFields).length === 0) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing storage.fields`, { model: qualifiedName });\n\t\t\t\tfor (const [fieldName, field] of Object.entries(storageFields)) {\n\t\t\t\t\tif (!field.column) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" is missing column property`, {\n\t\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\t\tfield: fieldName\n\t\t\t\t\t});\n\t\t\t\t\tif (!columnNames.has(field.column)) throw sqlEmitterValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" references non-existent column \"${field.column}\" in table \"${tableName}\"`, {\n\t\t\t\t\t\tmodel: qualifiedName,\n\t\t\t\t\t\tfield: fieldName,\n\t\t\t\t\t\tcolumn: field.column,\n\t\t\t\t\t\ttable: tableName\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!model.relations || typeof model.relations !== \"object\") throw sqlEmitterValidationError(`Model \"${qualifiedName}\" is missing required field \"relations\" (must be an object)`, { model: qualifiedName });\n\t\t\t}\n\t\t}\n\t\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) {\n\t\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\t\tif (!Array.isArray(table.uniques)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"uniques\" (must be an array)`, { table: tableName });\n\t\t\tif (!Array.isArray(table.indexes)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"indexes\" (must be an array)`, { table: tableName });\n\t\t\tif (!Array.isArray(table.foreignKeys)) throw sqlEmitterValidationError(`Table \"${tableName}\" is missing required field \"foreignKeys\" (must be an array)`, { table: tableName });\n\t\t\tif (table.primaryKey) {\n\t\t\t\tfor (const colName of table.primaryKey.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" primaryKey references non-existent column \"${colName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor (const unique of table.uniques) for (const colName of unique.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" unique constraint references non-existent column \"${colName}\"`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tfor (const index of table.indexes) for (const colName of index.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" index references non-existent column \"${colName}\"`, {\n\t\t\t\ttable: tableName,\n\t\t\t\tcolumn: colName\n\t\t\t});\n\t\t\tfor (const fk of table.foreignKeys) {\n\t\t\t\tfor (const colName of fk.source.columns) if (!columnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent column \"${colName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName\n\t\t\t\t});\n\t\t\t\tconst referencedTable = entityAt(storage, {\n\t\t\t\t\tnamespaceId: fk.target.namespaceId,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: fk.target.tableName\n\t\t\t\t});\n\t\t\t\tif (!referencedTable) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent table \"${fk.target.tableName}\" in namespace \"${fk.target.namespaceId}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\ttargetTable: fk.target.tableName,\n\t\t\t\t\ttargetNamespace: fk.target.namespaceId\n\t\t\t\t});\n\t\t\t\tconst referencedColumnNames = new Set(Object.keys(referencedTable.columns));\n\t\t\t\tfor (const colName of fk.target.columns) if (!referencedColumnNames.has(colName)) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey references non-existent column \"${colName}\" in table \"${fk.target.tableName}\"`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcolumn: colName,\n\t\t\t\t\ttargetTable: fk.target.tableName\n\t\t\t\t});\n\t\t\t\tif (fk.source.columns.length !== fk.target.columns.length) throw sqlEmitterValidationError(`Table \"${tableName}\" foreignKey column count (${fk.source.columns.length}) does not match referenced column count (${fk.target.columns.length})`, {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tsourceColumnCount: fk.source.columns.length,\n\t\t\t\t\ttargetColumnCount: fk.target.columns.length\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\tgenerateStorageType(contract, storageHashTypeName) {\n\t\tconst storage = contract.storage;\n\t\tconst namespacesType = generateStorageNamespacesType(storage.namespaces);\n\t\tconst docTypes = generateDocumentScopedStorageTypesType(storage.types);\n\t\treturn `{ readonly namespaces: ${namespacesType}${docTypes === void 0 ? \"\" : `; readonly types: ${docTypes}`}; readonly storageHash: ${storageHashTypeName} }`;\n\t},\n\tgenerateModelStorageType(_modelName, model) {\n\t\tconst sqlModel = model;\n\t\tconst tableName = sqlModel.storage.table;\n\t\tconst storageFields = sqlModel.storage.fields;\n\t\tconst storageParts = [`readonly table: ${serializeValue(tableName)}`, `readonly namespaceId: ${serializeValue(sqlModel.storage.namespaceId)}`];\n\t\tif (Object.keys(storageFields).length > 0) {\n\t\t\tconst fieldParts = [];\n\t\t\tfor (const [fieldName, field] of Object.entries(storageFields)) fieldParts.push(`readonly ${serializeObjectKey(fieldName)}: { readonly column: ${serializeValue(field.column)} }`);\n\t\t\tstorageParts.push(`readonly fields: { ${fieldParts.join(\"; \")} }`);\n\t\t}\n\t\treturn `{ ${storageParts.join(\"; \")} }`;\n\t},\n\tresolveFieldValueSet(_modelName, fieldName, model, contract) {\n\t\tconst sqlModel = blindCast(model);\n\t\tconst storageField = sqlModel.storage?.fields?.[fieldName];\n\t\tif (!storageField) return void 0;\n\t\tconst storage = blindCast(contract.storage);\n\t\tif (!storage) return void 0;\n\t\tconst storageNamespaceId = sqlModel.storage.namespaceId;\n\t\tif (!storageNamespaceId) return void 0;\n\t\tconst column = entityAt(storage, {\n\t\t\tnamespaceId: storageNamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: sqlModel.storage.table\n\t\t})?.columns[storageField.column];\n\t\tif (!column?.valueSet) return void 0;\n\t\tconst valueSet = entityAt(storage, {\n\t\t\tnamespaceId: column.valueSet.namespaceId,\n\t\t\tentityKind: column.valueSet.entityKind,\n\t\t\tentityName: column.valueSet.entityName\n\t\t});\n\t\tif (!valueSet) return void 0;\n\t\treturn {\n\t\t\tencodedValues: valueSet.values,\n\t\t\tcodecId: column.codecId\n\t\t};\n\t},\n\tgetStorageTypeExports(contract, codecLookup) {\n\t\tconst storage = blindCast(contract.storage);\n\t\tif (!storage?.namespaces) return void 0;\n\t\tconst outputMap = generateStorageColumnTypesMap(storage, \"output\", codecLookup);\n\t\tconst inputMap = generateStorageColumnTypesMap(storage, \"input\", codecLookup);\n\t\treturn [`export type StorageColumnTypes = ${outputMap};`, `export type StorageColumnInputTypes = ${inputMap};`].join(\"\\n\");\n\t},\n\tgetFamilyImports(resolveImportSpecifier) {\n\t\treturn [\n\t\t\t\"import type {\",\n\t\t\t\" ContractWithTypeMaps,\",\n\t\t\t\" RelationKeys,\",\n\t\t\t\" TypeMaps as TypeMapsType,\",\n\t\t\t`} from '${resolveImportSpecifier(\"@internal/sql-contract/types\")}';`\n\t\t];\n\t},\n\tgetFamilyTypeAliases(options) {\n\t\tconst queryOperationAliases = (options?.queryOperationTypeImports ?? []).filter((imp) => imp.named === \"QueryOperationTypes\").map((imp) => `${imp.alias}<CodecTypes>`);\n\t\treturn [\n\t\t\t\"export type LaneCodecTypes = CodecTypes;\",\n\t\t\t`export type QueryOperationTypes = ${queryOperationAliases.length > 0 ? queryOperationAliases.join(\" & \") : \"Record<string, never>\"};`,\n\t\t\t`export type AggregateTypes = ${generateAggregateTypes(options)};`,\n\t\t\t\"type DefaultLiteralValue<CodecId extends string, Encoded> =\",\n\t\t\t\" CodecId extends keyof CodecTypes\",\n\t\t\t\" ? Encoded extends CodecTypes[CodecId][\\\"json\\\"]\",\n\t\t\t\" ? Encoded\",\n\t\t\t\" : CodecTypes[CodecId][\\\"json\\\"]\",\n\t\t\t\" : Encoded;\"\n\t\t].join(\"\\n\");\n\t},\n\tgetTypeMapsExpression() {\n\t\treturn \"TypeMapsType<CodecTypes, QueryOperationTypes, FieldOutputTypes, FieldInputTypes, StorageColumnTypes, StorageColumnInputTypes, AggregateTypes>\";\n\t},\n\tgetContractWrapper(contractBaseName, typeMapsName) {\n\t\treturn [\n\t\t\t`export type Contract = ContractWithTypeMaps<${contractBaseName}, ${typeMapsName}>;`,\n\t\t\t\"\",\n\t\t\t\"export type Namespaces = Contract['storage']['namespaces'];\"\n\t\t].join(\"\\n\");\n\t}\n};\nfunction renderRefinedCodecType(column, side, params, codecLookup) {\n\tif (codecLookup && params) {\n\t\tconst rendered = side === \"output\" ? codecLookup.renderOutputTypeFor(column.codecId, params) : codecLookup.renderInputTypeFor?.(column.codecId, params);\n\t\tif (rendered && isSafeTypeExpression(rendered)) return rendered;\n\t}\n\treturn `CodecTypes[${serializeValue(column.codecId)}][${serializeValue(side)}]`;\n}\nfunction computeColumnType(storage, column, side, codecLookup) {\n\tlet base;\n\tif (column.valueSet) {\n\t\tconst valueSet = entityAt(storage, {\n\t\t\tnamespaceId: column.valueSet.namespaceId,\n\t\t\tentityKind: column.valueSet.entityKind,\n\t\t\tentityName: column.valueSet.entityName\n\t\t});\n\t\tbase = valueSet ? renderValueSetType(valueSet.values, column.codecId, side, codecLookup) : void 0;\n\t}\n\tif (base === void 0) base = renderRefinedCodecType(column, side, resolvedTypeParams(column, storage.types), codecLookup);\n\tif (column.many !== false) base = `ReadonlyArray<${column.many.elementNullable ? `${base} | null` : base}>`;\n\treturn column.nullable ? `${base} | null` : base;\n}\nfunction generateStorageColumnTypesMap(storage, side, codecLookup) {\n\tconst namespaceEntries = Object.entries(storage.namespaces ?? {}).sort(([a], [b]) => a.localeCompare(b));\n\tif (namespaceEntries.length === 0) return \"Record<string, never>\";\n\tconst nsParts = [];\n\tfor (const [nsId, ns] of namespaceEntries) {\n\t\tconst tables = blindCast(ns.entries.table ?? {});\n\t\tconst tableEntries = Object.entries(tables).sort(([a], [b]) => a.localeCompare(b));\n\t\tconst tableParts = [];\n\t\tfor (const [tableName, table] of tableEntries) {\n\t\t\tconst colEntries = Object.entries(table.columns).sort(([a], [b]) => a.localeCompare(b));\n\t\t\tconst colParts = [];\n\t\t\tfor (const [colName, col] of colEntries) {\n\t\t\t\tconst colType = computeColumnType(storage, col, side, codecLookup);\n\t\t\t\tcolParts.push(`readonly ${serializeObjectKey(colName)}: ${colType}`);\n\t\t\t}\n\t\t\tconst colMap = colParts.length > 0 ? `{ ${colParts.join(\"; \")} }` : \"{}\";\n\t\t\ttableParts.push(`readonly ${serializeObjectKey(tableName)}: ${colMap}`);\n\t\t}\n\t\tconst tableMap = tableParts.length > 0 ? `{ ${tableParts.join(\"; \")} }` : \"{}\";\n\t\tnsParts.push(`readonly ${serializeObjectKey(nsId)}: ${tableMap}`);\n\t}\n\treturn `{ ${nsParts.join(\"; \")} }`;\n}\nfunction generateDocumentScopedStorageTypesType(types) {\n\tif (!types || Object.keys(types).length === 0) return;\n\tconst typeEntries = [];\n\tfor (const [typeName, typeInstance] of Object.entries(types)) {\n\t\tconst codecInstanceShape = typeInstance;\n\t\tif (typeof codecInstanceShape.codecId !== \"string\" || typeof codecInstanceShape.dataType !== \"string\") throw sqlEmitterError(\"CONTRACT.TYPE_UNKNOWN\", `Unknown storage type kind for \"${typeName}\" in document-scoped storage.types; expected a codec-instance triple.`, {\n\t\t\twhy: \"A storage.types entry is not a codec-instance triple, so its column type cannot be emitted.\",\n\t\t\tfix: \"Regenerate the contract from its authoring source; storage.types entries must carry codecId and dataType.\",\n\t\t\tmeta: { type: typeName }\n\t\t});\n\t\tconst codecId = serializeValue(codecInstanceShape.codecId);\n\t\tconst dataType = serializeValue(codecInstanceShape.dataType);\n\t\tconst typeParamsStr = serializeTypeParamsLiteral(codecInstanceShape.typeParams);\n\t\ttypeEntries.push(`readonly ${serializeObjectKey(typeName)}: { readonly kind: \"codec-instance\"; readonly codecId: ${codecId}; readonly dataType: ${dataType}; readonly typeParams: ${typeParamsStr} }`);\n\t}\n\treturn `{ ${typeEntries.join(\"; \")} }`;\n}\n/**\n* Literalizes the `valueSet` entries slot — a core SQL entity kind (alongside\n* `table`), not a pack-contributed one, so naming it here isn't a\n* family→target layering leak. This is the only non-`table` entries slot with\n* a type-level consumer (`db.nativeEnums`, `packages/3-extensions/postgres`):\n* pack-contributed slots (`role`, `policy`, `native_enum`, …) have none and\n* are not emitted.\n*/\nfunction generateValueSetBlockType(valueSets) {\n\treturn `{ ${Object.entries(valueSets).sort(([a], [b]) => a.localeCompare(b)).map(([name, valueSet]) => `readonly ${serializeObjectKey(name)}: ${serializeValue(valueSet)}`).join(\"; \")} }`;\n}\nfunction namespaceSerializedKind(ns) {\n\tconst kind = ns.kind;\n\tif (kind === \"schema\") return `readonly kind: \"${ns.id === UNBOUND_NAMESPACE_ID ? \"postgres-unbound-schema\" : \"postgres-schema\"}\"`;\n\tif (typeof kind === \"string\") return `readonly kind: ${serializeValue(kind)}`;\n\tthrow sqlEmitterError(\"CONTRACT.NAMESPACE_INVALID\", `Namespace '${ns.id}' has no string kind — all namespaces must be target concretions with a defined kind property.`, {\n\t\twhy: \"The namespace is not a target concretion, so the emitter cannot serialize its kind.\",\n\t\tfix: \"Regenerate the contract with a target pack that materializes every namespace as a target concretion.\",\n\t\tmeta: { namespace: ns.id }\n\t});\n}\nfunction generateTableLiteralType(table) {\n\tconst columns = [];\n\tfor (const [colName, col] of Object.entries(table.columns)) {\n\t\tconst nullable = col.nullable ? \"true\" : \"false\";\n\t\tconst dataType = serializeValue(col.dataType);\n\t\tconst codecId = serializeValue(col.codecId);\n\t\tconst defaultSpec = col.default ? col.default.kind === \"literal\" ? `; readonly default: { readonly kind: \"literal\"; readonly value: DefaultLiteralValue<${codecId}, ${serializeValue(col.default.value)}> }` : `; readonly default: { readonly kind: \"function\"; readonly expression: ${serializeValue(col.default.expression)} }` : \"\";\n\t\tconst typeParamsSpec = col.typeParams && Object.keys(col.typeParams).length > 0 ? `; readonly typeParams: ${serializeTypeParamsLiteral(col.typeParams)}` : \"\";\n\t\tconst typeRefSpec = col.typeRef ? `; readonly typeRef: ${serializeValue(col.typeRef)}` : \"\";\n\t\tconst manySpec = col.many === false ? \"; readonly many: false\" : `; readonly many: { readonly elementNullable: ${col.many.elementNullable} }`;\n\t\tcolumns.push(`readonly ${serializeObjectKey(colName)}: { readonly dataType: ${dataType}; readonly codecId: ${codecId}; readonly nullable: ${nullable}${defaultSpec}${typeParamsSpec}${typeRefSpec}${manySpec} }`);\n\t}\n\tconst tableParts = [`columns: { ${columns.join(\"; \")} }`];\n\tif (table.primaryKey) {\n\t\tconst pkParts = [`readonly columns: readonly [${table.primaryKey.columns.map((c) => serializeValue(c)).join(\", \")}]`];\n\t\tif (table.primaryKey.name) pkParts.push(`readonly name: ${serializeValue(table.primaryKey.name)}`);\n\t\ttableParts.push(`primaryKey: { ${pkParts.join(\"; \")} }`);\n\t}\n\tconst uniques = table.uniques.map((u) => {\n\t\tconst parts = [`readonly columns: readonly [${u.columns.map((c) => serializeValue(c)).join(\", \")}]`];\n\t\tif (u.name) parts.push(`readonly name: ${serializeValue(u.name)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`uniques: readonly [${uniques}]`);\n\tconst indexes = table.indexes.map((i) => {\n\t\tconst parts = [`readonly name: ${serializeValue(i.name)}`];\n\t\tif (i.prefix !== void 0) parts.push(`readonly prefix: ${serializeValue(i.prefix)}`);\n\t\tif (i.columns !== void 0) parts.push(`readonly columns: readonly [${i.columns.map((c) => serializeValue(c)).join(\", \")}]`);\n\t\tif (i.expression !== void 0) parts.push(`readonly expression: ${serializeValue(i.expression)}`);\n\t\tif (i.where !== void 0) parts.push(`readonly where: ${serializeValue(i.where)}`);\n\t\tparts.push(`readonly unique: ${i.unique}`);\n\t\tif (i.type !== void 0) parts.push(`readonly type: ${serializeValue(i.type)}`);\n\t\tif (i.options !== void 0) parts.push(`readonly options: ${serializeValue(i.options)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`indexes: readonly [${indexes}]`);\n\tconst fks = table.foreignKeys.map((fk) => {\n\t\tconst srcCols = fk.source.columns.map((c) => serializeValue(c)).join(\", \");\n\t\tconst tgtCols = fk.target.columns.map((c) => serializeValue(c)).join(\", \");\n\t\tconst srcRef = `{ readonly namespaceId: ${serializeNamespaceId(String(fk.source.namespaceId))}; readonly tableName: ${serializeValue(fk.source.tableName)}; readonly columns: readonly [${srcCols}] }`;\n\t\tconst tgtRef = `{ readonly namespaceId: ${serializeNamespaceId(String(fk.target.namespaceId))}; readonly tableName: ${serializeValue(fk.target.tableName)}; readonly columns: readonly [${tgtCols}] }`;\n\t\tconst parts = [`readonly source: ${srcRef}`, `readonly target: ${tgtRef}`];\n\t\tif (fk.name) parts.push(`readonly name: ${serializeValue(fk.name)}`);\n\t\treturn `{ ${parts.join(\"; \")} }`;\n\t}).join(\", \");\n\ttableParts.push(`foreignKeys: readonly [${fks}]`);\n\treturn `{ ${tableParts.join(\"; \")} }`;\n}\nfunction generateTablesMapType(tables) {\n\tconst tableEntries = [];\n\tfor (const [tableName, table] of Object.entries(tables).sort(([a], [b]) => a.localeCompare(b))) tableEntries.push(`readonly ${serializeObjectKey(tableName)}: ${generateTableLiteralType(table)}`);\n\tif (tableEntries.length === 0) return \"{}\";\n\treturn `{ ${tableEntries.join(\"; \")} }`;\n}\nfunction generateStorageNamespacesType(namespaces) {\n\tconst entries = Object.entries(namespaces ?? {}).sort(([a], [b]) => a.localeCompare(b));\n\tif (entries.length === 0) return \"Record<string, never>\";\n\tconst parts = [];\n\tfor (const [name, ns] of entries) {\n\t\tconst kindSuffix = `; ${namespaceSerializedKind(ns)}`;\n\t\tconst entriesParts = [`readonly table: ${generateTablesMapType(ns.entries.table ?? {})}`];\n\t\tconst valueSetEntries = ns.entries.valueSet;\n\t\tif (valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0) entriesParts.push(`readonly valueSet: ${generateValueSetBlockType(valueSetEntries)}`);\n\t\tconst entriesType = `{ ${entriesParts.join(\"; \")} }`;\n\t\tparts.push(`readonly ${serializeObjectKey(name)}: { readonly id: ${serializeValue(ns.id)}${kindSuffix}; readonly entries: ${entriesType} }`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\n//#endregion\nexport { sqlEmission };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;AAQA,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AAC;CACtB,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,GAAG,aAAa,KAAK,YAAY,mBAAmB,SAAS,EAAE,IAAI,yBAAyB,KAAK,GAAG;CACjM,IAAI,aAAa,WAAW,GAAG,OAAO;CACtC,OAAO,KAAK,aAAa,KAAK,IAAI,EAAE;AACrC;AACA,SAAS,8BAA8B,YAAY;CAClD,MAAM,UAAU,OAAO,QAAQ,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;CACtF,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,CAAC,MAAM,OAAO,SAAS;EACjC,MAAM,aAAa,KAAK,wBAAwB,EAAE;EAClD,MAAM,eAAe,CAAC,mBAAmB,sBAAsB,GAAG,QAAQ,SAAS,CAAC,CAAC,GAAG;EACxF,MAAM,kBAAkB,GAAG,QAAQ;EACnC,IAAI,oBAAoB,KAAK,KAAK,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS,GAAG,aAAa,KAAK,sBAAsB,0BAA0B,eAAe,GAAG;EAC/J,MAAM,cAAc,KAAK,aAAa,KAAK,IAAI,EAAE;EACjD,MAAM,KAAK,YAAY,mBAAmB,IAAI,EAAE,mBAAmB,eAAe,GAAG,EAAE,IAAI,WAAW,sBAAsB,YAAY,GAAG;CAC5I;CACA,OAAO,KAAK,MAAM,KAAK,IAAI,EAAE;AAC9B"}
@@ -1,10 +1,10 @@
1
1
  import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
2
- import { c as StorageTable, i as Index, t as CheckConstraint } from "./storage-table-B7OSPl3G-EOodFPzq.mjs";
3
- import { n as checkConstraintInputFromSerialized, r as indexInputFromSerialized, t as StorageValueSet } from "./serialized-index-C26m_DWu-CnNi8WAI.mjs";
4
- import { DATA_TYPE_ID_PATTERN } from "@prisma/orm-framework/components/codec";
2
+ import { c as StorageTable, i as Index, t as CheckConstraint } from "./storage-table-B7OSPl3G-p1j6AjMS.mjs";
3
+ import { n as checkConstraintInputFromSerialized, r as indexInputFromSerialized, t as StorageValueSet } from "./serialized-index-C26m_DWu-BjU519sW.mjs";
5
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
5
+ import { DATA_TYPE_ID_PATTERN } from "@prisma/orm-framework/components/codec";
6
6
  import { type } from "arktype";
7
- //#region ../../../2-sql/1-core/contract/dist/entity-kinds-O3V1K26U.mjs
7
+ //#region ../../../2-sql/1-core/contract/dist/entity-kinds-DDTkNIr9.mjs
8
8
  const literalKindSchema = type("'literal'");
9
9
  const functionKindSchema = type("'function'");
10
10
  const ControlPolicySchema = type("'managed' | 'tolerated' | 'external' | 'observed'");
@@ -159,4 +159,4 @@ function composeSqlEntityKinds(packKinds = []) {
159
159
  //#endregion
160
160
  export { ForeignKeyReferenceSchema as a, IndexSchema as c, StorageValueSetSchema as d, composeSqlEntityKinds as f, ColumnDefaultSchema as i, ReferentialActionSchema as l, valueSetEntityKind as m, ColumnDefaultFunctionSchema as n, ForeignKeySchema as o, tableEntityKind as p, ColumnDefaultLiteralSchema as r, ForeignKeySourceSchema as s, CheckConstraintSchema as t, StorageTableSchema as u };
161
161
 
162
- //# sourceMappingURL=entity-kinds-O3V1K26U-B8TUrsX2.mjs.map
162
+ //# sourceMappingURL=entity-kinds-DDTkNIr9-DJ2EIO94.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-kinds-O3V1K26U-B8TUrsX2.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds-O3V1K26U.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { c as CheckConstraint, s as Index, t as StorageTable } from \"./storage-table-B7OSPl3G.mjs\";\nimport { n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-C26m_DWu.mjs\";\nimport { DATA_TYPE_ID_PATTERN } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\n//#region src/ir/storage-entry-schemas.ts\nconst literalKindSchema = type(\"'literal'\");\nconst functionKindSchema = type(\"'function'\");\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst ColumnDefaultLiteralSchema = type.declare().type({\n\tkind: literalKindSchema,\n\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n});\nconst ColumnDefaultFunctionSchema = type.declare().type({\n\tkind: functionKindSchema,\n\texpression: \"string\"\n});\nconst ColumnDefaultSchema = ColumnDefaultLiteralSchema.or(ColumnDefaultFunctionSchema);\nconst StorageValueSetRefSchema = type({\n\tplane: \"'storage'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'valueSet'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\nconst StorageColumnSchema = type({\n\t\"+\": \"reject\",\n\tdataType: DATA_TYPE_ID_PATTERN,\n\tcodecId: \"string\",\n\tnullable: \"boolean\",\n\t\"many?\": type(\"false\").or({\n\t\t\"+\": \"reject\",\n\t\telementNullable: \"boolean\"\n\t}),\n\t\"typeParams?\": \"Record<string, unknown>\",\n\t\"typeRef?\": \"string\",\n\t\"default?\": ColumnDefaultSchema,\n\t\"control?\": ControlPolicySchema,\n\t\"valueSet?\": StorageValueSetRefSchema,\n\t\"noCheck?\": \"(\\\"membership\\\" | \\\"elementNotNull\\\")[]\"\n}).narrow((col, ctx) => {\n\tif (col.typeParams !== void 0 && col.typeRef !== void 0) return ctx.mustBe(\"a column with either typeParams or typeRef, not both\");\n\tif (col.noCheck !== void 0) {\n\t\tif (col.noCheck.length === 0) return ctx.mustBe(\"a column whose noCheck array is non-empty (omit the key when enforced)\");\n\t\tfor (let i = 1; i < col.noCheck.length; i += 1) {\n\t\t\tconst previous = col.noCheck[i - 1];\n\t\t\tconst current = col.noCheck[i];\n\t\t\tif (previous !== void 0 && current !== void 0 && previous >= current) return ctx.mustBe(\"a column whose noCheck kinds are unique and sorted ascending lexicographically\");\n\t\t}\n\t}\n\treturn true;\n});\n/**\n* Storage value-set entry under `storage.namespaces[id].entries.valueSet[name]`.\n* Carries a `kind: 'valueSet'` discriminator (enumerable, survives JSON) and an\n* ordered `values` array of codec-encoded permitted values.\n*/\nconst StorageValueSetSchema = type({\n\tkind: \"'valueSet'\",\n\tvalues: type(\"string | number | boolean | null | unknown[] | Record<string, unknown>\").array().readonly()\n});\nconst PrimaryKeySchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst UniqueConstraintSchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst IndexSchema = type({\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\t\"columns?\": type.string.array().readonly(),\n\t\"expression?\": \"string\",\n\t\"where?\": \"string\",\n\tunique: \"boolean\",\n\t\"type?\": \"string\",\n\t\"options?\": \"Record<string, unknown>\"\n});\nconst ForeignKeyReferenceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly(),\n\t\"spaceId?\": \"string\"\n});\nconst ForeignKeySourceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly()\n});\nconst ReferentialActionSchema = type.declare().type(\"'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'\");\nconst ForeignKeyIndexSchema = type.declare().type(type({\n\t\"+\": \"reject\",\n\tname: \"string\"\n}).or({\n\t\"+\": \"reject\",\n\tprimaryKey: \"true\"\n}).or({\n\t\"+\": \"reject\",\n\tunique: type.string.array().readonly()\n}));\nconst ForeignKeySchema = type.declare().type({\n\tsource: ForeignKeySourceSchema,\n\ttarget: ForeignKeyReferenceSchema,\n\t\"name?\": \"string\",\n\t\"onDelete?\": ReferentialActionSchema,\n\t\"onUpdate?\": ReferentialActionSchema,\n\t\"index?\": ForeignKeyIndexSchema.or(\"boolean\")\n});\nconst CheckConstraintSchema = type({\n\t\"+\": \"reject\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\texpression: \"string\"\n});\nconst StorageTableSchema = type({\n\t\"+\": \"reject\",\n\tcolumns: type({ \"[string]\": StorageColumnSchema }),\n\t\"primaryKey?\": PrimaryKeySchema,\n\tuniques: UniqueConstraintSchema.array().readonly(),\n\tindexes: IndexSchema.array().readonly(),\n\tforeignKeys: ForeignKeySchema.array().readonly(),\n\t\"control?\": ControlPolicySchema,\n\t\"checks?\": CheckConstraintSchema.array().readonly()\n});\n//#endregion\n//#region src/entity-kinds.ts\nconst tableEntityKind = {\n\tkind: \"table\",\n\tschema: StorageTableSchema,\n\tconstruct: (input) => new StorageTable({\n\t\t...input,\n\t\tindexes: input.indexes.map((i) => i instanceof Index ? i : indexInputFromSerialized(i)),\n\t\t...ifDefined(\"checks\", input.checks?.map((c) => c instanceof CheckConstraint ? c : checkConstraintInputFromSerialized(c)))\n\t})\n};\nconst valueSetEntityKind = {\n\tkind: \"valueSet\",\n\tschema: StorageValueSetSchema,\n\tconstruct: (input) => new StorageValueSet(input)\n};\n/**\n* Assembles the `kind → descriptor` registry for SQL namespaces: the built-in\n* `table` and `valueSet` kinds plus any target `packKinds`. This builds the\n* lookup table — it does not touch contract data. `hydrateNamespaceEntities`\n* later consumes this registry to turn a namespace's raw entries into IR\n* instances, and `createSqlContractSchema` derives validation from the same\n* registry. Throws on a duplicate kind.\n*/\nfunction composeSqlEntityKinds(packKinds = []) {\n\tconst kinds = /* @__PURE__ */ new Map([[\"table\", tableEntityKind], [\"valueSet\", valueSetEntityKind]]);\n\tfor (const descriptor of packKinds) {\n\t\tif (kinds.has(descriptor.kind)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `composeSqlEntityKinds: duplicate entity kind \"${descriptor.kind}\" — each kind may be registered only once`, { meta: { entityKind: descriptor.kind } });\n\t\tkinds.set(descriptor.kind, descriptor);\n\t}\n\treturn kinds;\n}\n//#endregion\nexport { ColumnDefaultFunctionSchema as a, ForeignKeyReferenceSchema as c, IndexSchema as d, ReferentialActionSchema as f, CheckConstraintSchema as i, ForeignKeySchema as l, StorageValueSetSchema as m, tableEntityKind as n, ColumnDefaultLiteralSchema as o, StorageTableSchema as p, valueSetEntityKind as r, ColumnDefaultSchema as s, composeSqlEntityKinds as t, ForeignKeySourceSchema as u };\n\n//# sourceMappingURL=entity-kinds-O3V1K26U.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,oBAAoB,KAAK,WAAW;AAC1C,MAAM,qBAAqB,KAAK,YAAY;AAC5C,MAAM,sBAAsB,KAAK,mDAAmD;AACpF,MAAM,6BAA6B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACtD,MAAM;CACN,OAAO;AACR,CAAC;AACD,MAAM,8BAA8B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACvD,MAAM;CACN,YAAY;AACb,CAAC;AACD,MAAM,sBAAsB,2BAA2B,GAAG,2BAA2B;AACrF,MAAM,2BAA2B,KAAK;CACrC,OAAO;CACP,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,YAAY;AACb,CAAC;AACD,MAAM,sBAAsB,KAAK;CAChC,KAAK;CACL,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS,KAAK,OAAO,CAAC,CAAC,GAAG;EACzB,KAAK;EACL,iBAAiB;CAClB,CAAC;CACD,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,YAAY;AACb,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ;CACvB,IAAI,IAAI,eAAe,KAAK,KAAK,IAAI,YAAY,KAAK,GAAG,OAAO,IAAI,OAAO,sDAAsD;CACjI,IAAI,IAAI,YAAY,KAAK,GAAG;EAC3B,IAAI,IAAI,QAAQ,WAAW,GAAG,OAA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c,sCAAsC,iDAAiD,WAAW,KAAK,4CAA4C,EAAE,MAAM,EAAE,YAAY,WAAW,KAAK,EAAE,CAAC;EAChP,MAAM,IAAI,WAAW,MAAM,UAAU;CACtC;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"entity-kinds-DDTkNIr9-DJ2EIO94.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds-DDTkNIr9.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { c as CheckConstraint, s as Index, t as StorageTable } from \"./storage-table-B7OSPl3G.mjs\";\nimport { n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-C26m_DWu.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { DATA_TYPE_ID_PATTERN } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/ir/storage-entry-schemas.ts\nconst literalKindSchema = type(\"'literal'\");\nconst functionKindSchema = type(\"'function'\");\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst ColumnDefaultLiteralSchema = type.declare().type({\n\tkind: literalKindSchema,\n\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n});\nconst ColumnDefaultFunctionSchema = type.declare().type({\n\tkind: functionKindSchema,\n\texpression: \"string\"\n});\nconst ColumnDefaultSchema = ColumnDefaultLiteralSchema.or(ColumnDefaultFunctionSchema);\nconst StorageValueSetRefSchema = type({\n\tplane: \"'storage'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'valueSet'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\nconst StorageColumnSchema = type({\n\t\"+\": \"reject\",\n\tdataType: DATA_TYPE_ID_PATTERN,\n\tcodecId: \"string\",\n\tnullable: \"boolean\",\n\t\"many?\": type(\"false\").or({\n\t\t\"+\": \"reject\",\n\t\telementNullable: \"boolean\"\n\t}),\n\t\"typeParams?\": \"Record<string, unknown>\",\n\t\"typeRef?\": \"string\",\n\t\"default?\": ColumnDefaultSchema,\n\t\"control?\": ControlPolicySchema,\n\t\"valueSet?\": StorageValueSetRefSchema,\n\t\"noCheck?\": \"(\\\"membership\\\" | \\\"elementNotNull\\\")[]\"\n}).narrow((col, ctx) => {\n\tif (col.typeParams !== void 0 && col.typeRef !== void 0) return ctx.mustBe(\"a column with either typeParams or typeRef, not both\");\n\tif (col.noCheck !== void 0) {\n\t\tif (col.noCheck.length === 0) return ctx.mustBe(\"a column whose noCheck array is non-empty (omit the key when enforced)\");\n\t\tfor (let i = 1; i < col.noCheck.length; i += 1) {\n\t\t\tconst previous = col.noCheck[i - 1];\n\t\t\tconst current = col.noCheck[i];\n\t\t\tif (previous !== void 0 && current !== void 0 && previous >= current) return ctx.mustBe(\"a column whose noCheck kinds are unique and sorted ascending lexicographically\");\n\t\t}\n\t}\n\treturn true;\n});\n/**\n* Storage value-set entry under `storage.namespaces[id].entries.valueSet[name]`.\n* Carries a `kind: 'valueSet'` discriminator (enumerable, survives JSON) and an\n* ordered `values` array of codec-encoded permitted values.\n*/\nconst StorageValueSetSchema = type({\n\tkind: \"'valueSet'\",\n\tvalues: type(\"string | number | boolean | null | unknown[] | Record<string, unknown>\").array().readonly()\n});\nconst PrimaryKeySchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst UniqueConstraintSchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst IndexSchema = type({\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\t\"columns?\": type.string.array().readonly(),\n\t\"expression?\": \"string\",\n\t\"where?\": \"string\",\n\tunique: \"boolean\",\n\t\"type?\": \"string\",\n\t\"options?\": \"Record<string, unknown>\"\n});\nconst ForeignKeyReferenceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly(),\n\t\"spaceId?\": \"string\"\n});\nconst ForeignKeySourceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly()\n});\nconst ReferentialActionSchema = type.declare().type(\"'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'\");\nconst ForeignKeyIndexSchema = type.declare().type(type({\n\t\"+\": \"reject\",\n\tname: \"string\"\n}).or({\n\t\"+\": \"reject\",\n\tprimaryKey: \"true\"\n}).or({\n\t\"+\": \"reject\",\n\tunique: type.string.array().readonly()\n}));\nconst ForeignKeySchema = type.declare().type({\n\tsource: ForeignKeySourceSchema,\n\ttarget: ForeignKeyReferenceSchema,\n\t\"name?\": \"string\",\n\t\"onDelete?\": ReferentialActionSchema,\n\t\"onUpdate?\": ReferentialActionSchema,\n\t\"index?\": ForeignKeyIndexSchema.or(\"boolean\")\n});\nconst CheckConstraintSchema = type({\n\t\"+\": \"reject\",\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\texpression: \"string\"\n});\nconst StorageTableSchema = type({\n\t\"+\": \"reject\",\n\tcolumns: type({ \"[string]\": StorageColumnSchema }),\n\t\"primaryKey?\": PrimaryKeySchema,\n\tuniques: UniqueConstraintSchema.array().readonly(),\n\tindexes: IndexSchema.array().readonly(),\n\tforeignKeys: ForeignKeySchema.array().readonly(),\n\t\"control?\": ControlPolicySchema,\n\t\"checks?\": CheckConstraintSchema.array().readonly()\n});\n//#endregion\n//#region src/entity-kinds.ts\nconst tableEntityKind = {\n\tkind: \"table\",\n\tschema: StorageTableSchema,\n\tconstruct: (input) => new StorageTable({\n\t\t...input,\n\t\tindexes: input.indexes.map((i) => i instanceof Index ? i : indexInputFromSerialized(i)),\n\t\t...ifDefined(\"checks\", input.checks?.map((c) => c instanceof CheckConstraint ? c : checkConstraintInputFromSerialized(c)))\n\t})\n};\nconst valueSetEntityKind = {\n\tkind: \"valueSet\",\n\tschema: StorageValueSetSchema,\n\tconstruct: (input) => new StorageValueSet(input)\n};\n/**\n* Assembles the `kind → descriptor` registry for SQL namespaces: the built-in\n* `table` and `valueSet` kinds plus any target `packKinds`. This builds the\n* lookup table — it does not touch contract data. `hydrateNamespaceEntities`\n* later consumes this registry to turn a namespace's raw entries into IR\n* instances, and `createSqlContractSchema` derives validation from the same\n* registry. Throws on a duplicate kind.\n*/\nfunction composeSqlEntityKinds(packKinds = []) {\n\tconst kinds = /* @__PURE__ */ new Map([[\"table\", tableEntityKind], [\"valueSet\", valueSetEntityKind]]);\n\tfor (const descriptor of packKinds) {\n\t\tif (kinds.has(descriptor.kind)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `composeSqlEntityKinds: duplicate entity kind \"${descriptor.kind}\" — each kind may be registered only once`, { meta: { entityKind: descriptor.kind } });\n\t\tkinds.set(descriptor.kind, descriptor);\n\t}\n\treturn kinds;\n}\n//#endregion\nexport { ColumnDefaultFunctionSchema as a, ForeignKeyReferenceSchema as c, IndexSchema as d, ReferentialActionSchema as f, CheckConstraintSchema as i, ForeignKeySchema as l, StorageValueSetSchema as m, tableEntityKind as n, ColumnDefaultLiteralSchema as o, StorageTableSchema as p, valueSetEntityKind as r, ColumnDefaultSchema as s, composeSqlEntityKinds as t, ForeignKeySourceSchema as u };\n\n//# sourceMappingURL=entity-kinds-DDTkNIr9.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,oBAAoB,KAAK,WAAW;AAC1C,MAAM,qBAAqB,KAAK,YAAY;AAC5C,MAAM,sBAAsB,KAAK,mDAAmD;AACpF,MAAM,6BAA6B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACtD,MAAM;CACN,OAAO;AACR,CAAC;AACD,MAAM,8BAA8B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACvD,MAAM;CACN,YAAY;AACb,CAAC;AACD,MAAM,sBAAsB,2BAA2B,GAAG,2BAA2B;AACrF,MAAM,2BAA2B,KAAK;CACrC,OAAO;CACP,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,YAAY;AACb,CAAC;AACD,M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AG,UAAU,UAAU,MAAM,QAAQ,KAAK,MAAM,aAAa,kBAAkB,IAAI,mCAAmC,CAAC,CAAC,CAAC;CAC1H,CAAC;AACF;AACA,MAAM,qBAAqB;CAC1B,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,gBAAgB,KAAK;AAChD;;;;;;;;;AASA,SAAS,sBAAsB,YAAY,CAAC,GAAG;CAC9C,MAAM,wBAAwB,IAAI,IAAI,CAAC,CAAC,SAAS,eAAe,GAAG,CAAC,YAAY,kBAAkB,CAAC,CAAC;CACpG,KAAK,MAAM,cAAc,WAAW;EACnC,IAAI,MAAM,IAAI,WAAW,IAAI,GAAG,MAAM,cAAc,sCAAsC,iDAAiD,WAAW,KAAK,4CAA4C,EAAE,MAAM,EAAE,YAAY,WAAW,KAAK,EAAE,CAAC;EAChP,MAAM,IAAI,WAAW,MAAM,UAAU;CACtC;CACA,OAAO;AACR"}
@@ -1,8 +1,8 @@
1
- import { t as CheckConstraint } from "./check-constraint-B7qGu6rc-agxAjKLG.mjs";
2
- import { t as Index } from "./sql-index-ByAAE7K8-DPkZtr7t.mjs";
3
- import { i as StorageTableInput, r as StorageTable } from "./storage-table-WXeVNycx-tlFMnbig.mjs";
1
+ import { t as CheckConstraint } from "./check-constraint-B7qGu6rc-CBVYAMwG.mjs";
2
+ import { t as Index } from "./sql-index-ByAAE7K8-BpbPBWPD.mjs";
3
+ import { i as StorageTableInput, r as StorageTable } from "./storage-table-WXeVNycx-BCwDhdq5.mjs";
4
4
  import { n as StorageValueSetInput, t as StorageValueSet } from "./storage-value-set-BGlj5Uus-CvZD--GG.mjs";
5
- import { n as SerializedIndex, t as SerializedCheckConstraint } from "./serialized-index-CrgG8ct1-D64Figsu.mjs";
5
+ import { n as SerializedIndex, t as SerializedCheckConstraint } from "./serialized-index-CrgG8ct1-DDfHKUEK.mjs";
6
6
  import { AnyEntityKindDescriptor, EntityKindDescriptor } from "@prisma/orm-framework/components/ir";
7
7
  //#region ../../../2-sql/1-core/contract/dist/entity-kinds.d.mts
8
8
  //#region src/entity-kinds.d.ts
@@ -28,4 +28,4 @@ declare const valueSetEntityKind: EntityKindDescriptor<StorageValueSetInput, Sto
28
28
  declare function composeSqlEntityKinds(packKinds?: readonly AnyEntityKindDescriptor[]): ReadonlyMap<string, AnyEntityKindDescriptor>;
29
29
  //#endregion
30
30
  export { tableEntityKind as n, valueSetEntityKind as r, composeSqlEntityKinds as t };
31
- //# sourceMappingURL=entity-kinds--HvqT50S.d.mts.map
31
+ //# sourceMappingURL=entity-kinds-DqUYen0Y.d.mts.map