@prisma/orm-family-sql 8.0.0-rc.1-dev.30 → 8.0.0-rc.1-dev.32

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 (225) hide show
  1. package/dist/{ast-Px7aAd_0.d.mts → ast-DRbUiQ-9.d.mts} +3 -3
  2. package/dist/{ast-Px7aAd_0.d.mts.map → ast-DRbUiQ-9.d.mts.map} +1 -1
  3. package/dist/authored-check-naming-BWBe-PVE.d.mts +30 -0
  4. package/dist/authored-check-naming-BWBe-PVE.d.mts.map +1 -0
  5. package/dist/authored-check-naming-Hf9990DV.mjs +47 -0
  6. package/dist/authored-check-naming-Hf9990DV.mjs.map +1 -0
  7. package/dist/{authoring-type-constructors-Blqoa2Ua-OP7GsSm3.mjs → authoring-type-constructors-Blqoa2Ua-CvHn00xx.mjs} +2 -2
  8. package/dist/{authoring-type-constructors-Blqoa2Ua-OP7GsSm3.mjs.map → authoring-type-constructors-Blqoa2Ua-CvHn00xx.mjs.map} +1 -1
  9. package/dist/builder.d.mts +2 -2
  10. package/dist/builder__runtime.d.mts +9 -9
  11. package/dist/builder__runtime.mjs +1 -1
  12. package/dist/builder__types.d.mts +2 -2
  13. package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts +44 -0
  14. package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts.map +1 -0
  15. package/dist/{codec-descriptor-registry-DMUcCfyb.mjs → codec-descriptor-registry-N0dhtKaH.mjs} +2 -2
  16. package/dist/{codec-descriptor-registry-DMUcCfyb.mjs.map → codec-descriptor-registry-N0dhtKaH.mjs.map} +1 -1
  17. package/dist/{config-types-D7vjxNMf.mjs → config-types-B6cQRwJw.mjs} +2 -2
  18. package/dist/{config-types-D7vjxNMf.mjs.map → config-types-B6cQRwJw.mjs.map} +1 -1
  19. package/dist/{config-types-ktywvY7L.d.mts → config-types-D9fdKG3g.d.mts} +4 -4
  20. package/dist/{config-types-ktywvY7L.d.mts.map → config-types-D9fdKG3g.d.mts.map} +1 -1
  21. package/dist/{contract-builder-Dqnem9IW.d.mts → contract-builder-CG_tGDbB.d.mts} +45 -10
  22. package/dist/contract-builder-CG_tGDbB.d.mts.map +1 -0
  23. package/dist/{contract-builder-BFN7WSed.mjs → contract-builder-vdfvmuiO.mjs} +25 -5
  24. package/dist/contract-builder-vdfvmuiO.mjs.map +1 -0
  25. package/dist/contract-emitter.mjs +1 -1
  26. package/dist/contract-psl.d.mts +3 -3
  27. package/dist/contract-psl.mjs +1 -1
  28. package/dist/contract-psl__provider.d.mts +2 -2
  29. package/dist/contract-psl__provider.mjs +3 -3
  30. package/dist/contract-psl__provider.mjs.map +1 -1
  31. package/dist/contract-ts.d.mts +5 -5
  32. package/dist/contract-ts.mjs +4 -4
  33. package/dist/contract-ts__config-types.d.mts +1 -1
  34. package/dist/contract-ts__config-types.mjs +1 -1
  35. package/dist/contract-ts__contract-builder.d.mts +4 -4
  36. package/dist/contract-ts__contract-builder.mjs +3 -3
  37. package/dist/{contract-view-C2LYZzWr.d.mts → contract-view-CPHxoAEX.d.mts} +2 -2
  38. package/dist/{contract-view-C2LYZzWr.d.mts.map → contract-view-CPHxoAEX.d.mts.map} +1 -1
  39. package/dist/contract.d.mts +17 -15
  40. package/dist/contract.mjs +10 -9
  41. package/dist/contract__authored-check-naming.d.mts +2 -0
  42. package/dist/contract__authored-check-naming.mjs +2 -0
  43. package/dist/contract__contract-view.d.mts +1 -1
  44. package/dist/contract__entity-kinds.d.mts +1 -1
  45. package/dist/contract__entity-kinds.mjs +1 -1
  46. package/dist/contract__factories.d.mts +1 -1
  47. package/dist/contract__factories.mjs +1 -1
  48. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  49. package/dist/contract__foreign-key-materialization.mjs +1 -1
  50. package/dist/contract__index-naming.d.mts +1 -1
  51. package/dist/contract__index-naming.mjs +1 -1
  52. package/dist/contract__index-type-validation.d.mts +1 -1
  53. package/dist/contract__resolve-storage-table.d.mts +1 -1
  54. package/dist/contract__types.d.mts +7 -6
  55. package/dist/contract__types.mjs +3 -3
  56. package/dist/contract__validators.d.mts +1 -1
  57. package/dist/contract__validators.mjs +2 -2
  58. package/dist/{control-f9B6b5c2.mjs → control-DAkNosoF.mjs} +9 -9
  59. package/dist/{control-f9B6b5c2.mjs.map → control-DAkNosoF.mjs.map} +1 -1
  60. package/dist/{control-0OFuH6HK.d.mts → control-DI9DC2AS.d.mts} +14 -14
  61. package/dist/{control-0OFuH6HK.d.mts.map → control-DI9DC2AS.d.mts.map} +1 -1
  62. package/dist/control-adapter-BdOcXTOm.d.mts +1 -0
  63. package/dist/{control-adapter-C99J7aEF-B4MyB0B0.d.mts → control-adapter-C99J7aEF-DsxImHyk.d.mts} +8 -8
  64. package/dist/{control-adapter-C99J7aEF-B4MyB0B0.d.mts.map → control-adapter-C99J7aEF-DsxImHyk.d.mts.map} +1 -1
  65. package/dist/{db-C5jmOFPM-BRijskUO.d.mts → db-C5jmOFPM-BGm-QfKd.d.mts} +9 -9
  66. package/dist/{db-C5jmOFPM-BRijskUO.d.mts.map → db-C5jmOFPM-BGm-QfKd.d.mts.map} +1 -1
  67. package/dist/{ddl-types-CnLSuwXa-Dsz9N7Wm.d.mts → ddl-types-CnLSuwXa-Bv46yIe9.d.mts} +3 -3
  68. package/dist/{ddl-types-CnLSuwXa-Dsz9N7Wm.d.mts.map → ddl-types-CnLSuwXa-Bv46yIe9.d.mts.map} +1 -1
  69. package/dist/{derived-checks-CmJgg-N0-CugkINPW.mjs → derived-checks-DFMRmiAu-8jmha26I.mjs} +69 -22
  70. package/dist/derived-checks-DFMRmiAu-8jmha26I.mjs.map +1 -0
  71. package/dist/{derived-checks-DPdD01O0-CE4vJKET.d.mts → derived-checks-DPdD01O0-DGqOFjs6.d.mts} +3 -3
  72. package/dist/{derived-checks-DPdD01O0-CE4vJKET.d.mts.map → derived-checks-DPdD01O0-DGqOFjs6.d.mts.map} +1 -1
  73. package/dist/{diff-dX8KnmWc.d.mts → diff-DVvZXmFv.d.mts} +8 -8
  74. package/dist/{diff-dX8KnmWc.d.mts.map → diff-DVvZXmFv.d.mts.map} +1 -1
  75. package/dist/{dist-DtLVFgdI.mjs → dist-ZK6oeI5e.mjs} +2 -2
  76. package/dist/{dist-DtLVFgdI.mjs.map → dist-ZK6oeI5e.mjs.map} +1 -1
  77. package/dist/{entity-kinds-DZzdcuU5.d.mts → entity-kinds-B5cUFU22.d.mts} +5 -4
  78. package/dist/entity-kinds-B5cUFU22.d.mts.map +1 -0
  79. package/dist/{entity-kinds-CCzdAMq3-x9-uzHu1.mjs → entity-kinds-D7vwoN_T-CCBwFJy0.mjs} +4 -4
  80. package/dist/{entity-kinds-CCzdAMq3-x9-uzHu1.mjs.map → entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map} +1 -1
  81. package/dist/{expression-E67TGFZA.d.mts → expression-D7H1kyVG.d.mts} +5 -5
  82. package/dist/{expression-E67TGFZA.d.mts.map → expression-D7H1kyVG.d.mts.map} +1 -1
  83. package/dist/{factories-C8VyKQ90.d.mts → factories-P3qBQhO-.d.mts} +4 -4
  84. package/dist/{factories-C8VyKQ90.d.mts.map → factories-P3qBQhO-.d.mts.map} +1 -1
  85. package/dist/{factories-BIzyHng2.mjs → factories-SVor5xIT.mjs} +3 -3
  86. package/dist/{factories-BIzyHng2.mjs.map → factories-SVor5xIT.mjs.map} +1 -1
  87. package/dist/family.d.mts +11 -11
  88. package/dist/family.mjs +4 -4
  89. package/dist/family__control-adapter.d.mts +2 -2
  90. package/dist/family__control.d.mts +3 -3
  91. package/dist/family__control.mjs +2 -2
  92. package/dist/family__diff.d.mts +2 -2
  93. package/dist/family__diff.mjs +1 -1
  94. package/dist/family__ir.d.mts +1 -1
  95. package/dist/family__ir.mjs +1 -1
  96. package/dist/family__migration.d.mts +1 -1
  97. package/dist/family__pack.mjs +1 -1
  98. package/dist/family__psl-infer.d.mts +1 -1
  99. package/dist/family__psl-infer.mjs +1 -1
  100. package/dist/family__runtime.d.mts +2 -2
  101. package/dist/{foreign-key-materialization-ziwobURR.mjs → foreign-key-materialization-DLOi1Ps0.mjs} +2 -2
  102. package/dist/{foreign-key-materialization-ziwobURR.mjs.map → foreign-key-materialization-DLOi1Ps0.mjs.map} +1 -1
  103. package/dist/{foreign-key-materialization-CDDVZI8R.d.mts → foreign-key-materialization-DO9dvG7v.d.mts} +2 -2
  104. package/dist/{foreign-key-materialization-CDDVZI8R.d.mts.map → foreign-key-materialization-DO9dvG7v.d.mts.map} +1 -1
  105. package/dist/{index-DbDTloZS.d.mts → index-C5I8D-MB.d.mts} +3 -3
  106. package/dist/{index-DbDTloZS.d.mts.map → index-C5I8D-MB.d.mts.map} +1 -1
  107. package/dist/{index-BIj_Z-Yu.d.mts → index-Ddquditw.d.mts} +16 -16
  108. package/dist/{index-BIj_Z-Yu.d.mts.map → index-Ddquditw.d.mts.map} +1 -1
  109. package/dist/{index-naming-BQXnMcXt.d.mts → index-naming-Ct65z5Xk.d.mts} +7 -7
  110. package/dist/{index-naming-BQXnMcXt.d.mts.map → index-naming-Ct65z5Xk.d.mts.map} +1 -1
  111. package/dist/{index-naming-BoGBcMmI-CoehgjMK.mjs → index-naming-DREt6js7-CRH27yUv.mjs} +15 -13
  112. package/dist/index-naming-DREt6js7-CRH27yUv.mjs.map +1 -0
  113. package/dist/{index-type-validation-DS9n07WO.d.mts → index-type-validation-CZ5L2lli.d.mts} +3 -3
  114. package/dist/{index-type-validation-DS9n07WO.d.mts.map → index-type-validation-CZ5L2lli.d.mts.map} +1 -1
  115. package/dist/{interpreter-BDZ_Y5U--CMEJIQ40.mjs → interpreter-DaBA2fm--FFkq_gGd.mjs} +75 -5
  116. package/dist/interpreter-DaBA2fm--FFkq_gGd.mjs.map +1 -0
  117. package/dist/{ir-CVhRa-4t.d.mts → ir-Bghjt-FG.d.mts} +3 -3
  118. package/dist/{ir-CVhRa-4t.d.mts.map → ir-Bghjt-FG.d.mts.map} +1 -1
  119. package/dist/lane-query-builder.d.mts +4 -4
  120. package/dist/{middleware-Bp5oIYM0-9a28aLnt.d.mts → middleware-Bp5oIYM0-Ek8bISDH.d.mts} +2 -2
  121. package/dist/{middleware-Bp5oIYM0-9a28aLnt.d.mts.map → middleware-Bp5oIYM0-Ek8bISDH.d.mts.map} +1 -1
  122. package/dist/middleware-aFpB1ZhU.d.mts +1 -0
  123. package/dist/{migration-C8MAouav.d.mts → migration-Dtymew3g.d.mts} +4 -4
  124. package/dist/{migration-C8MAouav.d.mts.map → migration-Dtymew3g.d.mts.map} +1 -1
  125. package/dist/{naming-BsvzQPOq-qOWmknyp.d.mts → naming-CV9j2pXl-KARaDReS.d.mts} +16 -3
  126. package/dist/naming-CV9j2pXl-KARaDReS.d.mts.map +1 -0
  127. package/dist/{naming-BWkuWJJK-zuGIIJ49.mjs → naming-DKr4TJd7-Cszhq9RV.mjs} +26 -4
  128. package/dist/naming-DKr4TJd7-Cszhq9RV.mjs.map +1 -0
  129. package/dist/operations.d.mts +1 -1
  130. package/dist/orm-client.d.mts +11 -11
  131. package/dist/orm-client.mjs +1 -1
  132. package/dist/{plan-DfLDIdep-CoshEetE.d.mts → plan-DfLDIdep-6R1mLkcW.d.mts} +4 -4
  133. package/dist/{plan-DfLDIdep-CoshEetE.d.mts.map → plan-DfLDIdep-6R1mLkcW.d.mts.map} +1 -1
  134. package/dist/plan-HWPzzUxh.d.mts +2 -0
  135. package/dist/{psl-infer-DmFgn-Ub.d.mts → psl-infer-CCAD6FWA.d.mts} +3 -3
  136. package/dist/{psl-infer-DmFgn-Ub.d.mts.map → psl-infer-CCAD6FWA.d.mts.map} +1 -1
  137. package/dist/{psl-infer-Z4wA2xpx.mjs → psl-infer-YhbKkybN.mjs} +2 -2
  138. package/dist/{psl-infer-Z4wA2xpx.mjs.map → psl-infer-YhbKkybN.mjs.map} +1 -1
  139. package/dist/{query-lane-context-DyDSQVS--ByM80KpV.d.mts → query-lane-context-DyDSQVS--CyCznt67.d.mts} +5 -5
  140. package/dist/{query-lane-context-DyDSQVS--ByM80KpV.d.mts.map → query-lane-context-DyDSQVS--CyCznt67.d.mts.map} +1 -1
  141. package/dist/query-lane-context-qfJzguc9.d.mts +1 -0
  142. package/dist/relational-core.d.mts +11 -11
  143. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  144. package/dist/relational-core__ast.d.mts +3 -3
  145. package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
  146. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  147. package/dist/relational-core__contract-free.d.mts +3 -3
  148. package/dist/relational-core__expression.d.mts +1 -1
  149. package/dist/relational-core__middleware.d.mts +2 -2
  150. package/dist/relational-core__plan.d.mts +3 -3
  151. package/dist/relational-core__query-lane-context.d.mts +2 -2
  152. package/dist/relational-core__types.d.mts +2 -2
  153. package/dist/{resolve-storage-table-DFhpOR0X.d.mts → resolve-storage-table-Nyrgk4h8.d.mts} +3 -3
  154. package/dist/{resolve-storage-table-DFhpOR0X.d.mts.map → resolve-storage-table-Nyrgk4h8.d.mts.map} +1 -1
  155. package/dist/{runtime-VGVRdwBD.d.mts → runtime-CjXCGPS4.d.mts} +3 -3
  156. package/dist/{runtime-VGVRdwBD.d.mts.map → runtime-CjXCGPS4.d.mts.map} +1 -1
  157. package/dist/runtime.d.mts +3 -3
  158. package/dist/runtime.mjs +1 -1
  159. package/dist/{schema-differ-DpG_gnur-B7QINE8f.d.mts → schema-differ-DpG_gnur-DFAtGezx.d.mts} +5 -5
  160. package/dist/{schema-differ-DpG_gnur-B7QINE8f.d.mts.map → schema-differ-DpG_gnur-DFAtGezx.d.mts.map} +1 -1
  161. package/dist/schema-ir.d.mts +1 -1
  162. package/dist/schema-ir.mjs +1 -1
  163. package/dist/schema-ir__naming.d.mts +2 -2
  164. package/dist/schema-ir__naming.mjs +2 -2
  165. package/dist/schema-ir__types.d.mts +2 -2
  166. package/dist/schema-ir__types.mjs +1 -1
  167. package/dist/{schema-verify-C_PEdlAr-U3MX28Zu.mjs → schema-verify-C_PEdlAr-Dxxjm6EM.mjs} +2 -2
  168. package/dist/{schema-verify-C_PEdlAr-U3MX28Zu.mjs.map → schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map} +1 -1
  169. package/dist/{serialized-index-D9YgVREe-KaLdoijn.d.mts → serialized-index-CrgG8ct1-DG3JpHc7.d.mts} +4 -4
  170. package/dist/serialized-index-CrgG8ct1-DG3JpHc7.d.mts.map +1 -0
  171. package/dist/{serialized-index-DMOkKJdP-JPETIsd7.mjs → serialized-index-nBTwanKy-_ddEK4tk.mjs} +5 -5
  172. package/dist/{serialized-index-DMOkKJdP-JPETIsd7.mjs.map → serialized-index-nBTwanKy-_ddEK4tk.mjs.map} +1 -1
  173. package/dist/{sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs → sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs} +5 -5
  174. package/dist/{sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs.map → sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map} +1 -1
  175. package/dist/{sql-execution-plan-qxvHnFcA-DdIwfSmv.d.mts → sql-execution-plan-qxvHnFcA-HjRSS3l9.d.mts} +2 -2
  176. package/dist/{sql-execution-plan-qxvHnFcA-DdIwfSmv.d.mts.map → sql-execution-plan-qxvHnFcA-HjRSS3l9.d.mts.map} +1 -1
  177. package/dist/{sql-index-ByAAE7K8-C1h4IS27.d.mts → sql-index-ByAAE7K8-DKj2V86p.d.mts} +2 -2
  178. package/dist/{sql-index-ByAAE7K8-C1h4IS27.d.mts.map → sql-index-ByAAE7K8-DKj2V86p.d.mts.map} +1 -1
  179. package/dist/{sql-storage-CySVsLrY-e9C5Gszx.d.mts → sql-storage-8LqxeLAY-DH4DdUXx.d.mts} +4 -4
  180. package/dist/{sql-storage-CySVsLrY-e9C5Gszx.d.mts.map → sql-storage-8LqxeLAY-DH4DdUXx.d.mts.map} +1 -1
  181. package/dist/{storage-table-BLcRrDzz-D4JOM8FC.d.mts → storage-table-DSeWszOL-CI-cItEK.d.mts} +6 -44
  182. package/dist/storage-table-DSeWszOL-CI-cItEK.d.mts.map +1 -0
  183. package/dist/{storage-table-D8o37IKw-bbcikEu-.mjs → storage-table-ZzbR-xzQ-BRoTQE_2.mjs} +4 -4
  184. package/dist/{storage-table-D8o37IKw-bbcikEu-.mjs.map → storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map} +1 -1
  185. package/dist/{types-CRlrNF8_-xtE1f_Ya.mjs → types-4YenawkP-CwaaZSid.mjs} +3 -3
  186. package/dist/{types-CRlrNF8_-xtE1f_Ya.mjs.map → types-4YenawkP-CwaaZSid.mjs.map} +1 -1
  187. package/dist/types-4u1EPYY6.d.mts +1 -0
  188. package/dist/{types-C89S13jo-CGy-V60b.d.mts → types-BDUG29Df-LE85dIXP.d.mts} +7 -6
  189. package/dist/types-BDUG29Df-LE85dIXP.d.mts.map +1 -0
  190. package/dist/{types-CLN9Y3BH-B9xrXW2L.d.mts → types-CLN9Y3BH-BHUrV7MD.d.mts} +10 -10
  191. package/dist/{types-CLN9Y3BH-B9xrXW2L.d.mts.map → types-CLN9Y3BH-BHUrV7MD.d.mts.map} +1 -1
  192. package/dist/{types-DYXr7yN6.mjs → types-CUsJrvEl.mjs} +2 -2
  193. package/dist/{types-DYXr7yN6.mjs.map → types-CUsJrvEl.mjs.map} +1 -1
  194. package/dist/types-Dwcw0F8X.d.mts +1 -0
  195. package/dist/{types-IqZMLrFC-Sr3TZmGu.d.mts → types-IqZMLrFC-Dk3bHKmk.d.mts} +9 -9
  196. package/dist/{types-IqZMLrFC-Sr3TZmGu.d.mts.map → types-IqZMLrFC-Dk3bHKmk.d.mts.map} +1 -1
  197. package/dist/{types-D6ST3Gkf.d.mts → types-UcHa2cTe.d.mts} +7 -6
  198. package/dist/types-UcHa2cTe.d.mts.map +1 -0
  199. package/dist/{types-H7xjfrKl-CHqi_h5i.d.mts → types-YStFFkKs-D9UAmnON.d.mts} +3 -3
  200. package/dist/{types-H7xjfrKl-CHqi_h5i.d.mts.map → types-YStFFkKs-D9UAmnON.d.mts.map} +1 -1
  201. package/dist/{types-ZzeQKmYD-D1hXGIgd.d.mts → types-ZzeQKmYD-kI_QWHEx.d.mts} +2 -2
  202. package/dist/{types-ZzeQKmYD-D1hXGIgd.d.mts.map → types-ZzeQKmYD-kI_QWHEx.d.mts.map} +1 -1
  203. package/dist/{validators-DQHTuehE.d.mts → validators-Belo8QqM.d.mts} +3 -3
  204. package/dist/{validators-DQHTuehE.d.mts.map → validators-Belo8QqM.d.mts.map} +1 -1
  205. package/dist/{validators-Bvxcp487.mjs → validators-CrWD6bSP.mjs} +0 -0
  206. package/dist/{validators-Bvxcp487.mjs.map → validators-CrWD6bSP.mjs.map} +1 -1
  207. package/package.json +19 -18
  208. package/dist/contract-builder-BFN7WSed.mjs.map +0 -1
  209. package/dist/contract-builder-Dqnem9IW.d.mts.map +0 -1
  210. package/dist/control-adapter-CTyZpWUT.d.mts +0 -1
  211. package/dist/derived-checks-CmJgg-N0-CugkINPW.mjs.map +0 -1
  212. package/dist/entity-kinds-DZzdcuU5.d.mts.map +0 -1
  213. package/dist/index-naming-BoGBcMmI-CoehgjMK.mjs.map +0 -1
  214. package/dist/interpreter-BDZ_Y5U--CMEJIQ40.mjs.map +0 -1
  215. package/dist/middleware-Pe2hkf2T.d.mts +0 -1
  216. package/dist/naming-BWkuWJJK-zuGIIJ49.mjs.map +0 -1
  217. package/dist/naming-BsvzQPOq-qOWmknyp.d.mts.map +0 -1
  218. package/dist/plan-DduVZV0X.d.mts +0 -2
  219. package/dist/query-lane-context-DojOMvih.d.mts +0 -1
  220. package/dist/serialized-index-D9YgVREe-KaLdoijn.d.mts.map +0 -1
  221. package/dist/storage-table-BLcRrDzz-D4JOM8FC.d.mts.map +0 -1
  222. package/dist/types-C0QjlN2G.d.mts +0 -1
  223. package/dist/types-C89S13jo-CGy-V60b.d.mts.map +0 -1
  224. package/dist/types-D6ST3Gkf.d.mts.map +0 -1
  225. package/dist/types-yvAngq6d.d.mts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dist-DtLVFgdI.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 { 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\tresolveFieldTypeParams(_modelName, fieldName, model, contract) {\n\t\tconst sqlModel = model;\n\t\tconst storageField = sqlModel.storage?.fields?.[fieldName];\n\t\tif (!storageField) return void 0;\n\t\tconst storage = contract.storage;\n\t\tif (!storage) return void 0;\n\t\tconst tableName = sqlModel.storage.table;\n\t\tconst storageNamespaceId = sqlModel.storage.namespaceId;\n\t\tif (!storageNamespaceId) return void 0;\n\t\tconst table = entityAt(storage, {\n\t\t\tnamespaceId: storageNamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t\tif (!table) return void 0;\n\t\tconst column = table.columns[storageField.column];\n\t\tif (!column) return void 0;\n\t\tif (column.typeRef) {\n\t\t\tconst typeInstance = storage.types?.[column.typeRef];\n\t\t\tif (typeInstance === void 0) return void 0;\n\t\t\treturn typeInstance.typeParams;\n\t\t}\n\t\treturn column.typeParams;\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\" 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 columnTypeParams(storage, column) {\n\tif (column.typeRef) {\n\t\tconst typeInstance = storage.types?.[column.typeRef];\n\t\tif (typeInstance === void 0) return void 0;\n\t\treturn blindCast(typeInstance).typeParams;\n\t}\n\treturn column.typeParams;\n}\nfunction renderRefinedCodecType(column, side, params, codecLookup) {\n\tif (codecLookup && params && Object.keys(params).length > 0) {\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, columnTypeParams(storage, column), codecLookup);\n\tif (column.many === true) base = `ReadonlyArray<${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.nativeType !== \"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 nativeType.\",\n\t\t\tmeta: { type: typeName }\n\t\t});\n\t\tconst codecId = serializeValue(codecInstanceShape.codecId);\n\t\tconst nativeType = serializeValue(codecInstanceShape.nativeType);\n\t\tconst typeParamsStr = serializeTypeParamsLiteral(codecInstanceShape.typeParams);\n\t\ttypeEntries.push(`readonly ${serializeObjectKey(typeName)}: { readonly kind: \"codec-instance\"; readonly codecId: ${codecId}; readonly nativeType: ${nativeType}; 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 nativeType = serializeValue(col.nativeType);\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\tcolumns.push(`readonly ${serializeObjectKey(colName)}: { readonly nativeType: ${nativeType}; readonly codecId: ${codecId}; readonly nullable: ${nullable}${defaultSpec}${typeParamsSpec}${typeRefSpec} }`);\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":";;;;;;;AAOA,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,OAAO,KAAK,IAAI,EAAE,iBAAiB;EACjP,KAAK;EACL,KAAK,uCAAuC,UAAU,UAAU,UAAU,UAAU,QAAQ;EAC5F,MAAM;GACL,WAAW,UAAU;GACrB,SAAS,UAAU;GACnB,QAAQ,UAAU;EACnB;CACD,CAAC;CACD,OAAO,KAAK,CAAC,GAAG,QAAQ,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,KAAK,cAAc,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,WAAW;EACpH,MAAM,UAAU,CAAC,uBAAuB,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,aAAa,eAAe,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,KAAK,cAAc,KAAK,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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
+ {"version":3,"file":"dist-ZK6oeI5e.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 { 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\tresolveFieldTypeParams(_modelName, fieldName, model, contract) {\n\t\tconst sqlModel = model;\n\t\tconst storageField = sqlModel.storage?.fields?.[fieldName];\n\t\tif (!storageField) return void 0;\n\t\tconst storage = contract.storage;\n\t\tif (!storage) return void 0;\n\t\tconst tableName = sqlModel.storage.table;\n\t\tconst storageNamespaceId = sqlModel.storage.namespaceId;\n\t\tif (!storageNamespaceId) return void 0;\n\t\tconst table = entityAt(storage, {\n\t\t\tnamespaceId: storageNamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t\tif (!table) return void 0;\n\t\tconst column = table.columns[storageField.column];\n\t\tif (!column) return void 0;\n\t\tif (column.typeRef) {\n\t\t\tconst typeInstance = storage.types?.[column.typeRef];\n\t\t\tif (typeInstance === void 0) return void 0;\n\t\t\treturn typeInstance.typeParams;\n\t\t}\n\t\treturn column.typeParams;\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\" 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 columnTypeParams(storage, column) {\n\tif (column.typeRef) {\n\t\tconst typeInstance = storage.types?.[column.typeRef];\n\t\tif (typeInstance === void 0) return void 0;\n\t\treturn blindCast(typeInstance).typeParams;\n\t}\n\treturn column.typeParams;\n}\nfunction renderRefinedCodecType(column, side, params, codecLookup) {\n\tif (codecLookup && params && Object.keys(params).length > 0) {\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, columnTypeParams(storage, column), codecLookup);\n\tif (column.many === true) base = `ReadonlyArray<${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.nativeType !== \"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 nativeType.\",\n\t\t\tmeta: { type: typeName }\n\t\t});\n\t\tconst codecId = serializeValue(codecInstanceShape.codecId);\n\t\tconst nativeType = serializeValue(codecInstanceShape.nativeType);\n\t\tconst typeParamsStr = serializeTypeParamsLiteral(codecInstanceShape.typeParams);\n\t\ttypeEntries.push(`readonly ${serializeObjectKey(typeName)}: { readonly kind: \"codec-instance\"; readonly codecId: ${codecId}; readonly nativeType: ${nativeType}; 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 nativeType = serializeValue(col.nativeType);\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\tcolumns.push(`readonly ${serializeObjectKey(colName)}: { readonly nativeType: ${nativeType}; readonly codecId: ${codecId}; readonly nullable: ${nullable}${defaultSpec}${typeParamsSpec}${typeRefSpec} }`);\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":";;;;;;;AAOA,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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,EAAE,mBAAmB,eAAe,GAAG,EAAE,IAAI,WAAW,sBAAsB,YAAY,GAAG;CAC5I;CACA,OAAO,KAAK,MAAM,KAAK,IAAI,EAAE;AAC9B"}
@@ -1,7 +1,8 @@
1
- import { t as Index } from "./sql-index-ByAAE7K8-C1h4IS27.mjs";
2
- import { a as StorageTable, o as StorageTableInput, t as CheckConstraint } from "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
1
+ import { t as CheckConstraint } from "./check-constraint-B7qGu6rc-HvQjjX82.mjs";
2
+ import { t as Index } from "./sql-index-ByAAE7K8-DKj2V86p.mjs";
3
+ import { i as StorageTableInput, r as StorageTable } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
3
4
  import { n as StorageValueSetInput, t as StorageValueSet } from "./storage-value-set-BGlj5Uus-CvZD--GG.mjs";
4
- import { n as SerializedIndex, t as SerializedCheckConstraint } from "./serialized-index-D9YgVREe-KaLdoijn.mjs";
5
+ import { n as SerializedIndex, t as SerializedCheckConstraint } from "./serialized-index-CrgG8ct1-DG3JpHc7.mjs";
5
6
  import { AnyEntityKindDescriptor, EntityKindDescriptor } from "@prisma/orm-framework/components/ir";
6
7
  //#region ../../../2-sql/1-core/contract/dist/entity-kinds.d.mts
7
8
  //#region src/entity-kinds.d.ts
@@ -27,4 +28,4 @@ declare const valueSetEntityKind: EntityKindDescriptor<StorageValueSetInput, Sto
27
28
  declare function composeSqlEntityKinds(packKinds?: readonly AnyEntityKindDescriptor[]): ReadonlyMap<string, AnyEntityKindDescriptor>;
28
29
  //#endregion
29
30
  export { tableEntityKind as n, valueSetEntityKind as r, composeSqlEntityKinds as t };
30
- //# sourceMappingURL=entity-kinds-DZzdcuU5.d.mts.map
31
+ //# sourceMappingURL=entity-kinds-B5cUFU22.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-kinds-B5cUFU22.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds.d.mts"],"mappings":";;;;;;;;;;;;;KAYK,yBAAyB,KAAK;WACxB,SAAS,cAAc,QAAQ;WAC/B,SAAS,cAAc,kBAAkB;;cAEtC,iBAAiB,qBAAqB,wBAAwB;cAC9D,oBAAoB,qBAAqB,sBAAsB;;;;;;;;;iBAS5D,sBAAsB,qBAAqB,4BAA4B,oBAAoB"}
@@ -1,9 +1,9 @@
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-D8o37IKw-bbcikEu-.mjs";
3
- import { n as checkConstraintInputFromSerialized, r as indexInputFromSerialized, t as StorageValueSet } from "./serialized-index-DMOkKJdP-JPETIsd7.mjs";
2
+ import { c as StorageTable, i as Index, t as CheckConstraint } from "./storage-table-ZzbR-xzQ-BRoTQE_2.mjs";
3
+ import { n as checkConstraintInputFromSerialized, r as indexInputFromSerialized, t as StorageValueSet } from "./serialized-index-nBTwanKy-_ddEK4tk.mjs";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
5
5
  import { type } from "arktype";
6
- //#region ../../../2-sql/1-core/contract/dist/entity-kinds-CCzdAMq3.mjs
6
+ //#region ../../../2-sql/1-core/contract/dist/entity-kinds-D7vwoN_T.mjs
7
7
  const literalKindSchema = type("'literal'");
8
8
  const functionKindSchema = type("'function'");
9
9
  const ControlPolicySchema = type("'managed' | 'tolerated' | 'external' | 'observed'");
@@ -143,4 +143,4 @@ function composeSqlEntityKinds(packKinds = []) {
143
143
  //#endregion
144
144
  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 };
145
145
 
146
- //# sourceMappingURL=entity-kinds-CCzdAMq3-x9-uzHu1.mjs.map
146
+ //# sourceMappingURL=entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-kinds-CCzdAMq3-x9-uzHu1.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds-CCzdAMq3.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { c as CheckConstraint, s as Index, t as StorageTable } from \"./storage-table-D8o37IKw.mjs\";\nimport { n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-DMOkKJdP.mjs\";\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 StorageColumnSchema = type({\n\t\"+\": \"reject\",\n\tnativeType: \"string\",\n\tcodecId: \"string\",\n\tnullable: \"boolean\",\n\t\"many?\": \"boolean\",\n\t\"typeParams?\": \"Record<string, unknown>\",\n\t\"typeRef?\": \"string\",\n\t\"default?\": ColumnDefaultSchema,\n\t\"control?\": ControlPolicySchema,\n\t\"valueSet?\": type({\n\t\tplane: \"'storage'\",\n\t\tnamespaceId: \"string\",\n\t\tentityKind: \"'valueSet'\",\n\t\tentityName: \"string\",\n\t\t\"spaceId?\": \"string\"\n\t}),\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 ForeignKeySchema = type.declare().type({\n\tsource: ForeignKeySourceSchema,\n\ttarget: ForeignKeyReferenceSchema,\n\t\"name?\": \"string\",\n\t\"onDelete?\": ReferentialActionSchema,\n\t\"onUpdate?\": ReferentialActionSchema\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-CCzdAMq3.mjs.map"],"mappings":";;;;;;AAMA,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,sBAAsB,KAAK;CAChC,KAAK;CACL,YAAY;CACZ,SAAS;CACT,UAAU;CACV,SAAS;CACT,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa,KAAK;EACjB,OAAO;EACP,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,YAAY;CACb,CAAC;CACD,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,OAAO,IAAI,OAAO,wEAAwE;EACxH,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,QAAQ,KAAK,GAAG;GA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AAqB,KAAK;CAC/B,KAAK;CACL,SAAS,KAAK,EAAE,YAAY,oBAAoB,CAAC;CACjD,eAAe;CACf,SAAS,uBAAuB,MAAM,CAAC,CAAC,SAAS;CACjD,SAAS,YAAY,MAAM,CAAC,CAAC,SAAS;CACtC,aAAa,iBAAiB,MAAM,CAAC,CAAC,SAAS;CAC/C,YAAY;CACZ,WAAW,sBAAsB,MAAM,CAAC,CAAC,SAAS;AACnD,CAAC;AAGD,MAAM,kBAAkB;CACvB,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,aAAa;EACtC,GAAG;EACH,SAAS,MAAM,QAAQ,KAAK,MAAM,aAAa,QAAQ,IAAI,yBAAyB,CAAC,CAAC;EACtF,GAAG,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
+ {"version":3,"file":"entity-kinds-D7vwoN_T-CCBwFJy0.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds-D7vwoN_T.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { c as CheckConstraint, s as Index, t as StorageTable } from \"./storage-table-ZzbR-xzQ.mjs\";\nimport { n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-nBTwanKy.mjs\";\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 StorageColumnSchema = type({\n\t\"+\": \"reject\",\n\tnativeType: \"string\",\n\tcodecId: \"string\",\n\tnullable: \"boolean\",\n\t\"many?\": \"boolean\",\n\t\"typeParams?\": \"Record<string, unknown>\",\n\t\"typeRef?\": \"string\",\n\t\"default?\": ColumnDefaultSchema,\n\t\"control?\": ControlPolicySchema,\n\t\"valueSet?\": type({\n\t\tplane: \"'storage'\",\n\t\tnamespaceId: \"string\",\n\t\tentityKind: \"'valueSet'\",\n\t\tentityName: \"string\",\n\t\t\"spaceId?\": \"string\"\n\t}),\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 ForeignKeySchema = type.declare().type({\n\tsource: ForeignKeySourceSchema,\n\ttarget: ForeignKeyReferenceSchema,\n\t\"name?\": \"string\",\n\t\"onDelete?\": ReferentialActionSchema,\n\t\"onUpdate?\": ReferentialActionSchema\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, valueS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AACnD,CAAC;AAGD,MAAM,kBAAkB;CACvB,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,aAAa;EACtC,GAAG;EACH,SAAS,MAAM,QAAQ,KAAK,MAAM,aAAa,QAAQ,IAAI,yBAAyB,CAAC,CAAC;EACtF,GAAG,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,7 +1,7 @@
1
- import { S as QueryOperationReturn } from "./types-C89S13jo-CGy-V60b.mjs";
2
- import "./types-D6ST3Gkf.mjs";
3
- import { t as SqlLoweringSpec } from "./index-DbDTloZS.mjs";
4
- import { Ct as RawSqlLiteral, T as CodecRef$1, _t as ParamRef, s as AnyExpression } from "./types-ZzeQKmYD-D1hXGIgd.mjs";
1
+ import { S as QueryOperationReturn } from "./types-BDUG29Df-LE85dIXP.mjs";
2
+ import "./types-UcHa2cTe.mjs";
3
+ import { t as SqlLoweringSpec } from "./index-C5I8D-MB.mjs";
4
+ import { Ct as RawSqlLiteral, T as CodecRef$1, _t as ParamRef, s as AnyExpression } from "./types-ZzeQKmYD-kI_QWHEx.mjs";
5
5
  import { ParamSpec } from "@prisma/orm-framework/operations";
6
6
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts
7
7
  //#region src/expression.d.ts
@@ -163,4 +163,4 @@ type RawSqlInterpolation = Expression<ScopeField> | ParamRef | RawSqlLiteral;
163
163
  declare function createRawSql(adapter: RawCodecInferer): RawSqlTag;
164
164
  //#endregion
165
165
  export { Expression as a, RawSqlTag as c, TraitExpression as d, buildOperation as f, toExpr as g, param as h, CodecValue as i, ScalarListExpression as l, createRawSql as m, CodecExpression as n, RawCodecInferer as o, codecOf as p, CodecTypesBase as r, RawSqlBuilder as s, BuildOperationSpec as t, ScopeField as u };
166
- //# sourceMappingURL=expression-E67TGFZA.d.mts.map
166
+ //# sourceMappingURL=expression-D7H1kyVG.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression-E67TGFZA.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts"],"mappings":";;;;;;;KAKK;EACH;EACA;;;;;;;;EAQA;;;;EAIA,QAAQ;;KAEL,iBAAiB;WACX;WACA;;;;;KAKN,WAAW,UAAU,cAAc;WAC7B,YAAY;EACrB,YAAY;;KAET,kBAAkB,WAAW;WACvB;IACP,+CAA+C,WAAW,cAAc,GAAG;WACpE,cAAc;KACpB,iCAAiC,KAAK,2BAA2B;KACjE,WAAW,KAAK;;;;;KAKhB,WAAW,wBAAwB,0BAA0B,WAAW;WAClE;OACJ,sBAAsB,KAAK,GAAG,6BAA6B,WAAW;;;;;;;;;;;;;;;KAexE,gBAAgB,wBAAwB,0BAA0B,WAAW;WACvE;MACL;EACJ,SAAS;EACT,UAAU;EACV;KACG,WAAW,SAAS,UAAU;;;;;;;KAO9B,qBAAqB,wBAAwB,4BAA4B;EAC5E,SAAS;EACT,UAAU;EACV;;;;;;;KAOG,gBAAgB,kCAAkC,0BAA0B,WAAW;WACjF;MACL,gBAAgB,kBAAkB,IAAI,SAAS,UAAU;;;;;;;;iBAQ9C,OAAO,gBAAgB,QAAQ,aAAW;;;;iBAI1C,MAAM,GAAG,OAAO,GAAG;EAClC;IACE;;;;;;;;;;;iBAWa,QAAQ,iBAAiB;UAChC,mBAAmB,UAAU;WAC5B;;;;WAIA,gBAAgB,kBAAkB;WAClC,SAAS,IAAI;WACb,UAAU;;;;;iBAKJ,eAAe,UAAU,YAAY,MAAM,mBAAmB,KAAK,WAAW;;;;;;;;;;;;;UAarF;EACR,WAAW,OAAO;;;UAGV;EACR,QAAQ,kBAAkB,MAAM,IAAI;IAClC,SAAS;IACT;;EAEF,QAAQ,kBAAkB,2BAA2B;aAC1C,SAAS;aACT,WAAW;MAClB;IACF,SAAS;IACT,UAAU;;;;KAIT,aAAa,SAAS,yBAAyB,QAAQ,0BAA0B;KACjF,sBAAsB,WAAW,cAAc,WAAW;;;;;;iBAM9C,aAAa,SAAS,kBAAkB"}
1
+ {"version":3,"file":"expression-D7H1kyVG.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/expression.d.mts"],"mappings":";;;;;;;KAKK;EACH;EACA;;;;;;;;EAQA;;;;EAIA,QAAQ;;KAEL,iBAAiB;WACX;WACA;;;;;KAKN,WAAW,UAAU,cAAc;WAC7B,YAAY;EACrB,YAAY;;KAET,kBAAkB,WAAW;WACvB;IACP,+CAA+C,WAAW,cAAc,GAAG;WACpE,cAAc;KACpB,iCAAiC,KAAK,2BAA2B;KACjE,WAAW,KAAK;;;;;KAKhB,WAAW,wBAAwB,0BAA0B,WAAW;WAClE;OACJ,sBAAsB,KAAK,GAAG,6BAA6B,WAAW;;;;;;;;;;;;;;;KAexE,gBAAgB,wBAAwB,0BAA0B,WAAW;WACvE;MACL;EACJ,SAAS;EACT,UAAU;EACV;KACG,WAAW,SAAS,UAAU;;;;;;;KAO9B,qBAAqB,wBAAwB,4BAA4B;EAC5E,SAAS;EACT,UAAU;EACV;;;;;;;KAOG,gBAAgB,kCAAkC,0BAA0B,WAAW;WACjF;MACL,gBAAgB,kBAAkB,IAAI,SAAS,UAAU;;;;;;;;iBAQ9C,OAAO,gBAAgB,QAAQ,aAAW;;;;iBAI1C,MAAM,GAAG,OAAO,GAAG;EAClC;IACE;;;;;;;;;;;iBAWa,QAAQ,iBAAiB;UAChC,mBAAmB,UAAU;WAC5B;;;;WAIA,gBAAgB,kBAAkB;WAClC,SAAS,IAAI;WACb,UAAU;;;;;iBAKJ,eAAe,UAAU,YAAY,MAAM,mBAAmB,KAAK,WAAW;;;;;;;;;;;;;UAarF;EACR,WAAW,OAAO;;;UAGV;EACR,QAAQ,kBAAkB,MAAM,IAAI;IAClC,SAAS;IACT;;EAEF,QAAQ,kBAAkB,2BAA2B;aAC1C,SAAS;aACT,WAAW;MAClB;IACF,SAAS;IACT,UAAU;;;;KAIT,aAAa,SAAS,yBAAyB,QAAQ,0BAA0B;KACjF,sBAAsB,WAAW,cAAc,WAAW;;;;;;iBAM9C,aAAa,SAAS,kBAAkB"}
@@ -1,8 +1,8 @@
1
1
  import { t as ForeignKey } from "./foreign-key-C-iTPuRT-C9ip8zFx.mjs";
2
2
  import { r as UniqueConstraint, t as PrimaryKey } from "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
3
- import { t as Index } from "./sql-index-ByAAE7K8-C1h4IS27.mjs";
4
- import { a as StorageTable, i as StorageColumnInput, r as StorageColumn } from "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
5
- import { A as SqlModelStorage, k as SqlModelFieldStorage, y as ForeignKeyOptions } from "./types-C89S13jo-CGy-V60b.mjs";
3
+ import { t as Index } from "./sql-index-ByAAE7K8-DKj2V86p.mjs";
4
+ import { n as StorageColumnInput, r as StorageTable, t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
5
+ import { A as SqlModelStorage, k as SqlModelFieldStorage, y as ForeignKeyOptions } from "./types-BDUG29Df-LE85dIXP.mjs";
6
6
  import { ScalarFieldType } from "@prisma/orm-framework/contract/types";
7
7
  //#region ../../../2-sql/1-core/contract/dist/factories.d.mts
8
8
  //#region src/factories.d.ts
@@ -36,4 +36,4 @@ declare function model(tableName: string, fields: Record<string, SqlModelFieldSt
36
36
  };
37
37
  //#endregion
38
38
  export { pk as a, model as i, fk as n, table as o, index as r, unique as s, col as t };
39
- //# sourceMappingURL=factories-C8VyKQ90.d.mts.map
39
+ //# sourceMappingURL=factories-P3qBQhO-.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factories-C8VyKQ90.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/factories.d.mts"],"mappings":";;;;;;;;iBAOiB,IAAI,oBAAoB,iBAAiB,oBAAoB;WACnE;IACP;iBACa,MAAM,6BAA6B;iBACnC,UAAU,6BAA6B;iBACvC,MAAM,cAAc,4BAA4B;WACtD;WACA;WACA;WACA,UAAU;IACjB;iBACa,GAAG,sBAAsB,+BAA+B,yBAAyB,kCAAkC,OAAO;EACzI;IACE;iBACa,MAAM,SAAS,eAAe,gBAAgB,qBAAqB;EAClF,KAAK;EACL,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;IACb;iBACa,MAAM,mBAAmB,QAAQ,eAAe,uBAAuB,YAAY,yBAAyB;EAC3H,SAAS;EACT,QAAQ;aACG;aACA,MAAM;;EAEjB,WAAW"}
1
+ {"version":3,"file":"factories-P3qBQhO-.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/factories.d.mts"],"mappings":";;;;;;;;iBAOiB,IAAI,oBAAoB,iBAAiB,oBAAoB;WACnE;IACP;iBACa,MAAM,6BAA6B;iBACnC,UAAU,6BAA6B;iBACvC,MAAM,cAAc,4BAA4B;WACtD;WACA;WACA;WACA,UAAU;IACjB;iBACa,GAAG,sBAAsB,+BAA+B,yBAAyB,kCAAkC,OAAO;EACzI;IACE;iBACa,MAAM,SAAS,eAAe,gBAAgB,qBAAqB;EAClF,KAAK;EACL,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;IACb;iBACa,MAAM,mBAAmB,QAAQ,eAAe,uBAAuB,YAAY,yBAAyB;EAC3H,SAAS;EACT,QAAQ;aACG;aACA,MAAM;;EAEjB,WAAW"}
@@ -1,5 +1,5 @@
1
- import { p as parseNaming } from "./naming-BWkuWJJK-zuGIIJ49.mjs";
2
- import { a as PrimaryKey, c as StorageTable, i as Index, l as UniqueConstraint, n as ForeignKey, s as StorageColumn } from "./storage-table-D8o37IKw-bbcikEu-.mjs";
1
+ import { m as parseNaming } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
2
+ import { a as PrimaryKey, c as StorageTable, i as Index, l as UniqueConstraint, n as ForeignKey, s as StorageColumn } from "./storage-table-ZzbR-xzQ-BRoTQE_2.mjs";
3
3
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
4
  import { asNamespaceId } from "@prisma/orm-framework/contract/types";
5
5
  //#region ../../../2-sql/1-core/contract/dist/factories.mjs
@@ -74,4 +74,4 @@ function model(tableName, fields, relations = {}, namespaceId = UNBOUND_NAMESPAC
74
74
  //#endregion
75
75
  export { pk as a, model as i, fk as n, table as o, index as r, unique as s, col as t };
76
76
 
77
- //# sourceMappingURL=factories-BIzyHng2.mjs.map
77
+ //# sourceMappingURL=factories-SVor5xIT.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"factories-BIzyHng2.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/factories.mjs"],"sourcesContent":["import { a as ForeignKey, i as PrimaryKey, n as UniqueConstraint, r as StorageColumn, s as Index, t as StorageTable } from \"./storage-table-D8o37IKw.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/factories.ts\nfunction col(nativeType, codecId, nullable = false, opts) {\n\treturn new StorageColumn({\n\t\tnativeType,\n\t\tcodecId,\n\t\tnullable,\n\t\t...opts?.many !== void 0 && { many: opts.many }\n\t});\n}\nfunction pk(...columns) {\n\treturn new PrimaryKey({ columns });\n}\nfunction unique(...columns) {\n\treturn new UniqueConstraint({ columns });\n}\nfunction index(name, columns, opts) {\n\treturn new Index({\n\t\tnaming: parseNaming(name, opts?.prefix),\n\t\tcolumns,\n\t\twhere: void 0,\n\t\tunique: opts?.unique ?? false,\n\t\ttype: opts?.type,\n\t\toptions: opts?.options\n\t});\n}\nfunction fk(srcTableName, srcColumns, targetTableName, targetColumns, opts) {\n\tconst namespaceId = asNamespaceId(opts?.namespaceId ?? UNBOUND_NAMESPACE_ID);\n\treturn new ForeignKey({\n\t\tsource: {\n\t\t\tnamespaceId,\n\t\t\ttableName: srcTableName,\n\t\t\tcolumns: srcColumns\n\t\t},\n\t\ttarget: {\n\t\t\tnamespaceId,\n\t\t\ttableName: targetTableName,\n\t\t\tcolumns: targetColumns\n\t\t},\n\t\t...opts?.name !== void 0 && { name: opts.name },\n\t\t...opts?.onDelete !== void 0 && { onDelete: opts.onDelete },\n\t\t...opts?.onUpdate !== void 0 && { onUpdate: opts.onUpdate }\n\t});\n}\nfunction table(columns, opts) {\n\treturn new StorageTable({\n\t\tcolumns,\n\t\t...opts?.pk !== void 0 && { primaryKey: opts.pk },\n\t\tuniques: opts?.uniques ?? [],\n\t\tindexes: opts?.indexes ?? [],\n\t\tforeignKeys: opts?.fks ?? []\n\t});\n}\nfunction model(tableName, fields, relations = {}, namespaceId = UNBOUND_NAMESPACE_ID) {\n\treturn {\n\t\tstorage: {\n\t\t\ttable: tableName,\n\t\t\tnamespaceId,\n\t\t\tfields\n\t\t},\n\t\tfields: Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, {\n\t\t\tnullable: field.nullable ?? false,\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: field.codecId ?? \"core/unknown@1\"\n\t\t\t}\n\t\t}])),\n\t\trelations\n\t};\n}\n//#endregion\nexport { col, fk, index, model, pk, table, unique };\n\n//# sourceMappingURL=factories.mjs.map"],"mappings":";;;;;AAKA,SAAS,IAAI,YAAY,SAAS,WAAW,OAAO,MAAM;CACzD,OAAO,IAAI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AO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM;GAC/E,UAAU,MAAM,YAAY;GAC5B,MAAM;IACL,MAAM;IACN,SAAS,MAAM,WAAW;GAC3B;EACD,CAAC,CAAC,CAAC;EACH;CACD;AACD"}
1
+ {"version":3,"file":"factories-SVor5xIT.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/factories.mjs"],"sourcesContent":["import { a as ForeignKey, i as PrimaryKey, n as UniqueConstraint, r as StorageColumn, s as Index, t as StorageTable } from \"./storage-table-ZzbR-xzQ.mjs\";\nimport { parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/factories.ts\nfunction col(nativeType, codecId, nullable = false, opts) {\n\treturn new StorageColumn({\n\t\tnativeType,\n\t\tcodecId,\n\t\tnullable,\n\t\t...opts?.many !== void 0 && { many: opts.many }\n\t});\n}\nfunction pk(...columns) {\n\treturn new PrimaryKey({ columns });\n}\nfunction unique(...columns) {\n\treturn new UniqueConstraint({ columns });\n}\nfunction index(name, columns, opts) {\n\treturn new Index({\n\t\tnaming: parseNaming(name, opts?.prefix),\n\t\tcolumns,\n\t\twhere: void 0,\n\t\tunique: opts?.unique ?? false,\n\t\ttype: opts?.type,\n\t\toptions: opts?.options\n\t});\n}\nfunction fk(srcTableName, srcColumns, targetTableName, targetColumns, opts) {\n\tconst namespaceId = asNamespaceId(opts?.namespaceId ?? UNBOUND_NAMESPACE_ID);\n\treturn new ForeignKey({\n\t\tsource: {\n\t\t\tnamespaceId,\n\t\t\ttableName: srcTableName,\n\t\t\tcolumns: srcColumns\n\t\t},\n\t\ttarget: {\n\t\t\tnamespaceId,\n\t\t\ttableName: targetTableName,\n\t\t\tcolumns: targetColumns\n\t\t},\n\t\t...opts?.name !== void 0 && { name: opts.name },\n\t\t...opts?.onDelete !== void 0 && { onDelete: opts.onDelete },\n\t\t...opts?.onUpdate !== void 0 && { onUpdate: opts.onUpdate }\n\t});\n}\nfunction table(columns, opts) {\n\treturn new StorageTable({\n\t\tcolumns,\n\t\t...opts?.pk !== void 0 && { primaryKey: opts.pk },\n\t\tuniques: opts?.uniques ?? [],\n\t\tindexes: opts?.indexes ?? [],\n\t\tforeignKeys: opts?.fks ?? []\n\t});\n}\nfunction model(tableName, fields, relations = {}, namespaceId = UNBOUND_NAMESPACE_ID) {\n\treturn {\n\t\tstorage: {\n\t\t\ttable: tableName,\n\t\t\tnamespaceId,\n\t\t\tfields\n\t\t},\n\t\tfields: Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, {\n\t\t\tnullable: field.nullable ?? false,\n\t\t\ttype: {\n\t\t\t\tkind: \"scalar\",\n\t\t\t\tcodecId: field.codecId ?? \"core/unknown@1\"\n\t\t\t}\n\t\t}])),\n\t\trelations\n\t};\n}\n//#endregion\nexport { col, fk, index, model, pk, table, unique };\n\n//# sourceMappingURL=factories.mjs.map"],"mappings":";;;;;AAKA,SAAS,IAAI,YAAY,SAAS,WAAW,OAAO,MAAM;CACzD,OAAO,IAAI,cAAc;EACxB;EACA;EACA;EACA,GAAG,MAAM,SAAS,KAAK,KAAK,EAAE,MAAM,KAAK,KAAK;CAC/C,CAAC;AACF;AACA,SAAS,GAAG,GAAG,SAAS;CACvB,OAAO,IAAI,WAAW,EAAE,QAAQ,CAAC;AAClC;AACA,SAAS,OAAO,GAAG,SAAS;CAC3B,OAAO,IAAI,iBAAiB,EAAE,QAAQ,CAAC;AACxC;AACA,SAAS,MAAM,MAAM,SAAS,MAAM;CACnC,OAAO,IAAI,MAAM;EAChB,QAAQ,YAAY,MAAM,MAAM,MAAM;EACtC;EACA,OAAO,KAAK;EACZ,QAAQ,MAAM,UAAU;EACxB,MAAM,MAAM;EACZ,SAAS,MAAM;CAChB,CAAC;AACF;AACA,SAAS,GAAG,cAAc,YAAY,iBAAiB,eAAe,MAAM;CAC3E,MAAM,cAAc,cAAc,MAAM,eAAe,oBAAoB;CAC3E,OAAO,IAAI,WAAW;EACrB,QAAQ;GACP;GACA,WAAW;GACX,SAAS;EACV;EACA,QAAQ;GACP;GACA,WAAW;GACX,SAAS;EACV;EACA,GAAG,MAAM,SAAS,KAAK,KAAK,EAAE,MAAM,KAAK,KAAK;EAC9C,GAAG,MAAM,aAAa,KAAK,KAAK,EAAE,UAAU,KAAK,SAAS;EAC1D,GAAG,MAAM,aAAa,KAAK,KAAK,EAAE,UAAU,KAAK,SAAS;CAC3D,CAAC;AACF;AACA,SAAS,MAAM,SAAS,MAAM;CAC7B,OAAO,IAAI,aAAa;EACvB;EACA,GAAG,MAAM,OAAO,KAAK,KAAK,EAAE,YAAY,KAAK,GAAG;EAChD,SAAS,MAAM,WAAW,CAAC;EAC3B,SAAS,MAAM,WAAW,CAAC;EAC3B,aAAa,MAAM,OAAO,CAAC;CAC5B,CAAC;AACF;AACA,SAAS,MAAM,WAAW,QAAQ,YAAY,CAAC,GAAG,cAAc,sBAAsB;CACrF,OAAO;EACN,SAAS;GACR,OAAO;GACP;GACA;EACD;EACA,QAAQ,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM;GAC/E,UAAU,MAAM,YAAY;GAC5B,MAAM;IACL,MAAM;IACN,SAAS,MAAM,WAAW;GAC3B;EACD,CAAC,CAAC,CAAC;EACH;CACD;AACD"}
package/dist/family.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-DFhpOR0X.mjs";
2
- import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-B4MyB0B0.mjs";
3
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-Sr3TZmGu.mjs";
4
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-B7QINE8f.mjs";
5
- import { A as partitionCallsByControlPolicy, B as timestampNowControlDescriptor, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-0OFuH6HK.mjs";
6
- import "./control-adapter-CTyZpWUT.mjs";
7
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-dX8KnmWc.mjs";
8
- import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-CVhRa-4t.mjs";
9
- import { t as SqlMigration } from "./migration-C8MAouav.mjs";
10
- import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toEnumName, y as toFieldName } from "./psl-infer-DmFgn-Ub.mjs";
11
- import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-VGVRdwBD.mjs";
1
+ import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
+ import { i as SqlControlAdapter, n as Lowerer, o as arraysEqual, r as NativeTypeNormalizer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-DsxImHyk.mjs";
3
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-Dk3bHKmk.mjs";
4
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DFAtGezx.mjs";
5
+ import { A as partitionCallsByControlPolicy, B as timestampNowControlDescriptor, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-DI9DC2AS.mjs";
6
+ import "./control-adapter-BdOcXTOm.mjs";
7
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-DVvZXmFv.mjs";
8
+ import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-Bghjt-FG.mjs";
9
+ import { t as SqlMigration } from "./migration-Dtymew3g.mjs";
10
+ import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toEnumName, y as toFieldName } from "./psl-infer-CCAD6FWA.mjs";
11
+ import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CjXCGPS4.mjs";
12
12
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
13
13
  export { type CodecControlHooks, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultRenderer, type DefaultResolver, type EnumInfo, type EnumNamespaceSchemaResolver, type ExecuteRequestLowerer, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type InferredRelations, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type NativeTypeNormalizer, type PlanFieldEventOperationsOptions, type PslPrinterOptions, type PslTypeMap, type PslTypeReference, type PslTypeResolution, type RelationField, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SuppressionRecord, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, parseRawDefault, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, verifySqlSchemaByDiff };
package/dist/family.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
- import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-U3MX28Zu.mjs";
3
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs";
2
+ import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
3
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs";
4
4
  import { n as parseContractMarkerRow } from "./verify-u0UTdZgD-DSAaz9rW.mjs";
5
5
  import { a as timestampNowControlDescriptor, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, r as temporalCodecPreset } from "./timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs";
6
- import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-f9B6b5c2.mjs";
6
+ import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-DAkNosoF.mjs";
7
7
  import { t as arraysEqual } from "./diff-B16bL_IR.mjs";
8
8
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
9
9
  import { t as SqlMigration } from "./migration-CK4oePIo.mjs";
10
- import { a as mapDefault, c as toEnumMemberName, d as toModelName, i as inferRelations, l as toEnumName, n as deriveBackRelationFieldName, o as parseRawDefault, r as deriveRelationFieldName, s as pluralize, t as buildChildRelationField, u as toFieldName } from "./psl-infer-Z4wA2xpx.mjs";
10
+ import { a as mapDefault, c as toEnumMemberName, d as toModelName, i as inferRelations, l as toEnumName, n as deriveBackRelationFieldName, o as parseRawDefault, r as deriveRelationFieldName, s as pluralize, t as buildChildRelationField, u as toFieldName } from "./psl-infer-YhbKkybN.mjs";
11
11
  import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-tIHpGCcG.mjs";
12
12
  export { INIT_ADDITIVE_POLICY, SqlMigration as Migration, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, UNBOUND_DOMAIN_NAMESPACE_ID, arraysEqual, assembleAuthoringContributions, buildChildRelationField, buildNativeTypeExpander, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, extractCodecControlHooks, inferRelations, mapDefault, parseContractMarkerRow, parseRawDefault, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, pluralize, resolveDomainModel, resolveStorageTable, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-B4MyB0B0.mjs";
2
- import "./control-adapter-CTyZpWUT.mjs";
1
+ import { a as SqlControlAdapterDescriptor, i as SqlControlAdapter, n as Lowerer, t as ExecuteRequestLowerer } from "./control-adapter-C99J7aEF-DsxImHyk.mjs";
2
+ import "./control-adapter-BdOcXTOm.mjs";
3
3
  export type { ExecuteRequestLowerer, Lowerer, SqlControlAdapter, SqlControlAdapterDescriptor };
@@ -1,4 +1,4 @@
1
- import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-Sr3TZmGu.mjs";
2
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-B7QINE8f.mjs";
3
- import { A as partitionCallsByControlPolicy, B as timestampNowControlDescriptor, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-0OFuH6HK.mjs";
1
+ import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, D as SqlPlannerConflictLocation, E as SqlPlannerConflictKind, O as SqlPlannerFailureResult, S as SqlMigrationRunnerResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, a as FieldEvent, b as SqlMigrationRunnerExecuteOptions, c as SqlControlAdapterDescriptor, d as SqlMigrationPlanContractInfo, f as SqlMigrationPlanOperation, g as SqlMigrationPlannerPlanOptions, h as SqlMigrationPlanner, i as ExpandNativeTypeInput, j as StorageTypePlanResult, k as SqlPlannerResult, l as SqlControlExtensionDescriptor, m as SqlMigrationPlanOperationTarget, n as CodecControlHooks, o as FieldEventContext, p as SqlMigrationPlanOperationStep, r as CreateSqlMigrationPlanOptions, s as ResolveIdentityValueInput, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, w as SqlPlanTargetDetails, x as SqlMigrationRunnerFailure, y as SqlMigrationRunnerExecuteCallbacks } from "./types-IqZMLrFC-Dk3bHKmk.mjs";
2
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-DFAtGezx.mjs";
3
+ import { A as partitionCallsByControlPolicy, B as timestampNowControlDescriptor, C as buildNativeTypeExpander, D as createMigrationPlan, E as controlPolicyForCall, F as runnerFailure, I as runnerSuccess, L as temporalAuthoringPresets, M as planFieldEventOperations, N as plannerFailure, O as detectDestructiveChanges, P as plannerSuccess, R as temporalCodecPreset, S as assembleAuthoringContributions, T as contractToSchemaIR, _ as SqlControlTargetDescriptor, a as EnumNamespaceSchemaResolver, b as TargetMigrationsCapability, c as MigrationOperationPolicy, d as MigrationPlanner, f as MigrationPlannerConflict, g as SqlControlFamilyInstance, h as PlanFieldEventOperationsOptions, i as DefaultResolver, j as partitionIssuesByControlPolicy, k as extractCodecControlHooks, l as MigrationPlan, m as NativeTypeExpander, n as ControlPolicySubject, o as INIT_ADDITIVE_POLICY, p as MigrationPlannerResult, r as DefaultRenderer, s as MigrationOperationClass, t as ContractToSchemaIROptions, u as MigrationPlanOperation, v as SqlDescribedContractSpace, w as contractNamespaceToSchemaIR, x as _default, y as SuppressionRecord, z as temporalCodecPresetWithPrecision } from "./control-DI9DC2AS.mjs";
4
4
  export { type CodecControlHooks, type ContractToSchemaIROptions, type ControlPolicySubject, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type DefaultResolver, type EnumNamespaceSchemaResolver, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type StorageTypePlanResult, type SuppressionRecord, type TargetMigrationsCapability, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor };
@@ -1,4 +1,4 @@
1
- import { o as extractCodecControlHooks } from "./schema-verify-C_PEdlAr-U3MX28Zu.mjs";
1
+ import { o as extractCodecControlHooks } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
2
2
  import { a as timestampNowControlDescriptor, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, r as temporalCodecPreset } from "./timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs";
3
- import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, s as control_default, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-f9B6b5c2.mjs";
3
+ import { a as contractToSchemaIR, c as createMigrationPlan, d as partitionIssuesByControlPolicy, f as planFieldEventOperations, g as runnerSuccess, h as runnerFailure, i as contractNamespaceToSchemaIR, l as detectDestructiveChanges, m as plannerSuccess, n as assembleAuthoringContributions, o as controlPolicyForCall, p as plannerFailure, r as buildNativeTypeExpander, s as control_default, t as INIT_ADDITIVE_POLICY, u as partitionCallsByControlPolicy } from "./control-DAkNosoF.mjs";
4
4
  export { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor };
@@ -1,3 +1,3 @@
1
- import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-B4MyB0B0.mjs";
2
- import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-dX8KnmWc.mjs";
1
+ import { o as arraysEqual, r as NativeTypeNormalizer } from "./control-adapter-C99J7aEF-DsxImHyk.mjs";
2
+ import { a as VerifySqlSchemaByDiffInput, c as computeSqlDiffVerdict, i as StorageTypeVerdictInput, l as computeStorageTypeVerdict, n as SqlDiffVerdictInput, o as classifyDiffSubjectGranularity, r as StorageTypeVerdict, s as classifySqlDiffIssue, t as SqlDiffVerdict, u as verifySqlSchemaByDiff } from "./diff-DVvZXmFv.mjs";
3
3
  export { type NativeTypeNormalizer, type SqlDiffVerdict, type SqlDiffVerdictInput, type StorageTypeVerdict, type StorageTypeVerdictInput, type VerifySqlSchemaByDiffInput, arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-U3MX28Zu.mjs";
1
+ import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as verifySqlSchemaByDiff } from "./schema-verify-C_PEdlAr-Dxxjm6EM.mjs";
2
2
  import { t as arraysEqual } from "./diff-B16bL_IR.mjs";
3
3
  export { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,2 +1,2 @@
1
- import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-CVhRa-4t.mjs";
1
+ import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-Bghjt-FG.mjs";
2
2
  export { SqlContractSerializer, SqlContractSerializerBase, type SqlEntityHydrationFactory, SqlSchemaVerifierBase };
@@ -1,3 +1,3 @@
1
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs";
1
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs";
2
2
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
3
3
  export { SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase };
@@ -1,2 +1,2 @@
1
- import { t as SqlMigration } from "./migration-C8MAouav.mjs";
1
+ import { t as SqlMigration } from "./migration-Dtymew3g.mjs";
2
2
  export { SqlMigration as Migration };
@@ -1,4 +1,4 @@
1
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-Blqoa2Ua-OP7GsSm3.mjs";
1
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-Blqoa2Ua-CvHn00xx.mjs";
2
2
  //#region ../../../2-sql/9-family/dist/pack.mjs
3
3
  const sqlFamilyPack = {
4
4
  kind: "family",
@@ -1,2 +1,2 @@
1
- import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toEnumName, y as toFieldName } from "./psl-infer-DmFgn-Ub.mjs";
1
+ import { _ as toEnumMemberName, a as PslPrinterOptions, b as toModelName, c as PslTypeResolution, d as deriveBackRelationFieldName, f as deriveRelationFieldName, g as pluralize, h as parseRawDefault, i as InferredRelations, l as RelationField, m as mapDefault, n as DefaultMappingResult, o as PslTypeMap, p as inferRelations, r as EnumInfo, s as PslTypeReference, t as DefaultMappingOptions, u as buildChildRelationField, v as toEnumName, y as toFieldName } from "./psl-infer-CCAD6FWA.mjs";
2
2
  export { type DefaultMappingOptions, type DefaultMappingResult, type EnumInfo, type InferredRelations, type PslPrinterOptions, type PslTypeMap, type PslTypeReference, type PslTypeResolution, type RelationField, buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, mapDefault, parseRawDefault, pluralize, toEnumMemberName, toEnumName, toFieldName, toModelName };
@@ -1,2 +1,2 @@
1
- import { a as mapDefault, c as toEnumMemberName, d as toModelName, i as inferRelations, l as toEnumName, n as deriveBackRelationFieldName, o as parseRawDefault, r as deriveRelationFieldName, s as pluralize, t as buildChildRelationField, u as toFieldName } from "./psl-infer-Z4wA2xpx.mjs";
1
+ import { a as mapDefault, c as toEnumMemberName, d as toModelName, i as inferRelations, l as toEnumName, n as deriveBackRelationFieldName, o as parseRawDefault, r as deriveRelationFieldName, s as pluralize, t as buildChildRelationField, u as toFieldName } from "./psl-infer-YhbKkybN.mjs";
2
2
  export { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, mapDefault, parseRawDefault, pluralize, toEnumMemberName, toEnumName, toFieldName, toModelName };
@@ -1,3 +1,3 @@
1
- import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-DFhpOR0X.mjs";
2
- import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-VGVRdwBD.mjs";
1
+ import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
2
+ import { a as timestampNowRuntimeGenerator, i as sqlRuntimeFamilyDescriptor, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-CjXCGPS4.mjs";
3
3
  export { type ResolvedDomainModel, type ResolvedStorageTable, UNBOUND_DOMAIN_NAMESPACE_ID, sqlRuntimeFamilyDescriptor as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };