@prisma/orm-family-sql 8.0.0-rc.16-dev.9 → 8.0.0-rc.16-dev.10

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 (221) hide show
  1. package/dist/{ast-Bf6J9_ra.d.mts → ast-Bmb-2vbO.d.mts} +3 -3
  2. package/dist/{ast-Bf6J9_ra.d.mts.map → ast-Bmb-2vbO.d.mts.map} +1 -1
  3. package/dist/{authoring-entity-types-CZ-vdwYS-Bq3LXsCn.d.mts → authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts} +2 -2
  4. package/dist/{authoring-entity-types-CZ-vdwYS-Bq3LXsCn.d.mts.map → authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts.map} +1 -1
  5. package/dist/{authoring-type-constructors-0Iv2zdwS-CVl4womm.mjs → authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs} +2 -2
  6. package/dist/{authoring-type-constructors-0Iv2zdwS-CVl4womm.mjs.map → authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs.map} +1 -1
  7. package/dist/builder.d.mts +2 -2
  8. package/dist/builder__runtime.d.mts +9 -9
  9. package/dist/builder__runtime.mjs +1 -1
  10. package/dist/builder__types.d.mts +2 -2
  11. package/dist/{codec-descriptor-registry-D7bl9ayf.mjs → codec-descriptor-registry-CdIIOkuE.mjs} +2 -2
  12. package/dist/{codec-descriptor-registry-D7bl9ayf.mjs.map → codec-descriptor-registry-CdIIOkuE.mjs.map} +1 -1
  13. package/dist/{config-types-DeIF6WyF.mjs → config-types-D0sxpKAN.mjs} +2 -2
  14. package/dist/{config-types-DeIF6WyF.mjs.map → config-types-D0sxpKAN.mjs.map} +1 -1
  15. package/dist/{config-types-Cag6qJnA.d.mts → config-types-DB6gRJ5K.d.mts} +4 -4
  16. package/dist/{config-types-Cag6qJnA.d.mts.map → config-types-DB6gRJ5K.d.mts.map} +1 -1
  17. package/dist/{contract-builder-BaJMQFAc.d.mts → contract-builder-V5pFHDv3.d.mts} +14 -11
  18. package/dist/contract-builder-V5pFHDv3.d.mts.map +1 -0
  19. package/dist/{contract-builder-BlFrYr97.mjs → contract-builder-tEax3I2q.mjs} +4 -4
  20. package/dist/{contract-builder-BlFrYr97.mjs.map → contract-builder-tEax3I2q.mjs.map} +1 -1
  21. package/dist/contract-emitter.mjs +1 -1
  22. package/dist/contract-prisma7__provider.d.mts +2 -2
  23. package/dist/contract-prisma7__provider.mjs +36 -8
  24. package/dist/contract-prisma7__provider.mjs.map +1 -1
  25. package/dist/contract-psl.d.mts +3 -3
  26. package/dist/contract-psl.mjs +1 -1
  27. package/dist/contract-psl__attribute-specs.d.mts +4 -4
  28. package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
  29. package/dist/contract-psl__attribute-specs.mjs +1 -1
  30. package/dist/contract-psl__provider.d.mts +2 -2
  31. package/dist/contract-psl__provider.mjs +2 -2
  32. package/dist/contract-psl__provider.mjs.map +1 -1
  33. package/dist/contract-ts.d.mts +3 -3
  34. package/dist/contract-ts.mjs +3 -3
  35. package/dist/contract-ts__config-types.d.mts +1 -1
  36. package/dist/contract-ts__config-types.mjs +1 -1
  37. package/dist/contract-ts__contract-builder.d.mts +2 -2
  38. package/dist/contract-ts__contract-builder.mjs +2 -2
  39. package/dist/{contract-view-Cd6_tdxU.d.mts → contract-view-C1xX3yIj.d.mts} +2 -2
  40. package/dist/{contract-view-Cd6_tdxU.d.mts.map → contract-view-C1xX3yIj.d.mts.map} +1 -1
  41. package/dist/contract.d.mts +14 -14
  42. package/dist/contract.mjs +9 -8
  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 +2 -2
  49. package/dist/contract__foreign-key-materialization.mjs +3 -2
  50. package/dist/contract__index-type-validation.d.mts +1 -1
  51. package/dist/contract__referential-action-sql.d.mts +1 -1
  52. package/dist/contract__resolve-storage-table.d.mts +1 -1
  53. package/dist/contract__types.d.mts +6 -6
  54. package/dist/contract__types.mjs +3 -3
  55. package/dist/contract__validators.d.mts +1 -1
  56. package/dist/contract__validators.mjs +2 -2
  57. package/dist/{control-BkyDhucB.d.mts → control-B3Mb21Md.d.mts} +16 -16
  58. package/dist/{control-BkyDhucB.d.mts.map → control-B3Mb21Md.d.mts.map} +1 -1
  59. package/dist/{control-BRbds4vn.mjs → control-C5Yy0n3w.mjs} +10 -10
  60. package/dist/{control-BRbds4vn.mjs.map → control-C5Yy0n3w.mjs.map} +1 -1
  61. package/dist/control-adapter-BXQ29_fa.d.mts +1 -0
  62. package/dist/{control-adapter-CkFfBVei-Ba9JNrCN.d.mts → control-adapter-CkFfBVei-BLYeKcLW.d.mts} +6 -6
  63. package/dist/{control-adapter-CkFfBVei-Ba9JNrCN.d.mts.map → control-adapter-CkFfBVei-BLYeKcLW.d.mts.map} +1 -1
  64. package/dist/{db-D7R5zKiH-SEM04lcK.d.mts → db-D7R5zKiH-P7Tg4ZXk.d.mts} +9 -9
  65. package/dist/{db-D7R5zKiH-SEM04lcK.d.mts.map → db-D7R5zKiH-P7Tg4ZXk.d.mts.map} +1 -1
  66. package/dist/{ddl-types-DtKZjNtN-6TxFf4bH.d.mts → ddl-types-DtKZjNtN-CByECwns.d.mts} +4 -4
  67. package/dist/{ddl-types-DtKZjNtN-6TxFf4bH.d.mts.map → ddl-types-DtKZjNtN-CByECwns.d.mts.map} +1 -1
  68. package/dist/{derived-checks-DdguQPYm-BP57ljP8.mjs → derived-checks-D5zdlyyh-CPofdm1W.mjs} +30 -20
  69. package/dist/{derived-checks-DdguQPYm-BP57ljP8.mjs.map → derived-checks-D5zdlyyh-CPofdm1W.mjs.map} +1 -1
  70. package/dist/{derived-checks-DpPkO6Dt-BituyKFg.d.mts → derived-checks-DpPkO6Dt-D3M7YEr2.d.mts} +3 -3
  71. package/dist/{derived-checks-DpPkO6Dt-BituyKFg.d.mts.map → derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map} +1 -1
  72. package/dist/{diff-DMOqiT2h.d.mts → diff-CBqsNkxe.d.mts} +6 -6
  73. package/dist/{diff-DMOqiT2h.d.mts.map → diff-CBqsNkxe.d.mts.map} +1 -1
  74. package/dist/{dist-7hmkNQGd.mjs → dist-Dm_hQ-hh.mjs} +2 -2
  75. package/dist/{dist-7hmkNQGd.mjs.map → dist-Dm_hQ-hh.mjs.map} +1 -1
  76. package/dist/{entity-kinds-DCwkg9t7.d.mts → entity-kinds--HvqT50S.d.mts} +2 -2
  77. package/dist/{entity-kinds-DCwkg9t7.d.mts.map → entity-kinds--HvqT50S.d.mts.map} +1 -1
  78. package/dist/{entity-kinds-JlqzyFoo-kIaAUFyK.mjs → entity-kinds-O3V1K26U-B8TUrsX2.mjs} +16 -5
  79. package/dist/entity-kinds-O3V1K26U-B8TUrsX2.mjs.map +1 -0
  80. package/dist/{expression-B-QXMOmY.d.mts → expression-DE893va7.d.mts} +7 -7
  81. package/dist/{expression-B-QXMOmY.d.mts.map → expression-DE893va7.d.mts.map} +1 -1
  82. package/dist/{factories-BsUyFxsk.mjs → factories-Bp41Aity.mjs} +4 -3
  83. package/dist/factories-Bp41Aity.mjs.map +1 -0
  84. package/dist/{factories-CgVRbL8l.d.mts → factories-DzLBAAvj.d.mts} +4 -4
  85. package/dist/{factories-CgVRbL8l.d.mts.map → factories-DzLBAAvj.d.mts.map} +1 -1
  86. package/dist/family.d.mts +13 -13
  87. package/dist/family.mjs +6 -6
  88. package/dist/family__control-adapter.d.mts +2 -2
  89. package/dist/family__control.d.mts +4 -4
  90. package/dist/family__control.mjs +3 -3
  91. package/dist/family__diff.d.mts +2 -2
  92. package/dist/family__diff.mjs +1 -1
  93. package/dist/family__ir.d.mts +1 -1
  94. package/dist/family__ir.mjs +1 -1
  95. package/dist/family__migration.d.mts +1 -1
  96. package/dist/family__pack.d.mts +1 -1
  97. package/dist/family__pack.mjs +2 -2
  98. package/dist/family__psl-build.mjs +1 -1
  99. package/dist/family__psl-infer.d.mts +1 -1
  100. package/dist/family__psl-infer.mjs +1 -1
  101. package/dist/family__runtime.d.mts +2 -2
  102. package/dist/foreign-key-materialization-Cv3q8Pix.mjs +278 -0
  103. package/dist/foreign-key-materialization-Cv3q8Pix.mjs.map +1 -0
  104. package/dist/foreign-key-materialization-D0Ltg78T.d.mts +96 -0
  105. package/dist/foreign-key-materialization-D0Ltg78T.d.mts.map +1 -0
  106. package/dist/{foreign-key-C-iTPuRT-C9ip8zFx.d.mts → foreign-key-qkDFfG8t-Fyrzd0VI.d.mts} +20 -4
  107. package/dist/foreign-key-qkDFfG8t-Fyrzd0VI.d.mts.map +1 -0
  108. package/dist/{index-qOLTnfYz.d.mts → index-CnpTmyXs.d.mts} +3 -3
  109. package/dist/{index-qOLTnfYz.d.mts.map → index-CnpTmyXs.d.mts.map} +1 -1
  110. package/dist/index-equivalence-DswCiq5l-C7wLMPwF.mjs +109 -0
  111. package/dist/index-equivalence-DswCiq5l-C7wLMPwF.mjs.map +1 -0
  112. package/dist/{index-DYjWQAcJ.d.mts → index-oNRBExeI.d.mts} +11 -11
  113. package/dist/{index-DYjWQAcJ.d.mts.map → index-oNRBExeI.d.mts.map} +1 -1
  114. package/dist/{index-type-validation-BHppm9U-.d.mts → index-type-validation-B925ye4q.d.mts} +3 -3
  115. package/dist/{index-type-validation-BHppm9U-.d.mts.map → index-type-validation-B925ye4q.d.mts.map} +1 -1
  116. package/dist/{interpreter-BF5Xrf3W-bdklH78q.mjs → interpreter-DlG-2o64-DmykcFbp.mjs} +64 -17
  117. package/dist/interpreter-DlG-2o64-DmykcFbp.mjs.map +1 -0
  118. package/dist/{ir-BYHqe2mj.d.mts → ir-BPrf_vgX.d.mts} +3 -3
  119. package/dist/{ir-BYHqe2mj.d.mts.map → ir-BPrf_vgX.d.mts.map} +1 -1
  120. package/dist/middleware-DwaZ6s12.d.mts +1 -0
  121. package/dist/{middleware-mLwvcOLS-6Y52seRP.d.mts → middleware-mLwvcOLS-SaqhgsmA.d.mts} +2 -2
  122. package/dist/{middleware-mLwvcOLS-6Y52seRP.d.mts.map → middleware-mLwvcOLS-SaqhgsmA.d.mts.map} +1 -1
  123. package/dist/{migration-C5HGygKM.d.mts → migration-C_J49WKy.d.mts} +4 -4
  124. package/dist/{migration-C5HGygKM.d.mts.map → migration-C_J49WKy.d.mts.map} +1 -1
  125. package/dist/operations.d.mts +1 -1
  126. package/dist/orm-client.d.mts +15 -15
  127. package/dist/orm-client.mjs +1 -1
  128. package/dist/{pack-l0vLQrO8.d.mts → pack-DZtuLikU.d.mts} +3 -3
  129. package/dist/{pack-l0vLQrO8.d.mts.map → pack-DZtuLikU.d.mts.map} +1 -1
  130. package/dist/plan-Dhl03MtT.d.mts +2 -0
  131. package/dist/{plan-cGEaSXHv-2F5y-Dpy.d.mts → plan-cGEaSXHv-BeW-cC5v.d.mts} +4 -4
  132. package/dist/{plan-cGEaSXHv-2F5y-Dpy.d.mts.map → plan-cGEaSXHv-BeW-cC5v.d.mts.map} +1 -1
  133. package/dist/{prepared-statement-YtgdlN7e-DBJtJAm7.d.mts → prepared-statement-YtgdlN7e-CI1fD5IM.d.mts} +16 -16
  134. package/dist/{prepared-statement-YtgdlN7e-DBJtJAm7.d.mts.map → prepared-statement-YtgdlN7e-CI1fD5IM.d.mts.map} +1 -1
  135. package/dist/{psl-build-Di-cBOCv.mjs → psl-build-B5iMVWHu.mjs} +2 -2
  136. package/dist/{psl-build-Di-cBOCv.mjs.map → psl-build-B5iMVWHu.mjs.map} +1 -1
  137. package/dist/{psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts → psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts} +2 -2
  138. package/dist/{psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts.map → psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts.map} +1 -1
  139. package/dist/{psl-field-resolution-DUCrDnuq-DSxPrd-4.mjs → psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs} +6 -6
  140. package/dist/psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs.map +1 -0
  141. package/dist/{psl-infer-fU7LRjTx.mjs → psl-infer-B0yuv-j_.mjs} +22 -16
  142. package/dist/psl-infer-B0yuv-j_.mjs.map +1 -0
  143. package/dist/{psl-infer-Cm7eDSA-.d.mts → psl-infer-DkPZJnUM.d.mts} +11 -12
  144. package/dist/{psl-infer-Cm7eDSA-.d.mts.map → psl-infer-DkPZJnUM.d.mts.map} +1 -1
  145. package/dist/query-lane-context-BaoHpLsE.d.mts +1 -0
  146. package/dist/{query-lane-context-CJoNBspB-Ylhia3fC.d.mts → query-lane-context-CJoNBspB-CR_n8DNB.d.mts} +5 -5
  147. package/dist/{query-lane-context-CJoNBspB-Ylhia3fC.d.mts.map → query-lane-context-CJoNBspB-CR_n8DNB.d.mts.map} +1 -1
  148. package/dist/{referential-action-sql-DJ9ps6-S.d.mts → referential-action-sql-Cw1Q0YSd.d.mts} +2 -2
  149. package/dist/referential-action-sql-Cw1Q0YSd.d.mts.map +1 -0
  150. package/dist/relational-core.d.mts +11 -11
  151. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  152. package/dist/relational-core__ast.d.mts +3 -3
  153. package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
  154. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  155. package/dist/relational-core__contract-free.d.mts +4 -4
  156. package/dist/relational-core__expression.d.mts +1 -1
  157. package/dist/relational-core__middleware.d.mts +2 -2
  158. package/dist/relational-core__plan.d.mts +3 -3
  159. package/dist/relational-core__query-lane-context.d.mts +2 -2
  160. package/dist/relational-core__types.d.mts +2 -2
  161. package/dist/{resolve-storage-table-Ba33K41A.d.mts → resolve-storage-table-B7m9cFy4.d.mts} +3 -3
  162. package/dist/{resolve-storage-table-Ba33K41A.d.mts.map → resolve-storage-table-B7m9cFy4.d.mts.map} +1 -1
  163. package/dist/{runtime-BUemUdMk.d.mts → runtime-Ca7PVQcJ.d.mts} +2 -2
  164. package/dist/{runtime-BUemUdMk.d.mts.map → runtime-Ca7PVQcJ.d.mts.map} +1 -1
  165. package/dist/runtime.d.mts +4 -4
  166. package/dist/runtime.mjs +2 -2
  167. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  168. package/dist/{schema-differ-CqWOkoW9--uxNOini.d.mts → schema-differ-CqWOkoW9-BABSAGGB.d.mts} +3 -3
  169. package/dist/{schema-differ-CqWOkoW9--uxNOini.d.mts.map → schema-differ-CqWOkoW9-BABSAGGB.d.mts.map} +1 -1
  170. package/dist/{schema-verify-DIfHSB4I-CjYnmUuD.mjs → schema-verify-DIfHSB4I-Dx3Tq9hf.mjs} +2 -2
  171. package/dist/{schema-verify-DIfHSB4I-CjYnmUuD.mjs.map → schema-verify-DIfHSB4I-Dx3Tq9hf.mjs.map} +1 -1
  172. package/dist/{serialized-index-QAYy0fjm-zxvK3RBa.mjs → serialized-index-C26m_DWu-CnNi8WAI.mjs} +3 -3
  173. package/dist/{serialized-index-QAYy0fjm-zxvK3RBa.mjs.map → serialized-index-C26m_DWu-CnNi8WAI.mjs.map} +1 -1
  174. package/dist/{sql-contract-serializer-DDaAVCQr-CLDkZLXO.mjs → sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs} +4 -4
  175. package/dist/{sql-contract-serializer-DDaAVCQr-CLDkZLXO.mjs.map → sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs.map} +1 -1
  176. package/dist/{sql-execution-plan-C7XauPPu-BMi8hJlv.d.mts → sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts} +2 -2
  177. package/dist/{sql-execution-plan-C7XauPPu-BMi8hJlv.d.mts.map → sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts.map} +1 -1
  178. package/dist/{sql-storage-DSnnRQAf-DaHPnley.d.mts → sql-storage-BTlJLUID-O6fBB_am.d.mts} +3 -3
  179. package/dist/{sql-storage-DSnnRQAf-DaHPnley.d.mts.map → sql-storage-BTlJLUID-O6fBB_am.d.mts.map} +1 -1
  180. package/dist/{storage-table-CyL4CNMi-ByGZXmzd.mjs → storage-table-B7OSPl3G-EOodFPzq.mjs} +5 -3
  181. package/dist/storage-table-B7OSPl3G-EOodFPzq.mjs.map +1 -0
  182. package/dist/{storage-table-BBcKoAuF-CssyCQhM.d.mts → storage-table-WXeVNycx-tlFMnbig.d.mts} +3 -3
  183. package/dist/{storage-table-BBcKoAuF-CssyCQhM.d.mts.map → storage-table-WXeVNycx-tlFMnbig.d.mts.map} +1 -1
  184. package/dist/{types-BJQcLx-8-DSnaugR4.d.mts → types-BJQcLx-8-DY221fiX.d.mts} +10 -10
  185. package/dist/{types-BJQcLx-8-DSnaugR4.d.mts.map → types-BJQcLx-8-DY221fiX.d.mts.map} +1 -1
  186. package/dist/{types-DkOYK86-.d.mts → types-BURWzacK.d.mts} +5 -5
  187. package/dist/{types-DkOYK86-.d.mts.map → types-BURWzacK.d.mts.map} +1 -1
  188. package/dist/{types-DDHgx581.mjs → types-C7oOtFcJ.mjs} +2 -2
  189. package/dist/{types-DDHgx581.mjs.map → types-C7oOtFcJ.mjs.map} +1 -1
  190. package/dist/{types-CzxOObSY-CNWyrf87.d.mts → types-CzxOObSY-DEfjmbj1.d.mts} +7 -7
  191. package/dist/{types-CzxOObSY-CNWyrf87.d.mts.map → types-CzxOObSY-DEfjmbj1.d.mts.map} +1 -1
  192. package/dist/{types-DV040Uuq-Bu8CnbMa.d.mts → types-DFZhLz18-C_h0u-Zx.d.mts} +8 -7
  193. package/dist/types-DFZhLz18-C_h0u-Zx.d.mts.map +1 -0
  194. package/dist/types-DLjT0ADz.d.mts +1 -0
  195. package/dist/{types-Sh5HuaZE-C8I29pGQ.d.mts → types-Sh5HuaZE-B_FQUPng.d.mts} +2 -2
  196. package/dist/{types-Sh5HuaZE-C8I29pGQ.d.mts.map → types-Sh5HuaZE-B_FQUPng.d.mts.map} +1 -1
  197. package/dist/{validators-BAa0JKuB.d.mts → validators-Cr_FFJAG.d.mts} +5 -4
  198. package/dist/{validators-BAa0JKuB.d.mts.map → validators-Cr_FFJAG.d.mts.map} +1 -1
  199. package/dist/{validators-Xx-TKcx3.mjs → validators-oyDG5mVX.mjs} +22 -2
  200. package/dist/validators-oyDG5mVX.mjs.map +1 -0
  201. package/package.json +18 -18
  202. package/dist/contract-builder-BaJMQFAc.d.mts.map +0 -1
  203. package/dist/control-adapter-CD_gz6TI.d.mts +0 -1
  204. package/dist/entity-kinds-JlqzyFoo-kIaAUFyK.mjs.map +0 -1
  205. package/dist/factories-BsUyFxsk.mjs.map +0 -1
  206. package/dist/foreign-key-C-iTPuRT-C9ip8zFx.d.mts.map +0 -1
  207. package/dist/foreign-key-materialization-IGfTKmHV.mjs +0 -73
  208. package/dist/foreign-key-materialization-IGfTKmHV.mjs.map +0 -1
  209. package/dist/foreign-key-materialization-U4M9cqKd.d.mts +0 -65
  210. package/dist/foreign-key-materialization-U4M9cqKd.d.mts.map +0 -1
  211. package/dist/interpreter-BF5Xrf3W-bdklH78q.mjs.map +0 -1
  212. package/dist/middleware-BFoORv3y.d.mts +0 -1
  213. package/dist/plan-CmfWjqtI.d.mts +0 -2
  214. package/dist/psl-field-resolution-DUCrDnuq-DSxPrd-4.mjs.map +0 -1
  215. package/dist/psl-infer-fU7LRjTx.mjs.map +0 -1
  216. package/dist/query-lane-context-qK5s2okl.d.mts +0 -1
  217. package/dist/referential-action-sql-DJ9ps6-S.d.mts.map +0 -1
  218. package/dist/storage-table-CyL4CNMi-ByGZXmzd.mjs.map +0 -1
  219. package/dist/types-14L6c26e.d.mts +0 -1
  220. package/dist/types-DV040Uuq-Bu8CnbMa.d.mts.map +0 -1
  221. package/dist/validators-Xx-TKcx3.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"psl-field-resolution-DUCrDnuq-DSxPrd-4.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/psl-field-resolution-DUCrDnuq.mjs"],"sourcesContent":["import { bool, diagnosticSource, entityRef, fieldAttribute, fieldRef, funcCall, identifier, interpretAttribute, leafDiagnostic, list, modelAttribute, nodePslSpan, numLiteral, oneOf, optional, record, referencedFieldRef, str, taggedLiteral, typeReferenceNode } from \"@internal/psl-parser\";\nimport { isValueObjectMember, storedAsListColumn } from \"@internal/sql-contract-ts/contract-builder\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { admittedForms, castTypedValue, describeExpected, describeRefusal, describeRefusedValueType, exactRewrite, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, readWrittenValue, tagForm, validateAuthoringHelperArguments, validateAuthoringTypeParams } from \"@internal/framework-components/authoring\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { instantiatePslFieldPreset, isBareTypeConstructor, mapPslHelperArgs, reportPresetNotCalled, reportTypeConstructorNotCalled } from \"@internal/psl-parser/interpret\";\nimport { ArrayLiteralAst, FunctionCallAst, IdentifierAst } from \"@internal/psl-parser/syntax\";\nimport { SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, sqlTextFromCanonical } from \"@internal/sql-contract/sql-expression\";\nimport { checkSqlDefaultText, reservedSqlDefaultText } from \"@internal/sql-contract/validators\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { canonicalFormOf, codecForRef } from \"@internal/framework-components/codec\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/psl-attribute-parsing.ts\nfunction storageName(symbol, physicalNames) {\n\tconst name = physicalNames.get(symbol);\n\tassertDefined(name, \"Physical names are populated for every model and field before lowering\");\n\treturn name;\n}\nfunction getAttribute(attributes, name) {\n\treturn attributes?.find((attribute) => attribute.name === name);\n}\nfunction formatDbAttributeMigrationMessage(attribute) {\n\tconst renderedArguments = attribute.args.map((argument) => argument.kind === \"named\" && argument.name !== void 0 ? `${argument.name}: ${argument.value}` : argument.value).join(\", \");\n\tconst argumentList = attribute.args.length === 0 ? \"\" : `(${renderedArguments})`;\n\tconst constructorName = attribute.name.slice(3);\n\treturn `@${attribute.name}${argumentList} is no longer supported; use ${constructorName}${argumentList} in type position`;\n}\nfunction getNamedArgument(attribute, name) {\n\tconst entry = attribute.args.find((arg) => arg.kind === \"named\" && arg.name === name);\n\tif (entry?.kind !== \"named\") return;\n\treturn entry.value;\n}\nfunction mapFieldNamesToColumns(input) {\n\tconst columns = [];\n\tfor (const fieldName of input.fieldNames) {\n\t\tconst field = input.model.fields[fieldName];\n\t\tif (field === void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${input.entityLabel} references unknown field \"${input.model.name}.${fieldName}\"`,\n\t\t\t\t...input.source.at(input.span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcolumns.push(storageName(field, input.physicalNames));\n\t}\n\treturn columns;\n}\n//#endregion\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/data-type-default.ts\n/** A written value the column's codec refuses. */\nconst PSL_INVALID_DEFAULT_LITERAL = \"PSL_INVALID_DEFAULT_LITERAL\";\n/** A written value whose data type the receiving type neither is nor casts from. */\nconst PSL_VALUE_TYPE_INCOMPATIBLE = \"PSL_VALUE_TYPE_INCOMPATIBLE\";\n/** A single value written as the default of a column that holds a list. */\nconst PSL_DEFAULT_LIST_EXPECTED = \"PSL_DEFAULT_LIST_EXPECTED\";\nfunction messageOf(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\nfunction refused(refusal, suggestedTypes) {\n\treturn {\n\t\tok: false,\n\t\trefusal,\n\t\tsuggestedTypes\n\t};\n}\nfunction readOneValue(dataTypes, written, elementIndex, suggestedTypes) {\n\tconst read = readWrittenValue(dataTypes, written);\n\treturn read.ok ? {\n\t\tok: true,\n\t\ttyped: read.value\n\t} : refused({\n\t\t...read.failure,\n\t\telementIndex\n\t}, suggestedTypes);\n}\n/** The column's `typeParams` as the codec reference carries them, so `vector(3)` checks its length. */\nfunction codecRefTypeParams(typeParams) {\n\treturn typeParams === void 0 ? void 0 : blindCast(typeParams);\n}\n/** A value in the canonical form of the column's values, when they have one. */\nfunction inCanonicalForm(toCanonicalForm, value, elementIndex, suggestedTypes) {\n\tif (toCanonicalForm === void 0) return {\n\t\tok: true,\n\t\tvalue\n\t};\n\ttry {\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalue: toCanonicalForm(value)\n\t\t};\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn {\n\t\t\tok: false,\n\t\t\trefusal: {\n\t\t\t\tkind: \"unreadable\",\n\t\t\t\tmessage: messageOf(error),\n\t\t\t\telementIndex\n\t\t\t},\n\t\t\tsuggestedTypes\n\t\t};\n\t}\n}\n/**\n* The column's codec descriptor, and `read`, which reads a value in its stored JSON form with the column's codec, built with the column's type parameters, and gives it the canonical form of the column's values.\n*/\nfunction storedValueReader(input) {\n\tconst descriptor = input.codecLookup.descriptorFor(input.column.codecId);\n\tconst codec = codecForRef(input.codecLookup, {\n\t\tcodecId: input.column.codecId,\n\t\t...ifDefined(\"typeParams\", codecRefTypeParams(input.column.typeParams))\n\t});\n\tif (codec === void 0 || descriptor === void 0) throw new InternalError(`Field \"${input.fieldPath}\": no codec descriptor is registered for \"${input.column.codecId}\", but the column was resolved from one.`);\n\tconst suggestedTypes = [descriptor.dataType];\n\tconst toCanonicalForm = canonicalFormOf(descriptor, input.dataTypeLookup);\n\tconst read = (written, elementIndex) => {\n\t\ttry {\n\t\t\tcodec.decodeJson(written);\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\trefusal: {\n\t\t\t\t\tkind: \"refused-by-codec\",\n\t\t\t\t\tcodecId: input.column.codecId,\n\t\t\t\t\tmessage: messageOf(error),\n\t\t\t\t\telementIndex\n\t\t\t\t},\n\t\t\t\tsuggestedTypes\n\t\t\t};\n\t\t}\n\t\treturn inCanonicalForm(toCanonicalForm, written, elementIndex, suggestedTypes);\n\t};\n\treturn {\n\t\tdescriptor,\n\t\tread\n\t};\n}\n/**\n* Reads a value already in its stored JSON form, such as one member of a JSON document default, with the column's codec, and gives it the canonical form of the column's values. Worded as {@link lowerDataTypeDefault} words the same refusals.\n*/\nfunction readStoredValue(input) {\n\tconst reading = storedValueReader(input).read(input.value, void 0);\n\treturn reading.ok ? reading : storedRefusalDiagnostic(reading.refusal, `Field \"${input.fieldPath}\"`);\n}\n/**\n* Read one `@default(...)` value for a column, refusing in parts so each contract source words its\n* own diagnostic. `isList` selects the check: a list column's elements are each read and cast\n* against the element codec's data type, while a scalar column takes a written list only through\n* its type's list cast — which is how `pgvector.Vector(3) @default([0.1, 0.2])` is read.\n*/\nfunction readDataTypeDefault(input) {\n\tconst { descriptor, read: readStored } = storedValueReader({\n\t\t...input,\n\t\tdataTypeLookup: input.dataTypes.lookup\n\t});\n\tconst columnType = descriptor.dataType;\n\tconst suggestedTypes = [columnType];\n\tconst readOne = (written, elementIndex) => {\n\t\tconst read = readOneValue(input.dataTypes, written, elementIndex, suggestedTypes);\n\t\tif (!read.ok) return read;\n\t\tconst cast = castTypedValue(input.dataTypes, columnType, read.typed);\n\t\tif (!cast.ok) return refused({\n\t\t\t...cast.failure,\n\t\t\telementIndex\n\t\t}, suggestedTypes);\n\t\treturn readStored(cast.value.value, elementIndex);\n\t};\n\tif (input.written.kind !== \"list\") {\n\t\tif (input.isList) return refused({\n\t\t\tkind: \"not-a-list\",\n\t\t\telementIndex: void 0\n\t\t}, suggestedTypes);\n\t\treturn readOne(input.written, void 0);\n\t}\n\tif (input.isList) {\n\t\tconst elements = [];\n\t\tfor (const [elementIndex, written] of input.written.elements.entries()) {\n\t\t\tif (written.kind === \"list\") return nestedList(elementIndex, suggestedTypes);\n\t\t\tconst element = readOne(written, elementIndex);\n\t\t\tif (!element.ok) return element;\n\t\t\telements.push(element.value);\n\t\t}\n\t\treturn {\n\t\t\tok: true,\n\t\t\tvalue: elements\n\t\t};\n\t}\n\treturn readListIntoScalar({\n\t\t...input,\n\t\twritten: input.written,\n\t\tcolumnType,\n\t\treadStored\n\t});\n}\nfunction nestedList(elementIndex, suggestedTypes) {\n\treturn refused({\n\t\tkind: \"unreadable\",\n\t\tmessage: \"a list holds values, not other lists\",\n\t\telementIndex\n\t}, suggestedTypes);\n}\n/** A written list on a column that is not a list: the column's type takes it through its list cast. */\nfunction readListIntoScalar(input) {\n\tconst declaration = input.dataTypes.lookup.get(input.columnType);\n\tconst listCast = declaration?.listCast;\n\tif (listCast === void 0) return refused({\n\t\tkind: \"no-list-cast\",\n\t\treceivingType: input.columnType,\n\t\tcasts: Object.keys(declaration?.casts ?? {}),\n\t\telementIndex: void 0\n\t}, [input.columnType]);\n\tconst elements = [];\n\tfor (const [elementIndex, written] of input.written.elements.entries()) {\n\t\tif (written.kind === \"list\") return nestedList(elementIndex, listCast.of);\n\t\tconst read = readOneValue(input.dataTypes, written, elementIndex, listCast.of);\n\t\tif (!read.ok) return read;\n\t\tif (!listCast.of.includes(read.typed.type)) return refused({\n\t\t\tkind: \"no-element-cast\",\n\t\t\treceivingType: input.columnType,\n\t\t\tvalueType: read.typed.type,\n\t\t\telementTypes: listCast.of,\n\t\t\telementIndex\n\t\t}, listCast.of);\n\t\telements.push(read.typed.value);\n\t}\n\ttry {\n\t\treturn input.readStored(listCast.cast(elements), void 0);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn refused({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error),\n\t\t\telementIndex: void 0\n\t\t}, [input.columnType]);\n\t}\n}\n/** Where a diagnostic is about, for a message: `Field \"N.count\" at element 2`. */\nfunction location(subject, elementIndex) {\n\treturn elementIndex === void 0 ? subject : `${subject} at element ${elementIndex + 1}`;\n}\n/**\n* What may be written where every one of `types` is received, each form once: `a number`. A column\n* whose type nothing writes still takes a `sql` literal, which `@default` stores as a SQL expression.\n*/\nfunction formsOf(dataTypes, types) {\n\tconst forms = admittedForms(dataTypes, types);\n\treturn forms.length === 0 ? [tagForm(SQL_EXPRESSION_TAG)] : forms;\n}\n/** The exact rewrite of the written value a `no-cast` refusal is about, before list elements are renumbered to the source list. */\nfunction rewriteOf(refusal, written, dataTypes) {\n\tif (refusal.kind !== \"no-cast\") return void 0;\n\tconst refused = refusal.elementIndex === void 0 || written.kind !== \"list\" ? written : written.elements[refusal.elementIndex];\n\treturn refused === void 0 || refused.kind === \"list\" ? void 0 : exactRewrite(dataTypes, refusal.receivingType, refused);\n}\n/** {@link readDataTypeDefault} worded as a PSL diagnostic's code and message. */\nfunction lowerDataTypeDefault(input) {\n\tconst read = readDataTypeDefault(input);\n\treturn read.ok ? read : refusalDiagnostic(atSourceElement(read.refusal, input.sourceElementIndexes), `Field \"${input.fieldPath}\"`, input.dataTypes, guidanceFor(read, input.written, input.dataTypes));\n}\n/**\n* Reads one number literal written in a contract source outside a default, such as an enum member's value, from its source text for a codec, as {@link lowerDataTypeDefault} reads a default: the number's entry gives it a data type, the codec's data type takes it directly or through a cast, and the codec checks it. A refusal is worded for `subject`.\n*/\nfunction readWrittenNumberForCodec(input) {\n\tconst written = {\n\t\tkind: \"number\",\n\t\ttext: input.text\n\t};\n\tconst read = readDataTypeDefault({\n\t\twritten,\n\t\tisList: false,\n\t\tcolumn: { codecId: input.codecId },\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypes: input.dataTypes,\n\t\tfieldPath: input.subject\n\t});\n\treturn read.ok ? read : refusalDiagnostic(read.refusal, input.subject, input.dataTypes, guidanceFor(read, written, input.dataTypes));\n}\n/** What a refusal of `written` tells the author to write instead. */\nfunction guidanceFor(failure, written, dataTypes) {\n\treturn {\n\t\tforms: formsOf(dataTypes, failure.suggestedTypes),\n\t\trewrite: rewriteOf(failure.refusal, written, dataTypes)\n\t};\n}\nfunction atSourceElement(refusal, sourceElementIndexes) {\n\tif (refusal.elementIndex === void 0) return refusal;\n\tconst elementIndex = sourceElementIndexes?.[refusal.elementIndex];\n\treturn elementIndex === void 0 ? refusal : {\n\t\t...refusal,\n\t\telementIndex\n\t};\n}\nfunction codecRefusalDiagnostic(refusal, subject) {\n\treturn {\n\t\tok: false,\n\t\tcode: PSL_INVALID_DEFAULT_LITERAL,\n\t\tmessage: `${location(subject, refusal.elementIndex)}: ${refusal.message}`,\n\t\tplace: { kind: \"attribute\" }\n\t};\n}\nfunction storedRefusalDiagnostic(refusal, subject) {\n\tif (refusal.kind === \"refused-by-codec\") return codecRefusalDiagnostic(refusal, subject);\n\treturn {\n\t\tok: false,\n\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\tmessage: `${location(subject, refusal.elementIndex)}: ${refusal.message}`,\n\t\tplace: { kind: \"attribute\" }\n\t};\n}\n/** A refusal worded as a PSL diagnostic's code, message and place; `guidance` says what to write instead. */\nfunction refusalDiagnostic(refusal, subject, dataTypes, guidance) {\n\tconst where = location(subject, refusal.elementIndex);\n\tconst atWrittenValue = {\n\t\tkind: \"written-value\",\n\t\telementIndex: refusal.elementIndex\n\t};\n\tswitch (refusal.kind) {\n\t\tcase \"not-a-list\": return {\n\t\t\tok: false,\n\t\t\tcode: PSL_DEFAULT_LIST_EXPECTED,\n\t\t\tmessage: `${where}: this column holds a list, so its default is a list literal, as in [1, 2]`,\n\t\t\tplace: { kind: \"attribute\" }\n\t\t};\n\t\tcase \"refused-by-codec\": return codecRefusalDiagnostic(refusal, subject);\n\t\tcase \"no-list-cast\": return {\n\t\t\tok: false,\n\t\t\tcode: PSL_VALUE_TYPE_INCOMPATIBLE,\n\t\t\tmessage: `${where}: ${describeExpected(guidance.forms)}; got a list`,\n\t\t\tplace: atWrittenValue\n\t\t};\n\t\tcase \"no-element-cast\": return {\n\t\t\tok: false,\n\t\t\tcode: PSL_VALUE_TYPE_INCOMPATIBLE,\n\t\t\tmessage: `${where}: ${describeRefusedValueType(refusal, dataTypes, guidance)}`,\n\t\t\tplace: atWrittenValue\n\t\t};\n\t\tdefault: {\n\t\t\tconst { code, message } = describeRefusal(refusal, dataTypes, guidance);\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tcode,\n\t\t\t\tmessage: `${where}: ${message}`,\n\t\t\t\tplace: atWrittenValue\n\t\t\t};\n\t\t}\n\t}\n}\n//#endregion\n//#region src/default-function-registry.ts\nfunction formatSupportedFunctionList(registry) {\n\tconst signatures = Array.from(registry.entries()).sort(([a], [b]) => a.localeCompare(b)).flatMap(([functionName, entry]) => {\n\t\tconst usageSignatures = entry.usageSignatures?.filter((signature) => signature.length > 0);\n\t\treturn usageSignatures && usageSignatures.length > 0 ? usageSignatures : [`${functionName}()`];\n\t});\n\treturn signatures.length > 0 ? signatures.join(\", \") : \"none\";\n}\n/** The diagnostic message for a `dbgenerated(...)` call, which raw SQL tagged literals replaced. */\nfunction removedDbgeneratedMessage(registry) {\n\treturn `Default function \"dbgenerated\" was removed. Write the SQL as a tagged literal: @default(sql\\`<expression>\\`). Supported functions: ${formatSupportedFunctionList(registry)}.`;\n}\nfunction lowerDefaultFunctionWithRegistry(input) {\n\tconst entry = input.registry.get(input.call.fn);\n\tif (entry) {\n\t\tconst result = entry.lower({\n\t\t\tcall: input.call,\n\t\t\tcontext: input.context\n\t\t});\n\t\treturn result.ok ? result : {\n\t\t\t...result,\n\t\t\tkind: \"external\"\n\t\t};\n\t}\n\tconst supportedFunctionList = formatSupportedFunctionList(input.registry);\n\treturn {\n\t\tok: false,\n\t\tkind: \"owned\",\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_UNKNOWN_DEFAULT_FUNCTION\",\n\t\t\tmessage: `Default function \"${input.call.fn}\" is not supported in SQL PSL provider v1. Supported functions: ${supportedFunctionList}.`,\n\t\t\t...input.source.at(input.call.span)\n\t\t}\n\t};\n}\n//#endregion\n//#region src/sql-attribute-specs.ts\nfunction buildModelAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction buildFieldAttributeCtx(input) {\n\treturn {\n\t\tsources: input.sources,\n\t\tselfModel: input.selfModel,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tsymbols: input.symbols\n\t};\n}\nfunction modelAttributeSpecsFrom(modelAttributesByName) {\n\tconst result = Object.create(null);\n\tfor (const [name, descriptor] of modelAttributesByName) result[name] = blindCast(descriptor.spec);\n\treturn result;\n}\nfunction interpretModelAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildModelAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction interpretFieldAttribute(input) {\n\tconst result = interpretAttribute(input.node, input.spec, buildFieldAttributeCtx({\n\t\tsymbols: input.symbols,\n\t\tselfModel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder\n\t}));\n\tif (!result.ok) {\n\t\tinput.diagnostics.push(...result.failure);\n\t\treturn;\n\t}\n\treturn result.value;\n}\nfunction validateMappedName(value, ctx, attributeNode) {\n\treturn value.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"Mapped name must not be empty\")] : [];\n}\nconst mapModelSpec = modelAttribute(\"map\", {\n\tdocumentation: \"Maps this model to a database table name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty database table name.\"\n\t}],\n\trefine: validateMappedName\n});\nconst mapFieldSpec = fieldAttribute(\"map\", {\n\tdocumentation: \"Maps this field to a database column name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty database column name.\"\n\t}],\n\trefine: validateMappedName\n});\nfunction nullLiteral() {\n\tconst nullIdentifier = identifier(\"null\", { documentation: \"A null list element or nullable scalar default.\" });\n\treturn {\n\t\tkind: \"null\",\n\t\tlabel: \"null\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst result = nullIdentifier.parse(arg, ctx);\n\t\t\treturn result.ok ? ok(null) : result;\n\t\t}\n\t};\n}\nfunction scalarDefaultArms(isList, dataTypes, registries) {\n\tconst tagArms = (admits) => {\n\t\tconst tagsByDocumentation = /* @__PURE__ */ new Map();\n\t\tfor (const [dataType, entry] of Object.entries(dataTypes.entries)) {\n\t\t\tif (entry.written.kind !== \"tag\" || !admits(dataType)) continue;\n\t\t\tconst tags = tagsByDocumentation.get(entry.documentation);\n\t\t\tif (tags === void 0) tagsByDocumentation.set(entry.documentation, [entry.written.tag]);\n\t\t\telse tags.push(entry.written.tag);\n\t\t}\n\t\treturn [...tagsByDocumentation].map(([documentation, tags]) => taggedLiteral(tags, { documentation }));\n\t};\n\tconst anyTag = () => tagArms(() => true);\n\tconst literal = () => oneOf(str(), numLiteral(), bool(), nullLiteral(), ...tagArms((dataType) => dataType !== SQL_EXPRESSION_DATA_TYPE_ID));\n\tconst listArm = () => list(literal(), { label: `list of (${literal().label})` });\n\tconst funcArms = [...registries.defaultFunctionRegistry.entries()].map(([name, entry]) => funcCall(name, blindCast(entry.signature)));\n\treturn isList ? [\n\t\tlistArm(),\n\t\t...funcArms,\n\t\t...anyTag()\n\t] : [\n\t\tstr(),\n\t\tnumLiteral(),\n\t\tbool(),\n\t\tnullLiteral(),\n\t\t...funcArms,\n\t\t...anyTag(),\n\t\tlistArm()\n\t];\n}\n/**\n* The `@default` value arms, with a `dbgenerated(...)` call reported as removed before the arms\n* are tried, so the author is told what replaced it instead of being shown the list of arms.\n*/\nfunction defaultValueArm(arms, registry) {\n\tconst value = arms.length === 1 && arms[0].kind === \"list\" ? arms[0] : oneOf(...arms);\n\treturn {\n\t\t...value,\n\t\tparse: (arg, ctx) => FunctionCallAst.cast(arg.syntax)?.path().join(\".\") === \"dbgenerated\" ? notOk([leafDiagnostic(ctx, arg, removedDbgeneratedMessage(registry), \"PSL_UNKNOWN_DEFAULT_FUNCTION\")]) : value.parse(arg, ctx)\n\t};\n}\nfunction noEnumMember() {\n\treturn {\n\t\tkind: \"rejecting\",\n\t\tlabel: \"enum member\",\n\t\tmessage: \"Enum declares no members\",\n\t\tparse: (arg, ctx) => notOk([leafDiagnostic(ctx, arg, \"Enum declares no members\")])\n\t};\n}\nfunction enumMemberNames(ctx) {\n\tconst resolution = ctx.typeResolution;\n\tif (resolution?.kind !== \"block\" || resolution.symbol.keyword !== \"enum\") return void 0;\n\tconst block = resolution.symbol;\n\tconst names = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0 || seen.has(key)) continue;\n\t\tseen.add(key);\n\t\tnames.push(key);\n\t}\n\treturn names;\n}\nfunction enumDefaultArms(members, enumName, isList) {\n\tconst [first, ...rest] = members;\n\tif (first === void 0) return [noEnumMember()];\n\tconst member = (name) => identifier(name, { documentation: `The \\`${name}\\` member of enum \\`${enumName}\\`.` });\n\tif (isList) return [list(oneOf(member(first), ...rest.map(member), nullLiteral()))];\n\treturn [member(first), ...rest.map(member)];\n}\nfunction defaultFieldSpec(ctx) {\n\tconst members = enumMemberNames(ctx);\n\treturn fieldAttribute(\"default\", {\n\t\tdocumentation: \"Supplies a default value when this field is omitted from a mutation.\",\n\t\tpositional: [{\n\t\t\tkey: \"value\",\n\t\t\ttype: defaultValueArm(members === void 0 ? scalarDefaultArms(ctx.field.list, ctx.dataTypes, ctx.controlMutationDefaults) : enumDefaultArms(members, ctx.field.typeName, ctx.field.list), ctx.controlMutationDefaults.defaultFunctionRegistry),\n\t\t\tdocumentation: \"A literal, enum member, or registered default function compatible with this field.\"\n\t\t}]\n\t});\n}\nconst idFieldSpec = fieldAttribute(\"id\", {\n\tdocumentation: \"Makes this field the primary key of the table.\",\n\tnamed: { map: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The database primary-key constraint name.\"\n\t} }\n});\nconst uniqueFieldSpec = fieldAttribute(\"unique\", {\n\tdocumentation: \"Requires values in this field to be unique.\",\n\tnamed: { map: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The database unique-constraint name.\"\n\t} }\n});\nconst noCheckKindArgument = () => oneOf(identifier(\"membership\", { documentation: \"Waives the generated check that values belong to the declared domain enum.\" }), identifier(\"elementNotNull\", { documentation: \"Waives the generated check that scalar-list elements are non-null.\" }));\n/**\n* `@noCheck` waives generated CHECK constraints on one column: bare for every\n* kind the column's shape derives, or naming concrete kinds. Two optional\n* positional slots cover the whole kind vocabulary; a third argument is\n* necessarily a duplicate and fails as excess arity.\n*/\nconst noCheckFieldSpec = fieldAttribute(\"noCheck\", {\n\tdocumentation: \"Waives generated CHECK constraints for this column. With no arguments, waives every generated kind.\",\n\tpositional: [{\n\t\tkey: \"first\",\n\t\ttype: optional(noCheckKindArgument()),\n\t\tdocumentation: \"The first generated check kind to waive: `membership` or `elementNotNull`.\"\n\t}, {\n\t\tkey: \"second\",\n\t\ttype: optional(noCheckKindArgument()),\n\t\tdocumentation: \"A second, distinct generated check kind to waive.\"\n\t}],\n\trefine: (value, ctx, attributeNode) => {\n\t\tif (value.first !== void 0 && value.first === value.second) return [leafDiagnostic(ctx, attributeNode, \"`@noCheck` names the same kind twice\")];\n\t\treturn [];\n\t}\n});\nconst idModelSpec = modelAttribute(\"id\", {\n\tdocumentation: \"Declares a compound primary key for this table.\",\n\tpositional: [{\n\t\tkey: \"fields\",\n\t\ttype: list(fieldRef(), {\n\t\t\tallowEmpty: false,\n\t\t\tunique: true\n\t\t}),\n\t\tdocumentation: \"The ordered, nonempty list of distinct primary-key fields.\"\n\t}],\n\tnamed: { map: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The database primary-key constraint name.\"\n\t} }\n});\nconst uniqueModelSpec = modelAttribute(\"unique\", {\n\tdocumentation: \"Requires the combination of these fields to be unique.\",\n\tpositional: [{\n\t\tkey: \"fields\",\n\t\ttype: list(fieldRef(), {\n\t\t\tallowEmpty: false,\n\t\t\tunique: true\n\t\t}),\n\t\tdocumentation: \"The ordered, nonempty list of distinct fields in the unique constraint.\"\n\t}],\n\tnamed: { map: {\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The database unique-constraint name.\"\n\t} }\n});\nconst PSL_INDEX_FIELDS_XOR_EXPRESSION = \"PSL_INDEX_FIELDS_XOR_EXPRESSION\";\nconst PSL_INDEX_EXPRESSION_REQUIRES_NAME = \"PSL_INDEX_EXPRESSION_REQUIRES_NAME\";\nconst PSL_INDEX_NAME_XOR_MAP = \"PSL_INDEX_NAME_XOR_MAP\";\nconst indexModelSpec = modelAttribute(\"index\", {\n\tdocumentation: \"Declares a database index over fields or a SQL expression, optionally restricted by a predicate.\",\n\tpositional: [{\n\t\tkey: \"fields\",\n\t\ttype: optional(list(fieldRef(), {\n\t\t\tallowEmpty: false,\n\t\t\tunique: true\n\t\t})),\n\t\tdocumentation: \"The ordered list of distinct indexed fields. Mutually exclusive with `expression`.\"\n\t}],\n\tnamed: {\n\t\texpression: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The SQL index expression. Requires `name` or `map` and cannot be combined with a fields list.\"\n\t\t},\n\t\twhere: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t},\n\t\tunique: {\n\t\t\ttype: optional(bool()),\n\t\t\tdocumentation: \"Whether the index enforces uniqueness.\"\n\t\t},\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t},\n\t\tmap: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t},\n\t\ttype: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The target-specific index access method.\"\n\t\t},\n\t\toptions: {\n\t\t\ttype: optional(record(str())),\n\t\t\tdocumentation: \"Target-specific index options. Requires an explicit `type`.\"\n\t\t}\n\t},\n\trefine: (value, ctx, attributeNode) => {\n\t\tconst diagnostics = [];\n\t\tif (value.fields === void 0 === (value.expression === void 0)) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@index` requires exactly one of a fields list or an `expression` argument\", PSL_INDEX_FIELDS_XOR_EXPRESSION));\n\t\tif (value.expression !== void 0 && value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@index` with an `expression` argument requires a `name` or `map` argument (a default name cannot be derived from an expression)\", PSL_INDEX_EXPRESSION_REQUIRES_NAME));\n\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@index` takes at most one of `name` and `map`\", PSL_INDEX_NAME_XOR_MAP));\n\t\tif (value.options !== void 0 && value.type === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@index` options argument requires a type argument\"));\n\t\treturn diagnostics;\n\t}\n});\nconst PSL_CHECK_REQUIRES_NAME_OR_MAP = \"PSL_CHECK_REQUIRES_NAME_OR_MAP\";\nconst PSL_CHECK_NAME_XOR_MAP = \"PSL_CHECK_NAME_XOR_MAP\";\nconst PSL_CHECK_EXPRESSION_EMPTY = \"PSL_CHECK_EXPRESSION_EMPTY\";\n/**\n* A single-table-inheritance variant (`@@base` with no own `@@map`) shares\n* its base model's storage table and has no table of its own to declare a\n* check on — raised from {@link interpretPslDocumentToSqlContract}, not from\n* this spec's own `refine`, because the rule needs the model's `@@base`\n* declaration, which a single attribute's `refine` cannot see.\n*/\nconst PSL_CHECK_ON_STI_VARIANT = \"PSL_CHECK_ON_STI_VARIANT\";\nconst checkModelSpec = modelAttribute(\"check\", {\n\tdocumentation: \"Declares a named database CHECK constraint on this table.\",\n\tnamed: {\n\t\texpression: {\n\t\t\ttype: str(),\n\t\t\tdocumentation: \"The nonempty SQL predicate checked for each row.\"\n\t\t},\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The constraint name. Exactly one of `name` and `map` is required.\"\n\t\t},\n\t\tmap: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The database constraint name. Exactly one of `name` and `map` is required.\"\n\t\t}\n\t},\n\trefine: (value, ctx, attributeNode) => {\n\t\tconst diagnostics = [];\n\t\tif (value.expression.trim().length === 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@check` expression must not be empty — an empty predicate is not a constraint\", PSL_CHECK_EXPRESSION_EMPTY));\n\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@check` requires a `name` or `map` argument (a default name cannot be derived — a check has no column tuple to name itself after)\", PSL_CHECK_REQUIRES_NAME_OR_MAP));\n\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@check` takes at most one of `name` and `map`\", PSL_CHECK_NAME_XOR_MAP));\n\t\treturn diagnostics;\n\t}\n});\nconst controlModelSpec = modelAttribute(\"control\", {\n\tdocumentation: \"Sets how schema management treats this model’s storage.\",\n\tpositional: [{\n\t\tkey: \"policy\",\n\t\tdocumentation: \"The storage control policy: `managed`, `tolerated`, `external`, or `observed`.\",\n\t\ttype: oneOf(identifier(\"managed\", { documentation: \"Verifies the declared shape strictly and allows migrations to create, alter, or drop the storage object.\" }), identifier(\"tolerated\", { documentation: \"Verifies declared columns while allowing extra columns. Migrations may create missing storage, but never alter or drop existing storage.\" }), identifier(\"external\", { documentation: \"Verifies declared storage without creating, altering, or dropping it.\" }), identifier(\"observed\", { documentation: \"Reports storage differences as warnings rather than verification failures and never emits migration operations.\" }))\n\t}]\n});\nconst discriminatorModelSpec = modelAttribute(\"discriminator\", {\n\tdocumentation: \"Selects the field that identifies inheritance variants of this model.\",\n\tpositional: [{\n\t\tkey: \"field\",\n\t\ttype: fieldRef(),\n\t\tdocumentation: \"The discriminator field on this model.\"\n\t}]\n});\nfunction baseModelSpec() {\n\treturn modelAttribute(\"base\", {\n\t\tdocumentation: \"Declares this model as a variant of a base model.\",\n\t\tpositional: [{\n\t\t\tkey: \"base\",\n\t\t\ttype: entityRef({ kind: \"model\" }),\n\t\t\tdocumentation: \"The base model to inherit from.\"\n\t\t}, {\n\t\t\tkey: \"value\",\n\t\t\ttype: str(),\n\t\t\tdocumentation: \"The discriminator value identifying this variant.\"\n\t\t}]\n\t});\n}\nfunction relationAttributeSpan(ctx) {\n\tconst node = getAttribute(ctx.field.attributes, \"relation\")?.node;\n\tif (node !== void 0) return nodePslSpan(node.syntax, ctx.sources);\n\treturn ctx.field.span;\n}\nfunction relationInvariants(parsed, ctx) {\n\tif (parsed.fields !== void 0 !== (parsed.references !== void 0)) return [{\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `Relation field \"${ctx.selfModel.name}.${ctx.field.name}\" requires fields and references arguments`,\n\t\t...diagnosticSource(ctx.sources, ctx.field.node.syntax).at(relationAttributeSpan(ctx))\n\t}];\n\treturn [];\n}\nconst referentialActionArgument = () => oneOf(identifier(\"NoAction\", { documentation: \"Rejects a change that would violate the foreign key when the constraint is checked; checking may be deferred when supported and configured.\" }), identifier(\"Restrict\", { documentation: \"Rejects deleting or updating a referenced row while referencing rows remain, without deferring the check.\" }), identifier(\"Cascade\", { documentation: \"Propagates deletion or key updates of a referenced row to its referencing rows.\" }), identifier(\"SetNull\", { documentation: \"Sets referencing foreign-key fields to null when the referenced row is deleted or its key changes. The fields must allow null.\" }), identifier(\"SetDefault\", { documentation: \"Sets referencing foreign-key fields to their defaults when the referenced row is deleted or its key changes. The resulting values must satisfy the foreign key.\" }));\nconst relationFieldSpec = fieldAttribute(\"relation\", {\n\tdocumentation: \"Defines the relation name, foreign-key fields, and referential actions for this relation.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: optional(str()),\n\t\tdocumentation: \"The relation name used to pair both sides. May also be supplied by name.\"\n\t}],\n\tnamed: {\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The relation name used to pair both sides. Cannot also be supplied positionally.\"\n\t\t},\n\t\tfields: {\n\t\t\ttype: optional(list(fieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The ordered local foreign-key fields. Must be supplied together with `references`.\"\n\t\t},\n\t\treferences: {\n\t\t\ttype: optional(list(referencedFieldRef(), {\n\t\t\t\tallowEmpty: false,\n\t\t\t\tunique: true\n\t\t\t})),\n\t\t\tdocumentation: \"The corresponding fields on the referenced model. Must be supplied together with `fields`.\"\n\t\t},\n\t\tmap: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The database foreign-key constraint name.\"\n\t\t},\n\t\tonDelete: {\n\t\t\ttype: optional(referentialActionArgument()),\n\t\t\tdocumentation: \"The referential action when a referenced row is deleted.\"\n\t\t},\n\t\tonUpdate: {\n\t\t\ttype: optional(referentialActionArgument()),\n\t\t\tdocumentation: \"The referential action when a referenced key is updated.\"\n\t\t},\n\t\tindex: {\n\t\t\ttype: optional(bool()),\n\t\t\tdocumentation: \"Whether to create an index for the relation’s foreign-key fields.\"\n\t\t}\n\t},\n\trefine: relationInvariants\n});\nfunction fieldSpecContext(input) {\n\tconst node = typeReferenceNode(input.field);\n\treturn {\n\t\tsymbols: input.symbols,\n\t\tmodel: input.model,\n\t\tfield: input.field,\n\t\ttypeResolution: node === void 0 ? void 0 : input.binder.symbolForNode(node),\n\t\tcontrolMutationDefaults: input.controlMutationDefaults,\n\t\tdataTypes: input.dataTypes\n\t};\n}\nconst sqlAttributeSpecs = {\n\tmodel: {\n\t\tmap: () => mapModelSpec,\n\t\tid: () => idModelSpec,\n\t\tunique: () => uniqueModelSpec,\n\t\tindex: () => indexModelSpec,\n\t\tcheck: () => checkModelSpec,\n\t\tcontrol: () => controlModelSpec,\n\t\tdiscriminator: () => discriminatorModelSpec,\n\t\tbase: baseModelSpec\n\t},\n\tfield: {\n\t\tmap: () => mapFieldSpec,\n\t\tid: () => idFieldSpec,\n\t\tunique: () => uniqueFieldSpec,\n\t\tnoCheck: () => noCheckFieldSpec,\n\t\trelation: () => relationFieldSpec,\n\t\tdefault: defaultFieldSpec\n\t}\n};\n//#endregion\n//#region src/value-object-default.ts\n/**\n* The value-object column's default as the document it holds, and in the form the column stores. A\n* column may store the document's JSON text, as `sqlite/json@1` does, so its codec reads the stored\n* value into the document the composite type describes. A list literal on a list of value objects\n* is read element by element; the column stores the list's document in its own form.\n*/\nfunction valueObjectDefaultDocument(input) {\n\tconst codec = codecForRef(input.codecLookup, { codecId: input.codecId });\n\tif (codec === void 0) return {\n\t\tdocument: input.stored,\n\t\tstored: input.stored\n\t};\n\tif (input.elementwise && Array.isArray(input.stored)) {\n\t\tconst document = input.stored.map((element) => readDocument(codec, element));\n\t\treturn {\n\t\t\tdocument,\n\t\t\tstored: codec.encodeJson(document)\n\t\t};\n\t}\n\treturn {\n\t\tdocument: readDocument(codec, input.stored),\n\t\tstored: input.stored\n\t};\n}\n/** The column's codec has already read `stored` while the default was lowered, so it reads again. */\nfunction readDocument(codec, stored) {\n\tif (stored === null) return null;\n\treturn blindCast(codec.decodeJson(stored));\n}\n/** Each way the default does not match the composite type. */\nfunction valueObjectDefaultMismatches(input) {\n\tconst mismatches = [];\n\tconst shape = (path, message) => mismatches.push({\n\t\tcode: PSL_VALUE_TYPE_INCOMPATIBLE,\n\t\tmessage: `Field \"${path}\": ${message}`\n\t});\n\tconst checkObject = (value, valueObjectName, path) => {\n\t\tconst valueObject = input.types.nodes.get(valueObjectName);\n\t\tconst declared = input.types.declaredMembers.get(valueObjectName);\n\t\tif (valueObject === void 0 || declared === void 0) throw new InternalError(`Field \"${path}\" is typed by the value object \"${valueObjectName}\", which the contract does not declare.`);\n\t\tif (!isJsonObject(value)) {\n\t\t\tshape(path, `a value of \"${valueObjectName}\" is a JSON object, not ${jsonKind(value)}`);\n\t\t\treturn;\n\t\t}\n\t\tfor (const key of Object.keys(value)) if (!declared.has(key)) shape(path, `\"${key}\" is not a member of \"${valueObjectName}\"`);\n\t\tfor (const member of valueObject.fields) checkMember(value[member.fieldName], member, `${path}.${member.fieldName}`);\n\t};\n\tconst checkMember = (value, member, path) => {\n\t\tif (value === void 0) {\n\t\t\tif (!member.nullable) shape(path, \"the member is required, and the default has no value for it\");\n\t\t\treturn;\n\t\t}\n\t\tif (value === null && member.nullable) return;\n\t\tif (member.many === true) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tshape(path, `the member is a list, so its value is a JSON array, not ${jsonKind(value)}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const [index, element] of value.entries()) {\n\t\t\t\tif (element === null && member.elementNullable) continue;\n\t\t\t\tcheckOne(element, member, `${path}[${index}]`, \"an element of the member is not null\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tcheckOne(value, member, path, \"the member is not optional, so its value is not null\");\n\t};\n\tconst checkOne = (value, member, path, notNull) => {\n\t\tif (isValueObjectMember(member)) {\n\t\t\tif (value === null) shape(path, notNull);\n\t\t\telse checkObject(value, member.valueObjectName, path);\n\t\t\treturn;\n\t\t}\n\t\tconst reading = readStoredValue({\n\t\t\tvalue,\n\t\t\tcolumn: member.descriptor,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdataTypeLookup: input.dataTypeLookup,\n\t\t\tfieldPath: path\n\t\t});\n\t\tif (!reading.ok) {\n\t\t\tif (value === null) shape(path, notNull);\n\t\t\telse mismatches.push({\n\t\t\t\tcode: reading.code,\n\t\t\t\tmessage: reading.message\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst enumMismatch = enumValueMismatch(value, member, path, input.codecLookup);\n\t\tif (enumMismatch !== void 0) mismatches.push(enumMismatch);\n\t};\n\tif (input.value === null) {\n\t\tif (input.nullable) return mismatches;\n\t\tshape(input.fieldPath, input.list ? \"the default of a list of value objects is a JSON array, not null\" : \"the default of a value object is a JSON object, not null\");\n\t\treturn mismatches;\n\t}\n\tif (input.list) {\n\t\tif (!Array.isArray(input.value)) {\n\t\t\tshape(input.fieldPath, `the default of a list of value objects is a JSON array, not ${jsonKind(input.value)}`);\n\t\t\treturn mismatches;\n\t\t}\n\t\tfor (const [index, element] of input.value.entries()) {\n\t\t\tif (element === null && input.elementNullable) continue;\n\t\t\tcheckObject(element, input.valueObjectName, `${input.fieldPath}[${index}]`);\n\t\t}\n\t\treturn mismatches;\n\t}\n\tif (!isJsonObject(input.value)) {\n\t\tshape(input.fieldPath, `the default of a value object is a JSON object, not ${jsonKind(input.value)}`);\n\t\treturn mismatches;\n\t}\n\tcheckObject(input.value, input.valueObjectName, input.fieldPath);\n\treturn mismatches;\n}\n/**\n* A member typed by an enum takes only the enum's values, in the form its codec stores them, as a model field of that enum takes only its members.\n*/\nfunction enumValueMismatch(value, member, path, codecLookup) {\n\tconst handle = member.enumTypeHandle;\n\tif (handle === void 0) return void 0;\n\tconst codec = codecLookup.get(handle.codecId);\n\tconst stored = handle.values.map((enumValue) => codec === void 0 ? enumValue : codec.encodeJson(enumValue));\n\tif (stored.some((storedValue) => storedValue === value)) return void 0;\n\treturn {\n\t\tcode: PSL_INVALID_DEFAULT_LITERAL,\n\t\tmessage: `Field \"${path}\": Expected one of: ${stored.map((storedValue) => JSON.stringify(storedValue)).join(\" | \")}`\n\t};\n}\nfunction isJsonObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction jsonKind(value) {\n\tif (value === null) return \"null\";\n\tif (Array.isArray(value)) return \"a JSON array\";\n\tif (typeof value === \"object\") return \"a JSON object\";\n\treturn `a JSON ${typeof value}`;\n}\n//#endregion\n//#region src/psl-column-resolution.ts\nfunction toNamedTypeFieldDescriptor(typeRef, descriptor) {\n\treturn {\n\t\tcodecId: descriptor.codecId,\n\t\ttypeRef\n\t};\n}\nfunction argumentSpan(call, descriptors, index) {\n\tif (index === void 0) return call.span;\n\tconst name = descriptors?.[index]?.name;\n\tconst named = call.args.find((arg) => arg.kind === \"named\" && arg.name === name);\n\tconst positional = call.args.filter((arg) => arg.kind === \"positional\")[index];\n\treturn (named ?? positional)?.span ?? call.span;\n}\n/**\n* Checks the type parameters a constructor or preset produced against its codec's parameter schema,\n* reporting a failure at the argument the failing parameter came from. Returns whether they passed.\n*/\nfunction checkPslTypeParams(input) {\n\tconst helperPath = input.call.path.join(\".\");\n\ttry {\n\t\tvalidateAuthoringTypeParams(helperPath, input.template, input.typeParams, input.codecLookup.descriptorFor(input.template.codecId)?.paramsSchema);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${input.subject} ${message}`,\n\t\t\t...input.source.at(argumentSpan(input.call, input.args, argumentIndexOf(error)))\n\t\t});\n\t\treturn false;\n\t}\n}\nfunction argumentIndexOf(error) {\n\tif (typeof error !== \"object\" || error === null || !(\"details\" in error)) return void 0;\n\tconst { details } = error;\n\tif (typeof details !== \"object\" || details === null || !(\"argumentIndex\" in details)) return;\n\treturn typeof details.argumentIndex === \"number\" ? details.argumentIndex : void 0;\n}\n/**\n* Walks `authoringContributions.entityTypes` segment-by-segment and returns\n* the entity type descriptor at the resolved path, or `undefined` if no\n* descriptor is registered.\n*\n* Used by the PSL interpreter to dispatch declarative entity-shaped\n* declarations (`enum`, future `namespace { … }`, …) through the\n* pack entity-type mechanism — the descriptor's `factory` (or\n* `template`) materialises the IR-class instance without the\n* interpreter knowing target-specific construction.\n*/\nfunction getAuthoringEntity(contributions, path) {\n\tlet current = contributions?.entityTypes;\n\tfor (const segment of path) {\n\t\tif (typeof current !== \"object\" || current === null || \"kind\" in current) return;\n\t\tcurrent = current[segment];\n\t}\n\treturn current !== void 0 && isAuthoringEntityTypeDescriptor(current) ? current : void 0;\n}\nfunction instantiatePslTypeConstructor(input) {\n\tconst helperPath = input.call.path.join(\".\");\n\tconst args = mapPslHelperArgs({\n\t\targs: input.call.args,\n\t\tdescriptors: input.descriptor.args ?? [],\n\t\thelperLabel: `constructor \"${helperPath}\"`,\n\t\tspan: input.call.span,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel\n\t});\n\tif (!args) return;\n\tlet output;\n\ttry {\n\t\tvalidateAuthoringHelperArguments(helperPath, input.descriptor.args, args);\n\t\toutput = instantiateAuthoringTypeConstructor(input.descriptor, args);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${input.entityLabel} constructor \"${helperPath}\" ${message}`,\n\t\t\t...input.source.at(input.call.span)\n\t\t});\n\t\treturn;\n\t}\n\treturn checkPslTypeParams({\n\t\tcall: input.call,\n\t\tsubject: `${input.entityLabel} constructor \"${helperPath}\"`,\n\t\targs: input.descriptor.args,\n\t\ttemplate: input.descriptor.output,\n\t\ttypeParams: output.typeParams,\n\t\tcodecLookup: input.codecLookup,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source\n\t}) ? output : void 0;\n}\n/**\n* Structural check for a codec descriptor exposing the authoring-time\n* `columnFromEntity` hook a type constructor's `entityRefArg` resolves\n* through (e.g. the `pg/enum@1` codec descriptor). No casts.\n*/\nfunction hasColumnFromEntityHook(descriptor) {\n\treturn \"columnFromEntity\" in descriptor && typeof descriptor.columnFromEntity === \"function\";\n}\n/**\n* Resolves a type-constructor call whose descriptor declares an\n* `entityRefArg` (e.g. `pg.enum(AalLevel)`): extracts the call's sole\n* positional-argument ref string, resolves it against the field's\n* namespace's already-lowered extension entities (keyed by the declared\n* `entityRefArg.entityKind`, then block name), and converts the resolved\n* entity to column params via the `columnFromEntity` authoring hook on the\n* codec descriptor registered for `descriptor.output.codecId`. The\n* `typeParams.typeName` `columnFromEntity` returns is bare — schema\n* qualification (e.g. `auth.aal_level`) is a target concern, applied later\n* when the target builds the field's namespace. A `valueSet` ref is\n* attached when the same namespace derived a value-set under the same block\n* name (the generic `deriveValueSet` mechanism), scoped to the field's own\n* namespace.\n*/\nfunction resolveEntityRefTypeConstructorCall(input) {\n\tconst entityRefArg = input.descriptor.entityRefArg;\n\tif (entityRefArg === void 0) throw new InternalError(\"resolveEntityRefTypeConstructorCall called with a descriptor that does not declare an entityRefArg. This is an interpreter bug.\");\n\tconst helperPath = input.call.path.join(\".\");\n\tconst positionalArgs = input.call.args.filter((arg) => arg.kind === \"positional\");\n\tconst ref = positionalArgs[entityRefArg.index]?.value;\n\tif (input.call.args.length !== 1 || positionalArgs.length !== 1 || ref === void 0) {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${input.entityLabel} type constructor \"${helperPath}\" expects exactly one positional argument naming the referenced entity`,\n\t\t\t...input.source.at(input.call.span)\n\t\t});\n\t\treturn NOT_RESOLVED;\n\t}\n\tconst reportUnknownRef = () => {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNKNOWN_ENTITY_REF\",\n\t\t\tmessage: `${input.entityLabel} type constructor \"${helperPath}(${ref})\" does not resolve — no entity named \"${ref}\" was found in namespace \"${input.namespaceId ?? \"(unspecified)\"}\"`,\n\t\t\t...input.source.at(input.call.span)\n\t\t});\n\t\treturn NOT_RESOLVED;\n\t};\n\tconst entity = input.namespaceExtensionEntities?.[entityRefArg.entityKind]?.[ref];\n\tif (entity === void 0) return reportUnknownRef();\n\tconst codecId = input.descriptor.output.codecId;\n\tconst codecDescriptor = input.codecLookup.descriptorFor(codecId);\n\tif (codecDescriptor === void 0 || !hasColumnFromEntityHook(codecDescriptor)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Type constructor \"${helperPath}\" registers codecId \"${codecId}\" with an entity-ref argument, but its codec descriptor has no \"columnFromEntity\" authoring hook. This is a contributor bug in the pack registering \"${helperPath}\", not a user-schema error.`, { meta: {\n\t\thelperPath,\n\t\tcodecId\n\t} });\n\tconst resolved = codecDescriptor.columnFromEntity(entity);\n\tif (resolved === void 0) return reportUnknownRef();\n\tconst derivedValueSet = input.namespaceExtensionEntities?.[\"valueSet\"]?.[ref];\n\tif (derivedValueSet !== void 0 && input.namespaceId === void 0) {\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${input.entityLabel} type constructor \"${helperPath}(${ref})\" resolves to a value-set-typed entity, but the field has no resolvable namespace to scope the value-set ref to`,\n\t\t\t...input.source.at(input.call.span)\n\t\t});\n\t\treturn NOT_RESOLVED;\n\t}\n\tconst valueSet = derivedValueSet !== void 0 && input.namespaceId !== void 0 ? {\n\t\tplane: \"storage\",\n\t\tentityKind: \"valueSet\",\n\t\tnamespaceId: input.namespaceId,\n\t\tentityName: ref\n\t} : void 0;\n\treturn {\n\t\tok: true,\n\t\tdescriptor: {\n\t\t\tcodecId,\n\t\t\t...resolved.typeParams !== void 0 ? { typeParams: resolved.typeParams } : {},\n\t\t\t...valueSet !== void 0 ? { valueSet } : {}\n\t\t}\n\t};\n}\nconst NOT_RESOLVED = { ok: false };\nfunction instantiateFieldTypeConstructor(input) {\n\tif (input.descriptor.entityRefArg !== void 0) return resolveEntityRefTypeConstructorCall({\n\t\tcall: input.call,\n\t\tdescriptor: input.descriptor,\n\t\tnamespaceId: input.namespaceId,\n\t\tnamespaceExtensionEntities: input.namespaceExtensionEntities,\n\t\tcodecLookup: input.codecLookup,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel\n\t});\n\tconst instantiated = instantiatePslTypeConstructor({\n\t\tcall: input.call,\n\t\tdescriptor: input.descriptor,\n\t\tcodecLookup: input.codecLookup,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source,\n\t\tentityLabel: input.entityLabel\n\t});\n\treturn instantiated === void 0 ? NOT_RESOLVED : {\n\t\tok: true,\n\t\tdescriptor: instantiated\n\t};\n}\nfunction instantiateFieldPreset(input) {\n\tconst instantiated = instantiatePslFieldPreset(input);\n\tif (!instantiated) return NOT_RESOLVED;\n\tif (!checkPslTypeParams({\n\t\tcall: input.call,\n\t\tsubject: `${input.entityLabel} preset \"${input.call.path.join(\".\")}\"`,\n\t\targs: input.descriptor.args,\n\t\ttemplate: input.descriptor.output,\n\t\ttypeParams: instantiated.descriptor.typeParams,\n\t\tcodecLookup: input.codecLookup,\n\t\tdiagnostics: input.diagnostics,\n\t\tsource: input.source\n\t})) return NOT_RESOLVED;\n\tconst presetContributions = {\n\t\tnullable: instantiated.nullable,\n\t\tid: instantiated.id,\n\t\tunique: instantiated.unique,\n\t\t...instantiated.default !== void 0 ? { default: instantiated.default } : {},\n\t\t...instantiated.executionDefaults !== void 0 ? { executionDefaults: instantiated.executionDefaults } : {}\n\t};\n\treturn {\n\t\tok: true,\n\t\tdescriptor: instantiated.descriptor,\n\t\tpresetContributions\n\t};\n}\nfunction bareTypeConstructorOf(resolution) {\n\tif (resolution?.kind !== \"contributedType\") return void 0;\n\tconst { descriptor } = resolution.symbol;\n\treturn descriptor.kind === \"typeConstructor\" && isBareTypeConstructor(descriptor) ? descriptor : void 0;\n}\nfunction resolvedKindLabel(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"compositeType\": return \"composite type\";\n\t\tcase \"namedType\": return \"named type\";\n\t\tcase \"block\": return resolution.symbol.keyword;\n\t\tcase \"crossSpace\": return \"type of another contract space\";\n\t\tdefault: return resolution.kind;\n\t}\n}\nfunction resolveFieldTypeDescriptor(input) {\n\tconst { field, resolution, entityLabel, diagnostics } = input;\n\tif (field.malformedType || resolution === void 0) return NOT_RESOLVED;\n\tconst source = diagnosticSource(input.sources, field.node.syntax);\n\tconst unsupported = (message) => {\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\tmessage,\n\t\t\t...source.at(field.span)\n\t\t});\n\t\treturn NOT_RESOLVED;\n\t};\n\tconst call = field.typeConstructor;\n\tswitch (resolution.kind) {\n\t\tcase \"unresolved\":\n\t\tcase \"namespace\":\n\t\tcase \"contributedNamespace\": return NOT_RESOLVED;\n\t\tcase \"contributedType\": {\n\t\t\tconst { descriptor, path } = resolution.symbol;\n\t\t\tconst written = path.join(\".\");\n\t\t\tif (descriptor.kind === \"fieldPreset\") {\n\t\t\t\tif (call === void 0) {\n\t\t\t\t\treportPresetNotCalled({\n\t\t\t\t\t\tentityLabel,\n\t\t\t\t\t\tpresetPath: written,\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tspan: field.span,\n\t\t\t\t\t\tdiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn NOT_RESOLVED;\n\t\t\t\t}\n\t\t\t\treturn instantiateFieldPreset({\n\t\t\t\t\tcall,\n\t\t\t\t\tdescriptor,\n\t\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\t\tdiagnostics,\n\t\t\t\t\tsource,\n\t\t\t\t\tentityLabel\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (call !== void 0) return instantiateFieldTypeConstructor({\n\t\t\t\t...input,\n\t\t\t\tcall,\n\t\t\t\tdescriptor,\n\t\t\t\tsource\n\t\t\t});\n\t\t\tif (!isBareTypeConstructor(descriptor)) {\n\t\t\t\treportTypeConstructorNotCalled({\n\t\t\t\t\tentityLabel,\n\t\t\t\t\tpath: written,\n\t\t\t\t\tdescriptor,\n\t\t\t\t\tsource,\n\t\t\t\t\tspan: field.span,\n\t\t\t\t\tdiagnostics\n\t\t\t\t});\n\t\t\t\treturn NOT_RESOLVED;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tdescriptor: instantiateAuthoringTypeConstructor(descriptor, [])\n\t\t\t};\n\t\t}\n\t\tcase \"field\":\n\t\tcase \"attribute\":\n\t\tcase \"parameter\":\n\t\tcase \"function\":\n\t\tcase \"constant\": throw new InternalError(`The type of ${entityLabel} resolved to a ${resolution.kind}; a type reference never names one. This is a binder bug.`);\n\t}\n\tif (call !== void 0) return unsupported(`${entityLabel} calls \"${call.path.join(\".\")}\", which is a ${resolvedKindLabel(resolution)}, not a type constructor. Remove the arguments.`);\n\tswitch (resolution.kind) {\n\t\tcase \"namedType\": {\n\t\t\tconst descriptor = input.namedTypeDescriptors.get(resolution.symbol);\n\t\t\treturn descriptor === void 0 ? NOT_RESOLVED : {\n\t\t\t\tok: true,\n\t\t\t\tdescriptor\n\t\t\t};\n\t\t}\n\t\tcase \"block\": {\n\t\t\tif (resolution.symbol.keyword !== \"enum\") return unsupported(`${entityLabel} is typed by the ${resolution.symbol.keyword} \"${resolution.symbol.name}\", which is not a column type.`);\n\t\t\tconst descriptor = input.enumTypeDescriptors.get(resolution.symbol);\n\t\t\treturn descriptor === void 0 ? NOT_RESOLVED : {\n\t\t\t\tok: true,\n\t\t\t\tdescriptor\n\t\t\t};\n\t\t}\n\t\tcase \"model\":\n\t\tcase \"compositeType\": return unsupported(`${entityLabel} is typed by the ${resolvedKindLabel(resolution)} \"${resolution.symbol.name}\", which is not a column type.`);\n\t\tcase \"crossSpace\": return unsupported(`${entityLabel} type \"${field.typeName}\" is a type of contract space \"${field.typeContractSpaceId}\"; only a relation field can name a type of another contract space.`);\n\t}\n}\nconst PSL_INVALID_DEFAULT_SQL = \"PSL_INVALID_DEFAULT_SQL\";\nconst TAGGED_LITERAL_CANONICALIZATION_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\nfunction defaultValueExpression(node) {\n\treturn [...node.argList()?.args() ?? []].find((arg) => arg.colon() === void 0)?.value();\n}\nfunction listElements(expression) {\n\tconst list = expression === void 0 ? void 0 : ArrayLiteralAst.cast(expression.syntax);\n\treturn list === void 0 ? [] : [...list.elements()];\n}\nfunction rejectStrictListNullDefault(input) {\n\tif (input.field.elementOptional) return false;\n\tfor (const arg of input.node.argList()?.args() ?? []) {\n\t\tconst expression = arg.value();\n\t\tconst list = expression ? ArrayLiteralAst.cast(expression.syntax) : void 0;\n\t\tfor (const element of list?.elements() ?? []) {\n\t\t\tconst identifier = IdentifierAst.cast(element.syntax);\n\t\t\tif (identifier?.token()?.text !== \"null\") continue;\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_APPLICABILITY\",\n\t\t\t\tmessage: `Field \"${input.modelName}.${input.field.name}\" has strict list elements and cannot use null in a literal list default. Make the element type nullable or remove null from the default.`,\n\t\t\t\t...diagnosticSource(input.sources, identifier.syntax).at()\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\nfunction lowerDefaultForField(input) {\n\tconst node = getAttribute(input.field.attributes, \"default\")?.node;\n\tif (node === void 0) return {};\n\tconst source = diagnosticSource(input.sources, node.syntax);\n\tconst spec = sqlAttributeSpecs.field.default(fieldSpecContext({\n\t\tsymbols: input.symbolTable,\n\t\tmodel: input.model,\n\t\tfield: input.field,\n\t\tbinder: input.binder,\n\t\tcontrolMutationDefaults: { defaultFunctionRegistry: input.defaultFunctionRegistry },\n\t\tdataTypes: input.dataTypes\n\t}));\n\tconst interpreted = interpretFieldAttribute({\n\t\tsymbols: input.symbolTable,\n\t\tnode,\n\t\tspec,\n\t\tmodel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tdiagnostics: input.diagnostics\n\t});\n\tif (interpreted === void 0) return {};\n\tconst value = interpreted.value;\n\tif (Array.isArray(value) && value.includes(null) && rejectStrictListNullDefault({\n\t\t...input,\n\t\tnode\n\t})) return {};\n\tif (value === null) {\n\t\tif (!input.field.optional) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_APPLICABILITY\",\n\t\t\t\tmessage: `Field \"${input.modelName}.${input.fieldName}\" is non-nullable and cannot use null as its literal default. Make the field nullable or use a non-null default.`,\n\t\t\t\t...source.at()\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\treturn { defaultValue: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: null,\n\t\t\tcanonical: true\n\t\t} };\n\t}\n\tconst valueExpression = defaultValueExpression(node);\n\tconst refusalLocation = (place) => {\n\t\tif (place.kind === \"attribute\") return source.at();\n\t\tconst expression = place.elementIndex === void 0 ? valueExpression : listElements(valueExpression)[place.elementIndex];\n\t\tif (expression === void 0) throw new InternalError(`Field \"${input.modelName}.${input.fieldName}\": the refused @default value has no written expression.`);\n\t\treturn diagnosticSource(input.sources, expression.syntax).at();\n\t};\n\tconst readsListElements = (written) => input.isListColumn || input.field.list && written.kind === \"list\";\n\tconst readAsLiteral = (written, sourceElementIndexes) => {\n\t\tconst lowered = lowerDataTypeDefault({\n\t\t\twritten,\n\t\t\tsourceElementIndexes,\n\t\t\tisList: readsListElements(written),\n\t\t\tcolumn: input.columnDescriptor,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdataTypes: input.dataTypes,\n\t\t\tfieldPath: `${input.modelName}.${input.fieldName}`\n\t\t});\n\t\tif (!lowered.ok) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: lowered.code,\n\t\t\t\tmessage: lowered.message,\n\t\t\t\t...refusalLocation(lowered.place)\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\tlet restoredValue = lowered.value;\n\t\tif (Array.isArray(value) && value.includes(null) && Array.isArray(lowered.value)) {\n\t\t\tlet index = 0;\n\t\t\tconst nonNullValues = lowered.value;\n\t\t\trestoredValue = value.map((element) => element === null ? null : nonNullValues[index++] ?? null);\n\t\t}\n\t\tif (input.valueObjectDefault !== void 0) {\n\t\t\tconst { document, stored } = valueObjectDefaultDocument({\n\t\t\t\tstored: restoredValue,\n\t\t\t\telementwise: readsListElements(written) && !input.isListColumn,\n\t\t\t\tcodecId: input.columnDescriptor.codecId,\n\t\t\t\tcodecLookup: input.codecLookup\n\t\t\t});\n\t\t\tconst mismatches = valueObjectDefaultMismatches({\n\t\t\t\tfieldPath: `${input.modelName}.${input.fieldName}`,\n\t\t\t\tvalue: document,\n\t\t\t\tlist: input.field.list,\n\t\t\t\tnullable: input.field.optional,\n\t\t\t\telementNullable: input.field.elementOptional,\n\t\t\t\t...input.valueObjectDefault,\n\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\tdataTypeLookup: input.dataTypes.lookup\n\t\t\t});\n\t\t\tfor (const { code, message } of mismatches) input.diagnostics.push({\n\t\t\t\tcode,\n\t\t\t\tmessage,\n\t\t\t\t...source.at()\n\t\t\t});\n\t\t\tif (mismatches.length > 0) return {};\n\t\t\treturn { defaultValue: {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: stored,\n\t\t\t\tcanonical: true\n\t\t\t} };\n\t\t}\n\t\treturn { defaultValue: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: restoredValue,\n\t\t\tcanonical: true\n\t\t} };\n\t};\n\tconst writtenScalar = (element) => {\n\t\tif (typeof element === \"string\") return {\n\t\t\tkind: \"string\",\n\t\t\ttext: element\n\t\t};\n\t\tif (typeof element === \"boolean\") return {\n\t\t\tkind: \"boolean\",\n\t\t\tvalue: element\n\t\t};\n\t\tif (\"text\" in element) return {\n\t\t\tkind: \"number\",\n\t\t\ttext: element.text\n\t\t};\n\t\tconst { canonicalization } = element;\n\t\tif (!canonicalization.ok) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: TAGGED_LITERAL_CANONICALIZATION_CODES[canonicalization.reason],\n\t\t\t\tmessage: describeTaggedLiteralFailure(canonicalization.reason),\n\t\t\t\t...source.at(element.span)\n\t\t\t});\n\t\t\treturn { ok: false };\n\t\t}\n\t\treturn {\n\t\t\tkind: \"tag\",\n\t\t\ttag: element.tag,\n\t\t\ttext: canonicalization.text\n\t\t};\n\t};\n\tconst sqlExpressionDefault = (text, span) => {\n\t\tconst reserved = reservedSqlDefaultText(text);\n\t\tconst refusal = reserved === void 0 ? checkSqlDefaultText(text) : `Write @default(${reserved}()) instead of ${SQL_EXPRESSION_TAG}\\`${reserved}()\\`; ${reserved}() is a Prisma default function, not raw SQL.`;\n\t\tif (refusal !== void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: PSL_INVALID_DEFAULT_SQL,\n\t\t\t\tmessage: refusal,\n\t\t\t\t...source.at(span)\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\treturn { defaultValue: {\n\t\t\tkind: \"function\",\n\t\t\texpression: text\n\t\t} };\n\t};\n\tif (input.columnDescriptor.valueSet !== void 0) {\n\t\tif (typeof value === \"string\") return { defaultValue: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t} };\n\t\tif (Array.isArray(value)) {\n\t\t\tconst members = value.filter((element) => element === null || typeof element === \"string\");\n\t\t\tif (members.length === value.length) return { defaultValue: {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: members\n\t\t\t} };\n\t\t}\n\t}\n\tif (Array.isArray(value)) {\n\t\tconst elements = [];\n\t\tconst sourceElementIndexes = [];\n\t\tfor (const [sourceIndex, element] of value.entries()) {\n\t\t\tif (element === null) continue;\n\t\t\tconst written = writtenScalar(element);\n\t\t\tif (\"ok\" in written) return {};\n\t\t\telements.push(written);\n\t\t\tsourceElementIndexes.push(sourceIndex);\n\t\t}\n\t\treturn readAsLiteral({\n\t\t\tkind: \"list\",\n\t\t\telements\n\t\t}, sourceElementIndexes);\n\t}\n\tif (typeof value === \"string\") return readAsLiteral({\n\t\tkind: \"string\",\n\t\ttext: value\n\t});\n\tif (typeof value === \"boolean\") return readAsLiteral({\n\t\tkind: \"boolean\",\n\t\tvalue\n\t});\n\tif (\"text\" in value) return readAsLiteral({\n\t\tkind: \"number\",\n\t\ttext: value.text\n\t});\n\tif (\"tag\" in value) {\n\t\tconst written = writtenScalar(value);\n\t\tif (\"ok\" in written) return {};\n\t\tconst read = readWrittenValue(input.dataTypes, written);\n\t\tif (read.ok && read.value.type === SQL_EXPRESSION_DATA_TYPE_ID) return sqlExpressionDefault(sqlTextFromCanonical(read.value.value), value.span);\n\t\treturn readAsLiteral(written);\n\t}\n\tif (typeof value === \"object\") {\n\t\tconst context = {\n\t\t\tsourceId: input.sources.sourceFileFor(node.syntax).filename,\n\t\t\tmodelName: input.modelName,\n\t\t\tfieldName: input.fieldName,\n\t\t\tcolumnCodecId: input.columnDescriptor.codecId\n\t\t};\n\t\tconst lowered = lowerDefaultFunctionWithRegistry({\n\t\t\tcall: value,\n\t\t\tregistry: input.defaultFunctionRegistry,\n\t\t\tcontext,\n\t\t\tsource\n\t\t});\n\t\tif (!lowered.ok) {\n\t\t\tif (lowered.kind === \"owned\") input.diagnostics.push(lowered.diagnostic);\n\t\t\telse input.diagnostics.pushExternal(lowered.diagnostic);\n\t\t\treturn {};\n\t\t}\n\t\tif (lowered.value.kind === \"storage\") return { defaultValue: lowered.value.defaultValue };\n\t\tconst generatorDescriptor = input.generatorDescriptorById.get(lowered.value.generated.id);\n\t\tif (!generatorDescriptor) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_APPLICABILITY\",\n\t\t\t\tmessage: `Default generator \"${lowered.value.generated.id}\" is not available in the composed mutation default registry.`,\n\t\t\t\t...source.at(value.span)\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\tif (generatorDescriptor.applicableCodecIds === void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_APPLICABILITY\",\n\t\t\t\tmessage: `Default generator \"${generatorDescriptor.id}\" is not applicable to \"@default(...)\" lowering. Use the corresponding field preset (e.g. \\`temporal.${generatorDescriptor.id === \"timestampNow\" ? \"updatedAt\" : generatorDescriptor.id}()\\`) instead.`,\n\t\t\t\t...source.at(value.span)\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\tif (!generatorDescriptor.applicableCodecIds.includes(input.columnDescriptor.codecId)) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_APPLICABILITY\",\n\t\t\t\tmessage: `Default generator \"${generatorDescriptor.id}\" is not applicable to \"${input.modelName}.${input.fieldName}\" with codecId \"${input.columnDescriptor.codecId}\".`,\n\t\t\t\t...source.at(value.span)\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t\treturn { executionDefaults: { onCreate: lowered.value.generated } };\n\t}\n\treturn {};\n}\n//#endregion\n//#region src/psl-field-resolution.ts\nfunction lowerEnumDefaultForField(input) {\n\tconst { field, model, enumHandle, diagnostics } = input;\n\tconst node = getAttribute(field.attributes, \"default\")?.node;\n\tif (node === void 0) return {};\n\tif (enumHandle.enumMembers.length === 0) return {};\n\tconst interpreted = interpretFieldAttribute({\n\t\tnode,\n\t\tspec: sqlAttributeSpecs.field.default(fieldSpecContext({\n\t\t\tsymbols: input.symbolTable,\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tbinder: input.binder,\n\t\t\tcontrolMutationDefaults: { defaultFunctionRegistry: input.defaultFunctionRegistry },\n\t\t\tdataTypes: input.dataTypes\n\t\t})),\n\t\tsymbols: input.symbolTable,\n\t\tmodel,\n\t\tfield,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tdiagnostics\n\t});\n\tif (interpreted === void 0) return {};\n\tconst member = interpreted.value;\n\tif (Array.isArray(member)) {\n\t\tif (member.includes(null) && rejectStrictListNullDefault({\n\t\t\t...input,\n\t\t\tnode\n\t\t})) return {};\n\t\treturn { defaultValue: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: blindCast(member.map((entry) => entry === null ? null : enumHandle.enumMembers.find((candidate) => candidate.name === entry)?.value))\n\t\t} };\n\t}\n\tinvariant(typeof member === \"string\", \"the enum @default grammar admits only member identifiers, so the parsed value is a string\");\n\tconst match = enumHandle.enumMembers.find((m) => m.name === member);\n\tif (!match) return {};\n\treturn { defaultValue: {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(match.value)\n\t} };\n}\nconst MODEL_COORDINATE_SEPARATOR = \"\\0\";\nfunction modelCoordinateKey(namespaceId, modelName) {\n\treturn `${namespaceId}${MODEL_COORDINATE_SEPARATOR}${modelName}`;\n}\nconst REMOVED_ATTRIBUTE_RULES = /* @__PURE__ */ new Map([[\"updatedAt\", {\n\thint: \"Use `temporal.updatedAt()` as a field-preset call instead.\",\n\tsuppressWhen: (field) => field.typeConstructor?.path[0] === \"temporal\"\n}]]);\n{\n\tconst overlap = [...REMOVED_ATTRIBUTE_RULES.keys()].filter((name) => Object.hasOwn(sqlAttributeSpecs.field, name));\n\tif (overlap.length > 0) throw new InternalError(`Registered SQL field attributes and REMOVED_ATTRIBUTE_RULES must not overlap. Names in both: ${overlap.join(\", \")}`);\n}\nfunction describeUnsupportedSqlAttribute(sources) {\n\treturn ({ attribute, level, owner, field }) => {\n\t\tif (owner.kind === \"compositeType\") return void 0;\n\t\tif (level === \"model\") {\n\t\t\tconst source = diagnosticSource(sources, owner.node.syntax);\n\t\t\treturn {\n\t\t\t\tcode: \"PSL_UNSUPPORTED_MODEL_ATTRIBUTE\",\n\t\t\t\tmessage: `Model \"${owner.name}\" uses unsupported attribute \"@@${attribute.name}\"`,\n\t\t\t\t...source.at(attribute.span)\n\t\t\t};\n\t\t}\n\t\tif (field === void 0) return void 0;\n\t\tconst source = diagnosticSource(sources, field.node.syntax);\n\t\tif (attribute.name.startsWith(\"db.\")) return {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: formatDbAttributeMigrationMessage(attribute),\n\t\t\t...source.at(attribute.span)\n\t\t};\n\t\tconst baseMessage = `Field \"${owner.name}.${field.name}\" uses unsupported attribute \"@${attribute.name}\"`;\n\t\tconst removedRule = REMOVED_ATTRIBUTE_RULES.get(attribute.name);\n\t\treturn {\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: removedRule && !removedRule.suppressWhen(field) ? `${baseMessage}. ${removedRule.hint}` : baseMessage,\n\t\t\t...source.at(attribute.span)\n\t\t};\n\t};\n}\nfunction extractFieldConstraintNames(input) {\n\tconst idAttribute = getAttribute(input.field.attributes, \"id\");\n\tconst uniqueAttribute = getAttribute(input.field.attributes, \"unique\");\n\tconst idNode = getAttribute(input.field.attributes, \"id\")?.node;\n\tconst idName = idNode === void 0 ? void 0 : interpretFieldAttribute({\n\t\tnode: idNode,\n\t\tsymbols: input.symbolTable,\n\t\tspec: sqlAttributeSpecs.field.id(),\n\t\tmodel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tdiagnostics: input.diagnostics\n\t})?.map;\n\tconst uniqueNode = getAttribute(input.field.attributes, \"unique\")?.node;\n\treturn {\n\t\tidAttribute,\n\t\tuniqueAttribute,\n\t\tidName,\n\t\tuniqueName: uniqueNode === void 0 ? void 0 : interpretFieldAttribute({\n\t\t\tnode: uniqueNode,\n\t\t\tsymbols: input.symbolTable,\n\t\t\tspec: sqlAttributeSpecs.field.unique(),\n\t\t\tmodel: input.model,\n\t\t\tfield: input.field,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tdiagnostics: input.diagnostics\n\t\t})?.map\n\t};\n}\n/**\n* Interprets a field's `@noCheck` attribute and resolves it against the\n* column's shape: the bare form becomes every kind the shape derives, and a\n* named kind that can never apply is a spec-validation diagnostic on the\n* attribute node. Returns the concrete kinds in canonical ascending order —\n* the only form the definition tree carries.\n*/\nfunction lowerNoCheckForField(input) {\n\tconst node = getAttribute(input.field.attributes, \"noCheck\")?.node;\n\tif (node === void 0) return void 0;\n\tconst interpreted = interpretFieldAttribute({\n\t\tnode,\n\t\tspec: sqlAttributeSpecs.field.noCheck(),\n\t\tsymbols: input.symbolTable,\n\t\tmodel: input.model,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tdiagnostics: input.diagnostics\n\t});\n\tif (interpreted === void 0) return void 0;\n\tconst span = getAttribute(input.field.attributes, \"noCheck\")?.span ?? input.field.span;\n\tconst subject = `Field \"${input.model.name}.${input.field.name}\"`;\n\tconst derivable = [];\n\tif (input.isListColumn && !input.elementNullable) derivable.push(\"elementNotNull\");\n\tif (input.isDomainEnum) derivable.push(\"membership\");\n\tconst authored = [interpreted.first, interpreted.second].filter((kind) => kind === \"membership\" || kind === \"elementNotNull\");\n\tif (authored.length === 0) {\n\t\tif (derivable.length === 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `${subject} @noCheck waives nothing — this column's shape derives no generated checks`,\n\t\t\t\t...diagnosticSource(input.sources, input.field.node.syntax).at(span)\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn derivable;\n\t}\n\tfor (const kind of authored) if (!derivable.includes(kind)) {\n\t\tconst explanation = kind === \"membership\" ? \"membership checks are derived only from enum value sets\" : \"element-non-null checks are derived only for lists whose elements are semantically non-null\";\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\tmessage: `${subject} @noCheck(${kind}) does not apply — ${explanation}`,\n\t\t\t...diagnosticSource(input.sources, input.field.node.syntax).at(span)\n\t\t});\n\t\treturn;\n\t}\n\treturn [...authored].sort();\n}\nfunction collectResolvedFields(input) {\n\tconst { model, symbolTable, enumTypeDescriptors, namedTypeDescriptors, valueObjectTypes, authoringContributions, binder, targetId, defaultFunctionRegistry, dataTypes, generatorDescriptorById, diagnostics, sources, scalarColumnDescriptors, enumHandles, capabilities, namespaceId, namespaceExtensionEntities, codecLookup } = input;\n\tconst resolvedFields = [];\n\tconst valueObjectStorageTypeName = authoringContributions?.valueObjectStorageType;\n\tconst declaredControlPolicy = getAttribute(model.attributes, \"control\")?.args.find((arg) => arg.kind === \"positional\")?.value.trim();\n\tconst modelDerivesChecks = declaredControlPolicy === void 0 || declaredControlPolicy === \"managed\";\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst source = diagnosticSource(sources, field.node.syntax);\n\t\tconst fieldTypeReference = typeReferenceNode(field);\n\t\tconst fieldTypeResolution = fieldTypeReference === void 0 ? void 0 : binder.symbolForNode(fieldTypeReference);\n\t\tconst isModelField = fieldTypeResolution?.kind === \"model\";\n\t\tif (field.list && isModelField) continue;\n\t\tconst relationAttribute = getAttribute(field.attributes, \"relation\");\n\t\tif (isModelField && relationAttribute) continue;\n\t\tif (field.typeContractSpaceId !== void 0 && relationAttribute) continue;\n\t\tif (isModelField) continue;\n\t\tconst valueObjectName = fieldTypeResolution?.kind === \"compositeType\" ? fieldTypeResolution.symbol.name : void 0;\n\t\tconst isValueObjectField = valueObjectName !== void 0;\n\t\tconst isListField = field.list;\n\t\tconst isListColumn = storedAsListColumn({\n\t\t\tlist: isListField,\n\t\t\ttypedByValueObject: isValueObjectField\n\t\t});\n\t\tlet descriptor;\n\t\tlet presetContributions;\n\t\tconst resolveInput = {\n\t\t\tfield,\n\t\t\tresolution: fieldTypeResolution,\n\t\t\tenumTypeDescriptors,\n\t\t\tnamedTypeDescriptors,\n\t\t\tdiagnostics,\n\t\t\tsources,\n\t\t\tentityLabel: `Field \"${model.name}.${field.name}\"`,\n\t\t\t...ifDefined(\"namespaceId\", namespaceId),\n\t\t\t...ifDefined(\"namespaceExtensionEntities\", namespaceExtensionEntities),\n\t\t\tcodecLookup\n\t\t};\n\t\tif (isValueObjectField) {\n\t\t\tif (valueObjectStorageTypeName === void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" is typed by the composite type \"${field.typeName}\", but the adapter of the stack declares no storage type for value objects, so the field has no column to be stored in.`,\n\t\t\t\t\t...source.at(field.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdescriptor = scalarColumnDescriptors.get(valueObjectStorageTypeName);\n\t\t\tif (descriptor === void 0) throw new InternalError(`The stack declares \"${valueObjectStorageTypeName}\" as its value-object storage type, but it is not one of the stack's scalar types; the control stack checks this when it is assembled.`);\n\t\t} else if (isListField) {\n\t\t\tif (capabilities[\"sql\"]?.[\"scalarList\"] !== true) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_SCALAR_LIST_UNSUPPORTED_TARGET\",\n\t\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" is a scalar list, but target \"${targetId}\" does not support scalar lists (the adapter does not report the \"scalarList\" capability). Remove the list or author it against a target that supports scalar lists.`,\n\t\t\t\t\t...source.at(field.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveFieldTypeDescriptor(resolveInput);\n\t\t\tif (!resolved.ok) continue;\n\t\t\tif (resolved.presetContributions) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_PRESET_NOT_LIST\",\n\t\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" uses a field-preset call as a list element type. Presets cannot be list elements; remove \"[]\" or use a scalar type.`,\n\t\t\t\t\t...source.at(field.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdescriptor = resolved.descriptor;\n\t\t} else {\n\t\t\tconst resolved = resolveFieldTypeDescriptor(resolveInput);\n\t\t\tif (!resolved.ok) continue;\n\t\t\tdescriptor = resolved.descriptor;\n\t\t\tpresetContributions = resolved.presetContributions;\n\t\t}\n\t\tif (!descriptor) continue;\n\t\tif (presetContributions && field.optional) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_PRESET_NOT_OPTIONAL\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" uses a field-preset call and cannot be optional. Remove \"?\" or use a different field type.`,\n\t\t\t\t...source.at(field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst defaultAttribute = getAttribute(field.attributes, \"default\");\n\t\tif (presetContributions && defaultAttribute) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_PRESET_AND_DEFAULT_CONFLICT\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" uses a field-preset call and cannot also declare @default(...). The preset already specifies the default value.`,\n\t\t\t\t...source.at(defaultAttribute.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst enumHandle = fieldTypeResolution?.kind === \"block\" ? enumHandles.get(fieldTypeResolution.symbol) : void 0;\n\t\tconst loweredDefault = defaultAttribute ? enumHandle ? lowerEnumDefaultForField({\n\t\t\tmodelName: model.name,\n\t\t\tfieldName: field.name,\n\t\t\tfield,\n\t\t\tmodel,\n\t\t\tsymbolTable,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tenumHandle,\n\t\t\tdefaultFunctionRegistry,\n\t\t\tdataTypes,\n\t\t\tdiagnostics\n\t\t}) : lowerDefaultForField({\n\t\t\tmodelName: model.name,\n\t\t\tfieldName: field.name,\n\t\t\tfield,\n\t\t\tmodel,\n\t\t\tsymbolTable,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tcolumnDescriptor: descriptor,\n\t\t\tisListColumn,\n\t\t\tvalueObjectDefault: valueObjectName === void 0 ? void 0 : {\n\t\t\t\tvalueObjectName,\n\t\t\t\ttypes: valueObjectTypes\n\t\t\t},\n\t\t\tgeneratorDescriptorById,\n\t\t\tdefaultFunctionRegistry,\n\t\t\tdataTypes,\n\t\t\tcodecLookup,\n\t\t\tdiagnostics\n\t\t}) : {};\n\t\tconst loweredOnCreate = loweredDefault.executionDefaults?.onCreate;\n\t\tif (isListField && loweredDefault.defaultValue?.kind === \"function\" && loweredDefault.defaultValue.expression === \"autoincrement()\") {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_LIST_AUTOINCREMENT_UNSUPPORTED\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" is a list and cannot use autoincrement(); it is a Prisma marker for a sequence-backed scalar column, not SQL.`,\n\t\t\t\t...source.at(defaultAttribute?.span ?? field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (isListField && loweredOnCreate) {\n\t\t\tconst defaultExpression = defaultAttribute?.args.find((arg) => arg.kind === \"positional\")?.value.trim() ?? \"this function\";\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_LIST_EXECUTION_DEFAULT_UNSUPPORTED\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" is a list and cannot use an execution default (\"${defaultExpression}\"). Lists have no per-element execution-default semantics; use a literal list @default or remove the default.`,\n\t\t\t\t...source.at(defaultAttribute?.span ?? field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (field.optional && loweredOnCreate) {\n\t\t\tconst generatorDescription = loweredOnCreate.kind === \"generator\" ? `\"${loweredOnCreate.id}\"` : \"for this field\";\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" cannot be optional when using execution default ${generatorDescription}. Remove \"?\" or use a storage default.`,\n\t\t\t\t...source.at(defaultAttribute?.span ?? field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst mappedColumnName = storageName(field, input.physicalNames);\n\t\tconst { idAttribute, uniqueAttribute, idName, uniqueName } = extractFieldConstraintNames({\n\t\t\tsymbolTable: input.symbolTable,\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tdiagnostics\n\t\t});\n\t\tlet isIdField = Boolean(idAttribute);\n\t\tif (idAttribute && isListField) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_LIST_ID_UNSUPPORTED\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" is a list and cannot be a primary key. Remove @id; a list cannot be an identity column.`,\n\t\t\t\t...source.at(idAttribute.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (idAttribute && field.optional) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" @id cannot be optional; primary key columns must be NOT NULL`,\n\t\t\t\t...source.at(idAttribute.span)\n\t\t\t});\n\t\t\tisIdField = false;\n\t\t}\n\t\tif (presetContributions && idAttribute && !presetContributions.id) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_PRESET_AND_ID_CONFLICT\",\n\t\t\t\tmessage: `Field \"${model.name}.${field.name}\" uses a field-preset call and cannot also declare @id. Use a preset that contributes id semantics, or drop @id.`,\n\t\t\t\t...source.at(idAttribute.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst fieldExecutionDefaults = presetContributions?.executionDefaults ?? loweredDefault.executionDefaults;\n\t\tconst fieldDefaultValue = presetContributions?.default ?? loweredDefault.defaultValue;\n\t\tconst noCheckKinds = modelDerivesChecks ? lowerNoCheckForField({\n\t\t\tsymbolTable: input.symbolTable,\n\t\t\tmodel,\n\t\t\tfield,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tisListColumn,\n\t\t\telementNullable: field.elementOptional,\n\t\t\tisDomainEnum: enumHandle !== void 0,\n\t\t\tdiagnostics\n\t\t}) : void 0;\n\t\tresolvedFields.push({\n\t\t\tfield,\n\t\t\tcolumnName: mappedColumnName,\n\t\t\tdescriptor,\n\t\t\tnullable: presetContributions?.nullable ?? field.optional,\n\t\t\t...ifDefined(\"defaultValue\", fieldDefaultValue),\n\t\t\t...ifDefined(\"executionDefaults\", fieldExecutionDefaults),\n\t\t\tisId: isIdField || Boolean(presetContributions?.id),\n\t\t\tisUnique: Boolean(uniqueAttribute) || Boolean(presetContributions?.unique),\n\t\t\t...ifDefined(\"idName\", idName),\n\t\t\t...ifDefined(\"uniqueName\", uniqueName),\n\t\t\t...ifDefined(\"many\", isListField ? true : void 0),\n\t\t\t...ifDefined(\"noCheck\", noCheckKinds),\n\t\t\t...ifDefined(\"elementNullable\", field.elementOptional ? true : void 0),\n\t\t\t...ifDefined(\"valueObjectTypeName\", valueObjectName),\n\t\t\t...ifDefined(\"enumTypeHandle\", enumHandle)\n\t\t});\n\t}\n\treturn resolvedFields;\n}\n//#endregion\nexport { storageName as S, contractError as _, getAuthoringEntity as a, getNamedArgument as b, resolveFieldTypeDescriptor as c, interpretFieldAttribute as d, interpretModelAttribute as f, readWrittenNumberForCodec as g, readDataTypeDefault as h, bareTypeConstructorOf as i, toNamedTypeFieldDescriptor as l, sqlAttributeSpecs as m, describeUnsupportedSqlAttribute as n, instantiateFieldTypeConstructor as o, modelAttributeSpecsFrom as p, modelCoordinateKey as r, instantiatePslTypeConstructor as s, collectResolvedFields as t, PSL_CHECK_ON_STI_VARIANT as u, formatDbAttributeMigrationMessage as v, mapFieldNamesToColumns as x, getAttribute as y };\n\n//# sourceMappingURL=psl-field-resolution-DUCrDnuq.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,YAAY,QAAQ,eAAe;CAC3C,MAAM,OAAO,cAAc,IAAI,MAAM;CACrC,cAAc,MAAM,wEAAwE;CAC5F,OAAO;AACR;AACA,SAAS,aAAa,YAAY,MAAM;CACvC,OAAO,YAAY,MAAM,cAAc,UAAU,SAAS,IAAI;AAC/D;AACA,SAAS,kCAAkC,WAAW;CACrD,MAAM,oBAAoB,UAAU,KAAK,KAAK,aAAa,SAAS,SAAS,WAAW,SAAS,SAAS,KAAK,IAAI,GAAG,SAAS,KAAK,IAAI,SAAS,UAAU,SAAS,KAAK,CAAC,CAAC,KAAK,IAAI;CACpL,MAAM,eAAe,UAAU,KAAK,WAAW,IAAI,KAAK,IAAI,kBAAkB;CAC9E,MAAM,kBAAkB,UAAU,KAAK,MAAM,CAAC;CA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AqB,WAAW,eAAe;EACzE,MAAM,eAAe,qBAAqB,qBAAqB;GAC9D,aAAa,MAAM;GACnB;GACA;GACA,SAAS,MAAM;GACf,QAAQ,MAAM;GACd;GACA,iBAAiB,MAAM;GACvB,cAAc,eAAe,KAAK;GAClC;EACD,CAAC,IAAI,KAAK;EACV,eAAe,KAAK;GACnB;GACA,YAAY;GACZ;GACA,UAAU,qBAAqB,YAAY,MAAM;GACjD,GAAG,UAAU,gBAAgB,iBAAiB;GAC9C,GAAG,UAAU,qBAAqB,sBAAsB;GACxD,MAAM,aAAa,QAAQ,qBAAqB,EAAE;GAClD,UAAU,QAAQ,eAAe,KAAK,QAAQ,qBAAqB,MAAM;GACzE,GAAG,UAAU,UAAU,MAAM;GAC7B,GAAG,UAAU,cAAc,UAAU;GACrC,GAAG,UAAU,QAAQ,cAAc,OAAO,KAAK,CAAC;GAChD,GAAG,UAAU,WAAW,YAAY;GACpC,GAAG,UAAU,mBAAmB,MAAM,kBAAkB,OAAO,KAAK,CAAC;GACrE,GAAG,UAAU,uBAAuB,eAAe;GACnD,GAAG,UAAU,kBAAkB,UAAU;EAC1C,CAAC;CACF;CACA,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"psl-infer-fU7LRjTx.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-infer.mjs"],"sourcesContent":["import { a as snakeToCamelCase, i as needsEscaping, n as escapeName, o as snakeToPascalCase, r as hasSeparators, t as escapeIfNeeded } from \"./psl-names-C3cwe0rg.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { defaultTableName } from \"@internal/sql-contract-psl/default-table-name\";\nimport pluralizeLib from \"pluralize\";\nimport { backingIndexColumnKeys, isBackedByColumnKeys } from \"@internal/sql-contract/foreign-key-materialization\";\n//#region src/core/psl-contract-infer/name-transforms.ts\nfunction toModelName(tableName) {\n\tlet name;\n\tif (hasSeparators(tableName)) name = snakeToPascalCase(tableName);\n\telse name = tableName.charAt(0).toUpperCase() + tableName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: tableName\n\t};\n\tif (defaultTableName(name) !== tableName) return {\n\t\tname,\n\t\tmap: tableName\n\t};\n\treturn { name };\n}\nfunction toFieldName(columnName) {\n\tlet name;\n\tif (hasSeparators(columnName)) name = snakeToCamelCase(columnName);\n\telse name = columnName.charAt(0).toLowerCase() + columnName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: columnName\n\t};\n\tif (name !== columnName) return {\n\t\tname,\n\t\tmap: columnName\n\t};\n\treturn { name };\n}\nfunction toEnumName(pgTypeName) {\n\tlet name;\n\tif (hasSeparators(pgTypeName)) name = snakeToPascalCase(pgTypeName);\n\telse name = pgTypeName.charAt(0).toUpperCase() + pgTypeName.slice(1);\n\tif (needsEscaping(name)) return {\n\t\tname: escapeName(name),\n\t\tmap: pgTypeName\n\t};\n\tif (name !== pgTypeName) return {\n\t\tname,\n\t\tmap: pgTypeName\n\t};\n\treturn { name };\n}\nfunction pluralize(word) {\n\treturn pluralizeLib.plural(word);\n}\nfunction deriveRelationFieldName(fkColumns, referencedTableName) {\n\tif (fkColumns.length === 1) {\n\t\tconst [col = referencedTableName] = fkColumns;\n\t\tconst stripped = col.replace(/_id$/i, \"\").replace(/Id$/, \"\");\n\t\tif (stripped.length > 0 && stripped !== col) return escapeIfNeeded(snakeToCamelCase(stripped));\n\t\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n\t}\n\treturn escapeIfNeeded(snakeToCamelCase(referencedTableName));\n}\nfunction deriveBackRelationFieldName(childModelName, isOneToOne) {\n\tconst base = childModelName.charAt(0).toLowerCase() + childModelName.slice(1);\n\treturn isOneToOne ? base : pluralize(base);\n}\n//#endregion\n//#region src/core/psl-contract-infer/relation-inference.ts\nconst DEFAULT_ON_DELETE = \"noAction\";\nconst DEFAULT_ON_UPDATE = \"noAction\";\nconst REFERENTIAL_ACTION_PSL = {\n\tnoAction: \"NoAction\",\n\trestrict: \"Restrict\",\n\tcascade: \"Cascade\",\n\tsetNull: \"SetNull\",\n\tsetDefault: \"SetDefault\"\n};\nfunction inferRelations(tables, modelNameMap) {\n\tconst relationsByTable = /* @__PURE__ */ new Map();\n\tconst fkCountByPair = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst pairKey = `${table.name}→${fk.referencedTable}`;\n\t\tfkCountByPair.set(pairKey, (fkCountByPair.get(pairKey) ?? 0) + 1);\n\t}\n\tconst usedFieldNames = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst names = /* @__PURE__ */ new Set();\n\t\tfor (const col of Object.values(table.columns)) names.add(col.name);\n\t\tusedFieldNames.set(table.name, names);\n\t}\n\tfor (const table of Object.values(tables)) for (const fk of table.foreignKeys) {\n\t\tconst childTableName = table.name;\n\t\tconst parentTableName = fk.referencedTable;\n\t\tconst childUsed = usedFieldNames.get(childTableName);\n\t\tif (childUsed === void 0) throw new InternalError(`Missing inferred field-name set for table \"${childTableName}\"`);\n\t\tconst childModelName = modelNameMap.get(childTableName) ?? childTableName;\n\t\tconst parentModelName = modelNameMap.get(parentTableName) ?? parentTableName;\n\t\tconst pairKey = `${childTableName}→${parentTableName}`;\n\t\tconst isSelfRelation = childTableName === parentTableName;\n\t\tconst needsRelationName = (fkCountByPair.get(pairKey) ?? 0) > 1 || isSelfRelation;\n\t\tconst isOneToOne = detectOneToOne(fk, table);\n\t\tconst childRelFieldName = resolveUniqueFieldName(deriveRelationFieldName(fk.columns, parentTableName), childUsed, parentModelName);\n\t\tconst relationName = needsRelationName ? deriveRelationName(fk, childRelFieldName, parentModelName, isSelfRelation) : void 0;\n\t\taddRelationField(relationsByTable, childTableName, buildChildRelationField(childRelFieldName, parentModelName, fk, fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false), relationName, table));\n\t\tchildUsed.add(childRelFieldName);\n\t\tconst parentUsed = usedFieldNames.get(parentTableName) ?? /* @__PURE__ */ new Set();\n\t\tusedFieldNames.set(parentTableName, parentUsed);\n\t\tconst backRelFieldName = resolveUniqueFieldName(deriveBackRelationFieldName(childModelName, isOneToOne), parentUsed, childModelName);\n\t\taddRelationField(relationsByTable, parentTableName, {\n\t\t\tfieldName: backRelFieldName,\n\t\t\ttypeName: childModelName,\n\t\t\toptional: isOneToOne,\n\t\t\tlist: !isOneToOne,\n\t\t\trelationName\n\t\t});\n\t\tparentUsed.add(backRelFieldName);\n\t}\n\treturn { relationsByTable };\n}\nfunction detectOneToOne(fk, table) {\n\tconst fkCols = [...fk.columns].sort();\n\tif (table.primaryKey) {\n\t\tconst pkCols = [...table.primaryKey.columns].sort();\n\t\tif (pkCols.length === fkCols.length && pkCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const unique of table.uniques) {\n\t\tconst uniqueCols = [...unique.columns].sort();\n\t\tif (uniqueCols.length === fkCols.length && uniqueCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\tfor (const index of table.indexes) {\n\t\tif (!index.unique || index.partial || index.columns === void 0) continue;\n\t\tconst indexCols = [...index.columns].sort();\n\t\tif (indexCols.length === fkCols.length && indexCols.every((c, i) => c === fkCols[i])) return true;\n\t}\n\treturn false;\n}\nfunction deriveRelationName(fk, childRelationFieldName, parentModelName, isSelfRelation) {\n\tif (fk.name) return fk.name;\n\tif (isSelfRelation) return `${childRelationFieldName.charAt(0).toUpperCase() + childRelationFieldName.slice(1)}${pluralize(parentModelName)}`;\n\treturn fk.columns.join(\"_\");\n}\n/**\n* Builds the child-side {@link RelationField} for a single foreign key:\n* `typeName` is the parent model name, `fields`/`references` are the FK's raw\n* columns, and `onDelete`/`onUpdate` are normalized to their PSL spelling.\n* Exported so a caller resolving a foreign key against a model outside\n* `tables` (e.g. a cross-space reference into another contract) can reuse the\n* same normalization instead of duplicating it.\n*\n* `hostTable` is the table the FK is declared on (i.e. `table`, not the\n* referenced parent) — its own indexes/uniques/primary key are what a\n* backing index for this FK would be. When none of them exactly match the\n* FK's source columns (in order), `index: false` is stamped so the emitted\n* `@relation` opts out of the framework's default derived backing-index\n* expectation, matching what `db verify` will find live. Passing the table\n* is optional so existing single-FK callers (e.g. cross-space resolution\n* before a host table reference is threaded through) can omit it and keep\n* the framework default.\n*/\nfunction buildChildRelationField(fieldName, parentModelName, fk, optional, relationName, hostTable) {\n\tconst onDelete = fk.onDelete && fk.onDelete !== DEFAULT_ON_DELETE ? fk.onDelete : void 0;\n\tconst onUpdate = fk.onUpdate && fk.onUpdate !== DEFAULT_ON_UPDATE ? fk.onUpdate : void 0;\n\tconst index = hostTable && !isBackedByColumnKeys(fk.columns, backingIndexColumnKeys({\n\t\tindexes: hostTable.indexes.filter((i) => i.where === void 0),\n\t\tuniques: hostTable.uniques,\n\t\tprimaryKey: hostTable.primaryKey\n\t})) ? false : void 0;\n\treturn {\n\t\tfieldName,\n\t\ttypeName: parentModelName,\n\t\treferencedTableName: fk.referencedTable,\n\t\toptional,\n\t\tlist: false,\n\t\trelationName,\n\t\tfkName: fk.name,\n\t\tfields: fk.columns,\n\t\treferences: fk.referencedColumns,\n\t\tonDelete: onDelete ? REFERENTIAL_ACTION_PSL[onDelete] : void 0,\n\t\tonUpdate: onUpdate ? REFERENTIAL_ACTION_PSL[onUpdate] : void 0,\n\t\tindex\n\t};\n}\nfunction resolveUniqueFieldName(desired, usedNames, fallbackSuffix) {\n\tif (!usedNames.has(desired)) return desired;\n\tconst withSuffix = `${desired}${fallbackSuffix}`;\n\tif (!usedNames.has(withSuffix)) return withSuffix;\n\tlet counter = 2;\n\twhile (usedNames.has(`${desired}${counter}`)) counter++;\n\treturn `${desired}${counter}`;\n}\nfunction addRelationField(map, tableName, field) {\n\tconst existing = map.get(tableName);\n\tif (existing) existing.push(field);\n\telse map.set(tableName, [field]);\n}\n//#endregion\nexport { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };\n\n//# sourceMappingURL=psl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uBAAuB,YAAY,KAAK;EAC7D;CACD;AACD;AACA,SAAS,uBAAuB,SAAS,WAAW,gBAAgB;CACnE,IAAI,CAAC,UAAU,IAAI,OAAO,GAAG,OAAO;CACpC,MAAM,aAAa,GAAG,UAAU;CAChC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,OAAO;CACvC,IAAI,UAAU;CACd,OAAO,UAAU,IAAI,GAAG,UAAU,SAAS,GAAG;CAC9C,OAAO,GAAG,UAAU;AACrB;AACA,SAAS,iBAAiB,KAAK,WAAW,OAAO;CAChD,MAAM,WAAW,IAAI,IAAI,SAAS;CAClC,IAAI,UAAU,SAAS,KAAK,KAAK;MAC5B,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC;AAChC"}
@@ -1 +0,0 @@
1
- import "./query-lane-context-CJoNBspB-Ylhia3fC.mjs";
@@ -1 +0,0 @@
1
- {"version":3,"file":"referential-action-sql-DJ9ps6-S.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/referential-action-sql.d.mts"],"mappings":";;;;;;;;cAOc,wBAAwB,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-table-CyL4CNMi-ByGZXmzd.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-CyL4CNMi.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-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\tdataType;\n\tcodecId;\n\tnullable;\n\tmany;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (Object.hasOwn(input, \"elementNullable\")) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"StorageColumn elementNullable must be nested under many.\", { meta: { reason: \"sibling-elementNullable\" } });\n\t\tthis.dataType = input.dataType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tthis.many = input.many ?? false;\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-CyL4CNMi.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,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,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Y,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 +0,0 @@
1
- import "./types-BJQcLx-8-DSnaugR4.mjs";
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-DV040Uuq-Bu8CnbMa.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types-DV040Uuq.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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kB,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 +0,0 @@
1
- {"version":3,"file":"validators-Xx-TKcx3.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/validators.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as ColumnDefaultFunctionSchema, c as ForeignKeyReferenceSchema, d as IndexSchema, f as ReferentialActionSchema, i as CheckConstraintSchema, l as ForeignKeySchema, m as StorageValueSetSchema, o as ColumnDefaultLiteralSchema, p as StorageTableSchema, s as ColumnDefaultSchema, t as composeSqlEntityKinds, u as ForeignKeySourceSchema } from \"./entity-kinds-JlqzyFoo.mjs\";\nimport { computeCheckContentHash, computeIndexContentHash } from \"@internal/sql-schema-ir/naming\";\nimport { isPlainRecord } from \"@internal/framework-components/ir\";\nimport { DATA_TYPE_ID_PATTERN } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { ContractExecutionSectionSchema, CrossReferenceSchema } from \"@internal/contract/types\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\n//#region src/default-sql-text.ts\nconst UNSAFE_DEFAULT_TEXT = /;|--|\\/\\*|\\$\\$|\\bSELECT\\b/i;\n/** Returns undefined when the text may be rendered as `DEFAULT (<text>)`, else the reason. */\nfunction checkSqlDefaultText(text) {\n\treturn UNSAFE_DEFAULT_TEXT.test(text) ? \"Default SQL must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.\" : void 0;\n}\n/**\n* Names the Prisma default function that raw SQL text is exactly, ignoring surrounding whitespace. The planners treat the contract expressions `now()` and `autoincrement()` as those functions, so raw SQL with that text would not be used as written.\n*/\nfunction reservedSqlDefaultText(text) {\n\tswitch (text.trim()) {\n\t\tcase \"now()\": return \"now\";\n\t\tcase \"autoincrement()\": return \"autoincrement\";\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/relation-storage.ts\nfunction sameColumns(left, right) {\n\treturn left.length === right.length && left.every((column, index) => column === right[index]);\n}\n/**\n* The storage facts behind a same-space to-one relation's nullability: which side owns the\n* foreign key, and whether each local column is nullable.\n*/\nfunction resolveSqlToOneRelationStorage(contract, modelStorage, relation) {\n\tconst table = blindCast(contract.storage.namespaces[modelStorage.namespaceId]?.entries.table?.[modelStorage.table]);\n\tconst columns = relation.on.localFields.map((fieldName) => {\n\t\tconst columnName = modelStorage.fields[fieldName]?.column;\n\t\tconst column = columnName === void 0 ? void 0 : table?.columns[columnName];\n\t\treturn {\n\t\t\tname: columnName ?? fieldName,\n\t\t\tnullable: column?.nullable ?? true\n\t\t};\n\t});\n\tconst columnNames = columns.map((column) => column.name);\n\treturn {\n\t\townsForeignKey: relation.cardinality === \"N:1\" || (table?.foreignKeys ?? []).some((foreignKey) => sameColumns(foreignKey.source.columns, columnNames)),\n\t\tcolumns\n\t};\n}\n//#endregion\n//#region src/validators.ts\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst DomainEnumRefSchema = type({\n\tplane: \"'domain'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'enum'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\n/** Document-scoped `storage.types`: codec triples only. */\nconst DocumentScopedStorageTypeSchema = type.declare().type({\n\tkind: \"'codec-instance'\",\n\tcodecId: \"string\",\n\tdataType: DATA_TYPE_ID_PATTERN,\n\t\"typeParams?\": \"Record<string, unknown>\"\n});\n/**\n* Domain enum entry under `domain.namespaces[id].enum[name]`.\n* Carries the codec id and an ordered `members` array of `{name, value}` pairs.\n*/\nconst ContractEnumSchema = type({\n\t\"+\": \"reject\",\n\tcodecId: \"string\",\n\tmembers: type({\n\t\tname: \"string\",\n\t\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n\t}).array().readonly()\n});\n/**\n* Derives a schema map from a descriptor map: maps each kind's key to its\n* `schema` field. Used by validation functions to validate entries.\n*/\nfunction schemaViewOf(kinds) {\n\treturn new Map([...kinds].map(([k, d]) => [k, d.schema]));\n}\nconst DEFAULT_SQL_KINDS = composeSqlEntityKinds();\n/**\n* Builds the per-namespace entry schema for `storage.namespaces[id]`.\n*\n* Validation is descriptor-driven: the `kinds` map carries both the schema\n* (used here for structural validation) and the construct function (used at\n* hydration time). An unregistered key fails validation naming the kind and\n* the namespace id, so validation fails closed.\n*/\nfunction createNamespaceEntrySchema(kinds) {\n\tconst schemas = schemaViewOf(kinds);\n\tconst knownKinds = new Set(kinds.keys());\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tid: \"string\",\n\t\t\"kind?\": \"string\",\n\t\tentries: \"object\"\n\t}).narrow((ns, ctx) => {\n\t\tif (!isPlainRecord(ns.entries)) return ctx.mustBe(\"an entries object\");\n\t\tfor (const [key, innerMap] of Object.entries(ns.entries)) {\n\t\t\tif (!knownKinds.has(key)) return ctx.reject({ expected: `entries key \"${key}\" in namespace \"${ns.id}\" is not a registered entity kind` });\n\t\t\tif (!isPlainRecord(innerMap)) return ctx.reject({ expected: `entries[\"${key}\"] in namespace \"${ns.id}\" must be an object` });\n\t\t\tconst entrySchema = blindCast(schemas.get(key));\n\t\t\tfor (const [, value] of Object.entries(innerMap)) {\n\t\t\t\tconst parsed = entrySchema(value);\n\t\t\t\tif (parsed instanceof type.errors) return ctx.reject({ expected: parsed.summary });\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n}\n/**\n* Builds the storage schema. Pack contributions reach the per-namespace\n* entry shape through {@link createNamespaceEntrySchema}; the\n* document-scoped `storage.types` field (codec triples only) and the\n* storage hash stay family-shared.\n*/\nfunction createSqlStorageSchema(kinds) {\n\tconst namespaceEntry = createNamespaceEntrySchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tstorageHash: \"string\",\n\t\t\"types?\": type({ \"[string]\": DocumentScopedStorageTypeSchema }),\n\t\t\"namespaces?\": type({ \"[string]\": namespaceEntry })\n\t});\n}\nconst StorageSchema = createSqlStorageSchema(DEFAULT_SQL_KINDS);\n/** The refusal of a value-object column when the stack declares no value-object storage type. */\nfunction valueObjectStorageTypeMissingMessage(columnPath) {\n\treturn `${columnPath}: a value-object column needs the stack's value-object storage type, and the stack declares none`;\n}\nconst LISTED_STORED_TYPE_NAMES = 5;\nfunction fieldOf(value, key) {\n\treturn isPlainRecord(value) ? value[key] : void 0;\n}\nfunction entriesOf(value) {\n\treturn isPlainRecord(value) ? Object.entries(value) : [];\n}\nfunction storedTypeNamePaths(storage) {\n\tconst columns = entriesOf(fieldOf(storage, \"namespaces\")).flatMap(([namespaceId, namespace]) => entriesOf(fieldOf(fieldOf(namespace, \"entries\"), \"table\")).flatMap(([tableName, table]) => entriesOf(fieldOf(table, \"columns\")).map(([columnName, column]) => ({\n\t\tpath: `storage.namespaces.${namespaceId}.entries.table.${tableName}.columns.${columnName}`,\n\t\tentry: column\n\t}))));\n\tconst types = entriesOf(fieldOf(storage, \"types\")).map(([typeName, entry]) => ({\n\t\tpath: `storage.types.${typeName}`,\n\t\tentry\n\t}));\n\treturn [...columns, ...types].filter(({ entry }) => isPlainRecord(entry) && Object.hasOwn(entry, \"nativeType\")).map(({ path }) => path);\n}\n/**\n* Contracts emitted before a column named its data type stored the database type name in `nativeType` on columns and `storage.types` entries. The first five such keys are reported with their paths and the rest are counted, so an old contract is refused with a short message that says what changed.\n*/\nfunction storedTypeNameProblems(storage) {\n\tconst paths = storedTypeNamePaths(storage);\n\tconst listed = paths.slice(0, LISTED_STORED_TYPE_NAMES).map((path) => `${path}.nativeType: contracts no longer store a column's database type name; the column names its data type in \"dataType\"`);\n\tconst unlisted = paths.length - listed.length;\n\treturn unlisted > 0 ? [...listed, `and ${unlisted} more ${unlisted === 1 ? \"path\" : \"paths\"} (${paths.length} in all)`] : listed;\n}\n/**\n* Any entries entity that declares both a `tableName` and a physical `name`\n* (e.g. a target's RLS policy entities) shares one physical-name space per\n* table: two such entries of one kind on the same table would collide as\n* DDL (`CREATE POLICY \"<name>\" ON <table>` fails on the second), while the\n* same name on different tables is legal. Structural — no entry-kind\n* vocabulary; `table` entries are keyed by name already and are excluded.\n*/\nfunction validateTableScopedEntryNames(storage, errors) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tif (!isPlainRecord(ns.entries)) continue;\n\t\tfor (const [entriesKind, slot] of Object.entries(ns.entries)) {\n\t\t\tif (entriesKind === \"table\" || !isPlainRecord(slot)) continue;\n\t\t\tconst seen = /* @__PURE__ */ new Map();\n\t\t\tfor (const entity of Object.values(slot)) {\n\t\t\t\tif (typeof entity !== \"object\" || entity === null) continue;\n\t\t\t\tconst record = blindCast(entity);\n\t\t\t\tconst name = record[\"name\"];\n\t\t\t\tconst tableName = record[\"tableName\"];\n\t\t\t\tif (typeof name !== \"string\" || typeof tableName !== \"string\") continue;\n\t\t\t\tconst key = JSON.stringify([tableName, name]);\n\t\t\t\tseen.set(key, (seen.get(key) ?? 0) + 1);\n\t\t\t\tif (seen.get(key) === 2) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": ${entriesKind} \"${name}\" is declared multiple times`);\n\t\t\t}\n\t\t}\n\t}\n}\nfunction eachStorageTable(storage) {\n\treturn Object.entries(storage.namespaces).flatMap(([namespaceId, ns]) => Object.entries(ns.entries[\"table\"] ?? {}).map(([tableName, table]) => ({\n\t\tnamespaceId,\n\t\ttableName,\n\t\ttable\n\t})));\n}\nfunction findDuplicateValue(values) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const value of values) {\n\t\tif (seen.has(value)) return value;\n\t\tseen.add(value);\n\t}\n}\n/** A column may appear at most once in one index's element tuple. */\nfunction rejectRepeatedIndexColumns(indexes, coordinate, errors) {\n\tfor (const index of indexes) {\n\t\tconst duplicateColumn = findDuplicateValue(index.columns ?? []);\n\t\tif (duplicateColumn !== void 0) errors.push(`${coordinate}: index contains duplicate column \"${duplicateColumn}\"`);\n\t}\n}\n/**\n* Two wire-named indexes with the same content are one index written twice —\n* the content hash is their identity, so neither spelling can survive. An\n* exact-named index is identified by its name instead, so content twins under\n* two names are legal and a repeated name is rejected by the named-object\n* check.\n*/\nfunction rejectDuplicateWireNamedIndexContent(indexes, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const index of indexes) {\n\t\tif (index.prefix === void 0) continue;\n\t\tconst content = computeIndexContentHash(index);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate index definition on columns [${(index.columns ?? []).join(\", \")}]`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\n/**\n* Two wire-named checks with the same predicate are one check written twice —\n* the content hash is their identity, so neither spelling can survive, and\n* whitespace variants of one predicate collapse onto the same hash. An\n* exact-named check is identified by its name instead, so content twins under\n* two names are legal (the legacy shape a database adopts from) and a repeated\n* name is rejected by the named-object check.\n*/\nfunction rejectDuplicateWireNamedCheckContent(checks, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const check of checks) {\n\t\tif (check.prefix === void 0) continue;\n\t\tconst content = computeCheckContentHash(check.expression);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate check constraint definition (expression \"${check.expression}\")`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\nfunction isContractFieldType(value) {\n\tif (!isPlainRecord(value)) return false;\n\tconst kind = value[\"kind\"];\n\tif (kind === \"scalar\") {\n\t\tif (typeof value[\"codecId\"] !== \"string\") return false;\n\t\tconst typeParams = value[\"typeParams\"];\n\t\tif (typeParams !== void 0 && !isPlainRecord(typeParams)) return false;\n\t\treturn true;\n\t}\n\tif (kind === \"valueObject\") return typeof value[\"name\"] === \"string\";\n\tif (kind === \"union\") {\n\t\tconst members = value[\"members\"];\n\t\tif (!Array.isArray(members)) return false;\n\t\treturn members.every((m) => isContractFieldType(m));\n\t}\n\treturn false;\n}\nconst ModelFieldSchema = type({\n\t\"+\": \"reject\",\n\tnullable: \"boolean\",\n\ttype: type(\"unknown\").narrow((value, ctx) => isContractFieldType(value) ? true : ctx.mustBe(\"scalar, valueObject, or union field type\")),\n\tmany: type(\"false\").or({\n\t\t\"+\": \"reject\",\n\t\telementNullable: \"boolean\"\n\t}).default(false),\n\t\"dict?\": \"true\",\n\t\"valueSet?\": DomainEnumRefSchema\n});\nconst ModelStorageSchema = type({\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tfields: type({ \"[string]\": type({\n\t\tcolumn: \"string\",\n\t\t\"codecId?\": \"string\",\n\t\t\"nullable?\": \"boolean\"\n\t}) })\n});\nconst ContractRelationThroughSchema = type({\n\t\"+\": \"reject\",\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tparentColumns: type.string.array().readonly(),\n\tchildColumns: type.string.array().readonly(),\n\ttargetColumns: type.string.array().readonly()\n});\nconst ContractRelationOnSchema = type({\n\t\"+\": \"reject\",\n\tlocalFields: type.string.array().readonly(),\n\ttargetFields: type.string.array().readonly()\n});\nconst ContractManyToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'N:M'\",\n\ton: ContractRelationOnSchema,\n\tthrough: ContractRelationThroughSchema\n});\nconst ContractToOneRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | 'N:1'\",\n\t\"nullable?\": \"boolean\",\n\ton: ContractRelationOnSchema\n});\nconst ContractToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:N'\",\n\ton: ContractRelationOnSchema\n});\nconst ContractReferenceRelationSchema = ContractManyToManyRelationSchema.or(ContractToOneRelationSchema).or(ContractToManyRelationSchema);\nconst ContractEmbedRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | '1:N'\"\n});\nconst ContractRelationSchema = ContractReferenceRelationSchema.or(ContractEmbedRelationSchema);\nconst ModelSchema = type({\n\tstorage: ModelStorageSchema,\n\t\"fields?\": type({ \"[string]\": ModelFieldSchema }),\n\t\"relations?\": type({ \"[string]\": ContractRelationSchema }),\n\t\"discriminator?\": \"unknown\",\n\t\"variants?\": \"unknown\",\n\t\"base?\": CrossReferenceSchema,\n\t\"owner?\": \"string\"\n});\nconst ContractMetaSchema = type({ \"[string]\": \"unknown\" });\n/**\n* Builds the full SQL contract schema. The storage subtree threads\n* pack contributions through {@link createSqlStorageSchema}; the rest\n* of the contract envelope is family-shared.\n*/\nfunction createSqlContractSchema(kinds) {\n\tconst storage = createSqlStorageSchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\ttarget: \"string\",\n\t\ttargetFamily: \"'sql'\",\n\t\t\"coreHash?\": \"string\",\n\t\tprofileHash: \"string\",\n\t\t\"capabilities?\": \"Record<string, Record<string, boolean>>\",\n\t\t\"extensions?\": \"Record<string, unknown>\",\n\t\t\"meta?\": ContractMetaSchema,\n\t\t\"defaultControlPolicy?\": ControlPolicySchema,\n\t\t\"roots?\": type({ \"[string]\": CrossReferenceSchema }),\n\t\tdomain: type({ namespaces: type({ \"[string]\": type({\n\t\t\tmodels: type({ \"[string]\": ModelSchema }),\n\t\t\t\"valueObjects?\": type({ \"[string]\": type({ fields: type({ \"[string]\": ModelFieldSchema }) }) }),\n\t\t\t\"enum?\": type({ \"[string]\": ContractEnumSchema })\n\t\t}) }) }),\n\t\tstorage,\n\t\t\"execution?\": ContractExecutionSectionSchema\n\t});\n}\nconst SqlContractSchema = createSqlContractSchema(DEFAULT_SQL_KINDS);\n/**\n* Validates the structural shape of SqlStorage using Arktype. Pure\n* structural check: namespace IR is never materialized here (that needs\n* a target concretion via the serializer hydration path), so this throws\n* on invalid input and constructs nothing.\n*\n* @param value - The storage value to validate\n* @throws Error if the storage structure is invalid\n*/\nfunction validateStorage(value) {\n\tconst storedTypeNames = storedTypeNameProblems(value);\n\tconst result = StorageSchema(value);\n\tconst errors = storedTypeNames.length > 0 ? [...storedTypeNames] : result instanceof type.errors ? result.map((p) => p.message) : [];\n\tif (errors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Storage validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n}\nfunction validateModel(value) {\n\tconst result = ModelSchema(value);\n\tif (result instanceof type.errors) {\n\t\tconst errors = result.map((p) => p.message);\n\t\tthrow contractError(\"CONTRACT.VALIDATION_FAILED\", `Model validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n\t}\n\treturn result;\n}\n/**\n* Structural arktype validation of an SQL contract envelope. Internal\n* helper for {@link validateSqlContractFully} — exposed only inside\n* this module, since the family seam-of-record is the\n* `SqlContractSerializerBase.deserializeContract` SPI.\n*/\nfunction validateSqlContractStructure(value, contractSchema) {\n\tif (typeof value !== \"object\" || value === null) throw new ContractValidationError(\"Contract structural validation failed: value must be an object\", \"structural\");\n\tconst targetFamily = \"targetFamily\" in value ? value.targetFamily : void 0;\n\tif (targetFamily !== void 0 && targetFamily !== \"sql\") throw new ContractValidationError(`Unsupported target family: ${targetFamily}`, \"structural\");\n\tconst storedTypeNames = storedTypeNameProblems(fieldOf(value, \"storage\"));\n\tif (storedTypeNames.length > 0) throw new ContractValidationError(`Contract structural validation failed: ${storedTypeNames.join(\"; \")}`, \"structural\");\n\tconst contractResult = contractSchema(value);\n\tif (contractResult instanceof type.errors) throw new ContractValidationError(`Contract structural validation failed: ${contractResult.map((p) => p.message).join(\"; \")}`, \"structural\");\n\treturn blindCast(contractResult);\n}\n/**\n* Validates semantic constraints on SqlStorage that cannot be expressed in Arktype schemas.\n*\n* Returns an array of human-readable error strings. Empty array = valid.\n*\n* Currently checks:\n* - duplicate named primary key / unique / index / foreign key objects within a table\n* - duplicate unique, index, or foreign key declarations within a table\n* - duplicate columns within primary key / unique / index definitions\n* - nullable columns in primary key definitions\n* - `setNull` referential action on a non-nullable FK column (would fail at runtime)\n* - `setDefault` referential action on a non-nullable FK column without a DEFAULT (would fail at runtime)\n*/\nfunction validateStorageSemantics(storage) {\n\tconst errors = [];\n\tvalidateTableScopedEntryNames(storage, errors);\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(storage)) {\n\t\tconst table = blindCast(rawTable);\n\t\tconst namedObjects = /* @__PURE__ */ new Map();\n\t\tconst registerNamedObject = (kind, name) => {\n\t\t\tif (!name) return;\n\t\t\tnamedObjects.set(name, [...namedObjects.get(name) ?? [], kind]);\n\t\t};\n\t\tregisterNamedObject(\"primary key\", table.primaryKey?.name);\n\t\tfor (const unique of table.uniques) registerNamedObject(\"unique constraint\", unique.name);\n\t\tfor (const index of table.indexes) registerNamedObject(\"index\", index.name);\n\t\tfor (const fk of table.foreignKeys) registerNamedObject(\"foreign key\", fk.name);\n\t\tfor (const check of table.checks ?? []) registerNamedObject(\"check constraint\", check.name);\n\t\tfor (const [name, kinds] of namedObjects) if (kinds.length > 1) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": named object \"${name}\" is declared multiple times (${kinds.join(\", \")})`);\n\t\tif (table.primaryKey) {\n\t\t\tconst duplicateColumn = findDuplicateValue(table.primaryKey.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tfor (const columnName of table.primaryKey.columns) if (table.columns[columnName]?.nullable === true) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key column \"${columnName}\" is nullable; primary key columns must be NOT NULL`);\n\t\t}\n\t\tconst seenUniqueDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const unique of table.uniques) {\n\t\t\tconst duplicateColumn = findDuplicateValue(unique.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": unique constraint contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tconst signature = JSON.stringify({ columns: unique.columns });\n\t\t\tif (seenUniqueDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate unique constraint definition on columns [${unique.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenUniqueDefinitions.add(signature);\n\t\t}\n\t\tconst tableCoordinate = `Namespace \"${namespaceId}\" table \"${tableName}\"`;\n\t\trejectRepeatedIndexColumns(table.indexes, tableCoordinate, errors);\n\t\trejectDuplicateWireNamedIndexContent(table.indexes, tableCoordinate, errors);\n\t\tconst seenForeignKeyDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst signature = JSON.stringify({\n\t\t\t\tsource: fk.source,\n\t\t\t\ttarget: fk.target,\n\t\t\t\tonDelete: fk.onDelete ?? null,\n\t\t\t\tonUpdate: fk.onUpdate ?? null\n\t\t\t});\n\t\t\tif (seenForeignKeyDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate foreign key definition on columns [${fk.source.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenForeignKeyDefinitions.add(signature);\n\t\t}\n\t\tfor (const fk of table.foreignKeys) for (const colName of fk.source.columns) {\n\t\t\tconst column = table.columns[colName];\n\t\t\tif (!column) continue;\n\t\t\tif (fk.onDelete === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onUpdate === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onDelete === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t\tif (fk.onUpdate === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t}\n\t\trejectDuplicateWireNamedCheckContent(table.checks ?? [], tableCoordinate, errors);\n\t}\n\treturn errors;\n}\n/**\n* SQL storage logical-consistency checks: every model.storage.table\n* resolves to a real table and every model.storage.fields[*].column\n* resolves to a real column. Throws `ContractValidationError` on the first\n* mismatch.\n*/\nfunction validateModelStorageReferences(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) {\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\tconst storageNamespaceId = modelStorage.namespaceId;\n\t\tif (storageNamespaceId !== namespaceId) throw new ContractValidationError(`Model \"${qualifiedName}\" storage.namespaceId \"${storageNamespaceId}\" does not match domain namespace \"${namespaceId}\"`, \"storage\");\n\t\tconst storageTable = modelStorage.table;\n\t\tconst rawTable = contract.storage.namespaces[storageNamespaceId]?.entries.table?.[storageTable];\n\t\tif (rawTable === void 0) throw new ContractValidationError(`Model \"${qualifiedName}\" references non-existent table \"${storageNamespaceId}.${storageTable}\"`, \"storage\");\n\t\tconst table = blindCast(rawTable);\n\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\tfor (const [fieldName, field] of Object.entries(modelStorage.fields)) if (!columnNames.has(field.column)) throw new ContractValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" references non-existent column \"${field.column}\" in table \"${storageTable}\"`, \"storage\");\n\t}\n}\n/**\n* Cross-table consistency checks for SQL storage: primary key, unique,\n* index, and foreign key column references resolve to real columns;\n* NOT NULL columns don't carry a literal `null` default; FK column\n* counts match their referenced columns. Throws on the first mismatch.\n*/\nfunction validateSqlStorageConsistency(contract) {\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(contract.storage)) {\n\t\tconst table = blindCast(rawTable);\n\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\tif (table.primaryKey) {\n\t\t\tfor (const colName of table.primaryKey.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" primaryKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t}\n\t\tfor (const unique of table.uniques) for (const colName of unique.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" unique constraint references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const index of table.indexes) for (const colName of index.columns ?? []) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" index references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const [colName, column] of Object.entries(table.columns)) if (!column.nullable && column.default?.kind === \"literal\" && column.default.value === null) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" column \"${colName}\" is NOT NULL but has a literal null default`, \"storage\");\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.source.namespaceId !== namespaceId || fk.source.tableName !== tableName) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" contains foreignKey with mismatched source coordinates (${fk.source.namespaceId}.${fk.source.tableName})`, \"storage\");\n\t\t\tfor (const colName of fk.source.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t\tif (fk.target.spaceId === void 0) {\n\t\t\t\tconst referencedRaw = contract.storage.namespaces[fk.target.namespaceId]?.entries.table?.[fk.target.tableName];\n\t\t\t\tif (referencedRaw === void 0) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent table \"${fk.target.namespaceId}.${fk.target.tableName}\"`, \"storage\");\n\t\t\t\tconst referencedTable = blindCast(referencedRaw);\n\t\t\t\tconst referencedColumnNames = new Set(Object.keys(referencedTable.columns));\n\t\t\t\tfor (const colName of fk.target.columns) if (!referencedColumnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\" in table \"${fk.target.tableName}\"`, \"storage\");\n\t\t\t}\n\t\t\tif (fk.source.columns.length !== fk.target.columns.length) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey column count (${fk.source.columns.length}) does not match referenced column count (${fk.target.columns.length})`, \"storage\");\n\t\t}\n\t}\n}\n/**\n* Full SQL contract validation: structural (arktype) +\n* framework-shared domain + SQL storage logical-consistency + SQL\n* storage semantic + model ↔ storage reference checks. Throws\n* `ContractValidationError` on the first failure. Returns the\n* validated flat-data shape; IR class hydration happens in the SPI\n* base on top of this helper.\n*/\nfunction validateSqlContractFully(value, options) {\n\tconst validated = validateSqlContractStructure(typeof value === \"object\" && value !== null ? (() => {\n\t\tconst { schemaVersion: _, _generated: _g, ...rest } = blindCast(value);\n\t\treturn rest;\n\t})() : value, options?.contractSchema ?? SqlContractSchema);\n\tvalidateContractDomain({\n\t\troots: validated.roots,\n\t\tdomain: validated.domain\n\t});\n\tvalidateSqlStorageConsistency(validated);\n\tconst semanticErrors = validateStorageSemantics(validated.storage);\n\tif (semanticErrors.length > 0) throw new ContractValidationError(`Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, \"storage\");\n\tvalidateModelStorageReferences(validated);\n\tvalidateRelationThroughConsistency(validated);\n\tvalidateToOneRelationNullabilityAgainstStorage(validated);\n\treturn validated;\n}\n/**\n* A same-space to-one relation that states `nullable` must agree with its local FK columns:\n* nullable exactly when one of them is nullable (a column that cannot be resolved counts as\n* nullable). A relation without the flag is left to hydration, which derives it the same way.\n*/\nfunction validateToOneRelationNullabilityAgainstStorage(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tfor (const [relationName, relation] of Object.entries(model.relations)) {\n\t\t\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || relation.nullable === void 0) continue;\n\t\t\tconst location = `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\t\tconst { ownsForeignKey, columns } = resolveSqlToOneRelationStorage(contract, storage, relation);\n\t\t\tif (!ownsForeignKey) {\n\t\t\t\tif (relation.nullable) continue;\n\t\t\t\tthrow new ContractValidationError(`${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, \"storage\");\n\t\t\t}\n\t\t\tconst anyNullable = columns.some((column) => column.nullable);\n\t\t\tif (relation.nullable === anyNullable) continue;\n\t\t\tconst columnList = columns.filter((column) => column.nullable !== relation.nullable).map((column) => `\"${column.name}\"`).join(\", \");\n\t\t\tthrow new ContractValidationError(relation.nullable ? `${location} is nullable but every local FK column is NOT NULL (columns ${columnList})` : `${location} is required but a local FK column is nullable (columns ${columnList})`, \"storage\");\n\t\t}\n\t}\n}\n/** Storage column lookup for through-consistency validation. */\nfunction lookupStorageColumn(contract, namespaceId, tableName, columnName) {\n\tconst rawTable = contract.storage.namespaces[namespaceId]?.entries.table?.[tableName];\n\tif (rawTable === void 0) return;\n\treturn blindCast(rawTable).columns[columnName];\n}\n/**\n* Two storage columns share a type when their `dataType` and `typeParams` match. `codecId` and\n* `nullable` are not compared: they do not change the database type that governs a join.\n*/\nfunction sameStorageType(a, b) {\n\treturn a.dataType === b.dataType && canonicalizeJson(a.typeParams ?? {}) === canonicalizeJson(b.typeParams ?? {});\n}\nfunction describeColumnType(column) {\n\treturn column.typeParams === void 0 ? column.dataType : `${column.dataType} ${canonicalizeJson(column.typeParams)}`;\n}\n/**\n* Validates one side of an N:M join: the junction columns and the model\n* columns they pair against positionally must be equal in number, exist in\n* their tables, and share the same storage type (`dataType` + `typeParams`).\n* The junction's storage foreign keys already guarantee this for user-declared\n* FK constraints, but `through` is a logical descriptor never tied to them by\n* the rest of validation — and the TS builder accepts explicit join columns\n* without requiring a junction FK at all — so this checks the columns directly\n* against storage, one path regardless of how the junction was authored.\n*\n* Joined columns must be the *same* storage type, not merely compatible:\n* relying on implicit conversion (e.g. `text`↔`character`) is unsafe on writes\n* — `character(n)` space-padding makes such coercions non-associative — and no\n* ADR sanctions heterogeneous junction columns. Equality is the conservative\n* default; it can be relaxed deliberately if a real use case ever appears.\n*/\nfunction validateThroughJoinSide(input) {\n\tconst fail = (detail) => new ContractValidationError(`Many-to-many relation \"${input.qualifiedName}\" ${detail}`, \"storage\");\n\tif (input.junctionColumns.length !== input.modelColumns.length) throw fail(`pairs ${input.junctionColumnsLabel} (${input.junctionColumns.length}) with ${input.modelColumnsLabel} (${input.modelColumns.length}) of differing length; they join positionally and must match.`);\n\tfor (const [index, junctionColumnName] of input.junctionColumns.entries()) {\n\t\tconst modelColumnRef = input.modelColumns[index];\n\t\tif (modelColumnRef === void 0) continue;\n\t\tconst junctionColumn = lookupStorageColumn(input.contract, input.junctionNamespaceId, input.junctionTable, junctionColumnName);\n\t\tif (junctionColumn === void 0) throw fail(`${input.junctionColumnsLabel} references column \"${junctionColumnName}\" absent from junction table \"${input.junctionNamespaceId}.${input.junctionTable}\".`);\n\t\tconst model = input.model;\n\t\tif (model === void 0) continue;\n\t\tlet modelColumnName = modelColumnRef;\n\t\tif (model.fieldToColumn !== void 0) {\n\t\t\tconst mapped = model.fieldToColumn[modelColumnRef];\n\t\t\tif (mapped === void 0) throw fail(`${input.modelColumnsLabel} references field \"${modelColumnRef}\" absent from model on table \"${model.namespaceId}.${model.table}\".`);\n\t\t\tmodelColumnName = mapped.column;\n\t\t}\n\t\tconst modelColumn = lookupStorageColumn(input.contract, model.namespaceId, model.table, modelColumnName);\n\t\tif (modelColumn === void 0) throw fail(`${input.modelColumnsLabel} references column \"${modelColumnName}\" absent from table \"${model.namespaceId}.${model.table}\".`);\n\t\tif (!sameStorageType(junctionColumn, modelColumn)) throw fail(`joins \"${input.junctionTable}.${junctionColumnName}\" (${describeColumnType(junctionColumn)}) with \"${model.table}.${modelColumnName}\" (${describeColumnType(modelColumn)}) of differing storage type; junction columns must match the type of the column they reference.`);\n\t}\n}\n/**\n* Validates that every N:M relation's `through` descriptor is consistent with\n* the storage columns it joins: both join sides match in column count,\n* reference columns that exist in their tables, and pair columns of the same\n* storage type. Without this, a `through` that disagrees with storage surfaces\n* as a silently wrong JOIN at query time rather than a validation error here.\n*/\nfunction validateRelationThroughConsistency(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations)) {\n\t\tif (relation.cardinality !== \"N:M\") continue;\n\t\tconst qualifiedName = `${namespaceId}.${modelName}.${relationName}`;\n\t\tconst { on, through } = relation;\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: on.localFields,\n\t\t\tmodelColumnsLabel: \"on.localFields\",\n\t\t\tmodel: {\n\t\t\t\tnamespaceId,\n\t\t\t\ttable: modelStorage.table,\n\t\t\t\tfieldToColumn: modelStorage.fields\n\t\t\t},\n\t\t\tjunctionColumns: through.parentColumns,\n\t\t\tjunctionColumnsLabel: \"through.parentColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t\tconst targetModel = relation.to.space === void 0 ? contract.domain.namespaces[relation.to.namespace]?.models[relation.to.model] : void 0;\n\t\tconst targetModelSide = targetModel === void 0 ? void 0 : {\n\t\t\tnamespaceId: relation.to.namespace,\n\t\t\ttable: blindCast(targetModel.storage).table\n\t\t};\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: through.targetColumns,\n\t\t\tmodelColumnsLabel: \"through.targetColumns\",\n\t\t\t...ifDefined(\"model\", targetModelSide),\n\t\t\tjunctionColumns: through.childColumns,\n\t\t\tjunctionColumnsLabel: \"through.childColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t}\n}\n//#endregion\nexport { CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, IndexSchema, ReferentialActionSchema, StorageTableSchema, StorageValueSetSchema, checkSqlDefaultText, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, reservedSqlDefaultText, resolveSqlToOneRelationStorage, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueObjectStorageTypeMissingMessage };\n\n//# sourceMappingURL=validators.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,sBAAsB;;AAE5B,SAAS,oBAAoB,MAAM;CAClC,OAAO,oBAAoB,KAAK,IAAI,IAAI,gGAAgG,KAAK;AAC9I;;;;AAIA,SAAS,uBAAuB,MAAM;CACrC,QAAQ,KAAK,KAAK,GAAlB;EACC,KAAK,SAAS,OAAO;EACrB,KAAK,mBAAmB,OAAO;EAC/B,SAAS;CACV;AACD;AAGA,SAAS,YAAY,MAAM,OAAO;CACjC,OAAO,KAAK,WAAW,MAAM,UAAU,KAAK,OAAO,QAAQ,UAAU,WAAW,MAAM,MAAM;AAC7F;;;;;AAKA,SAAS,+BAA+B,UAAU,cAAc,UAAU;CACzE,MAAM,QAAQ,UAAU,SAAS,QAAQ,WAAW,aAAa,YAAY,EAAE,QAAQ,QAAQ,aAAa,MAAM;CAClH,MAAM,UAAU,SAAS,GAAG,YAAY,KAAK,cAAc;EAC1D,MAAM,aAAa,aAAa,O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