@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":"storage-table-D8o37IKw-bbcikEu-.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-D8o37IKw.mjs"],"sourcesContent":["import { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ir/check-constraint.ts\n/**\n* SQL Contract IR node for a table-level check constraint, name-identified:\n* `name` is the full physical name; a present `prefix` marks the constraint as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)` over the expression's\n* content hash), an absent `prefix` marks it exact (the name is adopted\n* verbatim). This is the convention indexes and RLS policies already use — see\n* ADR 234, \"Content-addressed wire names for Postgres-normalized objects\".\n*\n* The predicate is opaque: one SQL string, never parsed and never rendered\n* from structured parts. A database reprints predicates in its own normalized\n* form, so a wire-named check is compared by name — the hash already commits\n* to the expression the contract declared.\n*/\nvar CheckConstraint = class CheckConstraint extends SqlNode {\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"CheckConstraint: every check constraint carries a full physical name.\", \"storage\");\n\t\tthis.name = name;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Normalizes either shape into an instance: an existing `CheckConstraint`\n\t* passes through, canonical input is constructed. Callers that accept\n\t* \"instance or input\" go through this, so the constructor keeps one\n\t* canonical shape instead of widening to a union.\n\t*/\n\tstatic from(value) {\n\t\treturn value instanceof CheckConstraint ? value : new CheckConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/sql-index.ts\n/**\n* SQL Contract IR node for a table-level secondary index, name-identified:\n* `name` is the full physical name; a present `prefix` marks the index as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)`), an absent `prefix`\n* marks it exact (the name is adopted verbatim).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL supported natively by\n* Postgres and SQLite alike, and the family IR must be able to represent\n* anything any SQL target can introspect. A target declining to AUTHOR them\n* (SQLite's rejection at namespace construction) is a capability decision,\n* not evidence of target-specificity.\n*\n* Note that this class shadows the global TypeScript `Index` lib type\n* at the family-shared name; consumer files that need both should\n* alias one (e.g.\n* `import { Index as SqlIndexNode } from '@internal/sql-contract/types'`).\n*/\nvar Index = class Index extends SqlNode {\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new ContractValidationError(`Index \"${name}\": exactly one of columns or expression must be set.`, \"storage\");\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tif (input.type !== void 0) this.type = input.type;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof Index ? value : new Index(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key-reference.ts\n/**\n* SQL Contract IR node for one side (source or target) of a foreign-key\n* declaration. Carries the full coordinate: namespace, table, and columns.\n*\n* Cross-space discrimination is based on `spaceId` presence: absent means\n* local (same contract-space); present means cross-space (the referenced\n* table lives in the contract-space identified by `spaceId`).\n*\n* For local references `spaceId` is absent from JSON, keeping the serialized\n* shape byte-identical to contracts authored before cross-space support was\n* added. For cross-space references `spaceId` appears in JSON so round-trips\n* are lossless.\n*\n* Use `UNBOUND_NAMESPACE_ID` from `@internal/framework-components/ir`\n* as the sentinel `namespaceId` for single-namespace (unbound) references.\n*/\nvar ForeignKeyReference = class ForeignKeyReference extends SqlNode {\n\tnamespaceId;\n\ttableName;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.namespaceId = asNamespaceId(input.namespaceId);\n\t\tthis.tableName = input.tableName;\n\t\tthis.columns = input.columns;\n\t\tif (input.spaceId !== void 0) this.spaceId = input.spaceId;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKeyReference ? value : new ForeignKeyReference(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key.ts\n/**\n* SQL Contract IR node for a table-level foreign-key declaration — the\n* referential constraint only (source, target, `onDelete`/`onUpdate`).\n*\n* A persisted `foreignKeys[]` entry always denotes a real constraint: whether\n* to emit the constraint at all, and whether to back it with an index, are\n* authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,\n* index })`) resolved once at `contract emit` — a `constraint: false` FK\n* simply has no entry here, and a backing index (if any) is its own discrete,\n* named entry in the table's `indexes[]`.\n*\n* Each FK carries explicit `source` and `target` {@link ForeignKeyReference}\n* coordinates (namespace, table, columns). For single-namespace contracts the\n* sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.\n*\n* The nested references are normalised to {@link ForeignKeyReference}\n* instances inside the constructor so downstream walks see a uniform AST\n* regardless of whether the input was a JSON literal or an already-constructed\n* class instance.\n*/\nvar ForeignKey = class ForeignKey extends SqlNode {\n\tsource;\n\ttarget;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.source = ForeignKeyReference.from(input.source);\n\t\tthis.target = ForeignKeyReference.from(input.target);\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKey ? value : new ForeignKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* SQL Contract IR node for a table's primary-key constraint.\n*/\nvar PrimaryKey = class PrimaryKey extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-column.ts\n/**\n* SQL Contract IR node for a single column entry in `StorageTable.columns`.\n*\n* Single concrete family-shared class — every SQL target reads the\n* same column shape today, so there is no per-target subclass. The\n* class type accepts any caller that constructs via\n* `new StorageColumn(input)`; literal construction sites must pass\n* through the constructor or the family-base hydration walker.\n*\n* The column's `name` is not on the class — columns are keyed by name\n* in the parent `StorageTable.columns: Record<string, StorageColumn>`\n* map, so a `name` field would be redundant with the key.\n*/\nvar StorageColumn = class StorageColumn extends SqlNode {\n\tnativeType;\n\tcodecId;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.noCheck !== void 0) this.noCheck = input.noCheck;\n\t\tif (input.typeParams !== void 0) this.typeParams = input.typeParams;\n\t\tif (input.typeRef !== void 0) this.typeRef = input.typeRef;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.valueSet !== void 0) this.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof StorageColumn ? value : new StorageColumn(value);\n\t}\n};\n//#endregion\n//#region src/ir/unique-constraint.ts\n/**\n* SQL Contract IR node for a table-level unique constraint.\n*/\nvar UniqueConstraint = class UniqueConstraint extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof UniqueConstraint ? value : new UniqueConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-table.ts\n/**\n* SQL Contract IR node for a single table entry in a namespace's\n* `tables` map.\n*\n* The constructor normalises nested IR-class fields (columns, primary\n* key, uniques, indexes, foreign keys) into the appropriate class\n* instances so downstream walks see a uniform AST regardless of whether\n* the input was a JSON literal or an already-constructed class.\n*\n* The table's `name` is not on the class — tables are keyed by name in\n* the parent namespace's `tables: Record<string, StorageTable>` map.\n*/\nvar StorageTable = class StorageTable extends SqlNode {\n\tcolumns;\n\tuniques;\n\tindexes;\n\tforeignKeys;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([name, col]) => [name, StorageColumn.from(col)])));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tthis.uniques = Object.freeze(input.uniques.map(UniqueConstraint.from));\n\t\tthis.indexes = Object.freeze(input.indexes.map(Index.from));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map(ForeignKey.from));\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(CheckConstraint.from));\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Runtime guard that a namespace `table` entry is really a `StorageTable`.\n\t* The compiler already types the entry as `StorageTable`, but a\n\t* freshly-deserialized contract may carry plain JSON at that slot until\n\t* hydration; this duck-types the structural shape. Accepts `undefined` so\n\t* optional-chained entry lookups pass straight through.\n\t*/\n\tstatic is(value) {\n\t\tif (typeof value !== \"object\" || value === null) return false;\n\t\treturn \"columns\" in value && \"uniques\" in value && \"indexes\" in value && \"foreignKeys\" in value;\n\t}\n\tstatic assert(value, coordinate) {\n\t\tif (!StorageTable.is(value)) throw new InternalError(`Expected a StorageTable at ${coordinate}`);\n\t}\n};\n//#endregion\nexport { ForeignKey as a, CheckConstraint as c, PrimaryKey as i, SqlNode as l, UniqueConstraint as n, ForeignKeyReference as o, StorageColumn as r, Index as s, StorageTable as t };\n\n//# sourceMappingURL=storage-table-D8o37IKw.mjs.map"],"mappings":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G,CAAC,CAAC,CAAC,CAAC;EACpI,IAAI,MAAM,eAAe,KAAK,GAAG,KAAK,aAAa,WAAW,KAAK,MAAM,UAAU;EACnF,KAAK,UAAU,OAAO,OAAO,MAAM,QAAQ,IAAI,iBAAiB,IAAI,CAAC;EACrE,KAAK,UAAU,OAAO,OAAO,MAAM,QAAQ,IAAI,MAAM,IAAI,CAAC;EAC1D,KAAK,cAAc,OAAO,OAAO,MAAM,YAAY,IAAI,WAAW,IAAI,CAAC;EACvE,IAAI,MAAM,YAAY,KAAK,GAAG,KAAK,UAAU,MAAM;EACnD,IAAI,MAAM,WAAW,KAAK,KAAK,MAAM,OAAO,SAAS,GAAG,KAAK,SAAS,OAAO,OAAO,MAAM,OAAO,IAAI,gBAAgB,IAAI,CAAC;EAC1H,WAAW,IAAI;CAChB;;;;;;;;CAQA,OAAO,GAAG,OAAO;EAChB,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;EACxD,OAAO,aAAa,SAAS,aAAa,SAAS,aAAa,SAAS,iBAAiB;CAC3F;CACA,OAAO,OAAO,OAAO,YAAY;EAChC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,MAAM,IAAI,cAAc,8BAA8B,YAAY;CAChG;AACD"}
1
+ {"version":3,"file":"storage-table-ZzbR-xzQ-BRoTQE_2.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-ZzbR-xzQ.mjs"],"sourcesContent":["import { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ir/check-constraint.ts\n/**\n* SQL Contract IR node for a table-level check constraint, name-identified:\n* `name` is the full physical name; a present `prefix` marks the constraint as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)` over the expression's\n* content hash), an absent `prefix` marks it exact (the name is adopted\n* verbatim). This is the convention indexes and RLS policies already use — see\n* ADR 234, \"Content-addressed wire names for Postgres-normalized objects\".\n*\n* The predicate is opaque: one SQL string, never parsed and never rendered\n* from structured parts. A database reprints predicates in its own normalized\n* form, so a wire-named check is compared by name — the hash already commits\n* to the expression the contract declared.\n*/\nvar CheckConstraint = class CheckConstraint extends SqlNode {\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"CheckConstraint: every check constraint carries a full physical name.\", \"storage\");\n\t\tthis.name = name;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Normalizes either shape into an instance: an existing `CheckConstraint`\n\t* passes through, canonical input is constructed. Callers that accept\n\t* \"instance or input\" go through this, so the constructor keeps one\n\t* canonical shape instead of widening to a union.\n\t*/\n\tstatic from(value) {\n\t\treturn value instanceof CheckConstraint ? value : new CheckConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/sql-index.ts\n/**\n* SQL Contract IR node for a table-level secondary index, name-identified:\n* `name` is the full physical name; a present `prefix` marks the index as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)`), an absent `prefix`\n* marks it exact (the name is adopted verbatim).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL supported natively by\n* Postgres and SQLite alike, and the family IR must be able to represent\n* anything any SQL target can introspect. A target declining to AUTHOR them\n* (SQLite's rejection at namespace construction) is a capability decision,\n* not evidence of target-specificity.\n*\n* Note that this class shadows the global TypeScript `Index` lib type\n* at the family-shared name; consumer files that need both should\n* alias one (e.g.\n* `import { Index as SqlIndexNode } from '@internal/sql-contract/types'`).\n*/\nvar Index = class Index extends SqlNode {\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new ContractValidationError(`Index \"${name}\": exactly one of columns or expression must be set.`, \"storage\");\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tif (input.type !== void 0) this.type = input.type;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof Index ? value : new Index(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key-reference.ts\n/**\n* SQL Contract IR node for one side (source or target) of a foreign-key\n* declaration. Carries the full coordinate: namespace, table, and columns.\n*\n* Cross-space discrimination is based on `spaceId` presence: absent means\n* local (same contract-space); present means cross-space (the referenced\n* table lives in the contract-space identified by `spaceId`).\n*\n* For local references `spaceId` is absent from JSON, keeping the serialized\n* shape byte-identical to contracts authored before cross-space support was\n* added. For cross-space references `spaceId` appears in JSON so round-trips\n* are lossless.\n*\n* Use `UNBOUND_NAMESPACE_ID` from `@internal/framework-components/ir`\n* as the sentinel `namespaceId` for single-namespace (unbound) references.\n*/\nvar ForeignKeyReference = class ForeignKeyReference extends SqlNode {\n\tnamespaceId;\n\ttableName;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.namespaceId = asNamespaceId(input.namespaceId);\n\t\tthis.tableName = input.tableName;\n\t\tthis.columns = input.columns;\n\t\tif (input.spaceId !== void 0) this.spaceId = input.spaceId;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKeyReference ? value : new ForeignKeyReference(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key.ts\n/**\n* SQL Contract IR node for a table-level foreign-key declaration — the\n* referential constraint only (source, target, `onDelete`/`onUpdate`).\n*\n* A persisted `foreignKeys[]` entry always denotes a real constraint: whether\n* to emit the constraint at all, and whether to back it with an index, are\n* authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,\n* index })`) resolved once at `contract emit` — a `constraint: false` FK\n* simply has no entry here, and a backing index (if any) is its own discrete,\n* named entry in the table's `indexes[]`.\n*\n* Each FK carries explicit `source` and `target` {@link ForeignKeyReference}\n* coordinates (namespace, table, columns). For single-namespace contracts the\n* sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.\n*\n* The nested references are normalised to {@link ForeignKeyReference}\n* instances inside the constructor so downstream walks see a uniform AST\n* regardless of whether the input was a JSON literal or an already-constructed\n* class instance.\n*/\nvar ForeignKey = class ForeignKey extends SqlNode {\n\tsource;\n\ttarget;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.source = ForeignKeyReference.from(input.source);\n\t\tthis.target = ForeignKeyReference.from(input.target);\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKey ? value : new ForeignKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* SQL Contract IR node for a table's primary-key constraint.\n*/\nvar PrimaryKey = class PrimaryKey extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-column.ts\n/**\n* SQL Contract IR node for a single column entry in `StorageTable.columns`.\n*\n* Single concrete family-shared class — every SQL target reads the\n* same column shape today, so there is no per-target subclass. The\n* class type accepts any caller that constructs via\n* `new StorageColumn(input)`; literal construction sites must pass\n* through the constructor or the family-base hydration walker.\n*\n* The column's `name` is not on the class — columns are keyed by name\n* in the parent `StorageTable.columns: Record<string, StorageColumn>`\n* map, so a `name` field would be redundant with the key.\n*/\nvar StorageColumn = class StorageColumn extends SqlNode {\n\tnativeType;\n\tcodecId;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.noCheck !== void 0) this.noCheck = input.noCheck;\n\t\tif (input.typeParams !== void 0) this.typeParams = input.typeParams;\n\t\tif (input.typeRef !== void 0) this.typeRef = input.typeRef;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.valueSet !== void 0) this.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof StorageColumn ? value : new StorageColumn(value);\n\t}\n};\n//#endregion\n//#region src/ir/unique-constraint.ts\n/**\n* SQL Contract IR node for a table-level unique constraint.\n*/\nvar UniqueConstraint = class UniqueConstraint extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof UniqueConstraint ? value : new UniqueConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-table.ts\n/**\n* SQL Contract IR node for a single table entry in a namespace's\n* `tables` map.\n*\n* The constructor normalises nested IR-class fields (columns, primary\n* key, uniques, indexes, foreign keys) into the appropriate class\n* instances so downstream walks see a uniform AST regardless of whether\n* the input was a JSON literal or an already-constructed class.\n*\n* The table's `name` is not on the class — tables are keyed by name in\n* the parent namespace's `tables: Record<string, StorageTable>` map.\n*/\nvar StorageTable = class StorageTable extends SqlNode {\n\tcolumns;\n\tuniques;\n\tindexes;\n\tforeignKeys;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([name, col]) => [name, StorageColumn.from(col)])));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tthis.uniques = Object.freeze(input.uniques.map(UniqueConstraint.from));\n\t\tthis.indexes = Object.freeze(input.indexes.map(Index.from));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map(ForeignKey.from));\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(CheckConstraint.from));\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Runtime guard that a namespace `table` entry is really a `StorageTable`.\n\t* The compiler already types the entry as `StorageTable`, but a\n\t* freshly-deserialized contract may carry plain JSON at that slot until\n\t* hydration; this duck-types the structural shape. Accepts `undefined` so\n\t* optional-chained entry lookups pass straight through.\n\t*/\n\tstatic is(value) {\n\t\tif (typeof value !== \"object\" || value === null) return false;\n\t\treturn \"columns\" in value && \"uniques\" in value && \"indexes\" in value && \"foreignKeys\" in value;\n\t}\n\tstatic assert(value, coordinate) {\n\t\tif (!StorageTable.is(value)) throw new InternalError(`Expected a StorageTable at ${coordinate}`);\n\t}\n};\n//#endregion\nexport { ForeignKey as a, CheckConstraint as c, PrimaryKey as i, SqlNode as l, UniqueConstraint as n, ForeignKeyReference as o, StorageColumn as r, Index as s, StorageTable as t };\n\n//# sourceMappingURL=storage-table-ZzbR-xzQ.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAI,UAAU,cAAc,WAAW;CACtC;CACA,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;CACF;AACD;;;;;;;;;;;;;;AAgBA,IAAI,kBAAkB,MAAM,wBAAwB,QAAQ;CAC3D;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,MAAM,OAAO,OAAO,MAAM,MAAM;EAChC,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,wBAAwB,yEAAyE,SAAS;EAC3I,KAAK,OAAO;EACZ,IAAI,MAAM,OAAO,SAAS,QAA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IAAI,gBAAgB,IAAI,CAAC;EAC1H,WAAW,IAAI;CAChB;;;;;;;;CAQA,OAAO,GAAG,OAAO;EAChB,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;EACxD,OAAO,aAAa,SAAS,aAAa,SAAS,aAAa,SAAS,iBAAiB;CAC3F;CACA,OAAO,OAAO,OAAO,YAAY;EAChC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,MAAM,IAAI,cAAc,8BAA8B,YAAY;CAChG;AACD"}
@@ -1,11 +1,11 @@
1
- import { c as nameOf, d as normalizeIndexOptionValue } from "./naming-BWkuWJJK-zuGIIJ49.mjs";
1
+ import { f as normalizeIndexOptionValue, l as nameOf } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
2
2
  import { IRNodeBase, freezeNode } from "@prisma/orm-framework/components/ir";
3
3
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
7
7
  import { isArrayEqual } from "@prisma/orm-framework/utils/array-equal";
8
- //#region ../../../2-sql/1-core/schema-ir/dist/types-CRlrNF8_.mjs
8
+ //#region ../../../2-sql/1-core/schema-ir/dist/types-4YenawkP.mjs
9
9
  /**
10
10
  * The `nodeKind` discriminant for each relational schema-diff leaf node.
11
11
  * Each node carries a unique value; the differ pairs siblings by `id`, and
@@ -717,4 +717,4 @@ var SqlSchemaIR = class extends SqlSchemaIRNode {
717
717
  //#endregion
718
718
  export { SqlColumnIR as a, SqlSchemaIR as c, SqlUniqueIR as d, assertNode as f, relationalNodeGranularity as h, SqlColumnDefaultIR as i, SqlSchemaIRNode as l, relationalNodeEntityKind as m, RelationalSchemaNodeKind as n, SqlForeignKeyIR as o, defineNonEnumerable as p, SqlCheckConstraintIR as r, SqlIndexIR as s, PrimaryKey as t, SqlTableIR as u };
719
719
 
720
- //# sourceMappingURL=types-CRlrNF8_-xtE1f_Ya.mjs.map
720
+ //# sourceMappingURL=types-4YenawkP-CwaaZSid.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-CRlrNF8_-xtE1f_Ya.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-CRlrNF8_.mjs"],"sourcesContent":["import { c as nameOf, d as normalizeIndexOptionValue } from \"./naming-BWkuWJJK.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/resolved-default-equality.ts\n/**\n* Structural equality for two resolved column defaults, ported from the\n* relational walk's `columnDefaultsEqual` normalized branch: kinds must\n* match; literal values are normalized (Date and temporal-typed strings to\n* ISO instants) then compared canonically (JSON objects match their\n* canonical string form); function expressions compare case- and\n* whitespace-insensitively.\n*\n* `nativeType` provides the temporal-normalization context (the actual\n* side's resolved native type in a diff comparison).\n*/\nfunction resolvedDefaultsEqual(expected, actual, nativeType) {\n\tif (expected.kind !== actual.kind) return false;\n\tif (expected.kind === \"literal\" && actual.kind === \"literal\") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType), normalizeLiteralValue(actual.value, nativeType));\n\tif (expected.kind === \"function\" && actual.kind === \"function\") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);\n\treturn false;\n}\nfunction normalizeFunctionExpression(expression) {\n\treturn expression.toLowerCase().replace(/\\s+/g, \"\");\n}\nfunction isTemporalNativeType(nativeType) {\n\tif (!nativeType) return false;\n\tconst normalized = nativeType.toLowerCase();\n\treturn normalized.includes(\"timestamp\") || normalized === \"date\";\n}\nfunction normalizeLiteralValue(value, nativeType) {\n\tif (value instanceof Date) return value.toISOString();\n\tif (typeof value === \"string\" && isTemporalNativeType(nativeType)) {\n\t\tconst parsed = new Date(value);\n\t\tif (!Number.isNaN(parsed.getTime())) return parsed.toISOString();\n\t}\n\treturn value;\n}\nfunction literalValuesEqual(a, b) {\n\tif (a === b) return true;\n\tif (typeof a === \"object\" && a !== null && typeof b === \"object\" && b !== null) return canonicalStringify(a) === canonicalStringify(b);\n\tif (typeof a === \"object\" && a !== null && typeof b === \"string\") try {\n\t\treturn canonicalStringify(a) === canonicalStringify(JSON.parse(b));\n\t} catch {\n\t\treturn false;\n\t}\n\tif (typeof a === \"string\" && typeof b === \"object\" && b !== null) try {\n\t\treturn canonicalStringify(JSON.parse(a)) === canonicalStringify(b);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn false;\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tif (input.nativeTypeContext !== void 0) this.nativeTypeContext = input.nativeTypeContext;\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Structured comparison with `this` as the expected side: both sides\n\t* resolved compare per the relational walk's `columnDefaultsEqual`\n\t* semantics; a declared expected default against an unparseable actual\n\t* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall\n\t* back to raw string equality.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tif (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext);\n\t\tif (this.resolved !== void 0 || node.resolved !== void 0) return false;\n\t\treturn this.raw === node.raw;\n\t}\n};\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"codecNamedType\", input.codecNamedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"nativeTypeContext\", this.resolvedNativeType),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, SqlCheckConstraintIR as c, assertNode as d, defineNonEnumerable as f, relationalNodeGranularity as h, SqlIndexIR as i, PrimaryKey as l, relationalNodeEntityKind as m, SqlTableIR as n, SqlColumnIR as o, RelationalSchemaNodeKind as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, SqlSchemaIRNode as u };\n\n//# sourceMappingURL=types-CRlrN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I,MAAM,eAAe,KAAK,GAAG,KAAK,aAAa,WAAW,KAAK,MAAM,UAAU;EACnF,IAAI,MAAM,gBAAgB,KAAK,GAAG,KAAK,cAAc,MAAM;EAC3D,IAAI,MAAM,WAAW,KAAK,KAAK,MAAM,OAAO,SAAS,GAAG,KAAK,SAAS,OAAO,OAAO,MAAM,OAAO,IAAI,qBAAqB,IAAI,CAAC;EAC/H,WAAW,IAAI;CAChB;CACA,IAAI,KAAK;EACR,OAAO,KAAK;CACb;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO;GACN,GAAG,OAAO,OAAO,KAAK,OAAO;GAC7B,GAAG,KAAK,aAAa,CAAC,KAAK,UAAU,IAAI,CAAC;GAC1C,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK,UAAU,CAAC;EACpB;CACD;AACD;;;;;;;;;;;;;;;;AAkBA,IAAI,cAAc,cAAc,gBAAgB;CAC/C,WAAW,yBAAyB;CACpC;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,aAAa,aAAa,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;EACtJ,IAAI,MAAM,gBAAgB,KAAK,GAAG,KAAK,cAAc,MAAM;EAC3D,WAAW,IAAI;CAChB;CACA,IAAI,KAAK;EACR,OAAO;CACR;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO,OAAO,OAAO,KAAK,MAAM;CACjC;AACD"}
1
+ {"version":3,"file":"types-4YenawkP-CwaaZSid.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-4YenawkP.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-DKr4TJd7.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/resolved-default-equality.ts\n/**\n* Structural equality for two resolved column defaults, ported from the\n* relational walk's `columnDefaultsEqual` normalized branch: kinds must\n* match; literal values are normalized (Date and temporal-typed strings to\n* ISO instants) then compared canonically (JSON objects match their\n* canonical string form); function expressions compare case- and\n* whitespace-insensitively.\n*\n* `nativeType` provides the temporal-normalization context (the actual\n* side's resolved native type in a diff comparison).\n*/\nfunction resolvedDefaultsEqual(expected, actual, nativeType) {\n\tif (expected.kind !== actual.kind) return false;\n\tif (expected.kind === \"literal\" && actual.kind === \"literal\") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType), normalizeLiteralValue(actual.value, nativeType));\n\tif (expected.kind === \"function\" && actual.kind === \"function\") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);\n\treturn false;\n}\nfunction normalizeFunctionExpression(expression) {\n\treturn expression.toLowerCase().replace(/\\s+/g, \"\");\n}\nfunction isTemporalNativeType(nativeType) {\n\tif (!nativeType) return false;\n\tconst normalized = nativeType.toLowerCase();\n\treturn normalized.includes(\"timestamp\") || normalized === \"date\";\n}\nfunction normalizeLiteralValue(value, nativeType) {\n\tif (value instanceof Date) return value.toISOString();\n\tif (typeof value === \"string\" && isTemporalNativeType(nativeType)) {\n\t\tconst parsed = new Date(value);\n\t\tif (!Number.isNaN(parsed.getTime())) return parsed.toISOString();\n\t}\n\treturn value;\n}\nfunction literalValuesEqual(a, b) {\n\tif (a === b) return true;\n\tif (typeof a === \"object\" && a !== null && typeof b === \"object\" && b !== null) return canonicalStringify(a) === canonicalStringify(b);\n\tif (typeof a === \"object\" && a !== null && typeof b === \"string\") try {\n\t\treturn canonicalStringify(a) === canonicalStringify(JSON.parse(b));\n\t} catch {\n\t\treturn false;\n\t}\n\tif (typeof a === \"string\" && typeof b === \"object\" && b !== null) try {\n\t\treturn canonicalStringify(JSON.parse(a)) === canonicalStringify(b);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn false;\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tif (input.nativeTypeContext !== void 0) this.nativeTypeContext = input.nativeTypeContext;\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Structured comparison with `this` as the expected side: both sides\n\t* resolved compare per the relational walk's `columnDefaultsEqual`\n\t* semantics; a declared expected default against an unparseable actual\n\t* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall\n\t* back to raw string equality.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tif (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext);\n\t\tif (this.resolved !== void 0 || node.resolved !== void 0) return false;\n\t\treturn this.raw === node.raw;\n\t}\n};\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"codecNamedType\", input.codecNamedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"nativeTypeContext\", this.resolvedNativeType),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, SqlCheckConstraintIR as c, assertNode as d, defineNonEnumerable as f, relationalNodeGranularity as h, SqlIndexIR as i, PrimaryKey as l, relationalNodeEntityKind as m, SqlTableIR as n, SqlColumnIR as o, RelationalSchemaNodeKind as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, SqlSchemaIRNode as u };\n\n//# sourceMappingURL=types-4YenawkP.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,SAA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I;CAChB;CACA,IAAI,KAAK;EACR,OAAO,KAAK;CACb;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO;GACN,GAAG,OAAO,OAAO,KAAK,OAAO;GAC7B,GAAG,KAAK,aAAa,CAAC,KAAK,UAAU,IAAI,CAAC;GAC1C,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK,UAAU,CAAC;EACpB;CACD;AACD;;;;;;;;;;;;;;;;AAkBA,IAAI,cAAc,cAAc,gBAAgB;CAC/C,WAAW,yBAAyB;CACpC;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,aAAa,aAAa,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;EACtJ,IAAI,MAAM,gBAAgB,KAAK,GAAG,KAAK,cAAc,MAAM;EAC3D,WAAW,IAAI;CAChB;CACA,IAAI,KAAK;EACR,OAAO;CACR;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO,OAAO,OAAO,KAAK,MAAM;CACjC;AACD"}
@@ -0,0 +1 @@
1
+ import "./types-CLN9Y3BH-BHUrV7MD.mjs";
@@ -1,14 +1,15 @@
1
1
  import "./sql-node-kEz6YFZo-v2F7delx.mjs";
2
+ import "./check-constraint-B7qGu6rc-HvQjjX82.mjs";
2
3
  import { a as ReferentialAction } from "./foreign-key-C-iTPuRT-C9ip8zFx.mjs";
3
4
  import "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
4
- import "./sql-index-ByAAE7K8-C1h4IS27.mjs";
5
- import "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
5
+ import "./sql-index-ByAAE7K8-DKj2V86p.mjs";
6
+ import "./storage-table-DSeWszOL-CI-cItEK.mjs";
6
7
  import "./storage-value-set-BGlj5Uus-CvZD--GG.mjs";
7
- import "./sql-storage-CySVsLrY-e9C5Gszx.mjs";
8
- import "./serialized-index-D9YgVREe-KaLdoijn.mjs";
8
+ import "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
9
+ import "./serialized-index-CrgG8ct1-DG3JpHc7.mjs";
9
10
  import { CodecTrait } from "@prisma/orm-framework/components/codec";
10
11
  import { ControlDriverInstance } from "@prisma/orm-framework/components/control";
11
- //#region ../../../2-sql/1-core/contract/dist/types-C89S13jo.d.mts
12
+ //#region ../../../2-sql/1-core/contract/dist/types-BDUG29Df.d.mts
12
13
  //#region src/types.d.ts
13
14
  interface SqlControlDriverInstance<T extends string = string> extends ControlDriverInstance<'sql', T> {
14
15
  query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{
@@ -157,4 +158,4 @@ type ExtractAggregateTypes<T> = AggregateTypesOf<ExtractTypeMapsFromContract<T>>
157
158
  type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never] ? ExtractCodecTypes<TContract> : CodecTypesOf<TTypeMaps>;
158
159
  //#endregion
159
160
  export { SqlModelStorage as A, QueryOperationSelfSpec as C, ResolveCodecTypes as D, QueryOperationTypesOf as E, TypeMapsPhantomKey as F, applyFkDefaults as I, StorageColumnInputTypesOf as M, StorageColumnTypesOf as N, SqlControlDriverInstance as O, TypeMaps as P, QueryOperationReturn as S, QueryOperationTypesBase as T, FieldInputTypesOf as _, CodecTypesOf as a, NamespacedFieldTypeMap as b, DEFAULT_FK_INDEX as c, ExtractFieldInputTypes as d, ExtractFieldOutputTypes as f, ExtractTypeMapsFromContract as g, ExtractStorageColumnTypes as h, AggregateTypesOf as i, SqlQueryOperationTypes as j, SqlModelFieldStorage as k, ExtractAggregateTypes as l, ExtractStorageColumnInputTypes as m, AggregateResultType as n, ContractWithTypeMaps as o, ExtractQueryOperationTypes as p, AggregateTypesBase as r, DEFAULT_FK_CONSTRAINT as s, AggregateOperationTypes as t, ExtractCodecTypes as u, FieldOutputTypesOf as v, QueryOperationTypeEntry as w, NamespacedStorageColumnTypeMap as x, ForeignKeyOptions as y };
160
- //# sourceMappingURL=types-C89S13jo-CGy-V60b.d.mts.map
161
+ //# sourceMappingURL=types-BDUG29Df-LE85dIXP.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BDUG29Df-LE85dIXP.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types-BDUG29Df.d.mts"],"mappings":";;;;;;;;;;;;;UAYU,yBAAyB,mCAAmC,6BAA6B;EACjG,MAAM,MAAM,yBAAyB,aAAa,8BAA8B;aACrE,MAAM;;;KAGd;WACM;WACA,WAAW;WACX,WAAW;;KAEjB;WACM;WACA;WACA;;KAEN;WACM;WACA;WACA,QAAQ,eAAe;;cAEpB;cACA;iBACG,gBAAgB;EAC/B;EACA;GACC;EACD;EACA;;EAEA;EACA;;KAEG,yBAAyB,eAAe,eAAe;KACvD,iCAAiC,eAAe,eAAe;;;;KAI/D;WACM;WACA;;;;;;;;;KASN;WACM,SAAS,eAAe;WACxB,eAAe;WACf,WAAW;;;KAGjB,qBAAqB,eAAe;KACpC,SAAS,oBAAoB;EAChC;KACG,uBAAuB,6BAA6B,0BAA0B,uBAAuB,0BAA0B,yBAAyB,uBAAuB,yBAAyB,yBAAyB,uBAAuB,4BAA4B,iCAAiC,uBAAuB,iCAAiC,iCAAiC,uBAAuB,wBAAwB,qBAAqB;WAC5c,YAAY;WACZ,qBAAqB;WACrB,kBAAkB;WAClB,iBAAiB;WACjB,oBAAoB;WACpB,yBAAyB;WACzB,gBAAgB;;KAEtB,iBAAiB,MAAM,qBAAqB,wBAAwB;WAC9D,sBAAsB;IAC7B,UAAU,qBAAqB,IAAI,wBAAwB;KAC1D,aAAa,MAAM,qBAAqB,wBAAwB;WAC1D,kBAAkB;IACzB,UAAU;EACZ;KACG,IAAI,wBAAwB;;;;;;;;;KAS5B;WACM;WACA;WACA;;WAEA,iBAAiB;WACjB;WACA;;WAEA;WACA,yBAAyB;WACzB;WACA;;;;;;;;;;KAUN;WACM;aACE;aACA;;;KAGR;WACM,OAAO;WACP,UAAU,kBAAkB;;KAElC,uBAAuB,YAAY;WAC7B;WACA;IACP,UAAU,eAAe,4BAA4B;KACpD,0BAA0B,eAAe;KACzC,sBAAsB,MAAM,qBAAqB,wBAAwB;WACnE,2BAA2B;IAClC,UAAU,0BAA0B,IAAI,wBAAwB;KAC/D;KACA,qBAAqB,WAAW,aAAa,wBAAwB,KAAK,sBAAsB;KAChG,4BAA4B,KAAK,iCAAiC,IAAI,YAAY,EAAE,2BAA2B;KAC/G,mBAAmB,MAAM,qBAAqB,wBAAwB;WAChE,wBAAwB;IAC/B,UAAU,yBAAyB,IAAI,wBAAwB;KAC9D,kBAAkB,MAAM,qBAAqB,wBAAwB;WAC/D,uBAAuB;IAC9B,UAAU,yBAAyB,IAAI,wBAAwB;KAC9D,qBAAqB,MAAM,qBAAqB,wBAAwB;WAClE,0BAA0B;IACjC,UAAU,iCAAiC,IAAI,wBAAwB;KACtE,0BAA0B,MAAM,qBAAqB,wBAAwB;WACvE,+BAA+B;IACtC,UAAU,iCAAiC,IAAI,wBAAwB;KACtE,kBAAkB,KAAK,aAAa,4BAA4B;KAChE,2BAA2B,KAAK,sBAAsB,4BAA4B;KAClF,wBAAwB,KAAK,mBAAmB,4BAA4B;KAC5E,uBAAuB,KAAK,kBAAkB,4BAA4B;KAC1E,0BAA0B,KAAK,qBAAqB,4BAA4B;KAChF,+BAA+B,KAAK,0BAA0B,4BAA4B;KAC1F,sBAAsB,KAAK,iBAAiB,4BAA4B;KACxE,kBAAkB,WAAW,cAAc,6BAA6B,kBAAkB,aAAa,aAAa"}
@@ -1,12 +1,12 @@
1
- import { r as StorageColumn } from "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
2
- import { c as SqlStorage } from "./sql-storage-CySVsLrY-e9C5Gszx.mjs";
3
- import { f as ExtractFieldOutputTypes } from "./types-C89S13jo-CGy-V60b.mjs";
4
- import "./types-D6ST3Gkf.mjs";
5
- import { t as SqlLoweringSpec } from "./index-DbDTloZS.mjs";
6
- import { D as ColumnRef, _t as ParamRef } from "./types-ZzeQKmYD-D1hXGIgd.mjs";
7
- import { t as SqlExecutionPlan } from "./sql-execution-plan-qxvHnFcA-DdIwfSmv.mjs";
8
- import { t as SqlQueryPlan } from "./plan-DfLDIdep-CoshEetE.mjs";
9
- import { r as ExecutionContext } from "./query-lane-context-DyDSQVS--ByM80KpV.mjs";
1
+ import { t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
2
+ import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
3
+ import { f as ExtractFieldOutputTypes } from "./types-BDUG29Df-LE85dIXP.mjs";
4
+ import "./types-UcHa2cTe.mjs";
5
+ import { t as SqlLoweringSpec } from "./index-C5I8D-MB.mjs";
6
+ import { D as ColumnRef, _t as ParamRef } from "./types-ZzeQKmYD-kI_QWHEx.mjs";
7
+ import { t as SqlExecutionPlan } from "./sql-execution-plan-qxvHnFcA-HjRSS3l9.mjs";
8
+ import { t as SqlQueryPlan } from "./plan-DfLDIdep-6R1mLkcW.mjs";
9
+ import { r as ExecutionContext } from "./query-lane-context-DyDSQVS--CyCznt67.mjs";
10
10
  import { Contract } from "@prisma/orm-framework/contract/types";
11
11
  import { ParamSpec } from "@prisma/orm-framework/operations";
12
12
  import { RuntimeExecutor } from "@prisma/orm-framework/components/runtime";
@@ -244,4 +244,4 @@ interface SqlBuilderOptions<TContract extends Contract<SqlStorage> = Contract<Sq
244
244
  }
245
245
  //#endregion
246
246
  export { TableDef as C, TablesOf as E, SqlPlan as S, TableMetadata as T, RawTemplateFactory as _, ColumnsOf as a, SqlBuilderOptions as b, META as c, ModelMetadata as d, OperationTypeSignature as f, RawFunctionOptions as g, RawFactory as h, ColumnResolutionContract as i, Meta as l, OperationsForTypeId as m, BuildParamsMap as n, ComputeColumnJsType as o, OperationTypes as p, CodecTypes as r, Expr as s, BuildOptions as t, ModelDef as u, RawTemplateOptions as v, TableKey as w, SqlOrmPlan as x, RuntimeScope as y };
247
- //# sourceMappingURL=types-CLN9Y3BH-B9xrXW2L.d.mts.map
247
+ //# sourceMappingURL=types-CLN9Y3BH-BHUrV7MD.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-CLN9Y3BH-B9xrXW2L.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/types-CLN9Y3BH.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;KAeK,aAAa,mBAAmB;;;;;;;;;KAShC,eAAe,KAAK,gBAAgB;;;KAGpC,OAAO,YAAY;;;;;;;;;;KAUnB;WACM;aACE,YAAY,SAAS;eACnB,QAAQ,SAAS;;;WAGrB;aACE,YAAY,SAAS;eACnB,SAAS,SAAS,eAAe,SAAS;;;;KAIpD,gBAAgB,kBAAkB,0BAA0B,uBAAuB,kCAAkC;WAC/G,cAAc,eAAe;IACpC;KACC,oBAAoB,kBAAkB,0BAA0B,qBAAqB,4BAA4B,gBAAgB,WAAW,qBAAqB,eAAe,8BAA8B,WAAW,kBAAkB,OAAO;WAC5O;aACE,OAAO;;IAEhB,mBAAmB;KAClB,qBAAqB,kBAAkB,0BAA0B,qBAAqB,0BAA0B,6BAA6B,oBAAoB,WAAW,MAAM,0BAA0B,4BAA4B,gBAAgB,WAAW,qBAAqB,eAAe,2BAA2B,kBAAkB,sBAAsB,uBAAuB,OAAO;WAClY;aACE,cAAc,eAAe;;OAEnC,WAAW,kBAAkB,OAAO;WAChC,QAAQ;IACf,mBAAmB;;KAElB,uBAAuB,kBAAkB,0BAA0B,qBAAqB,0BAA0B,6BAA6B,mCAAmC;WAC5K;aACE,aAAa,eAAe;;IAErC,wBAAwB,SAAS,OAAO;WACjC,eAAe,gBAAgB;IACtC,yBAAyB,UAAU,QAAQ,oBAAoB,gBAAgB,QAAQ;KACtF,oBAAoB,mBAAmB,eAAe,mBAAmB;WAC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,uBAAuB,oBAAoB,WAAW,MAAM,WAAW,YAAY,cAAc;;;;;;KAMhmB,QAAQ,iBAAiB,iBAAiB;;;;KAI1C,SAAS,aAAa;EACzB;IACE,cAAc;;IAEd;KACC,SAAS,aAAa,cAAc,SAAS;;;;cAIpC;;;;KAIT,KAAK;GACP;KACE,SAAS;;;;UAIJ,cAAc;EACtB,MAAM;;;;;UAKE,cAAc;EACtB,MAAM;;;;;;UAME,SAAS;YACP,OAAO,cAAc;;;;;;UAMvB,SAAS;YACP,OAAO,cAAc;;KAE5B,UAAU,WAAW,UAAU,SAAS,cAAc,gBAAgB,SAAS,aAAa,SAAS,WAAW;EACnH,eAAe;IACb;UACM;WACC,cAAc;;UAEf,2BAA2B;WAC1B,QAAQ;;KAEd,sBAAsB,SAAS,yBAAyB,+BAA+B;UAClF,mBAAmB;GAC1B,cAAc,SAAS,qBAAqB;EAC7C,KAAK,SAAS,qBAAqB;;UAE3B;YACE;;UAEF;WACC,SAAS;;UAEV,kBAAkB,kBAAkB,SAAS,cAAc,SAAS;WACnE,SAAS,iBAAiB"}
@@ -1,4 +1,4 @@
1
- import { o as SqlNode } from "./storage-table-D8o37IKw-bbcikEu-.mjs";
1
+ import { o as SqlNode } from "./storage-table-ZzbR-xzQ-BRoTQE_2.mjs";
2
2
  import { NamespaceBase, freezeNode, isPlainRecord } from "@prisma/orm-framework/components/ir";
3
3
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
4
4
  //#region ../../../2-sql/1-core/contract/dist/types.mjs
@@ -108,4 +108,4 @@ function applyFkDefaults(fk, overrideDefaults) {
108
108
  //#endregion
109
109
  export { SqlStorage as a, isSqlAuthoringContributions as c, SqlNamespaceBase as i, isStorageTypeInstance as l, DEFAULT_FK_CONSTRAINT as n, applyFkDefaults as o, DEFAULT_FK_INDEX as r, isMaterializedSqlNamespace as s, CODEC_INSTANCE_KIND as t, toStorageTypeInstance as u };
110
110
 
111
- //# sourceMappingURL=types-DYXr7yN6.mjs.map
111
+ //# sourceMappingURL=types-CUsJrvEl.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DYXr7yN6.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types.mjs"],"sourcesContent":["import { a as ForeignKey, c as CheckConstraint, i as PrimaryKey, l as SqlNode, n as UniqueConstraint, o as ForeignKeyReference, r as StorageColumn, s as Index, t as StorageTable } from \"./storage-table-D8o37IKw.mjs\";\nimport { i as isStorageValueSet, n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-DMOkKJdP.mjs\";\nimport { NamespaceBase, freezeNode, isPlainRecord } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/ir/storage-type-instance.ts\n/**\n* Sentinel kind for the legacy codec-triple shape persisted under\n* `SqlStorage.types`. Plain JSON-clean object literals carry this\n* discriminator so the polymorphic slot dispatch can route them down\n* the codec path while target-specific IR class instances (e.g. the\n* Postgres enum class) keep their own narrower `kind` literal.\n*/\nconst CODEC_INSTANCE_KIND = \"codec-instance\";\n/**\n* Stamp the codec-instance `kind` discriminator on a caller-supplied\n* codec triple. Idempotent: input that already carries the discriminator\n* passes through unchanged. Missing `typeParams` is normalised to `{}`.\n*/\nfunction toStorageTypeInstance(input) {\n\treturn {\n\t\tkind: CODEC_INSTANCE_KIND,\n\t\tcodecId: input.codecId,\n\t\tnativeType: input.nativeType,\n\t\ttypeParams: input.typeParams ?? {}\n\t};\n}\n/**\n* Type-guard for codec-typed entries on the polymorphic\n* `SqlStorage.types` slot. Distinguishes `StorageTypeInstance` from\n* any class-instance kinds a target pack contributes.\n*/\nfunction isStorageTypeInstance(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn value.kind === CODEC_INSTANCE_KIND;\n}\n//#endregion\n//#region src/ir/sql-storage.ts\n/**\n* Narrows framework `AuthoringContributions` to the SQL-family shape by testing\n* for the SQL-specific `createNamespace` capability.\n*/\nfunction isSqlAuthoringContributions(authoring) {\n\tif (authoring === void 0 || !Object.hasOwn(authoring, \"createNamespace\")) return false;\n\treturn typeof Reflect.get(authoring, \"createNamespace\") === \"function\";\n}\n/**\n* Abstract SQL family namespace base class. Target concretions (`PostgresSchema`,\n* `SqliteDatabase`, …) extend this — it is never instantiated directly.\n* `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]`\n* addresses any entity.\n*/\nvar SqlNamespaceBase = class extends NamespaceBase {};\n/**\n* Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks\n* `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it\n* survives duplicate-module boundaries (e.g. dist e2e where the target and\n* the family carry separate copies of `@internal/framework-components`).\n*\n* Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`,\n* `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput`\n* objects (`{ id, entries }`) do not.\n*/\nfunction isMaterializedSqlNamespace(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"qualifyTable\" in x)) return false;\n\treturn typeof x.qualifyTable === \"function\";\n}\nvar SqlStorage = class extends SqlNode {\n\tstorageHash;\n\tnamespaces;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.storageHash = input.storageHash;\n\t\tthis.namespaces = Object.freeze(input.namespaces);\n\t\tif (input.types !== void 0) this.types = Object.freeze(Object.fromEntries(Object.entries(input.types).map(([name, ti]) => [name, normaliseTypeEntry(name, ti)])));\n\t\tfreezeNode(this);\n\t}\n};\n/**\n* Strict polymorphic-slot dispatch for `SqlStorage.types` entries.\n* Every entry must carry a `kind: 'codec-instance'` discriminator or\n* be an already-constructed `StorageTypeInstance`. Untagged or\n* unrecognised inputs throw a diagnostic naming the entry and its\n* `kind`, so format drift surfaces loudly at the deserializer\n* boundary instead of slipping past the seam and corrupting\n* downstream IR walks.\n*\n* Codec-triple authors that have an untagged shape on hand can call\n* `toStorageTypeInstance(...)` (which stamps the `'codec-instance'`\n* discriminator) before constructing `SqlStorage`. On-disk reads\n* cross `familyInstance.deserializeContract` first; the structural\n* arktype schema rejects untagged entries earlier, so this throw\n* only fires for in-memory authoring bugs.\n*/\nfunction normaliseTypeEntry(name, entry) {\n\tif (isStorageTypeInstance(entry)) {\n\t\tif (\"typeParams\" in entry) return entry;\n\t\treturn toStorageTypeInstance(entry);\n\t}\n\tconst rawKind = isPlainRecord(entry) ? entry[\"kind\"] : void 0;\n\tconst kindDescription = rawKind === void 0 ? \"missing `kind` discriminator\" : `unrecognised \\`kind\\` discriminator ${JSON.stringify(rawKind)}`;\n\tthrow new InternalError(`storage.types[${JSON.stringify(name)}] has ${kindDescription}; expected ${JSON.stringify(\"codec-instance\")}. Untagged codec triples should be wrapped with toStorageTypeInstance(...) before construction.`);\n}\n//#endregion\n//#region src/types.ts\nconst DEFAULT_FK_CONSTRAINT = true;\nconst DEFAULT_FK_INDEX = true;\nfunction applyFkDefaults(fk, overrideDefaults) {\n\treturn {\n\t\tconstraint: fk.constraint ?? overrideDefaults?.constraint ?? true,\n\t\tindex: fk.index ?? overrideDefaults?.index ?? true\n\t};\n}\n//#endregion\nexport { CODEC_INSTANCE_KIND, CheckConstraint, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, Index, PrimaryKey, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageValueSet, UniqueConstraint, applyFkDefaults, checkConstraintInputFromSerialized, indexInputFromSerialized, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, toStorageTypeInstance };\n\n//# sourceMappingURL=types.mjs.map"],"mappings":";;;;;;;;;;;AAYA,MAAM,sBAAsB;;;;;;AAM5B,SAAS,sBAAsB,OAAO;CACrC,OAAO;EACN,MAAM;EACN,SAAS,MAAM;EACf,YAAY,MAAM;EAClB,YAAY,MAAM,cAAc,CAAC;CAClC;AACD;;;;;;AAMA,SAAS,sBAAsB,OAAO;CACrC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,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9C,OAAO;EACN,YAAY,GAAG,cAAc,kBAAkB,cAAc;EAC7D,OAAO,GAAG,SAAS,kBAAkB,SAAS;CAC/C;AACD"}
1
+ {"version":3,"file":"types-CUsJrvEl.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types.mjs"],"sourcesContent":["import { a as ForeignKey, c as CheckConstraint, i as PrimaryKey, l as SqlNode, n as UniqueConstraint, o as ForeignKeyReference, r as StorageColumn, s as Index, t as StorageTable } from \"./storage-table-ZzbR-xzQ.mjs\";\nimport { i as isStorageValueSet, n as checkConstraintInputFromSerialized, r as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-nBTwanKy.mjs\";\nimport { NamespaceBase, freezeNode, isPlainRecord } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/ir/storage-type-instance.ts\n/**\n* Sentinel kind for the legacy codec-triple shape persisted under\n* `SqlStorage.types`. Plain JSON-clean object literals carry this\n* discriminator so the polymorphic slot dispatch can route them down\n* the codec path while target-specific IR class instances (e.g. the\n* Postgres enum class) keep their own narrower `kind` literal.\n*/\nconst CODEC_INSTANCE_KIND = \"codec-instance\";\n/**\n* Stamp the codec-instance `kind` discriminator on a caller-supplied\n* codec triple. Idempotent: input that already carries the discriminator\n* passes through unchanged. Missing `typeParams` is normalised to `{}`.\n*/\nfunction toStorageTypeInstance(input) {\n\treturn {\n\t\tkind: CODEC_INSTANCE_KIND,\n\t\tcodecId: input.codecId,\n\t\tnativeType: input.nativeType,\n\t\ttypeParams: input.typeParams ?? {}\n\t};\n}\n/**\n* Type-guard for codec-typed entries on the polymorphic\n* `SqlStorage.types` slot. Distinguishes `StorageTypeInstance` from\n* any class-instance kinds a target pack contributes.\n*/\nfunction isStorageTypeInstance(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn value.kind === CODEC_INSTANCE_KIND;\n}\n//#endregion\n//#region src/ir/sql-storage.ts\n/**\n* Narrows framework `AuthoringContributions` to the SQL-family shape by testing\n* for the SQL-specific `createNamespace` capability.\n*/\nfunction isSqlAuthoringContributions(authoring) {\n\tif (authoring === void 0 || !Object.hasOwn(authoring, \"createNamespace\")) return false;\n\treturn typeof Reflect.get(authoring, \"createNamespace\") === \"function\";\n}\n/**\n* Abstract SQL family namespace base class. Target concretions (`PostgresSchema`,\n* `SqliteDatabase`, …) extend this — it is never instantiated directly.\n* `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]`\n* addresses any entity.\n*/\nvar SqlNamespaceBase = class extends NamespaceBase {};\n/**\n* Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks\n* `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it\n* survives duplicate-module boundaries (e.g. dist e2e where the target and\n* the family carry separate copies of `@internal/framework-components`).\n*\n* Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`,\n* `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput`\n* objects (`{ id, entries }`) do not.\n*/\nfunction isMaterializedSqlNamespace(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"qualifyTable\" in x)) return false;\n\treturn typeof x.qualifyTable === \"function\";\n}\nvar SqlStorage = class extends SqlNode {\n\tstorageHash;\n\tnamespaces;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.storageHash = input.storageHash;\n\t\tthis.namespaces = Object.freeze(input.namespaces);\n\t\tif (input.types !== void 0) this.types = Object.freeze(Object.fromEntries(Object.entries(input.types).map(([name, ti]) => [name, normaliseTypeEntry(name, ti)])));\n\t\tfreezeNode(this);\n\t}\n};\n/**\n* Strict polymorphic-slot dispatch for `SqlStorage.types` entries.\n* Every entry must carry a `kind: 'codec-instance'` discriminator or\n* be an already-constructed `StorageTypeInstance`. Untagged or\n* unrecognised inputs throw a diagnostic naming the entry and its\n* `kind`, so format drift surfaces loudly at the deserializer\n* boundary instead of slipping past the seam and corrupting\n* downstream IR walks.\n*\n* Codec-triple authors that have an untagged shape on hand can call\n* `toStorageTypeInstance(...)` (which stamps the `'codec-instance'`\n* discriminator) before constructing `SqlStorage`. On-disk reads\n* cross `familyInstance.deserializeContract` first; the structural\n* arktype schema rejects untagged entries earlier, so this throw\n* only fires for in-memory authoring bugs.\n*/\nfunction normaliseTypeEntry(name, entry) {\n\tif (isStorageTypeInstance(entry)) {\n\t\tif (\"typeParams\" in entry) return entry;\n\t\treturn toStorageTypeInstance(entry);\n\t}\n\tconst rawKind = isPlainRecord(entry) ? entry[\"kind\"] : void 0;\n\tconst kindDescription = rawKind === void 0 ? \"missing `kind` discriminator\" : `unrecognised \\`kind\\` discriminator ${JSON.stringify(rawKind)}`;\n\tthrow new InternalError(`storage.types[${JSON.stringify(name)}] has ${kindDescription}; expected ${JSON.stringify(\"codec-instance\")}. Untagged codec triples should be wrapped with toStorageTypeInstance(...) before construction.`);\n}\n//#endregion\n//#region src/types.ts\nconst DEFAULT_FK_CONSTRAINT = true;\nconst DEFAULT_FK_INDEX = true;\nfunction applyFkDefaults(fk, overrideDefaults) {\n\treturn {\n\t\tconstraint: fk.constraint ?? overrideDefaults?.constraint ?? true,\n\t\tindex: fk.index ?? overrideDefaults?.index ?? true\n\t};\n}\n//#endregion\nexport { CODEC_INSTANCE_KIND, CheckConstraint, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, Index, PrimaryKey, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageValueSet, UniqueConstraint, applyFkDefaults, checkConstraintInputFromSerialized, indexInputFromSerialized, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, toStorageTypeInstance };\n\n//# sourceMappingURL=types.mjs.map"],"mappings":";;;;;;;;;;;AAYA,MAAM,sBAAsB;;;;;;AAM5B,SAAS,sBAAsB,OAAO;CACrC,OAAO;EACN,MAAM;EACN,SAAS,MAAM;EACf,YAAY,MAAM;EAClB,YAAY,MAAM,cAAc,CAAC;CAClC;AACD;;;;;;AAMA,SAA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AC9B,MAAM,mBAAmB;AACzB,SAAS,gBAAgB,IAAI,kBAAkB;CAC9C,OAAO;EACN,YAAY,GAAG,cAAc,kBAAkB,cAAc;EAC7D,OAAO,GAAG,SAAS,kBAAkB,SAAS;CAC/C;AACD"}
@@ -0,0 +1 @@
1
+ import "./types-YStFFkKs-D9UAmnON.mjs";
@@ -1,11 +1,11 @@
1
- import { a as StorageTable, r as StorageColumn } from "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
2
- import { c as SqlStorage, d as StorageTypeInstance } from "./sql-storage-CySVsLrY-e9C5Gszx.mjs";
3
- import { O as SqlControlDriverInstance } from "./types-C89S13jo-CGy-V60b.mjs";
4
- import "./types-D6ST3Gkf.mjs";
5
- import { r as SqlOperationDescriptors } from "./index-DbDTloZS.mjs";
6
- import { v as SqlSchemaIRNode } from "./types-H7xjfrKl-CHqi_h5i.mjs";
7
- import "./types-yvAngq6d.mjs";
8
- import { i as SqlControlAdapter } from "./control-adapter-C99J7aEF-B4MyB0B0.mjs";
1
+ import { r as StorageTable, t as StorageColumn } from "./storage-table-DSeWszOL-CI-cItEK.mjs";
2
+ import { c as SqlStorage, d as StorageTypeInstance } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
3
+ import { O as SqlControlDriverInstance } from "./types-BDUG29Df-LE85dIXP.mjs";
4
+ import "./types-UcHa2cTe.mjs";
5
+ import { r as SqlOperationDescriptors } from "./index-C5I8D-MB.mjs";
6
+ import { v as SqlSchemaIRNode } from "./types-YStFFkKs-D9UAmnON.mjs";
7
+ import "./types-Dwcw0F8X.mjs";
8
+ import { i as SqlControlAdapter } from "./control-adapter-C99J7aEF-DsxImHyk.mjs";
9
9
  import { Contract } from "@prisma/orm-framework/contract/types";
10
10
  import { Result } from "@prisma/orm-framework/utils/result";
11
11
  import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
@@ -423,4 +423,4 @@ interface CreateSqlMigrationPlanOptions<TTargetDetails> {
423
423
  }
424
424
  //#endregion
425
425
  export { SqlPlannerSuccessResult as A, SqlMigrationRunnerSuccessValue as C, SqlPlannerConflictLocation as D, SqlPlannerConflictKind as E, SqlPlannerFailureResult as O, SqlMigrationRunnerResult as S, SqlPlannerConflict as T, SqlMigrationRunner as _, FieldEvent as a, SqlMigrationRunnerExecuteOptions as b, SqlControlAdapterDescriptor as c, SqlMigrationPlanContractInfo as d, SqlMigrationPlanOperation as f, SqlMigrationPlannerPlanOptions as g, SqlMigrationPlanner as h, ExpandNativeTypeInput as i, StorageTypePlanResult as j, SqlPlannerResult as k, SqlControlExtensionDescriptor as l, SqlMigrationPlanOperationTarget as m, CodecControlHooks as n, FieldEventContext as o, SqlMigrationPlanOperationStep as p, CreateSqlMigrationPlanOptions as r, ResolveIdentityValueInput as s, AnyRecord as t, SqlMigrationPlan as u, SqlMigrationRunnerErrorCode as v, SqlPlanTargetDetails as w, SqlMigrationRunnerFailure as x, SqlMigrationRunnerExecuteCallbacks as y };
426
- //# sourceMappingURL=types-IqZMLrFC-Sr3TZmGu.d.mts.map
426
+ //# sourceMappingURL=types-IqZMLrFC-Dk3bHKmk.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-IqZMLrFC-Sr3TZmGu.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/types-IqZMLrFC.d.mts"],"mappings":";;;;;;;;;;;;;;;KAUK,YAAY,SAAS;UAChB,sBAAsB;WACrB,qBAAqB,0BAA0B;;;;;UAKhD;WACC;WACA;WACA,aAAa;;;;;;;;;UASd;WACC;WACA;WACA,aAAa;;;;;;;;;;;;;;;;KAgBnB;;;;;;;;;;;;;UAaK;WACC;WACA;WACA;WACA,aAAa;WACb,WAAW;WACX,aAAa;WACb,WAAW;;UAEZ,kBAAkB;;;;;;;;;EAS1B,sBAAsB;aACX;aACA,cAAc;aACd,UAAU,SAAS;aACnB,QAAQ;aACR;aACA,QAAQ;QACb,sBAAsB;EAC5B,cAAc;aACH;aACA,cAAc;aACd,QAAQ;aACR;iBACI;EACf,mB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AU;;;;;WAKV,kBAAkB;;;;;;;WAOlB,qBAAqB,cAAc;;;;;WAKnC,yBAAyB;;KAE/B;UACK,kCAAkC;WACjC,MAAM;WACN,OAAO;;UAER,uCAAuC;KAC5C,2BAA2B,OAAO,gCAAgC;UAC7D,mBAAmB;;;;;;;;;;;;;;EAc3B,QAAQ;aACG,QAAQ;aACR,iBAAiB,cAAc,iCAAiC;MACvE,QAAQ;;;;;;;;;;;EAWZ,oBAAoB,SAAS,iCAAiC,kBAAkB,QAAQ;;UAEhF,8BAA8B;WAC7B;;;;WAIA;WACA,SAAS;WACT,aAAa;WACb,qBAAqB,0BAA0B;;;;;;WAM/C;WACA,OAAO"}
@@ -1,16 +1,17 @@
1
1
  import "./sql-node-kEz6YFZo-v2F7delx.mjs";
2
+ import "./check-constraint-B7qGu6rc-HvQjjX82.mjs";
2
3
  import "./foreign-key-C-iTPuRT-C9ip8zFx.mjs";
3
4
  import "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
4
- import "./sql-index-ByAAE7K8-C1h4IS27.mjs";
5
- import "./storage-table-BLcRrDzz-D4JOM8FC.mjs";
5
+ import "./sql-index-ByAAE7K8-DKj2V86p.mjs";
6
+ import "./storage-table-DSeWszOL-CI-cItEK.mjs";
6
7
  import "./storage-value-set-BGlj5Uus-CvZD--GG.mjs";
7
- import "./sql-storage-CySVsLrY-e9C5Gszx.mjs";
8
- import "./serialized-index-D9YgVREe-KaLdoijn.mjs";
9
- import "./types-C89S13jo-CGy-V60b.mjs";
8
+ import "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
9
+ import "./serialized-index-CrgG8ct1-DG3JpHc7.mjs";
10
+ import "./types-BDUG29Df-LE85dIXP.mjs";
10
11
  //#region ../../../2-sql/1-core/contract/dist/types.d.mts
11
12
  //#region src/column-type-resolution.d.ts
12
13
  type StorageColumnMapAt<SCT, NsId extends string, TableName extends string> = string extends keyof SCT ? never : NsId extends keyof SCT ? string extends keyof SCT[NsId] ? never : TableName extends keyof SCT[NsId] ? SCT[NsId][TableName] : never : never;
13
14
  type StorageColumnTypeAcrossNamespaces<SCT, TableName extends string, ColumnName extends string> = { [Ns in keyof SCT]: TableName extends keyof SCT[Ns] ? ColumnName extends keyof SCT[Ns][TableName] ? SCT[Ns][TableName][ColumnName] : never : never; }[keyof SCT];
14
15
  //#endregion
15
16
  export { StorageColumnTypeAcrossNamespaces as n, StorageColumnMapAt as t };
16
- //# sourceMappingURL=types-D6ST3Gkf.d.mts.map
17
+ //# sourceMappingURL=types-UcHa2cTe.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-UcHa2cTe.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types.d.mts"],"mappings":";;;;;;;;;;;;KAWK,mBAAmB,KAAK,qBAAqB,iDAAiD,cAAc,mBAAmB,2BAA2B,IAAI,gBAAgB,wBAAwB,IAAI,QAAQ,IAAI,MAAM;KAC5N,kCAAkC,KAAK,0BAA0B,gCAAgC,YAAY,MAAM,wBAAwB,IAAI,MAAM,yBAAyB,IAAI,IAAI,aAAa,IAAI,IAAI,WAAW,qCAAqC"}
@@ -1,9 +1,9 @@
1
- import { r as SqlObjectNaming } from "./naming-BsvzQPOq-qOWmknyp.mjs";
1
+ import { r as SqlObjectNaming } from "./naming-CV9j2pXl-KARaDReS.mjs";
2
2
  import { IRNodeBase } from "@prisma/orm-framework/components/ir";
3
3
  import { ColumnDefault } from "@prisma/orm-framework/contract/types";
4
4
  import { CodecRef } from "@prisma/orm-framework/components/codec";
5
5
  import { DiffSubjectGranularity, DiffableNode, SchemaNodeRef } from "@prisma/orm-framework/components/control";
6
- //#region ../../../2-sql/1-core/schema-ir/dist/types-H7xjfrKl.d.mts
6
+ //#region ../../../2-sql/1-core/schema-ir/dist/types-YStFFkKs.d.mts
7
7
  //#region src/ir/sql-schema-ir-node.d.ts
8
8
  /**
9
9
  * SQL Schema IR node base. Carries the family-level
@@ -691,4 +691,4 @@ interface SqlTypeMetadataRegistry {
691
691
  }
692
692
  //#endregion
693
693
  export { SqlUniqueIR as C, relationalNodeEntityKind as D, defineNonEnumerable as E, relationalNodeGranularity as O, SqlTypeMetadataRegistry as S, assertNode as T, SqlSchemaIRInput as _, SqlCheckConstraintIR as a, SqlTableIRInput as b, SqlColumnDefaultIRInput as c, SqlForeignKeyIR as d, SqlForeignKeyIRInput as f, SqlSchemaIR as g, SqlReferentialAction as h, SqlAnnotations as i, SqlColumnIR as l, SqlIndexIRInput as m, PrimaryKeyInput as n, SqlCheckConstraintIRInput as o, SqlIndexIR as p, RelationalSchemaNodeKind as r, SqlColumnDefaultIR as s, PrimaryKey as t, SqlColumnIRInput as u, SqlSchemaIRNode as v, SqlUniqueIRInput as w, SqlTypeMetadata as x, SqlTableIR as y };
694
- //# sourceMappingURL=types-H7xjfrKl-CHqi_h5i.d.mts.map
694
+ //# sourceMappingURL=types-YStFFkKs-D9UAmnON.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-H7xjfrKl-CHqi_h5i.d.mts","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-H7xjfrKl.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA2BuB,wBAAwB;WACpC;;;;;;;;;oBASS;EAClB;;;;;;;;iBAQe,WAAW,UAAU,iBAAiB,MAAM,6BAA6B,mBAAmB,YAAY,MAAM,oBAAoB,QAAQ,YAAY,QAAQ;;;;;;;;;;iBAU9J,oBAAoB,kBAAkB,QAAQ,GAAG,aAAa;;;UAGrE;WACC;WACA;;;;;;WAMA,qBAAqB;;;;;;;;;;;;;;;cAelB,mBAAmB,2BAA2B;WACjD;WACA;WACA;;WAEA,qBAAqB;EAC9B,YAAY,OAAO;MACf;EACJ,qBAAqB;SACd,KAAK,OAAO,aAAa,kBAAkB;SAC3C,GAAG,MAAM,kBAAkB,QAAQ;EAC1C,UAAU,OAAO;;;;;;;;;;;cAWL;WACH;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAEN,mCAAm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