@prisma/orm-family-sql 8.0.0-rc.16-dev.8 → 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.
- package/dist/{ast-Bf6J9_ra.d.mts → ast-Bmb-2vbO.d.mts} +3 -3
- package/dist/{ast-Bf6J9_ra.d.mts.map → ast-Bmb-2vbO.d.mts.map} +1 -1
- package/dist/{authoring-entity-types-CZ-vdwYS-Bq3LXsCn.d.mts → authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-Bq3LXsCn.d.mts.map → authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-0Iv2zdwS-CVl4womm.mjs → authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-CVl4womm.mjs.map → authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs.map} +1 -1
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +9 -9
- package/dist/builder__runtime.mjs +1 -1
- package/dist/builder__types.d.mts +2 -2
- package/dist/{codec-descriptor-registry-D7bl9ayf.mjs → codec-descriptor-registry-CdIIOkuE.mjs} +2 -2
- package/dist/{codec-descriptor-registry-D7bl9ayf.mjs.map → codec-descriptor-registry-CdIIOkuE.mjs.map} +1 -1
- package/dist/{config-types-DeIF6WyF.mjs → config-types-D0sxpKAN.mjs} +2 -2
- package/dist/{config-types-DeIF6WyF.mjs.map → config-types-D0sxpKAN.mjs.map} +1 -1
- package/dist/{config-types-Cag6qJnA.d.mts → config-types-DB6gRJ5K.d.mts} +4 -4
- package/dist/{config-types-Cag6qJnA.d.mts.map → config-types-DB6gRJ5K.d.mts.map} +1 -1
- package/dist/{contract-builder-BaJMQFAc.d.mts → contract-builder-V5pFHDv3.d.mts} +14 -11
- package/dist/contract-builder-V5pFHDv3.d.mts.map +1 -0
- package/dist/{contract-builder-BlFrYr97.mjs → contract-builder-tEax3I2q.mjs} +4 -4
- package/dist/{contract-builder-BlFrYr97.mjs.map → contract-builder-tEax3I2q.mjs.map} +1 -1
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-prisma7__provider.d.mts +2 -2
- package/dist/contract-prisma7__provider.mjs +36 -8
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +3 -3
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +4 -4
- package/dist/contract-psl__attribute-specs.d.mts.map +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.d.mts +2 -2
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +3 -3
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/{contract-view-Cd6_tdxU.d.mts → contract-view-C1xX3yIj.d.mts} +2 -2
- package/dist/{contract-view-Cd6_tdxU.d.mts.map → contract-view-C1xX3yIj.d.mts.map} +1 -1
- package/dist/contract.d.mts +14 -14
- package/dist/contract.mjs +9 -8
- package/dist/contract__contract-view.d.mts +1 -1
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +2 -2
- package/dist/contract__foreign-key-materialization.mjs +3 -2
- package/dist/contract__index-type-validation.d.mts +1 -1
- package/dist/contract__referential-action-sql.d.mts +1 -1
- package/dist/contract__resolve-storage-table.d.mts +1 -1
- package/dist/contract__types.d.mts +6 -6
- package/dist/contract__types.mjs +3 -3
- package/dist/contract__validators.d.mts +1 -1
- package/dist/contract__validators.mjs +2 -2
- package/dist/{control-BkyDhucB.d.mts → control-B3Mb21Md.d.mts} +16 -16
- package/dist/{control-BkyDhucB.d.mts.map → control-B3Mb21Md.d.mts.map} +1 -1
- package/dist/{control-BRbds4vn.mjs → control-C5Yy0n3w.mjs} +10 -10
- package/dist/{control-BRbds4vn.mjs.map → control-C5Yy0n3w.mjs.map} +1 -1
- package/dist/control-adapter-BXQ29_fa.d.mts +1 -0
- package/dist/{control-adapter-CkFfBVei-Ba9JNrCN.d.mts → control-adapter-CkFfBVei-BLYeKcLW.d.mts} +6 -6
- package/dist/{control-adapter-CkFfBVei-Ba9JNrCN.d.mts.map → control-adapter-CkFfBVei-BLYeKcLW.d.mts.map} +1 -1
- package/dist/{db-D7R5zKiH-SEM04lcK.d.mts → db-D7R5zKiH-P7Tg4ZXk.d.mts} +9 -9
- package/dist/{db-D7R5zKiH-SEM04lcK.d.mts.map → db-D7R5zKiH-P7Tg4ZXk.d.mts.map} +1 -1
- package/dist/{ddl-types-DtKZjNtN-6TxFf4bH.d.mts → ddl-types-DtKZjNtN-CByECwns.d.mts} +4 -4
- package/dist/{ddl-types-DtKZjNtN-6TxFf4bH.d.mts.map → ddl-types-DtKZjNtN-CByECwns.d.mts.map} +1 -1
- package/dist/{derived-checks-DdguQPYm-BP57ljP8.mjs → derived-checks-D5zdlyyh-CPofdm1W.mjs} +30 -20
- package/dist/{derived-checks-DdguQPYm-BP57ljP8.mjs.map → derived-checks-D5zdlyyh-CPofdm1W.mjs.map} +1 -1
- package/dist/{derived-checks-DpPkO6Dt-BituyKFg.d.mts → derived-checks-DpPkO6Dt-D3M7YEr2.d.mts} +3 -3
- package/dist/{derived-checks-DpPkO6Dt-BituyKFg.d.mts.map → derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map} +1 -1
- package/dist/{diff-DMOqiT2h.d.mts → diff-CBqsNkxe.d.mts} +6 -6
- package/dist/{diff-DMOqiT2h.d.mts.map → diff-CBqsNkxe.d.mts.map} +1 -1
- package/dist/{dist-7hmkNQGd.mjs → dist-Dm_hQ-hh.mjs} +2 -2
- package/dist/{dist-7hmkNQGd.mjs.map → dist-Dm_hQ-hh.mjs.map} +1 -1
- package/dist/{entity-kinds-DCwkg9t7.d.mts → entity-kinds--HvqT50S.d.mts} +2 -2
- package/dist/{entity-kinds-DCwkg9t7.d.mts.map → entity-kinds--HvqT50S.d.mts.map} +1 -1
- package/dist/{entity-kinds-JlqzyFoo-kIaAUFyK.mjs → entity-kinds-O3V1K26U-B8TUrsX2.mjs} +16 -5
- package/dist/entity-kinds-O3V1K26U-B8TUrsX2.mjs.map +1 -0
- package/dist/{expression-B-QXMOmY.d.mts → expression-DE893va7.d.mts} +7 -7
- package/dist/{expression-B-QXMOmY.d.mts.map → expression-DE893va7.d.mts.map} +1 -1
- package/dist/{factories-BsUyFxsk.mjs → factories-Bp41Aity.mjs} +4 -3
- package/dist/factories-Bp41Aity.mjs.map +1 -0
- package/dist/{factories-CgVRbL8l.d.mts → factories-DzLBAAvj.d.mts} +4 -4
- package/dist/{factories-CgVRbL8l.d.mts.map → factories-DzLBAAvj.d.mts.map} +1 -1
- package/dist/family.d.mts +13 -13
- package/dist/family.mjs +6 -6
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +4 -4
- package/dist/family__control.mjs +3 -3
- package/dist/family__diff.d.mts +2 -2
- package/dist/family__diff.mjs +1 -1
- package/dist/family__ir.d.mts +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/family__runtime.d.mts +2 -2
- package/dist/foreign-key-materialization-Cv3q8Pix.mjs +278 -0
- package/dist/foreign-key-materialization-Cv3q8Pix.mjs.map +1 -0
- package/dist/foreign-key-materialization-D0Ltg78T.d.mts +96 -0
- package/dist/foreign-key-materialization-D0Ltg78T.d.mts.map +1 -0
- package/dist/{foreign-key-C-iTPuRT-C9ip8zFx.d.mts → foreign-key-qkDFfG8t-Fyrzd0VI.d.mts} +20 -4
- package/dist/foreign-key-qkDFfG8t-Fyrzd0VI.d.mts.map +1 -0
- package/dist/{index-qOLTnfYz.d.mts → index-CnpTmyXs.d.mts} +3 -3
- package/dist/{index-qOLTnfYz.d.mts.map → index-CnpTmyXs.d.mts.map} +1 -1
- package/dist/index-equivalence-DswCiq5l-C7wLMPwF.mjs +109 -0
- package/dist/index-equivalence-DswCiq5l-C7wLMPwF.mjs.map +1 -0
- package/dist/{index-DYjWQAcJ.d.mts → index-oNRBExeI.d.mts} +11 -11
- package/dist/{index-DYjWQAcJ.d.mts.map → index-oNRBExeI.d.mts.map} +1 -1
- package/dist/{index-type-validation-BHppm9U-.d.mts → index-type-validation-B925ye4q.d.mts} +3 -3
- package/dist/{index-type-validation-BHppm9U-.d.mts.map → index-type-validation-B925ye4q.d.mts.map} +1 -1
- package/dist/{interpreter-BF5Xrf3W-bdklH78q.mjs → interpreter-DlG-2o64-DmykcFbp.mjs} +64 -17
- package/dist/interpreter-DlG-2o64-DmykcFbp.mjs.map +1 -0
- package/dist/{ir-BYHqe2mj.d.mts → ir-BPrf_vgX.d.mts} +3 -3
- package/dist/{ir-BYHqe2mj.d.mts.map → ir-BPrf_vgX.d.mts.map} +1 -1
- package/dist/middleware-DwaZ6s12.d.mts +1 -0
- package/dist/{middleware-mLwvcOLS-6Y52seRP.d.mts → middleware-mLwvcOLS-SaqhgsmA.d.mts} +2 -2
- package/dist/{middleware-mLwvcOLS-6Y52seRP.d.mts.map → middleware-mLwvcOLS-SaqhgsmA.d.mts.map} +1 -1
- package/dist/{migration-C5HGygKM.d.mts → migration-C_J49WKy.d.mts} +4 -4
- package/dist/{migration-C5HGygKM.d.mts.map → migration-C_J49WKy.d.mts.map} +1 -1
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +15 -15
- package/dist/orm-client.mjs +1 -1
- package/dist/{pack-l0vLQrO8.d.mts → pack-DZtuLikU.d.mts} +3 -3
- package/dist/{pack-l0vLQrO8.d.mts.map → pack-DZtuLikU.d.mts.map} +1 -1
- package/dist/plan-Dhl03MtT.d.mts +2 -0
- package/dist/{plan-cGEaSXHv-2F5y-Dpy.d.mts → plan-cGEaSXHv-BeW-cC5v.d.mts} +4 -4
- package/dist/{plan-cGEaSXHv-2F5y-Dpy.d.mts.map → plan-cGEaSXHv-BeW-cC5v.d.mts.map} +1 -1
- package/dist/{prepared-statement-YtgdlN7e-DBJtJAm7.d.mts → prepared-statement-YtgdlN7e-CI1fD5IM.d.mts} +16 -16
- package/dist/{prepared-statement-YtgdlN7e-DBJtJAm7.d.mts.map → prepared-statement-YtgdlN7e-CI1fD5IM.d.mts.map} +1 -1
- package/dist/{psl-build-Di-cBOCv.mjs → psl-build-B5iMVWHu.mjs} +2 -2
- package/dist/{psl-build-Di-cBOCv.mjs.map → psl-build-B5iMVWHu.mjs.map} +1 -1
- package/dist/{psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts → psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts} +2 -2
- package/dist/{psl-column-resolution-CNtNJ7g7-CR_auHUV.d.mts.map → psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts.map} +1 -1
- package/dist/{psl-field-resolution-DUCrDnuq-DSxPrd-4.mjs → psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs} +6 -6
- package/dist/psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs.map +1 -0
- package/dist/{psl-infer-fU7LRjTx.mjs → psl-infer-B0yuv-j_.mjs} +22 -16
- package/dist/psl-infer-B0yuv-j_.mjs.map +1 -0
- package/dist/{psl-infer-Cm7eDSA-.d.mts → psl-infer-DkPZJnUM.d.mts} +11 -12
- package/dist/{psl-infer-Cm7eDSA-.d.mts.map → psl-infer-DkPZJnUM.d.mts.map} +1 -1
- package/dist/query-lane-context-BaoHpLsE.d.mts +1 -0
- package/dist/{query-lane-context-CJoNBspB-Ylhia3fC.d.mts → query-lane-context-CJoNBspB-CR_n8DNB.d.mts} +5 -5
- package/dist/{query-lane-context-CJoNBspB-Ylhia3fC.d.mts.map → query-lane-context-CJoNBspB-CR_n8DNB.d.mts.map} +1 -1
- package/dist/{referential-action-sql-DJ9ps6-S.d.mts → referential-action-sql-Cw1Q0YSd.d.mts} +2 -2
- package/dist/referential-action-sql-Cw1Q0YSd.d.mts.map +1 -0
- package/dist/relational-core.d.mts +11 -11
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__ast.d.mts +3 -3
- package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__contract-free.d.mts +4 -4
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__plan.d.mts +3 -3
- package/dist/relational-core__query-lane-context.d.mts +2 -2
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{resolve-storage-table-Ba33K41A.d.mts → resolve-storage-table-B7m9cFy4.d.mts} +3 -3
- package/dist/{resolve-storage-table-Ba33K41A.d.mts.map → resolve-storage-table-B7m9cFy4.d.mts.map} +1 -1
- package/dist/{runtime-BUemUdMk.d.mts → runtime-Ca7PVQcJ.d.mts} +2 -2
- package/dist/{runtime-BUemUdMk.d.mts.map → runtime-Ca7PVQcJ.d.mts.map} +1 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +2 -2
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-CqWOkoW9--uxNOini.d.mts → schema-differ-CqWOkoW9-BABSAGGB.d.mts} +3 -3
- package/dist/{schema-differ-CqWOkoW9--uxNOini.d.mts.map → schema-differ-CqWOkoW9-BABSAGGB.d.mts.map} +1 -1
- package/dist/{schema-verify-DIfHSB4I-CjYnmUuD.mjs → schema-verify-DIfHSB4I-Dx3Tq9hf.mjs} +2 -2
- package/dist/{schema-verify-DIfHSB4I-CjYnmUuD.mjs.map → schema-verify-DIfHSB4I-Dx3Tq9hf.mjs.map} +1 -1
- package/dist/{serialized-index-QAYy0fjm-zxvK3RBa.mjs → serialized-index-C26m_DWu-CnNi8WAI.mjs} +3 -3
- package/dist/{serialized-index-QAYy0fjm-zxvK3RBa.mjs.map → serialized-index-C26m_DWu-CnNi8WAI.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-DDaAVCQr-CLDkZLXO.mjs → sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs} +4 -4
- package/dist/{sql-contract-serializer-DDaAVCQr-CLDkZLXO.mjs.map → sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs.map} +1 -1
- package/dist/{sql-execution-plan-C7XauPPu-BMi8hJlv.d.mts → sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts} +2 -2
- package/dist/{sql-execution-plan-C7XauPPu-BMi8hJlv.d.mts.map → sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts.map} +1 -1
- package/dist/{sql-storage-DSnnRQAf-DaHPnley.d.mts → sql-storage-BTlJLUID-O6fBB_am.d.mts} +3 -3
- package/dist/{sql-storage-DSnnRQAf-DaHPnley.d.mts.map → sql-storage-BTlJLUID-O6fBB_am.d.mts.map} +1 -1
- package/dist/{storage-table-CyL4CNMi-ByGZXmzd.mjs → storage-table-B7OSPl3G-EOodFPzq.mjs} +5 -3
- package/dist/storage-table-B7OSPl3G-EOodFPzq.mjs.map +1 -0
- package/dist/{storage-table-BBcKoAuF-CssyCQhM.d.mts → storage-table-WXeVNycx-tlFMnbig.d.mts} +3 -3
- package/dist/{storage-table-BBcKoAuF-CssyCQhM.d.mts.map → storage-table-WXeVNycx-tlFMnbig.d.mts.map} +1 -1
- package/dist/{types-BJQcLx-8-DSnaugR4.d.mts → types-BJQcLx-8-DY221fiX.d.mts} +10 -10
- package/dist/{types-BJQcLx-8-DSnaugR4.d.mts.map → types-BJQcLx-8-DY221fiX.d.mts.map} +1 -1
- package/dist/{types-DkOYK86-.d.mts → types-BURWzacK.d.mts} +5 -5
- package/dist/{types-DkOYK86-.d.mts.map → types-BURWzacK.d.mts.map} +1 -1
- package/dist/{types-DDHgx581.mjs → types-C7oOtFcJ.mjs} +2 -2
- package/dist/{types-DDHgx581.mjs.map → types-C7oOtFcJ.mjs.map} +1 -1
- package/dist/{types-CzxOObSY-CNWyrf87.d.mts → types-CzxOObSY-DEfjmbj1.d.mts} +7 -7
- package/dist/{types-CzxOObSY-CNWyrf87.d.mts.map → types-CzxOObSY-DEfjmbj1.d.mts.map} +1 -1
- package/dist/{types-DV040Uuq-Bu8CnbMa.d.mts → types-DFZhLz18-C_h0u-Zx.d.mts} +8 -7
- package/dist/types-DFZhLz18-C_h0u-Zx.d.mts.map +1 -0
- package/dist/types-DLjT0ADz.d.mts +1 -0
- package/dist/{types-Sh5HuaZE-C8I29pGQ.d.mts → types-Sh5HuaZE-B_FQUPng.d.mts} +2 -2
- package/dist/{types-Sh5HuaZE-C8I29pGQ.d.mts.map → types-Sh5HuaZE-B_FQUPng.d.mts.map} +1 -1
- package/dist/{validators-BAa0JKuB.d.mts → validators-Cr_FFJAG.d.mts} +5 -4
- package/dist/{validators-BAa0JKuB.d.mts.map → validators-Cr_FFJAG.d.mts.map} +1 -1
- package/dist/{validators-Xx-TKcx3.mjs → validators-oyDG5mVX.mjs} +22 -2
- package/dist/validators-oyDG5mVX.mjs.map +1 -0
- package/package.json +18 -18
- package/dist/contract-builder-BaJMQFAc.d.mts.map +0 -1
- package/dist/control-adapter-CD_gz6TI.d.mts +0 -1
- package/dist/entity-kinds-JlqzyFoo-kIaAUFyK.mjs.map +0 -1
- package/dist/factories-BsUyFxsk.mjs.map +0 -1
- package/dist/foreign-key-C-iTPuRT-C9ip8zFx.d.mts.map +0 -1
- package/dist/foreign-key-materialization-IGfTKmHV.mjs +0 -73
- package/dist/foreign-key-materialization-IGfTKmHV.mjs.map +0 -1
- package/dist/foreign-key-materialization-U4M9cqKd.d.mts +0 -65
- package/dist/foreign-key-materialization-U4M9cqKd.d.mts.map +0 -1
- package/dist/interpreter-BF5Xrf3W-bdklH78q.mjs.map +0 -1
- package/dist/middleware-BFoORv3y.d.mts +0 -1
- package/dist/plan-CmfWjqtI.d.mts +0 -2
- package/dist/psl-field-resolution-DUCrDnuq-DSxPrd-4.mjs.map +0 -1
- package/dist/psl-infer-fU7LRjTx.mjs.map +0 -1
- package/dist/query-lane-context-qK5s2okl.d.mts +0 -1
- package/dist/referential-action-sql-DJ9ps6-S.d.mts.map +0 -1
- package/dist/storage-table-CyL4CNMi-ByGZXmzd.mjs.map +0 -1
- package/dist/types-14L6c26e.d.mts +0 -1
- package/dist/types-DV040Uuq-Bu8CnbMa.d.mts.map +0 -1
- package/dist/validators-Xx-TKcx3.mjs.map +0 -1
package/dist/{derived-checks-DdguQPYm-BP57ljP8.mjs.map → derived-checks-D5zdlyyh-CPofdm1W.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derived-checks-DdguQPYm-BP57ljP8.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DdguQPYm.mjs"],"sourcesContent":["import { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { flushAuthoringWarnings, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { CheckConstraint, Index, SqlStorage, StorageTable, applyFkDefaults, checkConstraintInputFromSerialized, isMaterializedSqlNamespace, resolvedTypeParams, toStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, coreHash, crossRef, effectiveControlPolicy } from \"@internal/contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { codecForRef, enumRefusalOf } from \"@internal/framework-components/codec\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { lowerAuthoredCheck } from \"@internal/sql-contract/authored-check-naming\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { dataTypeParams, sqlDataTypeOfCodec, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { tableEntityKind, valueSetEntityKind } from \"@internal/sql-contract/entity-kinds\";\nimport { materializeForeignKeysAndIndexes } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { lowerAuthoredIndex } from \"@internal/sql-contract/index-naming\";\nimport { validateIndexTypes } from \"@internal/sql-contract/index-type-validation\";\nimport { createIndexTypeRegistry } from \"@internal/sql-contract/index-types\";\nimport { validateStorageSemantics } from \"@internal/sql-contract/validators\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\nimport { composeCheckWirePrefix, computeCheckContentHash, derivedCheckPrefixes } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/contract-definition.ts\n/**\n* Whether a field is stored in a list column. A list of scalars is; a list of value objects is not, because it is stored in one column whose value is the whole list, as one JSON array.\n*/\nfunction storedAsListColumn(field) {\n\treturn field.list && !field.typedByValueObject;\n}\n/** Whether a field or member is typed by a value object. */\nfunction isValueObjectMember(field) {\n\treturn \"valueObjectName\" in field;\n}\n//#endregion\n//#region src/to-one-nullability-message.ts\nfunction toOneNullabilityContradictionMessage(location, contradiction) {\n\treturn contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`;\n}\n//#endregion\n//#region src/build-contract.ts\n/**\n* The codec that encodes one column's default, built with the column's own `typeParams`, because a parameterized codec checks its params when it encodes and reads a default. Only a column has params; every other encode site takes the representative instance.\n*/\nfunction columnCodec(codecId, typeParams, codecLookup) {\n\treturn codecForRef(codecLookup, {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t});\n}\n/** Encodes a value the contract stores, and reads it back with the codec, which refuses a value its column would not hold. */\nfunction encodeViaCodec(value, codec) {\n\tif (codec) {\n\t\tconst json = codec.encodeJson(value);\n\t\tcodec.decodeJson(json);\n\t\treturn json;\n\t}\n\treturn blindCast(value);\n}\nfunction defaultRefusal(site, cause, elementPosition) {\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a ${subject} that its codec refuses: ${reason}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"codec-refused-default\",\n\t\t\t...ifDefined(\"elementPosition\", elementPosition)\n\t\t}\n\t});\n}\nfunction encodeDefaultValue(value, codec, site, elementPosition) {\n\ttry {\n\t\treturn encodeViaCodec(value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tthrow defaultRefusal(site, cause, elementPosition);\n\t}\n}\nfunction codecForDefault(codecLookup, resolveCodec, site) {\n\tconst codec = buildCodecForDefault(codecLookup, resolveCodec, site);\n\tif (codec === void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a default, but no pack in the contract declares its codec \"${site.codecId}\", so the default cannot be checked. List the pack that owns the codec in \\`extensions\\`.`, { meta: {\n\t\tmodelName: site.modelName,\n\t\tfieldName: site.fieldName,\n\t\tcodecId: site.codecId,\n\t\treason: \"codec-not-found\"\n\t} });\n\treturn codec;\n}\nfunction buildCodecForDefault(codecLookup, resolveCodec, site) {\n\ttry {\n\t\treturn resolveCodec(codecLookup);\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"RUNTIME.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its codec does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName,\n\t\t\t\tcodecId: site.codecId,\n\t\t\t\treason: \"type-params-invalid\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction encodeColumnDefault(defaultInput, codecLookup, resolveCodec, site, many = false, elementNullable = false) {\n\tif (defaultInput.kind === \"function\") return {\n\t\tkind: \"function\",\n\t\texpression: defaultInput.expression\n\t};\n\tif (\"canonical\" in defaultInput && defaultInput.canonical === true) return {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(defaultInput.value)\n\t};\n\tif (many) {\n\t\tif (!Array.isArray(defaultInput.value)) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" is a list field, so its default is an array; received ${typeof defaultInput.value}. Call .many() before .default().`, { meta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"list-default-not-array\"\n\t\t} });\n\t\tconst codec = codecForDefault(codecLookup, resolveCodec, site);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: defaultInput.value.map((element, index) => {\n\t\t\t\tif (element !== null) return encodeDefaultValue(element, codec, site, index + 1);\n\t\t\t\tif (elementNullable) return null;\n\t\t\t\tthrow new InternalError(\"Literal default on a strict list column cannot contain null elements.\");\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: encodeDefaultValue(defaultInput.value, codecForDefault(codecLookup, resolveCodec, site), site)\n\t};\n}\nfunction assertStorageSemantics(definition, contract) {\n\tconst semanticErrors = validateStorageSemantics(contract.storage);\n\tif (semanticErrors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, { meta: { errors: semanticErrors } });\n\tconst indexTypeRegistry = createIndexTypeRegistry();\n\tconst packsToRegister = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const pack of packsToRegister) {\n\t\tconst registration = pack.indexTypes;\n\t\tif (registration === void 0) continue;\n\t\tif (typeof registration !== \"object\" || registration === null || !(\"entries\" in registration) || !Array.isArray(registration.entries)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack \"${pack.id ?? \"<unknown>\"}\" declares \"indexTypes\" but its value is not an IndexTypeRegistration (expected an object with an \"entries\" array; got ${typeof registration}).`, { meta: {\n\t\t\tpackId: pack.id,\n\t\t\tcontribution: \"indexTypes\",\n\t\t\treason: \"invalid-shape\"\n\t\t} });\n\t\tfor (const entry of blindCast(registration).entries) indexTypeRegistry.register(entry);\n\t}\n\tvalidateIndexTypes(contract, indexTypeRegistry);\n}\nfunction assertKnownTargetModel(modelsByName, modelsByCoordinate, sourceModelName, targetModelName, targetNamespaceId, context) {\n\tconst targetModel = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? modelsByCoordinate.get(`${targetNamespaceId}:${targetModelName}`) : modelsByName.get(targetModelName);\n\tif (!targetModel) {\n\t\tconst qualified = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? `${targetNamespaceId}.${targetModelName}` : targetModelName;\n\t\tthrow contractError(\"CONTRACT.MODEL_UNKNOWN\", `${context} on model \"${sourceModelName}\" references unknown model \"${qualified}\"`, { meta: {\n\t\t\tsourceModel: sourceModelName,\n\t\t\ttargetModel: qualified,\n\t\t\tcontext\n\t\t} });\n\t}\n\treturn targetModel;\n}\nfunction assertTargetTableMatches(sourceModelName, targetModel, referencedTableName, context) {\n\tif (targetModel.tableName !== referencedTableName) throw contractError(\"CONTRACT.TABLE_MISMATCH\", `${context} on model \"${sourceModelName}\" references table \"${referencedTableName}\" but model \"${targetModel.modelName}\" maps to \"${targetModel.tableName}\"`, { meta: {\n\t\tsourceModel: sourceModelName,\n\t\treferencedTable: referencedTableName,\n\t\tmappedTable: targetModel.tableName,\n\t\tcontext\n\t} });\n}\n/**\n* Resolves a deferred entity-ref column descriptor (e.g. a `pg.enum(handle)`\n* column) against the field's now-known owning namespace: attaches the\n* storage `valueSet` ref the collected entity's derived value-set is stored\n* under. `typeParams.typeName` stays bare here — schema\n* qualification (e.g. `auth.aal_level`) is a target concern applied in the\n* next step, `qualifyColumnDescriptor`. A descriptor with no `entityRef` (the\n* ordinary case) passes through unchanged.\n*/\nfunction resolveEntityRefDescriptor(descriptor, namespaceId) {\n\tconst entityRef = descriptor.entityRef;\n\tif (entityRef === void 0) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\tvalueSet: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: entityRef.entityName\n\t\t}\n\t};\n}\n/**\n* Structural check for a target that contributes a `qualifyColumnType` hook\n* on its authoring contributions. Duck-typed (mirroring\n* `contract-psl`'s `hasColumnFromEntityHook`) so the SQL family stays blind\n* to the target's qualification logic and no framework/family interface has\n* to name the hook.\n*/\nfunction hasColumnTypeQualifier(authoring) {\n\treturn \"qualifyColumnType\" in authoring && typeof authoring.qualifyColumnType === \"function\";\n}\n/**\n* Structural check for a target that contributes a `renderCheckExpressions`\n* hook, duck-typed for the same reason {@link hasColumnTypeQualifier} is: the\n* SQL family stays blind to the target's predicate syntax.\n*/\nfunction hasCheckExpressionRenderer(authoring) {\n\treturn \"renderCheckExpressions\" in authoring && typeof authoring.renderCheckExpressions === \"function\";\n}\nfunction resolveCheckExpressionRenderer(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasCheckExpressionRenderer(authoring) ? authoring.renderCheckExpressions : void 0;\n}\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* Refuses a member whose codec reads its stored value back as a different value from the one written.\n* The contract's types name the member as written, while the runtime reads the stored value, so the\n* two must be the same value. A member with no literal type has nothing to contradict. The caller\n* has already read the stored value back once, so the codec takes it.\n*/\nfunction assertStoredAsWritten(enumName, member, stored, codec) {\n\tif (!hasLiteralType(member.value)) return;\n\tconst readBack = codec.decodeJson(stored);\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return;\n\tconst writeAs = hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored);\n\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${enumName}\"): member \"${member.name}\" is written ${canonicalStringify(member.value)}, but the column stores ${JSON.stringify(stored)}. Write the member as ${writeAs}.`, { meta: {\n\t\tenumName,\n\t\tmember: member.name,\n\t\treason: \"member-not-stored-as-written\"\n\t} });\n}\n/** A member's value in the form the enum's codec stores it. A member the codec refuses is a `CONTRACT.ENUM_INVALID` naming the enum and the member. */\nfunction encodeEnumMember(handle, member, codec) {\n\ttry {\n\t\treturn encodeViaCodec(member.value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\") member \"${member.name}\" has a value its codec ${handle.codecId} refuses: ${reason}`, {\n\t\t\tfix: \"Give the member a value the codec takes, or type the enum with a codec that takes it.\",\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tenumName: handle.enumName,\n\t\t\t\tmember: member.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\treason: \"codec-refused-member\"\n\t\t\t}\n\t\t});\n\t}\n}\n/**\n* Each member's value in the form the enum's codec stores it, read back by the codec. A codec an\n* enum cannot use, a member the codec refuses, a member written differently from how it is stored,\n* and two members that store the same value are each a `CONTRACT.ENUM_INVALID`.\n*/\nfunction encodeEnumMembers(handle, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(handle.codecId);\n\tconst enumRefusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (enumRefusal !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): an enum cannot use the codec ${handle.codecId}. ${enumRefusal}`, {\n\t\tfix: \"Type the enum with another codec.\",\n\t\tmeta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tcodecId: handle.codecId,\n\t\t\treason: \"codec-not-for-enums\"\n\t\t}\n\t});\n\tconst codec = codecLookup.get(handle.codecId);\n\tconst memberByStoredValue = /* @__PURE__ */ new Map();\n\treturn handle.enumMembers.map((member) => {\n\t\tconst value = encodeEnumMember(handle, member, codec);\n\t\tif (codec !== void 0) assertStoredAsWritten(handle.enumName, member, value, codec);\n\t\tconst key = canonicalStringify(value);\n\t\tconst earlier = memberByStoredValue.get(key);\n\t\tif (earlier !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): members \"${earlier}\" and \"${member.name}\" both store ${JSON.stringify(value)}. Member values must be unique as the column stores them.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tmembers: [earlier, member.name],\n\t\t\treason: \"duplicate-member-value\"\n\t\t} });\n\t\tmemberByStoredValue.set(key, member.name);\n\t\treturn {\n\t\t\tname: member.name,\n\t\t\tvalue\n\t\t};\n\t});\n}\n/**\n* The member values a membership check must enforce, encoded exactly as the\n* column stores them. Membership predicates support strings and finite numbers.\n*/\nfunction checkMemberValues(handle, codecLookup) {\n\tconst encoded = encodeEnumMembers(handle, codecLookup).map((member) => member.value);\n\tconst values = [];\n\tfor (const value of encoded) {\n\t\tif (typeof value !== \"string\" && !(typeof value === \"number\" && Number.isFinite(value))) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): CHECK constraint members must encode to strings or finite numbers.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\treason: \"unsupported-member-value\"\n\t\t} });\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\n/**\n* Resolves a field's authored `noCheck` kinds against its column shape:\n* the bare form (`[]`) becomes every kind the shape derives, and a named\n* kind that can never apply to the shape is an authoring error\n* (`CONTRACT.CHECK_OPTOUT_INVALID`). Returns the concrete kinds in\n* canonical ascending order — the only form the contract persists.\n*/\nfunction resolveNoCheckKinds(input) {\n\tconst derivable = [];\n\tif (input.many && !input.elementNullable) derivable.push(\"elementNotNull\");\n\tif (input.isDomainEnum) derivable.push(\"membership\");\n\tconst subject = `Field \"${input.modelName}.${input.fieldName}\"`;\n\tconst meta = {\n\t\tmodelName: input.modelName,\n\t\tfieldName: input.fieldName\n\t};\n\tif (input.kinds.length === 0) {\n\t\tif (derivable.length === 0) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck() waives nothing — this column's shape derives no generated checks.`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"no-derivable-checks\"\n\t\t} });\n\t\treturn derivable;\n\t}\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const kind of input.kinds) {\n\t\tif (seen.has(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") names the same kind twice.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"duplicate-kind\"\n\t\t} });\n\t\tseen.add(kind);\n\t\tif (!derivable.includes(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") does not apply — ${kind === \"membership\" ? \"membership checks are derived only from enumType() value sets\" : \"element-non-null checks are derived only for lists whose elements are semantically non-null\"}.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"inapplicable-kind\"\n\t\t} });\n\t}\n\treturn [...input.kinds].sort();\n}\n/**\n* Names the target's rendered checks and lowers them into contract entities.\n*\n* Naming is composed family-side ({@link composeCheckWirePrefix}) rather than\n* by the target, and suffixed with the predicate's content hash. Composing\n* family-side is what makes the truncation safe — two prefixes that truncate\n* alike still differ in their hashes, and the family can see that the\n* (table, column, kind) triple they were built from is unique per table,\n* rather than having to assume something about SQL text it declares itself\n* unable to read.\n*/\nfunction lowerRenderedChecks(tableName, candidates) {\n\treturn candidates.map((candidate) => new CheckConstraint({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: composeCheckWirePrefix(tableName, candidate.columnName, candidate.kind),\n\t\t\thash: computeCheckContentHash(candidate.expression)\n\t\t},\n\t\texpression: candidate.expression\n\t}));\n}\nfunction resolveColumnTypeQualifier(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasColumnTypeQualifier(authoring) ? authoring.qualifyColumnType : void 0;\n}\n/**\n* Applies the target's `qualifyColumnType` hook to a scalar column descriptor.\n* A descriptor whose codec the target leaves unchanged passes through untouched.\n*/\nfunction qualifyColumnDescriptor(descriptor, namespaceId, qualify) {\n\tif (qualify === void 0) return descriptor;\n\tconst qualified = qualify({\n\t\tcodecId: descriptor.codecId,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams)\n\t}, namespaceId);\n\tif (qualified.typeParams === descriptor.typeParams) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\t...ifDefined(\"typeParams\", qualified.typeParams)\n\t};\n}\n/**\n* Records a deferred column's entity-ref into the namespace-scoped collection\n* accumulator (`namespaceId → entityKind → entityName`) — folded into the same\n* namespace assembly `deriveEntityValueSets`/`entries.<kind>` step as the\n* entities-channel attachments, so a column-collected entity gets its\n* value-set the same way an entities-channel one does.\n*\n* The same handle reused by many columns in one namespace is normal (a native\n* enum type backs any number of columns) and records the identical entity once.\n* Two *different* entity instances sharing a name+kind in one namespace is a\n* name collision — the emitted `entries.valueSet.<name>` could only reflect one\n* of them, silently mismatching the other column's type/cast. PSL hard-errors\n* on the equivalent (`PSL_DUPLICATE_DECLARATION`); the TS path rejects it too.\n*/\nfunction collectEntityFromColumn(collected, namespaceId, entityRef) {\n\tconst forNs = collected[namespaceId] ?? {};\n\tconst forKind = forNs[entityRef.entityKind] ?? {};\n\tconst existing = forKind[entityRef.entityName];\n\tif (existing !== void 0 && existing !== entityRef.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${entityRef.entityKind}\" entities named \"${entityRef.entityName}\" in namespace \"${namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\tkind: entityRef.entityKind,\n\t\tname: entityRef.entityName,\n\t\tnamespaceId\n\t} });\n\tforKind[entityRef.entityName] = entityRef.entity;\n\tforNs[entityRef.entityKind] = forKind;\n\tcollected[namespaceId] = forNs;\n}\n/**\n* Merges a namespace's entities-channel attachments (lowered from the\n* `entities` handle list, carried on `ContractDefinition.attachedEntities`)\n* with the entities collected from that namespace's deferred entity-ref\n* columns. A column-collected entity that shadows a *different* attached\n* entity of the same kind+name (or vice-versa) is the same name-collision bug\n* `collectEntityFromColumn` guards against across columns, so it is rejected\n* the same way — by entity identity, so the same handle attached and used by\n* a column does not throw.\n*/\nfunction mergeColumnAndAttachedEntities(namespaceId, attached, columnCollected) {\n\tif (attached === void 0) return columnCollected;\n\tif (columnCollected === void 0) return attached;\n\tconst kinds = /* @__PURE__ */ new Set([...Object.keys(attached), ...Object.keys(columnCollected)]);\n\tconst result = {};\n\tfor (const kind of kinds) {\n\t\tconst attachedForKind = attached[kind];\n\t\tconst columnForKind = columnCollected[kind];\n\t\tfor (const [name, entity] of Object.entries(columnForKind ?? {})) {\n\t\t\tconst existing = attachedForKind?.[name];\n\t\t\tif (existing !== void 0 && existing !== entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${kind}\" entities named \"${name}\" in namespace \"${namespaceId}\" — a column-referenced entity conflicts with an attached one; pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t}\n\t\tresult[kind] = {\n\t\t\t...attachedForKind,\n\t\t\t...columnForKind\n\t\t};\n\t}\n\treturn result;\n}\nfunction resolveModelNamespaceId(model, modelNameToNamespaceId, defaultNamespaceId) {\n\tif (model.namespaceId !== void 0 && model.namespaceId.length > 0) return model.namespaceId;\n\treturn modelNameToNamespaceId.get(model.modelName) ?? defaultNamespaceId;\n}\nfunction toOneRelationNullable(semanticModel, relation) {\n\tconst location = `Relation \"${semanticModel.modelName}.${relation.fieldName}\"`;\n\tif (relation.nullable === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} with cardinality \"${relation.cardinality}\" must state whether it is nullable`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-missing\"\n\t} });\n\tconst localColumns = relation.on.parentColumns;\n\tconst { contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: semanticModel.fields.filter((field) => localColumns.includes(field.columnName)).map((field) => field.nullable),\n\t\townsReference: relation.cardinality === \"N:1\"\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", relation.cardinality === \"N:1\" ? toOneNullabilityContradictionMessage(location, contradiction) : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn relation.nullable;\n}\nfunction buildThroughDescriptor(through, tableNamespaceByName, targetModel, modelName, fieldName, defaultNamespaceId) {\n\tif (!tableNamespaceByName.has(through.table)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `buildSqlContractFromDefinition: junction table \"${through.table}\" for relation \"${modelName}.${fieldName}\" is not a declared model.`, { meta: {\n\t\tsourceModel: modelName,\n\t\trelationName: fieldName,\n\t\tjunctionTable: through.table\n\t} });\n\tconst namespaceId = through.namespaceId ?? defaultNamespaceId;\n\treturn {\n\t\ttable: through.table,\n\t\tnamespaceId,\n\t\tparentColumns: through.parentColumns,\n\t\tchildColumns: through.childColumns,\n\t\ttargetColumns: targetColumnsForJunction(targetModel, fieldName)\n\t};\n}\nfunction targetColumnsForJunction(targetModel, fieldName) {\n\tconst primaryKeyColumns = targetModel.id?.columns;\n\tif (primaryKeyColumns && primaryKeyColumns.length > 0) return primaryKeyColumns;\n\tconst firstUnique = targetModel.uniques?.find((u) => u.columns.length > 0);\n\tif (firstUnique) return firstUnique.columns;\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `M:N target model \"${targetModel.modelName}\" (relation field \"${fieldName}\") has no primary id or unique key to derive junction targetColumns.`, { meta: {\n\t\tmodelName: targetModel.modelName,\n\t\treason: \"no-key-for-junction-target-columns\"\n\t} });\n}\nfunction validateColumnTypeParams(dataType, typeParams, site) {\n\ttry {\n\t\tvalidateSqlTypeParams(dataType, dataTypeParams(dataType, typeParams));\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its data type does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName\n\t\t\t}\n\t\t});\n\t}\n}\nfunction buildStorageColumn(field, enumRefs, modelName, storageTypes, lookups) {\n\tconst { codecLookup } = lookups;\n\tconst { descriptor } = field;\n\tconst codecId = descriptor.codecId;\n\tconst isListColumn = storedAsListColumn({\n\t\tlist: field.many === true,\n\t\ttypedByValueObject: isValueObjectMember(field)\n\t});\n\tconst noCheck = isValueObjectMember(field) ? void 0 : field.noCheck;\n\tconst typeParams = resolvedTypeParams(descriptor, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(codecId, lookups);\n\tvalidateColumnTypeParams(dataType, typeParams, {\n\t\tmodelName,\n\t\tfieldName: field.fieldName\n\t});\n\tconst encodedDefault = field.default !== void 0 ? encodeColumnDefault(field.default, codecLookup, (lookup) => columnCodec(codecId, typeParams, lookup), {\n\t\tmodelName,\n\t\tfieldName: field.fieldName,\n\t\tcodecId\n\t}, isListColumn, field.elementNullable === true) : void 0;\n\tinvariant(enumRefs === void 0 || descriptor.valueSet === void 0, `Field \"${modelName}.${field.fieldName}\" is typed by a domain enum and also carries a storage value set from its type constructor.`);\n\tconst valueSet = enumRefs?.storage ?? descriptor.valueSet;\n\treturn {\n\t\tdataType: dataType.id,\n\t\tcodecId,\n\t\tnullable: field.nullable,\n\t\tmany: isListColumn ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"noCheck\", noCheck && [...noCheck].sort()),\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams),\n\t\t...ifDefined(\"default\", encodedDefault),\n\t\t...ifDefined(\"typeRef\", descriptor.typeRef),\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n}\n/**\n* The refs of a field typed by an authored enum: the domain enum and its storage value set. Authored enums are registered in the default namespace, whatever namespace the field's model is in.\n*/\nfunction enumValueSetRefs(enumHandle, defaultNamespaceId) {\n\tif (enumHandle === void 0) return void 0;\n\tconst common = {\n\t\tnamespaceId: defaultNamespaceId,\n\t\tentityName: enumHandle.enumName\n\t};\n\treturn {\n\t\tdomain: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\t...common\n\t\t},\n\t\tstorage: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\t...common\n\t\t}\n\t};\n}\nfunction buildDomainField(field, defaultNamespaceId, storageTypes) {\n\tif (isValueObjectMember(field)) return {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: field.valueObjectName\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false\n\t};\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: field.descriptor.codecId,\n\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(field.descriptor, storageTypes))\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"valueSet\", enumValueSetRefs(field.enumTypeHandle, defaultNamespaceId)?.domain)\n\t};\n}\nfunction collectStorageNamespaceCoordinateIds(definition) {\n\tconst ids = /* @__PURE__ */ new Set();\n\tids.add(definition.target.defaultNamespaceId);\n\tfor (const id of definition.namespaces ?? []) if (id.length > 0) ids.add(id);\n\tfor (const model of definition.models) if (model.namespaceId !== void 0 && model.namespaceId.length > 0) ids.add(model.namespaceId);\n\tfor (const id of Object.keys(definition.attachedEntities ?? {})) if (id.length > 0) ids.add(id);\n\treturn ids;\n}\n/**\n* Entry kinds the framework assembler itself manages (`table` from models,\n* `valueSet` from `enums` and attached-entity value-set derivation). A\n* pack-attached entity claiming one of these would silently clobber or be\n* clobbered by the managed slot, so it is rejected outright.\n*/\nconst MANAGED_ENTRY_KINDS = /* @__PURE__ */ new Set([tableEntityKind.kind, valueSetEntityKind.kind]);\nfunction assertNoManagedEntityKinds(namespaceId, entitiesForNs) {\n\tif (entitiesForNs === void 0) return;\n\tfor (const kind of Object.keys(entitiesForNs)) if (MANAGED_ENTRY_KINDS.has(kind)) throw contractError(\"CONTRACT.ENTITY_KIND_INVALID\", `buildSqlContractFromDefinition: attached entity in namespace \"${namespaceId}\" declares entry kind \"${kind}\", which is managed by the framework (table/valueSet) and cannot be attached.`, { meta: {\n\t\tentityKind: kind,\n\t\tnamespaceId\n\t} });\n}\n/**\n* Walks the flat `entityTypes` namespace tree contributed by the target pack\n* and every extension pack, indexing descriptors by their `discriminator` —\n* the same string a pack entity's entries-map key (`entries.<kind>`) uses.\n* Mirrors `contract-psl`'s `buildEntityTypesByDiscriminator`, recomposed here\n* from the packs `ContractDefinition` already carries (`target` +\n* `extensions`) since the TS assembler has no single pre-merged\n* `AuthoringContributions` input to read the way the PSL interpreter does.\n*/\nfunction collectEntityTypeDescriptorsByDiscriminator(definition) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst walk = (namespace) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse walk(value);\n\t};\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walk(entityTypes);\n\t}\n\treturn result;\n}\n/**\n* Derives value-sets for every pack entity declared in one namespace,\n* reusing the same `SqlValueSetDerivingEntityTypeOutput.deriveValueSet` hook\n* `contract-psl`'s `lowerExtensionBlocksForNamespace` folds into\n* `entries.valueSet` on the PSL path — so a TS-attached entity (e.g. a\n* native enum) gets its value-set the same way. Entity kinds with no\n* registered descriptor, or whose descriptor output doesn't derive a\n* value-set, contribute nothing.\n*/\nfunction deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator) {\n\tif (entitiesForNs === void 0) return void 0;\n\tlet result;\n\tfor (const [kind, entitiesByName] of Object.entries(entitiesForNs)) {\n\t\tconst descriptor = entityTypesByDiscriminator.get(kind);\n\t\tif (descriptor === void 0) continue;\n\t\tfor (const [name, entity] of Object.entries(entitiesByName)) {\n\t\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\t\tif (derivedValueSet === void 0) continue;\n\t\t\tresult ??= {};\n\t\t\tresult[name] = derivedValueSet;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Merges a namespace's `enumType()`-derived value-sets with its pack-entity-\n* derived value-sets. Both land in the same `entries.valueSet[name]` slot —\n* which drives value-set → codec typing and the domain-enum CHECK — so a\n* same-named entry in both would let one silently overwrite the other and\n* corrupt whichever column resolves against it. The same collision class the\n* `mergeColumnAndAttachedEntities` guard rejects; the PSL path already hard-errors\n* on the equivalent (`interpretPslDocumentToSqlContract`). Reject it here too.\n*/\nfunction mergeNamespaceValueSets(namespaceId, enumValueSets, packValueSets) {\n\tif (enumValueSets !== void 0 && packValueSets !== void 0) {\n\t\tfor (const name of Object.keys(packValueSets)) if (Object.hasOwn(enumValueSets, name)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: value-set \"${name}\" in namespace \"${namespaceId}\" is derived from both an enum and a pack entity — names must be unique per namespace.`, { meta: {\n\t\t\tkind: \"valueSet\",\n\t\t\tname,\n\t\t\tnamespaceId\n\t\t} });\n\t}\n\treturn {\n\t\t...enumValueSets,\n\t\t...packValueSets\n\t};\n}\nfunction ensureUnboundNamespaceSlot(namespaces, createNamespace) {\n\tif (Object.hasOwn(namespaces, UNBOUND_NAMESPACE_ID)) return namespaces;\n\tconst unbound = createNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: { table: {} }\n\t});\n\treturn {\n\t\t[UNBOUND_NAMESPACE_ID]: unbound,\n\t\t...namespaces\n\t};\n}\nconst DERIVABLE_CHECK_KINDS = [\"membership\", \"elementNotNull\"];\n/**\n* Which of `columnNames` could have produced `prefix` for some\n* {@link CheckKind} — the reverse of {@link derivedCheckPrefixes}, used only\n* to name the collision in `CONTRACT.CHECK_NAME_RESERVED`'s message. Callers\n* already know `prefix` is a member of `derivedCheckPrefixes(tableName,\n* columnNames)`, so the result is never empty.\n*/\nfunction columnsProducingCheckPrefix(tableName, columnNames, prefix) {\n\treturn columnNames.filter((columnName) => DERIVABLE_CHECK_KINDS.some((kind) => composeCheckWirePrefix(tableName, columnName, kind) === prefix));\n}\nfunction buildSqlContractFromDefinition(definition, codecLookup, dataTypeLookup) {\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup\n\t};\n\tconst target = definition.target.targetId;\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst qualifyColumnType = resolveColumnTypeQualifier(definition.target);\n\tconst renderCheckExpressions = resolveCheckExpressionRenderer(definition.target);\n\tconst targetFamily = \"sql\";\n\tconst resolveNamespaceId = (m) => m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId;\n\tconst modelsByName = new Map(definition.models.map((m) => [m.modelName, m]));\n\tconst tableNamespaceByName = new Map(definition.models.map((m) => [m.tableName, m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId]));\n\tconst modelsByCoordinate = new Map(definition.models.map((m) => [`${resolveNamespaceId(m)}:${m.modelName}`, m]));\n\tconst tablesByNamespace = {};\n\tconst authoringWarnings = [...definition.warnings ?? []];\n\tconst modelNameToNamespaceId = /* @__PURE__ */ new Map();\n\tconst executionDefaults = [];\n\tconst modelsByNamespace = {};\n\tconst collectedColumnEntities = {};\n\tconst rootEntries = [];\n\tfor (const semanticModel of definition.models) {\n\t\tconst tableName = semanticModel.tableName;\n\t\tconst namespaceId = semanticModel.namespaceId !== void 0 && semanticModel.namespaceId.length > 0 ? semanticModel.namespaceId : defaultNamespaceId;\n\t\tmodelNameToNamespaceId.set(semanticModel.modelName, namespaceId);\n\t\tif (!semanticModel.sharesBaseTable) rootEntries.push({\n\t\t\ttableName,\n\t\t\tnamespaceId,\n\t\t\tref: crossRef(semanticModel.modelName, namespaceId)\n\t\t});\n\t\tconst columns = {};\n\t\tconst fieldToColumn = {};\n\t\tconst domainFields = {};\n\t\tconst checksForTable = [];\n\t\tconst derivesChecks = effectiveControlPolicy(semanticModel.control, definition.defaultControlPolicy) === \"managed\";\n\t\tfor (const field of semanticModel.fields) {\n\t\t\tconst executionDefaultPhases = field.executionDefaults?.onCreate || field.executionDefaults?.onUpdate ? field.executionDefaults : void 0;\n\t\t\tif (executionDefaultPhases) {\n\t\t\t\tif (field.default !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" cannot define both default and executionDefaults.`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"default-and-executionDefaults\"\n\t\t\t\t} });\n\t\t\t\tif (field.nullable) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" is filled on write by a generated default (a preset such as temporal.createdAt() or an id generator), so it cannot be optional; remove .optional().`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"nullable-with-executionDefaults\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tconst enumHandle = !isValueObjectMember(field) ? field.enumTypeHandle : void 0;\n\t\t\tlet resolvedField = field;\n\t\t\tif (!isValueObjectMember(field)) {\n\t\t\t\tlet descriptor = field.descriptor;\n\t\t\t\tconst entityRef = descriptor.entityRef;\n\t\t\t\tif (entityRef !== void 0) {\n\t\t\t\t\tcollectEntityFromColumn(collectedColumnEntities, namespaceId, entityRef);\n\t\t\t\t\tdescriptor = resolveEntityRefDescriptor(descriptor, namespaceId);\n\t\t\t\t}\n\t\t\t\tdescriptor = qualifyColumnDescriptor(descriptor, namespaceId, qualifyColumnType);\n\t\t\t\tif (descriptor !== field.descriptor) resolvedField = {\n\t\t\t\t\t...field,\n\t\t\t\t\tdescriptor\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!isValueObjectMember(resolvedField) && resolvedField.noCheck !== void 0) {\n\t\t\t\tconst { noCheck: authoredNoCheck, ...withoutNoCheck } = resolvedField;\n\t\t\t\tresolvedField = derivesChecks ? {\n\t\t\t\t\t...withoutNoCheck,\n\t\t\t\t\tnoCheck: resolveNoCheckKinds({\n\t\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\t\tkinds: authoredNoCheck,\n\t\t\t\t\t\tmany: resolvedField.many === true,\n\t\t\t\t\t\telementNullable: resolvedField.elementNullable === true,\n\t\t\t\t\t\tisDomainEnum: enumHandle !== void 0\n\t\t\t\t\t})\n\t\t\t\t} : withoutNoCheck;\n\t\t\t}\n\t\t\tconst column = buildStorageColumn(resolvedField, enumValueSetRefs(enumHandle, defaultNamespaceId), semanticModel.modelName, definition.storageTypes ?? {}, lookups);\n\t\t\tconst columnMany = column.many ?? false;\n\t\t\tcolumns[field.columnName] = column;\n\t\t\tfieldToColumn[field.fieldName] = field.columnName;\n\t\t\tif (renderCheckExpressions !== void 0 && derivesChecks) {\n\t\t\t\tconst waivedKinds = !isValueObjectMember(resolvedField) ? resolvedField.noCheck : void 0;\n\t\t\t\tchecksForTable.push(...lowerRenderedChecks(tableName, renderCheckExpressions({\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumnName: field.columnName,\n\t\t\t\t\tmany: columnMany !== false,\n\t\t\t\t\telementNullable: columnMany !== false && columnMany.elementNullable,\n\t\t\t\t\tmemberValues: enumHandle !== void 0 ? checkMemberValues(enumHandle, codecLookup) : void 0\n\t\t\t\t}).filter((candidate) => !(waivedKinds?.includes(candidate.kind) ?? false))));\n\t\t\t}\n\t\t\tdomainFields[field.fieldName] = buildDomainField(resolvedField, defaultNamespaceId, definition.storageTypes ?? {});\n\t\t\tif (executionDefaultPhases) executionDefaults.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: namespaceId,\n\t\t\t\t\tentry: tableName,\n\t\t\t\t\tfield: field.columnName\n\t\t\t\t},\n\t\t\t\t...ifDefined(\"onCreate\", executionDefaultPhases.onCreate),\n\t\t\t\t...ifDefined(\"onUpdate\", executionDefaultPhases.onUpdate)\n\t\t\t});\n\t\t}\n\t\tconst authoringForeignKeys = (semanticModel.foreignKeys ?? []).map((fk) => {\n\t\t\tif (fk.references.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? defaultNamespaceId;\n\t\t\t\treturn {\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\t\ttableName,\n\t\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t\t},\n\t\t\t\t\ttarget: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\t\tcolumns: fk.references.columns,\n\t\t\t\t\t\tspaceId: fk.references.spaceId\n\t\t\t\t\t},\n\t\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, fk.references.model, fk.references.namespaceId, \"Foreign key\");\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, fk.references.table, \"Foreign key\");\n\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? (targetModel.namespaceId !== void 0 && targetModel.namespaceId.length > 0 ? targetModel.namespaceId : defaultNamespaceId);\n\t\t\treturn {\n\t\t\t\tsource: {\n\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\tcolumns: fk.references.columns\n\t\t\t\t},\n\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t};\n\t\t});\n\t\tif (semanticModel.sharesBaseTable && semanticModel.checks && semanticModel.checks.length > 0) throw contractError(\"CONTRACT.CHECK_ON_STI_VARIANT\", `Model \"${semanticModel.modelName}\" declares a check constraint but shares its base model's storage table (single-table inheritance) and has no table of its own to declare it on. Declare the check on the base model instead.`, { meta: {\n\t\t\ttableName,\n\t\t\tmodelName: semanticModel.modelName\n\t\t} });\n\t\tif (!semanticModel.sharesBaseTable) {\n\t\t\tconst uniques = (semanticModel.uniques ?? []).map((u) => ({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name)\n\t\t\t}));\n\t\t\tconst declaredIndexes = (semanticModel.indexes ?? []).map((i) => lowerAuthoredIndex(tableName, blindCast({\n\t\t\t\t...ifDefined(\"columns\", i.columns),\n\t\t\t\t...ifDefined(\"expression\", i.expression),\n\t\t\t\twhere: i.where,\n\t\t\t\tunique: i.unique,\n\t\t\t\tmap: i.map,\n\t\t\t\tname: i.name,\n\t\t\t\ttype: i.type,\n\t\t\t\toptions: i.options\n\t\t\t}), authoringWarnings));\n\t\t\tif (semanticModel.checks !== void 0 && semanticModel.checks.length > 0) {\n\t\t\t\tconst tableColumnNames = Object.keys(columns);\n\t\t\t\tconst reservedCheckPrefixes = derivedCheckPrefixes(tableName, tableColumnNames);\n\t\t\t\tfor (const authoredCheck of semanticModel.checks) {\n\t\t\t\t\tconst lowered = lowerAuthoredCheck(tableName, authoredCheck, authoringWarnings);\n\t\t\t\t\tif (lowered.naming.kind === \"wire\" && reservedCheckPrefixes.has(lowered.naming.prefix)) {\n\t\t\t\t\t\tconst collidingColumns = columnsProducingCheckPrefix(tableName, tableColumnNames, lowered.naming.prefix);\n\t\t\t\t\t\tconst columnList = collidingColumns.map((name) => `\"${name}\"`).join(\", \");\n\t\t\t\t\t\tthrow contractError(\"CONTRACT.CHECK_NAME_RESERVED\", `Check \"${lowered.naming.prefix}\" on table \"${tableName}\": this name's prefix matches the shape a derived enforcement check would use for column${collidingColumns.length === 1 ? \"\" : \"s\"} ${columnList} of this table, so it can't be told apart from one. Choose a different name.`, { meta: {\n\t\t\t\t\t\t\ttableName,\n\t\t\t\t\t\t\tprefix: lowered.naming.prefix,\n\t\t\t\t\t\t\tcollidingColumns\n\t\t\t\t\t\t} });\n\t\t\t\t\t}\n\t\t\t\t\tchecksForTable.push(new CheckConstraint(lowered));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst primaryKey = semanticModel.id ? {\n\t\t\t\tcolumns: semanticModel.id.columns,\n\t\t\t\t...ifDefined(\"name\", semanticModel.id.name)\n\t\t\t} : void 0;\n\t\t\tconst { foreignKeys, indexes } = materializeForeignKeysAndIndexes(tableName, authoringForeignKeys, declaredIndexes, uniques, primaryKey);\n\t\t\tconst tableInput = {\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"control\", semanticModel.control),\n\t\t\t\tuniques,\n\t\t\t\tindexes: indexes.map((i) => new Index(i)),\n\t\t\t\tforeignKeys,\n\t\t\t\t...primaryKey ? { primaryKey } : {},\n\t\t\t\t...checksForTable.length > 0 ? { checks: checksForTable } : {}\n\t\t\t};\n\t\t\tlet nsTables = tablesByNamespace[namespaceId];\n\t\t\tif (nsTables === void 0) {\n\t\t\t\tnsTables = {};\n\t\t\t\ttablesByNamespace[namespaceId] = nsTables;\n\t\t\t}\n\t\t\tif (nsTables[tableName] !== void 0) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: duplicate table \"${tableName}\" in namespace \"${namespaceId}\".`, { meta: {\n\t\t\t\tkind: \"table\",\n\t\t\t\tname: tableName,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t\tnsTables[tableName] = tableInput;\n\t\t}\n\t\tconst storageFields = {};\n\t\tfor (const [fieldName, columnName] of Object.entries(fieldToColumn)) storageFields[fieldName] = { column: columnName };\n\t\tconst columnToField = new Map(Object.entries(fieldToColumn).map(([field, col]) => [col, field]));\n\t\tconst modelRelations = {};\n\t\tfor (const relation of semanticModel.relations ?? []) {\n\t\t\tif (relation.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = relation.namespaceId ?? defaultNamespaceId;\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto: crossRef(relation.toModel, targetNamespaceId, relation.spaceId),\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\t\t\ttargetFields: relation.on.childColumns\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, relation.toModel, relation.toNamespaceId, \"Relation\");\n\t\t\tinvariant(relation.toTable !== void 0, `Relation \"${semanticModel.modelName}.${relation.fieldName}\" is local but carries no target table; only cross-space relations may leave it unset.`);\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, relation.toTable, \"Relation\");\n\t\t\tconst targetColumnToField = new Map(targetModel.fields.map((f) => [f.columnName, f.fieldName]));\n\t\t\tconst to = crossRef(relation.toModel, relation.toNamespaceId !== void 0 && relation.toNamespaceId.length > 0 ? relation.toNamespaceId : resolveModelNamespaceId(targetModel, modelNameToNamespaceId, defaultNamespaceId));\n\t\t\tconst on = {\n\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\ttargetFields: relation.on.childColumns.map((col) => targetColumnToField.get(col) ?? col)\n\t\t\t};\n\t\t\tif (relation.cardinality === \"N:M\") {\n\t\t\t\tif (!relation.through) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${semanticModel.modelName}.${relation.fieldName}\" with cardinality \"N:M\" requires through metadata`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\trelationName: relation.fieldName,\n\t\t\t\t\treason: \"many-to-many-missing-through\"\n\t\t\t\t} });\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto,\n\t\t\t\t\tcardinality: \"N:M\",\n\t\t\t\t\ton,\n\t\t\t\t\tthrough: buildThroughDescriptor(relation.through, tableNamespaceByName, targetModel, semanticModel.modelName, relation.fieldName, defaultNamespaceId)\n\t\t\t\t};\n\t\t\t} else if (relation.cardinality === \"1:N\") modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: \"1:N\",\n\t\t\t\ton\n\t\t\t};\n\t\t\telse modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: relation.cardinality,\n\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\ton\n\t\t\t};\n\t\t}\n\t\tlet namespaceModels = modelsByNamespace[namespaceId];\n\t\tif (namespaceModels === void 0) {\n\t\t\tnamespaceModels = {};\n\t\t\tmodelsByNamespace[namespaceId] = namespaceModels;\n\t\t}\n\t\tnamespaceModels[semanticModel.modelName] = {\n\t\t\tstorage: {\n\t\t\t\ttable: tableName,\n\t\t\t\tnamespaceId,\n\t\t\t\tfields: storageFields\n\t\t\t},\n\t\t\tfields: domainFields,\n\t\t\trelations: modelRelations\n\t\t};\n\t}\n\tconst rootTableNameCounts = /* @__PURE__ */ new Map();\n\tfor (const entry of rootEntries) rootTableNameCounts.set(entry.tableName, (rootTableNameCounts.get(entry.tableName) ?? 0) + 1);\n\tconst roots = {};\n\tfor (const entry of rootEntries) {\n\t\tconst key = (rootTableNameCounts.get(entry.tableName) ?? 0) > 1 ? `${entry.namespaceId}.${entry.tableName}` : entry.tableName;\n\t\troots[key] = entry.ref;\n\t}\n\tconst rawStorageTypes = definition.storageTypes ?? {};\n\tconst documentTypes = Object.fromEntries(Object.entries(rawStorageTypes).map(([name, entry]) => [name, toStorageTypeInstance({\n\t\tcodecId: entry.codecId,\n\t\tdataType: sqlDataTypeOfCodec(entry.codecId, lookups).id,\n\t\ttypeParams: entry.typeParams\n\t})]));\n\tconst namespaceCoordinateIds = collectStorageNamespaceCoordinateIds(definition);\n\tconst domainEnumsByNs = {};\n\tconst storageValueSetsByNs = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclarationKey: enumName,\n\t\t\treason: \"key-name-mismatch\"\n\t\t} });\n\t\tconst nsId = defaultNamespaceId;\n\t\tlet domainSlot = domainEnumsByNs[nsId];\n\t\tif (domainSlot === void 0) {\n\t\t\tdomainSlot = {};\n\t\t\tdomainEnumsByNs[nsId] = domainSlot;\n\t\t}\n\t\tconst storedMembers = encodeEnumMembers(handle, codecLookup);\n\t\tdomainSlot[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: storedMembers\n\t\t};\n\t\tlet storageSlot = storageValueSetsByNs[nsId];\n\t\tif (storageSlot === void 0) {\n\t\t\tstorageSlot = {};\n\t\t\tstorageValueSetsByNs[nsId] = storageSlot;\n\t\t}\n\t\tstorageSlot[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: storedMembers.map((member) => member.value)\n\t\t};\n\t}\n\tconst { createNamespace } = definition;\n\tconst entityTypesByDiscriminator = collectEntityTypeDescriptorsByDiscriminator(definition);\n\tconst namespaces = Object.fromEntries([...namespaceCoordinateIds].sort().map((id) => {\n\t\tconst entitiesForNs = mergeColumnAndAttachedEntities(id, definition.attachedEntities?.[id], collectedColumnEntities[id]);\n\t\tassertNoManagedEntityKinds(id, entitiesForNs);\n\t\tconst enumValueSetEntries = storageValueSetsByNs[id];\n\t\tconst packValueSetEntries = deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator);\n\t\tconst valueSetEntries = enumValueSetEntries !== void 0 || packValueSetEntries !== void 0 ? mergeNamespaceValueSets(id, enumValueSetEntries, packValueSetEntries) : void 0;\n\t\tconst nsInput = {\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\ttable: tablesByNamespace[id] ?? {},\n\t\t\t\t...entitiesForNs,\n\t\t\t\t...valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0 ? { valueSet: valueSetEntries } : {}\n\t\t\t}\n\t\t};\n\t\treturn [id, createNamespace(nsInput)];\n\t}));\n\tconst storageWithoutHash = {\n\t\t...Object.keys(documentTypes).length > 0 ? { types: documentTypes } : {},\n\t\tnamespaces: defaultNamespaceId === UNBOUND_NAMESPACE_ID ? ensureUnboundNamespaceSlot(namespaces, createNamespace) : namespaces\n\t};\n\tconst storageHash = definition.storageHash ? coreHash(definition.storageHash) : computeStorageHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tstorage: blindCast(storageWithoutHash),\n\t\t...sqlContractCanonicalizationHooks\n\t});\n\tconst storage = new SqlStorage({\n\t\t...storageWithoutHash,\n\t\tstorageHash\n\t});\n\tconst extensionNamespaces = definition.extensions ? Object.values(definition.extensions).map((pack) => pack.id) : void 0;\n\tconst extensions = { ...definition.extensions || {} };\n\tif (extensionNamespaces) {\n\t\tfor (const namespace of extensionNamespaces) if (!Object.hasOwn(extensions, namespace)) extensions[namespace] = {};\n\t}\n\tconst capabilities = mergeCapabilityMatrices({}, [definition.target, ...Object.values(definition.extensions ?? {})]);\n\tconst profileHash = computeProfileHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tcapabilities: {}\n\t});\n\tconst executionWithHash = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: executionDefaults\n\t});\n\tconst valueObjects = definition.valueObjects && definition.valueObjects.length > 0 ? Object.fromEntries(definition.valueObjects.map((vo) => [vo.name, { fields: Object.fromEntries(vo.fields.map((f) => [f.fieldName, buildDomainField(f, defaultNamespaceId, definition.storageTypes ?? {})])) }])) : void 0;\n\tconst domainNamespaceIds = new Set(Object.keys(modelsByNamespace));\n\tif (domainNamespaceIds.size === 0) domainNamespaceIds.add(defaultNamespaceId);\n\tif (valueObjects !== void 0) domainNamespaceIds.add(defaultNamespaceId);\n\tfor (const nsId of Object.keys(domainEnumsByNs)) domainNamespaceIds.add(nsId);\n\tconst domainNamespaces = Object.fromEntries([...domainNamespaceIds].sort().map((namespaceId) => {\n\t\tconst modelsInNs = modelsByNamespace[namespaceId] ?? {};\n\t\tconst enumsInNs = domainEnumsByNs[namespaceId];\n\t\treturn [namespaceId, {\n\t\t\tmodels: modelsInNs,\n\t\t\t...namespaceId === defaultNamespaceId && valueObjects !== void 0 ? { valueObjects } : {},\n\t\t\t...enumsInNs !== void 0 && Object.keys(enumsInNs).length > 0 ? { enum: enumsInNs } : {}\n\t\t}];\n\t}));\n\tconst contract = {\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\tdomain: { namespaces: domainNamespaces },\n\t\troots,\n\t\tstorage,\n\t\t...executionWithHash ? { execution: executionWithHash } : {},\n\t\textensions,\n\t\tcapabilities,\n\t\tprofileHash,\n\t\tmeta: {}\n\t};\n\tassertStorageSemantics(definition, contract);\n\tflushAuthoringWarnings(authoringWarnings);\n\treturn contract;\n}\n//#endregion\n//#region src/derived-checks.ts\n/**\n* The one step every SQL contract specifier funnels its loaded contract\n* through: stamp the specifier's default control policy, then strip derived\n* checks from every table the stamped policy leaves non-managed. Composing the\n* two here is what keeps the managed-only consequence from being skipped on\n* any specifier route.\n*/\nfunction applySqlSpecifierControlPolicy(contract, defaultControlPolicy, createNamespace) {\n\treturn stripDerivedChecksFromNonManagedTables(applySpecifierDefaultControlPolicy(contract, defaultControlPolicy), createNamespace);\n}\n/**\n* Removes generated enforcement checks from every table whose effective\n* control policy is not `managed`.\n*\n* A check is derived iff its wire prefix is one derivation would produce for\n* some column of its table — {@link derivedCheckPrefixes} enumerates that\n* set. Wire-naming alone no longer identifies derivation: an authored\n* `name:` check (`@@check` / `check()`) is wire-named too, so a bare\n* `check.prefix === undefined` test would delete an author's own constraint\n* from every non-`managed` table. The prefix-shape rule tests against the\n* table's own columns instead of the naming mode, so an authored check with\n* an unrelated prefix survives.\n*\n* The rule is weaker than recomputing the content hash `contract infer`\n* uses: that needs `postgresRenderCheckExpressions` to know what a kind\n* renders, and this funnel has no target descriptor to reach it through. It\n* can only ask whether some column could have produced a prefix of this\n* shape, not whether this exact column produced this exact check. The gap\n* that opens — an authored name that collides with a derived-prefix shape —\n* is closed at authoring time instead: such a name is rejected\n* (`CONTRACT.CHECK_NAME_RESERVED`) before it ever reaches storage.\n*\n* Why derivation stops at the namespace boundary: the contract *describes* an\n* external schema, it does not *prescribe* enforcement for it. Deriving a check\n* for a table Prisma 8 never creates declares a constraint the live database\n* has no reason to carry, and `external` fails verify on a declared shape the\n* database lacks — an unfixable failure, since no plan may emit DDL there\n* either.\n*\n* This is the post-build half of the rule. Authoring skips derivation for a\n* table whose policy is known in the source; this pass catches the policy a\n* contract *specifier* applies after the contract is already built, which is\n* the only signal a pack like the Supabase extension gives. Specifiers reach\n* it through `applySqlSpecifierControlPolicy` above.\n*\n* Returns the contract unchanged (same reference) when nothing is stripped.\n* When something is, the storage hash is recomputed — the stripped contract\n* describes different storage.\n*/\nfunction stripDerivedChecksFromNonManagedTables(contract, createNamespace) {\n\tconst storage = contract.storage;\n\tif (!isSqlStorageShaped(storage)) return contract;\n\tlet anyStripped = false;\n\tconst namespaces = {};\n\tfor (const [namespaceId, namespace] of Object.entries(storage.namespaces)) {\n\t\tif (!isMaterializedSqlNamespace(namespace)) return contract;\n\t\tconst tables = namespace.entries[\"table\"];\n\t\tif (tables === void 0) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tlet namespaceStripped = false;\n\t\tconst nextTables = {};\n\t\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\t\tconst stripped = StorageTable.is(table) ? withoutDerivedChecks(tableName, table, contract.defaultControlPolicy) : table;\n\t\t\tif (stripped !== table) namespaceStripped = true;\n\t\t\tnextTables[tableName] = stripped;\n\t\t}\n\t\tif (!namespaceStripped) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tanyStripped = true;\n\t\tnamespaces[namespaceId] = createNamespace({\n\t\t\tid: namespace.id,\n\t\t\tentries: {\n\t\t\t\t...namespace.entries,\n\t\t\t\ttable: nextTables\n\t\t\t}\n\t\t});\n\t}\n\tif (!anyStripped) return contract;\n\tconst storageWithoutHash = {\n\t\tnamespaces,\n\t\t...ifDefined(\"types\", storage.types)\n\t};\n\treturn {\n\t\t...contract,\n\t\tstorage: new SqlStorage({\n\t\t\t...storageWithoutHash,\n\t\t\tstorageHash: computeStorageHash({\n\t\t\t\ttarget: contract.target,\n\t\t\t\ttargetFamily: contract.targetFamily,\n\t\t\t\tstorage: storageWithoutHash,\n\t\t\t\t...sqlContractCanonicalizationHooks\n\t\t\t})\n\t\t})\n\t};\n}\n/**\n* Structural stand-in for `instanceof SqlStorage`: like the checks it wraps, a\n* storage instance can arrive from a realm whose IR classes are a separate\n* copy (the dist e2e shape), where an `instanceof` test would miss.\n*/\nfunction isSqlStorageShaped(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"namespaces\" in x)) return false;\n\treturn typeof x.namespaces === \"object\" && x.namespaces !== null;\n}\n/** The table itself when it keeps every check, a rebuilt one when it does not. */\nfunction withoutDerivedChecks(tableName, table, contractDefault) {\n\tconst checks = table.checks;\n\tif (checks === void 0 || checks.length === 0) return table;\n\tif (effectiveControlPolicy(table.control, contractDefault) === \"managed\") return table;\n\tconst columnNames = Object.keys(table.columns);\n\tinvariant(columnNames.length > 0, `withoutDerivedChecks: table \"${tableName}\" carries checks but its column map is empty. The caller must pass the table's real, complete column set — an empty or partial map makes every check misclassify as non-derived and survive the strip.`);\n\tconst derivedPrefixes = derivedCheckPrefixes(tableName, columnNames);\n\tconst kept = checks.filter((check) => check.prefix === void 0 || !derivedPrefixes.has(check.prefix));\n\tif (kept.length === checks.length) return table;\n\treturn new StorageTable({\n\t\tcolumns: table.columns,\n\t\tuniques: table.uniques,\n\t\tindexes: table.indexes,\n\t\tforeignKeys: table.foreignKeys,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey),\n\t\t...ifDefined(\"control\", table.control),\n\t\t...kept.length > 0 ? { checks: kept.map((check) => checkConstraintInputFromSerialized({\n\t\t\tname: check.name,\n\t\t\t...ifDefined(\"prefix\", check.prefix),\n\t\t\texpression: check.expression\n\t\t})) } : {}\n\t});\n}\n//#endregion\nexport { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, contractError as o, toOneNullabilityContradictionMessage as r, applySqlSpecifierControlPolicy as t };\n\n//# sourceMappingURL=derived-checks-DdguQPYm.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,SAAS,mBAAmB,OAAO;CAClC,OAAO,MAAM,QAAQ,CAAC,MAAM;AAC7B;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,qBAAqB;AAC7B;AAGA,SAAS,qCAAqC,UAAU,eAAe;CACtE,OAAO,kBAAkB,sBAAs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AAG,KAAK,SAAS,IAAI,EAAE,QAAQ,KAAK,KAAK,UAAU,mCAAmC;GACrF,MAAM,MAAM;GACZ,GAAG,UAAU,UAAU,MAAM,MAAM;GACnC,YAAY,MAAM;EACnB,CAAC,CAAC,EAAE,IAAI,CAAC;CACV,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"derived-checks-D5zdlyyh-CPofdm1W.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-D5zdlyyh.mjs"],"sourcesContent":["import { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { flushAuthoringWarnings, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { CheckConstraint, Index, SqlStorage, StorageTable, applyFkDefaults, checkConstraintInputFromSerialized, isMaterializedSqlNamespace, resolvedTypeParams, toStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, coreHash, crossRef, effectiveControlPolicy } from \"@internal/contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { codecForRef, enumRefusalOf } from \"@internal/framework-components/codec\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { lowerAuthoredCheck } from \"@internal/sql-contract/authored-check-naming\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { dataTypeParams, sqlDataTypeOfCodec, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { tableEntityKind, valueSetEntityKind } from \"@internal/sql-contract/entity-kinds\";\nimport { materializeForeignKeysAndIndexes } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { lowerAuthoredIndex } from \"@internal/sql-contract/index-naming\";\nimport { validateIndexTypes } from \"@internal/sql-contract/index-type-validation\";\nimport { createIndexTypeRegistry } from \"@internal/sql-contract/index-types\";\nimport { validateStorageSemantics } from \"@internal/sql-contract/validators\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\nimport { composeCheckWirePrefix, computeCheckContentHash, derivedCheckPrefixes } from \"@internal/sql-schema-ir/naming\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/contract-definition.ts\n/**\n* Whether a field is stored in a list column. A list of scalars is; a list of value objects is not, because it is stored in one column whose value is the whole list, as one JSON array.\n*/\nfunction storedAsListColumn(field) {\n\treturn field.list && !field.typedByValueObject;\n}\n/** Whether a field or member is typed by a value object. */\nfunction isValueObjectMember(field) {\n\treturn \"valueObjectName\" in field;\n}\n//#endregion\n//#region src/to-one-nullability-message.ts\nfunction toOneNullabilityContradictionMessage(location, contradiction) {\n\treturn contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`;\n}\n//#endregion\n//#region src/build-contract.ts\n/**\n* The codec that encodes one column's default, built with the column's own `typeParams`, because a parameterized codec checks its params when it encodes and reads a default. Only a column has params; every other encode site takes the representative instance.\n*/\nfunction columnCodec(codecId, typeParams, codecLookup) {\n\treturn codecForRef(codecLookup, {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t});\n}\n/** Encodes a value the contract stores, and reads it back with the codec, which refuses a value its column would not hold. */\nfunction encodeViaCodec(value, codec) {\n\tif (codec) {\n\t\tconst json = codec.encodeJson(value);\n\t\tcodec.decodeJson(json);\n\t\treturn json;\n\t}\n\treturn blindCast(value);\n}\nfunction defaultRefusal(site, cause, elementPosition) {\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a ${subject} that its codec refuses: ${reason}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"codec-refused-default\",\n\t\t\t...ifDefined(\"elementPosition\", elementPosition)\n\t\t}\n\t});\n}\nfunction encodeDefaultValue(value, codec, site, elementPosition) {\n\ttry {\n\t\treturn encodeViaCodec(value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tthrow defaultRefusal(site, cause, elementPosition);\n\t}\n}\nfunction codecForDefault(codecLookup, resolveCodec, site) {\n\tconst codec = buildCodecForDefault(codecLookup, resolveCodec, site);\n\tif (codec === void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has a default, but no pack in the contract declares its codec \"${site.codecId}\", so the default cannot be checked. List the pack that owns the codec in \\`extensions\\`.`, { meta: {\n\t\tmodelName: site.modelName,\n\t\tfieldName: site.fieldName,\n\t\tcodecId: site.codecId,\n\t\treason: \"codec-not-found\"\n\t} });\n\treturn codec;\n}\nfunction buildCodecForDefault(codecLookup, resolveCodec, site) {\n\ttry {\n\t\treturn resolveCodec(codecLookup);\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"RUNTIME.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its codec does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName,\n\t\t\t\tcodecId: site.codecId,\n\t\t\t\treason: \"type-params-invalid\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction encodeColumnDefault(defaultInput, codecLookup, resolveCodec, site, many = false, elementNullable = false) {\n\tif (defaultInput.kind === \"function\") return {\n\t\tkind: \"function\",\n\t\texpression: defaultInput.expression\n\t};\n\tif (\"canonical\" in defaultInput && defaultInput.canonical === true) return {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(defaultInput.value)\n\t};\n\tif (many) {\n\t\tif (!Array.isArray(defaultInput.value)) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" is a list field, so its default is an array; received ${typeof defaultInput.value}. Call .many() before .default().`, { meta: {\n\t\t\tmodelName: site.modelName,\n\t\t\tfieldName: site.fieldName,\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"list-default-not-array\"\n\t\t} });\n\t\tconst codec = codecForDefault(codecLookup, resolveCodec, site);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: defaultInput.value.map((element, index) => {\n\t\t\t\tif (element !== null) return encodeDefaultValue(element, codec, site, index + 1);\n\t\t\t\tif (elementNullable) return null;\n\t\t\t\tthrow new InternalError(\"Literal default on a strict list column cannot contain null elements.\");\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: encodeDefaultValue(defaultInput.value, codecForDefault(codecLookup, resolveCodec, site), site)\n\t};\n}\nfunction assertStorageSemantics(definition, contract) {\n\tconst semanticErrors = validateStorageSemantics(contract.storage);\n\tif (semanticErrors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, { meta: { errors: semanticErrors } });\n\tconst indexTypeRegistry = createIndexTypeRegistry();\n\tconst packsToRegister = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const pack of packsToRegister) {\n\t\tconst registration = pack.indexTypes;\n\t\tif (registration === void 0) continue;\n\t\tif (typeof registration !== \"object\" || registration === null || !(\"entries\" in registration) || !Array.isArray(registration.entries)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack \"${pack.id ?? \"<unknown>\"}\" declares \"indexTypes\" but its value is not an IndexTypeRegistration (expected an object with an \"entries\" array; got ${typeof registration}).`, { meta: {\n\t\t\tpackId: pack.id,\n\t\t\tcontribution: \"indexTypes\",\n\t\t\treason: \"invalid-shape\"\n\t\t} });\n\t\tfor (const entry of blindCast(registration).entries) indexTypeRegistry.register(entry);\n\t}\n\tvalidateIndexTypes(contract, indexTypeRegistry);\n}\nfunction assertKnownTargetModel(modelsByName, modelsByCoordinate, sourceModelName, targetModelName, targetNamespaceId, context) {\n\tconst targetModel = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? modelsByCoordinate.get(`${targetNamespaceId}:${targetModelName}`) : modelsByName.get(targetModelName);\n\tif (!targetModel) {\n\t\tconst qualified = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? `${targetNamespaceId}.${targetModelName}` : targetModelName;\n\t\tthrow contractError(\"CONTRACT.MODEL_UNKNOWN\", `${context} on model \"${sourceModelName}\" references unknown model \"${qualified}\"`, { meta: {\n\t\t\tsourceModel: sourceModelName,\n\t\t\ttargetModel: qualified,\n\t\t\tcontext\n\t\t} });\n\t}\n\treturn targetModel;\n}\nfunction assertTargetTableMatches(sourceModelName, targetModel, referencedTableName, context) {\n\tif (targetModel.tableName !== referencedTableName) throw contractError(\"CONTRACT.TABLE_MISMATCH\", `${context} on model \"${sourceModelName}\" references table \"${referencedTableName}\" but model \"${targetModel.modelName}\" maps to \"${targetModel.tableName}\"`, { meta: {\n\t\tsourceModel: sourceModelName,\n\t\treferencedTable: referencedTableName,\n\t\tmappedTable: targetModel.tableName,\n\t\tcontext\n\t} });\n}\n/**\n* Resolves a deferred entity-ref column descriptor (e.g. a `pg.enum(handle)`\n* column) against the field's now-known owning namespace: attaches the\n* storage `valueSet` ref the collected entity's derived value-set is stored\n* under. `typeParams.typeName` stays bare here — schema\n* qualification (e.g. `auth.aal_level`) is a target concern applied in the\n* next step, `qualifyColumnDescriptor`. A descriptor with no `entityRef` (the\n* ordinary case) passes through unchanged.\n*/\nfunction resolveEntityRefDescriptor(descriptor, namespaceId) {\n\tconst entityRef = descriptor.entityRef;\n\tif (entityRef === void 0) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\tvalueSet: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: entityRef.entityName\n\t\t}\n\t};\n}\n/**\n* Structural check for a target that contributes a `qualifyColumnType` hook\n* on its authoring contributions. Duck-typed (mirroring\n* `contract-psl`'s `hasColumnFromEntityHook`) so the SQL family stays blind\n* to the target's qualification logic and no framework/family interface has\n* to name the hook.\n*/\nfunction hasColumnTypeQualifier(authoring) {\n\treturn \"qualifyColumnType\" in authoring && typeof authoring.qualifyColumnType === \"function\";\n}\n/**\n* Structural check for a target that contributes a `renderCheckExpressions`\n* hook, duck-typed for the same reason {@link hasColumnTypeQualifier} is: the\n* SQL family stays blind to the target's predicate syntax.\n*/\nfunction hasCheckExpressionRenderer(authoring) {\n\treturn \"renderCheckExpressions\" in authoring && typeof authoring.renderCheckExpressions === \"function\";\n}\nfunction resolveCheckExpressionRenderer(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasCheckExpressionRenderer(authoring) ? authoring.renderCheckExpressions : void 0;\n}\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* Refuses a member whose codec reads its stored value back as a different value from the one written.\n* The contract's types name the member as written, while the runtime reads the stored value, so the\n* two must be the same value. A member with no literal type has nothing to contradict. The caller\n* has already read the stored value back once, so the codec takes it.\n*/\nfunction assertStoredAsWritten(enumName, member, stored, codec) {\n\tif (!hasLiteralType(member.value)) return;\n\tconst readBack = codec.decodeJson(stored);\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return;\n\tconst writeAs = hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored);\n\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${enumName}\"): member \"${member.name}\" is written ${canonicalStringify(member.value)}, but the column stores ${JSON.stringify(stored)}. Write the member as ${writeAs}.`, { meta: {\n\t\tenumName,\n\t\tmember: member.name,\n\t\treason: \"member-not-stored-as-written\"\n\t} });\n}\n/** A member's value in the form the enum's codec stores it. A member the codec refuses is a `CONTRACT.ENUM_INVALID` naming the enum and the member. */\nfunction encodeEnumMember(handle, member, codec) {\n\ttry {\n\t\treturn encodeViaCodec(member.value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\") member \"${member.name}\" has a value its codec ${handle.codecId} refuses: ${reason}`, {\n\t\t\tfix: \"Give the member a value the codec takes, or type the enum with a codec that takes it.\",\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\tenumName: handle.enumName,\n\t\t\t\tmember: member.name,\n\t\t\t\tcodecId: handle.codecId,\n\t\t\t\treason: \"codec-refused-member\"\n\t\t\t}\n\t\t});\n\t}\n}\n/**\n* Each member's value in the form the enum's codec stores it, read back by the codec. A codec an\n* enum cannot use, a member the codec refuses, a member written differently from how it is stored,\n* and two members that store the same value are each a `CONTRACT.ENUM_INVALID`.\n*/\nfunction encodeEnumMembers(handle, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(handle.codecId);\n\tconst enumRefusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (enumRefusal !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): an enum cannot use the codec ${handle.codecId}. ${enumRefusal}`, {\n\t\tfix: \"Type the enum with another codec.\",\n\t\tmeta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tcodecId: handle.codecId,\n\t\t\treason: \"codec-not-for-enums\"\n\t\t}\n\t});\n\tconst codec = codecLookup.get(handle.codecId);\n\tconst memberByStoredValue = /* @__PURE__ */ new Map();\n\treturn handle.enumMembers.map((member) => {\n\t\tconst value = encodeEnumMember(handle, member, codec);\n\t\tif (codec !== void 0) assertStoredAsWritten(handle.enumName, member, value, codec);\n\t\tconst key = canonicalStringify(value);\n\t\tconst earlier = memberByStoredValue.get(key);\n\t\tif (earlier !== void 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): members \"${earlier}\" and \"${member.name}\" both store ${JSON.stringify(value)}. Member values must be unique as the column stores them.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tmembers: [earlier, member.name],\n\t\t\treason: \"duplicate-member-value\"\n\t\t} });\n\t\tmemberByStoredValue.set(key, member.name);\n\t\treturn {\n\t\t\tname: member.name,\n\t\t\tvalue\n\t\t};\n\t});\n}\n/**\n* The member values a membership check must enforce, encoded exactly as the\n* column stores them. Membership predicates support strings and finite numbers.\n*/\nfunction checkMemberValues(handle, codecLookup) {\n\tconst encoded = encodeEnumMembers(handle, codecLookup).map((member) => member.value);\n\tconst values = [];\n\tfor (const value of encoded) {\n\t\tif (typeof value !== \"string\" && !(typeof value === \"number\" && Number.isFinite(value))) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): CHECK constraint members must encode to strings or finite numbers.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\treason: \"unsupported-member-value\"\n\t\t} });\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\n/**\n* Resolves a field's authored `noCheck` kinds against its column shape:\n* the bare form (`[]`) becomes every kind the shape derives, and a named\n* kind that can never apply to the shape is an authoring error\n* (`CONTRACT.CHECK_OPTOUT_INVALID`). Returns the concrete kinds in\n* canonical ascending order — the only form the contract persists.\n*/\nfunction resolveNoCheckKinds(input) {\n\tconst derivable = [];\n\tif (input.many && !input.elementNullable) derivable.push(\"elementNotNull\");\n\tif (input.isDomainEnum) derivable.push(\"membership\");\n\tconst subject = `Field \"${input.modelName}.${input.fieldName}\"`;\n\tconst meta = {\n\t\tmodelName: input.modelName,\n\t\tfieldName: input.fieldName\n\t};\n\tif (input.kinds.length === 0) {\n\t\tif (derivable.length === 0) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck() waives nothing — this column's shape derives no generated checks.`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"no-derivable-checks\"\n\t\t} });\n\t\treturn derivable;\n\t}\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const kind of input.kinds) {\n\t\tif (seen.has(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") names the same kind twice.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"duplicate-kind\"\n\t\t} });\n\t\tseen.add(kind);\n\t\tif (!derivable.includes(kind)) throw contractError(\"CONTRACT.CHECK_OPTOUT_INVALID\", `${subject}: noCheck(\"${kind}\") does not apply — ${kind === \"membership\" ? \"membership checks are derived only from enumType() value sets\" : \"element-non-null checks are derived only for lists whose elements are semantically non-null\"}.`, { meta: {\n\t\t\t...meta,\n\t\t\tkind,\n\t\t\treason: \"inapplicable-kind\"\n\t\t} });\n\t}\n\treturn [...input.kinds].sort();\n}\n/**\n* Names the target's rendered checks and lowers them into contract entities.\n*\n* Naming is composed family-side ({@link composeCheckWirePrefix}) rather than\n* by the target, and suffixed with the predicate's content hash. Composing\n* family-side is what makes the truncation safe — two prefixes that truncate\n* alike still differ in their hashes, and the family can see that the\n* (table, column, kind) triple they were built from is unique per table,\n* rather than having to assume something about SQL text it declares itself\n* unable to read.\n*/\nfunction lowerRenderedChecks(tableName, candidates) {\n\treturn candidates.map((candidate) => new CheckConstraint({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: composeCheckWirePrefix(tableName, candidate.columnName, candidate.kind),\n\t\t\thash: computeCheckContentHash(candidate.expression)\n\t\t},\n\t\texpression: candidate.expression\n\t}));\n}\nfunction resolveColumnTypeQualifier(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasColumnTypeQualifier(authoring) ? authoring.qualifyColumnType : void 0;\n}\n/**\n* Applies the target's `qualifyColumnType` hook to a scalar column descriptor.\n* A descriptor whose codec the target leaves unchanged passes through untouched.\n*/\nfunction qualifyColumnDescriptor(descriptor, namespaceId, qualify) {\n\tif (qualify === void 0) return descriptor;\n\tconst qualified = qualify({\n\t\tcodecId: descriptor.codecId,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams)\n\t}, namespaceId);\n\tif (qualified.typeParams === descriptor.typeParams) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\t...ifDefined(\"typeParams\", qualified.typeParams)\n\t};\n}\n/**\n* Records a deferred column's entity-ref into the namespace-scoped collection\n* accumulator (`namespaceId → entityKind → entityName`) — folded into the same\n* namespace assembly `deriveEntityValueSets`/`entries.<kind>` step as the\n* entities-channel attachments, so a column-collected entity gets its\n* value-set the same way an entities-channel one does.\n*\n* The same handle reused by many columns in one namespace is normal (a native\n* enum type backs any number of columns) and records the identical entity once.\n* Two *different* entity instances sharing a name+kind in one namespace is a\n* name collision — the emitted `entries.valueSet.<name>` could only reflect one\n* of them, silently mismatching the other column's type/cast. PSL hard-errors\n* on the equivalent (`PSL_DUPLICATE_DECLARATION`); the TS path rejects it too.\n*/\nfunction collectEntityFromColumn(collected, namespaceId, entityRef) {\n\tconst forNs = collected[namespaceId] ?? {};\n\tconst forKind = forNs[entityRef.entityKind] ?? {};\n\tconst existing = forKind[entityRef.entityName];\n\tif (existing !== void 0 && existing !== entityRef.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${entityRef.entityKind}\" entities named \"${entityRef.entityName}\" in namespace \"${namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\tkind: entityRef.entityKind,\n\t\tname: entityRef.entityName,\n\t\tnamespaceId\n\t} });\n\tforKind[entityRef.entityName] = entityRef.entity;\n\tforNs[entityRef.entityKind] = forKind;\n\tcollected[namespaceId] = forNs;\n}\n/**\n* Merges a namespace's entities-channel attachments (lowered from the\n* `entities` handle list, carried on `ContractDefinition.attachedEntities`)\n* with the entities collected from that namespace's deferred entity-ref\n* columns. A column-collected entity that shadows a *different* attached\n* entity of the same kind+name (or vice-versa) is the same name-collision bug\n* `collectEntityFromColumn` guards against across columns, so it is rejected\n* the same way — by entity identity, so the same handle attached and used by\n* a column does not throw.\n*/\nfunction mergeColumnAndAttachedEntities(namespaceId, attached, columnCollected) {\n\tif (attached === void 0) return columnCollected;\n\tif (columnCollected === void 0) return attached;\n\tconst kinds = /* @__PURE__ */ new Set([...Object.keys(attached), ...Object.keys(columnCollected)]);\n\tconst result = {};\n\tfor (const kind of kinds) {\n\t\tconst attachedForKind = attached[kind];\n\t\tconst columnForKind = columnCollected[kind];\n\t\tfor (const [name, entity] of Object.entries(columnForKind ?? {})) {\n\t\t\tconst existing = attachedForKind?.[name];\n\t\t\tif (existing !== void 0 && existing !== entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${kind}\" entities named \"${name}\" in namespace \"${namespaceId}\" — a column-referenced entity conflicts with an attached one; pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t}\n\t\tresult[kind] = {\n\t\t\t...attachedForKind,\n\t\t\t...columnForKind\n\t\t};\n\t}\n\treturn result;\n}\nfunction resolveModelNamespaceId(model, modelNameToNamespaceId, defaultNamespaceId) {\n\tif (model.namespaceId !== void 0 && model.namespaceId.length > 0) return model.namespaceId;\n\treturn modelNameToNamespaceId.get(model.modelName) ?? defaultNamespaceId;\n}\nfunction toOneRelationNullable(semanticModel, relation) {\n\tconst location = `Relation \"${semanticModel.modelName}.${relation.fieldName}\"`;\n\tif (relation.nullable === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} with cardinality \"${relation.cardinality}\" must state whether it is nullable`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-missing\"\n\t} });\n\tconst localColumns = relation.on.parentColumns;\n\tconst { contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: semanticModel.fields.filter((field) => localColumns.includes(field.columnName)).map((field) => field.nullable),\n\t\townsReference: relation.cardinality === \"N:1\"\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", relation.cardinality === \"N:1\" ? toOneNullabilityContradictionMessage(location, contradiction) : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn relation.nullable;\n}\nfunction buildThroughDescriptor(through, tableNamespaceByName, targetModel, modelName, fieldName, defaultNamespaceId) {\n\tif (!tableNamespaceByName.has(through.table)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `buildSqlContractFromDefinition: junction table \"${through.table}\" for relation \"${modelName}.${fieldName}\" is not a declared model.`, { meta: {\n\t\tsourceModel: modelName,\n\t\trelationName: fieldName,\n\t\tjunctionTable: through.table\n\t} });\n\tconst namespaceId = through.namespaceId ?? defaultNamespaceId;\n\treturn {\n\t\ttable: through.table,\n\t\tnamespaceId,\n\t\tparentColumns: through.parentColumns,\n\t\tchildColumns: through.childColumns,\n\t\ttargetColumns: targetColumnsForJunction(targetModel, fieldName)\n\t};\n}\nfunction targetColumnsForJunction(targetModel, fieldName) {\n\tconst primaryKeyColumns = targetModel.id?.columns;\n\tif (primaryKeyColumns && primaryKeyColumns.length > 0) return primaryKeyColumns;\n\tconst firstUnique = targetModel.uniques?.find((u) => u.columns.length > 0);\n\tif (firstUnique) return firstUnique.columns;\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `M:N target model \"${targetModel.modelName}\" (relation field \"${fieldName}\") has no primary id or unique key to derive junction targetColumns.`, { meta: {\n\t\tmodelName: targetModel.modelName,\n\t\treason: \"no-key-for-junction-target-columns\"\n\t} });\n}\nfunction validateColumnTypeParams(dataType, typeParams, site) {\n\ttry {\n\t\tvalidateSqlTypeParams(dataType, dataTypeParams(dataType, typeParams));\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `Field \"${site.modelName}.${site.fieldName}\" has type parameters that its data type does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\tmodelName: site.modelName,\n\t\t\t\tfieldName: site.fieldName\n\t\t\t}\n\t\t});\n\t}\n}\nfunction buildStorageColumn(field, enumRefs, modelName, storageTypes, lookups) {\n\tconst { codecLookup } = lookups;\n\tconst { descriptor } = field;\n\tconst codecId = descriptor.codecId;\n\tconst isListColumn = storedAsListColumn({\n\t\tlist: field.many === true,\n\t\ttypedByValueObject: isValueObjectMember(field)\n\t});\n\tconst noCheck = isValueObjectMember(field) ? void 0 : field.noCheck;\n\tconst typeParams = resolvedTypeParams(descriptor, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(codecId, lookups);\n\tvalidateColumnTypeParams(dataType, typeParams, {\n\t\tmodelName,\n\t\tfieldName: field.fieldName\n\t});\n\tconst encodedDefault = field.default !== void 0 ? encodeColumnDefault(field.default, codecLookup, (lookup) => columnCodec(codecId, typeParams, lookup), {\n\t\tmodelName,\n\t\tfieldName: field.fieldName,\n\t\tcodecId\n\t}, isListColumn, field.elementNullable === true) : void 0;\n\tinvariant(enumRefs === void 0 || descriptor.valueSet === void 0, `Field \"${modelName}.${field.fieldName}\" is typed by a domain enum and also carries a storage value set from its type constructor.`);\n\tconst valueSet = enumRefs?.storage ?? descriptor.valueSet;\n\treturn {\n\t\tdataType: dataType.id,\n\t\tcodecId,\n\t\tnullable: field.nullable,\n\t\tmany: isListColumn ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"noCheck\", noCheck && [...noCheck].sort()),\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams),\n\t\t...ifDefined(\"default\", encodedDefault),\n\t\t...ifDefined(\"typeRef\", descriptor.typeRef),\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n}\n/**\n* The refs of a field typed by an authored enum: the domain enum and its storage value set. Authored enums are registered in the default namespace, whatever namespace the field's model is in.\n*/\nfunction enumValueSetRefs(enumHandle, defaultNamespaceId) {\n\tif (enumHandle === void 0) return void 0;\n\tconst common = {\n\t\tnamespaceId: defaultNamespaceId,\n\t\tentityName: enumHandle.enumName\n\t};\n\treturn {\n\t\tdomain: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\t...common\n\t\t},\n\t\tstorage: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\t...common\n\t\t}\n\t};\n}\nfunction buildDomainField(field, defaultNamespaceId, storageTypes) {\n\tif (isValueObjectMember(field)) return {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: field.valueObjectName\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false\n\t};\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: field.descriptor.codecId,\n\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(field.descriptor, storageTypes))\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"valueSet\", enumValueSetRefs(field.enumTypeHandle, defaultNamespaceId)?.domain)\n\t};\n}\nfunction collectStorageNamespaceCoordinateIds(definition) {\n\tconst ids = /* @__PURE__ */ new Set();\n\tids.add(definition.target.defaultNamespaceId);\n\tfor (const id of definition.namespaces ?? []) if (id.length > 0) ids.add(id);\n\tfor (const model of definition.models) if (model.namespaceId !== void 0 && model.namespaceId.length > 0) ids.add(model.namespaceId);\n\tfor (const id of Object.keys(definition.attachedEntities ?? {})) if (id.length > 0) ids.add(id);\n\treturn ids;\n}\n/**\n* Entry kinds the framework assembler itself manages (`table` from models,\n* `valueSet` from `enums` and attached-entity value-set derivation). A\n* pack-attached entity claiming one of these would silently clobber or be\n* clobbered by the managed slot, so it is rejected outright.\n*/\nconst MANAGED_ENTRY_KINDS = /* @__PURE__ */ new Set([tableEntityKind.kind, valueSetEntityKind.kind]);\nfunction assertNoManagedEntityKinds(namespaceId, entitiesForNs) {\n\tif (entitiesForNs === void 0) return;\n\tfor (const kind of Object.keys(entitiesForNs)) if (MANAGED_ENTRY_KINDS.has(kind)) throw contractError(\"CONTRACT.ENTITY_KIND_INVALID\", `buildSqlContractFromDefinition: attached entity in namespace \"${namespaceId}\" declares entry kind \"${kind}\", which is managed by the framework (table/valueSet) and cannot be attached.`, { meta: {\n\t\tentityKind: kind,\n\t\tnamespaceId\n\t} });\n}\n/**\n* Walks the flat `entityTypes` namespace tree contributed by the target pack\n* and every extension pack, indexing descriptors by their `discriminator` —\n* the same string a pack entity's entries-map key (`entries.<kind>`) uses.\n* Mirrors `contract-psl`'s `buildEntityTypesByDiscriminator`, recomposed here\n* from the packs `ContractDefinition` already carries (`target` +\n* `extensions`) since the TS assembler has no single pre-merged\n* `AuthoringContributions` input to read the way the PSL interpreter does.\n*/\nfunction collectEntityTypeDescriptorsByDiscriminator(definition) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst walk = (namespace) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse walk(value);\n\t};\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walk(entityTypes);\n\t}\n\treturn result;\n}\n/**\n* Derives value-sets for every pack entity declared in one namespace,\n* reusing the same `SqlValueSetDerivingEntityTypeOutput.deriveValueSet` hook\n* `contract-psl`'s `lowerExtensionBlocksForNamespace` folds into\n* `entries.valueSet` on the PSL path — so a TS-attached entity (e.g. a\n* native enum) gets its value-set the same way. Entity kinds with no\n* registered descriptor, or whose descriptor output doesn't derive a\n* value-set, contribute nothing.\n*/\nfunction deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator) {\n\tif (entitiesForNs === void 0) return void 0;\n\tlet result;\n\tfor (const [kind, entitiesByName] of Object.entries(entitiesForNs)) {\n\t\tconst descriptor = entityTypesByDiscriminator.get(kind);\n\t\tif (descriptor === void 0) continue;\n\t\tfor (const [name, entity] of Object.entries(entitiesByName)) {\n\t\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\t\tif (derivedValueSet === void 0) continue;\n\t\t\tresult ??= {};\n\t\t\tresult[name] = derivedValueSet;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Merges a namespace's `enumType()`-derived value-sets with its pack-entity-\n* derived value-sets. Both land in the same `entries.valueSet[name]` slot —\n* which drives value-set → codec typing and the domain-enum CHECK — so a\n* same-named entry in both would let one silently overwrite the other and\n* corrupt whichever column resolves against it. The same collision class the\n* `mergeColumnAndAttachedEntities` guard rejects; the PSL path already hard-errors\n* on the equivalent (`interpretPslDocumentToSqlContract`). Reject it here too.\n*/\nfunction mergeNamespaceValueSets(namespaceId, enumValueSets, packValueSets) {\n\tif (enumValueSets !== void 0 && packValueSets !== void 0) {\n\t\tfor (const name of Object.keys(packValueSets)) if (Object.hasOwn(enumValueSets, name)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: value-set \"${name}\" in namespace \"${namespaceId}\" is derived from both an enum and a pack entity — names must be unique per namespace.`, { meta: {\n\t\t\tkind: \"valueSet\",\n\t\t\tname,\n\t\t\tnamespaceId\n\t\t} });\n\t}\n\treturn {\n\t\t...enumValueSets,\n\t\t...packValueSets\n\t};\n}\nfunction ensureUnboundNamespaceSlot(namespaces, createNamespace) {\n\tif (Object.hasOwn(namespaces, UNBOUND_NAMESPACE_ID)) return namespaces;\n\tconst unbound = createNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: { table: {} }\n\t});\n\treturn {\n\t\t[UNBOUND_NAMESPACE_ID]: unbound,\n\t\t...namespaces\n\t};\n}\nconst DERIVABLE_CHECK_KINDS = [\"membership\", \"elementNotNull\"];\n/**\n* Which of `columnNames` could have produced `prefix` for some\n* {@link CheckKind} — the reverse of {@link derivedCheckPrefixes}, used only\n* to name the collision in `CONTRACT.CHECK_NAME_RESERVED`'s message. Callers\n* already know `prefix` is a member of `derivedCheckPrefixes(tableName,\n* columnNames)`, so the result is never empty.\n*/\nfunction columnsProducingCheckPrefix(tableName, columnNames, prefix) {\n\treturn columnNames.filter((columnName) => DERIVABLE_CHECK_KINDS.some((kind) => composeCheckWirePrefix(tableName, columnName, kind) === prefix));\n}\nfunction buildSqlContractFromDefinition(definition, codecLookup, dataTypeLookup) {\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup\n\t};\n\tconst target = definition.target.targetId;\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst qualifyColumnType = resolveColumnTypeQualifier(definition.target);\n\tconst renderCheckExpressions = resolveCheckExpressionRenderer(definition.target);\n\tconst targetFamily = \"sql\";\n\tconst resolveNamespaceId = (m) => m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId;\n\tconst modelsByName = new Map(definition.models.map((m) => [m.modelName, m]));\n\tconst tableNamespaceByName = new Map(definition.models.map((m) => [m.tableName, m.namespaceId !== void 0 && m.namespaceId.length > 0 ? m.namespaceId : defaultNamespaceId]));\n\tconst modelsByCoordinate = new Map(definition.models.map((m) => [`${resolveNamespaceId(m)}:${m.modelName}`, m]));\n\tconst tablesByNamespace = {};\n\tconst authoringWarnings = [...definition.warnings ?? []];\n\tconst modelNameToNamespaceId = /* @__PURE__ */ new Map();\n\tconst executionDefaults = [];\n\tconst modelsByNamespace = {};\n\tconst collectedColumnEntities = {};\n\tconst rootEntries = [];\n\tfor (const semanticModel of definition.models) {\n\t\tconst tableName = semanticModel.tableName;\n\t\tconst namespaceId = semanticModel.namespaceId !== void 0 && semanticModel.namespaceId.length > 0 ? semanticModel.namespaceId : defaultNamespaceId;\n\t\tmodelNameToNamespaceId.set(semanticModel.modelName, namespaceId);\n\t\tif (!semanticModel.sharesBaseTable) rootEntries.push({\n\t\t\ttableName,\n\t\t\tnamespaceId,\n\t\t\tref: crossRef(semanticModel.modelName, namespaceId)\n\t\t});\n\t\tconst columns = {};\n\t\tconst fieldToColumn = {};\n\t\tconst domainFields = {};\n\t\tconst checksForTable = [];\n\t\tconst derivesChecks = effectiveControlPolicy(semanticModel.control, definition.defaultControlPolicy) === \"managed\";\n\t\tfor (const field of semanticModel.fields) {\n\t\t\tconst executionDefaultPhases = field.executionDefaults?.onCreate || field.executionDefaults?.onUpdate ? field.executionDefaults : void 0;\n\t\t\tif (executionDefaultPhases) {\n\t\t\t\tif (field.default !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" cannot define both default and executionDefaults.`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"default-and-executionDefaults\"\n\t\t\t\t} });\n\t\t\t\tif (field.nullable) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${semanticModel.modelName}.${field.fieldName}\" is filled on write by a generated default (a preset such as temporal.createdAt() or an id generator), so it cannot be optional; remove .optional().`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\treason: \"nullable-with-executionDefaults\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tconst enumHandle = !isValueObjectMember(field) ? field.enumTypeHandle : void 0;\n\t\t\tlet resolvedField = field;\n\t\t\tif (!isValueObjectMember(field)) {\n\t\t\t\tlet descriptor = field.descriptor;\n\t\t\t\tconst entityRef = descriptor.entityRef;\n\t\t\t\tif (entityRef !== void 0) {\n\t\t\t\t\tcollectEntityFromColumn(collectedColumnEntities, namespaceId, entityRef);\n\t\t\t\t\tdescriptor = resolveEntityRefDescriptor(descriptor, namespaceId);\n\t\t\t\t}\n\t\t\t\tdescriptor = qualifyColumnDescriptor(descriptor, namespaceId, qualifyColumnType);\n\t\t\t\tif (descriptor !== field.descriptor) resolvedField = {\n\t\t\t\t\t...field,\n\t\t\t\t\tdescriptor\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!isValueObjectMember(resolvedField) && resolvedField.noCheck !== void 0) {\n\t\t\t\tconst { noCheck: authoredNoCheck, ...withoutNoCheck } = resolvedField;\n\t\t\t\tresolvedField = derivesChecks ? {\n\t\t\t\t\t...withoutNoCheck,\n\t\t\t\t\tnoCheck: resolveNoCheckKinds({\n\t\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\t\tfieldName: field.fieldName,\n\t\t\t\t\t\tkinds: authoredNoCheck,\n\t\t\t\t\t\tmany: resolvedField.many === true,\n\t\t\t\t\t\telementNullable: resolvedField.elementNullable === true,\n\t\t\t\t\t\tisDomainEnum: enumHandle !== void 0\n\t\t\t\t\t})\n\t\t\t\t} : withoutNoCheck;\n\t\t\t}\n\t\t\tconst column = buildStorageColumn(resolvedField, enumValueSetRefs(enumHandle, defaultNamespaceId), semanticModel.modelName, definition.storageTypes ?? {}, lookups);\n\t\t\tconst columnMany = column.many ?? false;\n\t\t\tcolumns[field.columnName] = column;\n\t\t\tfieldToColumn[field.fieldName] = field.columnName;\n\t\t\tif (renderCheckExpressions !== void 0 && derivesChecks) {\n\t\t\t\tconst waivedKinds = !isValueObjectMember(resolvedField) ? resolvedField.noCheck : void 0;\n\t\t\t\tchecksForTable.push(...lowerRenderedChecks(tableName, renderCheckExpressions({\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumnName: field.columnName,\n\t\t\t\t\tmany: columnMany !== false,\n\t\t\t\t\telementNullable: columnMany !== false && columnMany.elementNullable,\n\t\t\t\t\tmemberValues: enumHandle !== void 0 ? checkMemberValues(enumHandle, codecLookup) : void 0\n\t\t\t\t}).filter((candidate) => !(waivedKinds?.includes(candidate.kind) ?? false))));\n\t\t\t}\n\t\t\tdomainFields[field.fieldName] = buildDomainField(resolvedField, defaultNamespaceId, definition.storageTypes ?? {});\n\t\t\tif (executionDefaultPhases) executionDefaults.push({\n\t\t\t\tref: {\n\t\t\t\t\tnamespace: namespaceId,\n\t\t\t\t\tentry: tableName,\n\t\t\t\t\tfield: field.columnName\n\t\t\t\t},\n\t\t\t\t...ifDefined(\"onCreate\", executionDefaultPhases.onCreate),\n\t\t\t\t...ifDefined(\"onUpdate\", executionDefaultPhases.onUpdate)\n\t\t\t});\n\t\t}\n\t\tconst authoringForeignKeys = (semanticModel.foreignKeys ?? []).map((fk) => {\n\t\t\tif (fk.references.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? defaultNamespaceId;\n\t\t\t\treturn {\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\t\ttableName,\n\t\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t\t},\n\t\t\t\t\ttarget: {\n\t\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\t\tcolumns: fk.references.columns,\n\t\t\t\t\t\tspaceId: fk.references.spaceId\n\t\t\t\t\t},\n\t\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, fk.references.model, fk.references.namespaceId, \"Foreign key\");\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, fk.references.table, \"Foreign key\");\n\t\t\tconst targetNamespaceId = fk.references.namespaceId ?? (targetModel.namespaceId !== void 0 && targetModel.namespaceId.length > 0 ? targetModel.namespaceId : defaultNamespaceId);\n\t\t\treturn {\n\t\t\t\tsource: {\n\t\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumns: fk.columns\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\tnamespaceId: asNamespaceId(targetNamespaceId),\n\t\t\t\t\ttableName: fk.references.table,\n\t\t\t\t\tcolumns: fk.references.columns\n\t\t\t\t},\n\t\t\t\t...applyFkDefaults({\n\t\t\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t\t\t...ifDefined(\"index\", fk.index)\n\t\t\t\t}, definition.foreignKeyDefaults),\n\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t\t\t};\n\t\t});\n\t\tif (semanticModel.sharesBaseTable && semanticModel.checks && semanticModel.checks.length > 0) throw contractError(\"CONTRACT.CHECK_ON_STI_VARIANT\", `Model \"${semanticModel.modelName}\" declares a check constraint but shares its base model's storage table (single-table inheritance) and has no table of its own to declare it on. Declare the check on the base model instead.`, { meta: {\n\t\t\ttableName,\n\t\t\tmodelName: semanticModel.modelName\n\t\t} });\n\t\tif (!semanticModel.sharesBaseTable) {\n\t\t\tconst uniques = (semanticModel.uniques ?? []).map((u) => ({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name)\n\t\t\t}));\n\t\t\tconst declaredIndexes = (semanticModel.indexes ?? []).map((i) => ({\n\t\t\t\tnamedByUser: i.name !== void 0 || i.map !== void 0,\n\t\t\t\tindex: lowerAuthoredIndex(tableName, blindCast({\n\t\t\t\t\t...ifDefined(\"columns\", i.columns),\n\t\t\t\t\t...ifDefined(\"expression\", i.expression),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tmap: i.map,\n\t\t\t\t\tname: i.name,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options\n\t\t\t\t}), authoringWarnings)\n\t\t\t}));\n\t\t\tif (semanticModel.checks !== void 0 && semanticModel.checks.length > 0) {\n\t\t\t\tconst tableColumnNames = Object.keys(columns);\n\t\t\t\tconst reservedCheckPrefixes = derivedCheckPrefixes(tableName, tableColumnNames);\n\t\t\t\tfor (const authoredCheck of semanticModel.checks) {\n\t\t\t\t\tconst lowered = lowerAuthoredCheck(tableName, authoredCheck, authoringWarnings);\n\t\t\t\t\tif (lowered.naming.kind === \"wire\" && reservedCheckPrefixes.has(lowered.naming.prefix)) {\n\t\t\t\t\t\tconst collidingColumns = columnsProducingCheckPrefix(tableName, tableColumnNames, lowered.naming.prefix);\n\t\t\t\t\t\tconst columnList = collidingColumns.map((name) => `\"${name}\"`).join(\", \");\n\t\t\t\t\t\tthrow contractError(\"CONTRACT.CHECK_NAME_RESERVED\", `Check \"${lowered.naming.prefix}\" on table \"${tableName}\": this name's prefix matches the shape a derived enforcement check would use for column${collidingColumns.length === 1 ? \"\" : \"s\"} ${columnList} of this table, so it can't be told apart from one. Choose a different name.`, { meta: {\n\t\t\t\t\t\t\ttableName,\n\t\t\t\t\t\t\tprefix: lowered.naming.prefix,\n\t\t\t\t\t\t\tcollidingColumns\n\t\t\t\t\t\t} });\n\t\t\t\t\t}\n\t\t\t\t\tchecksForTable.push(new CheckConstraint(lowered));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst primaryKey = semanticModel.id ? {\n\t\t\t\tcolumns: semanticModel.id.columns,\n\t\t\t\t...ifDefined(\"name\", semanticModel.id.name)\n\t\t\t} : void 0;\n\t\t\tconst { foreignKeys, indexes } = materializeForeignKeysAndIndexes({\n\t\t\t\ttableName,\n\t\t\t\tforeignKeys: authoringForeignKeys,\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\twarnings: authoringWarnings\n\t\t\t});\n\t\t\tconst tableInput = {\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"control\", semanticModel.control),\n\t\t\t\tuniques,\n\t\t\t\tindexes: indexes.map((i) => new Index(i)),\n\t\t\t\tforeignKeys,\n\t\t\t\t...primaryKey ? { primaryKey } : {},\n\t\t\t\t...checksForTable.length > 0 ? { checks: checksForTable } : {}\n\t\t\t};\n\t\t\tlet nsTables = tablesByNamespace[namespaceId];\n\t\t\tif (nsTables === void 0) {\n\t\t\t\tnsTables = {};\n\t\t\t\ttablesByNamespace[namespaceId] = nsTables;\n\t\t\t}\n\t\t\tif (nsTables[tableName] !== void 0) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: duplicate table \"${tableName}\" in namespace \"${namespaceId}\".`, { meta: {\n\t\t\t\tkind: \"table\",\n\t\t\t\tname: tableName,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t\tnsTables[tableName] = tableInput;\n\t\t}\n\t\tconst storageFields = {};\n\t\tfor (const [fieldName, columnName] of Object.entries(fieldToColumn)) storageFields[fieldName] = { column: columnName };\n\t\tconst columnToField = new Map(Object.entries(fieldToColumn).map(([field, col]) => [col, field]));\n\t\tconst modelRelations = {};\n\t\tfor (const relation of semanticModel.relations ?? []) {\n\t\t\tif (relation.spaceId !== void 0) {\n\t\t\t\tconst targetNamespaceId = relation.namespaceId ?? defaultNamespaceId;\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto: crossRef(relation.toModel, targetNamespaceId, relation.spaceId),\n\t\t\t\t\tcardinality: \"N:1\",\n\t\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\t\ton: {\n\t\t\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\t\t\ttargetFields: relation.on.childColumns\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst targetModel = assertKnownTargetModel(modelsByName, modelsByCoordinate, semanticModel.modelName, relation.toModel, relation.toNamespaceId, \"Relation\");\n\t\t\tinvariant(relation.toTable !== void 0, `Relation \"${semanticModel.modelName}.${relation.fieldName}\" is local but carries no target table; only cross-space relations may leave it unset.`);\n\t\t\tassertTargetTableMatches(semanticModel.modelName, targetModel, relation.toTable, \"Relation\");\n\t\t\tconst targetColumnToField = new Map(targetModel.fields.map((f) => [f.columnName, f.fieldName]));\n\t\t\tconst to = crossRef(relation.toModel, relation.toNamespaceId !== void 0 && relation.toNamespaceId.length > 0 ? relation.toNamespaceId : resolveModelNamespaceId(targetModel, modelNameToNamespaceId, defaultNamespaceId));\n\t\t\tconst on = {\n\t\t\t\tlocalFields: relation.on.parentColumns.map((col) => columnToField.get(col) ?? col),\n\t\t\t\ttargetFields: relation.on.childColumns.map((col) => targetColumnToField.get(col) ?? col)\n\t\t\t};\n\t\t\tif (relation.cardinality === \"N:M\") {\n\t\t\t\tif (!relation.through) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${semanticModel.modelName}.${relation.fieldName}\" with cardinality \"N:M\" requires through metadata`, { meta: {\n\t\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\t\trelationName: relation.fieldName,\n\t\t\t\t\treason: \"many-to-many-missing-through\"\n\t\t\t\t} });\n\t\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\t\tto,\n\t\t\t\t\tcardinality: \"N:M\",\n\t\t\t\t\ton,\n\t\t\t\t\tthrough: buildThroughDescriptor(relation.through, tableNamespaceByName, targetModel, semanticModel.modelName, relation.fieldName, defaultNamespaceId)\n\t\t\t\t};\n\t\t\t} else if (relation.cardinality === \"1:N\") modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: \"1:N\",\n\t\t\t\ton\n\t\t\t};\n\t\t\telse modelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: relation.cardinality,\n\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\ton\n\t\t\t};\n\t\t}\n\t\tlet namespaceModels = modelsByNamespace[namespaceId];\n\t\tif (namespaceModels === void 0) {\n\t\t\tnamespaceModels = {};\n\t\t\tmodelsByNamespace[namespaceId] = namespaceModels;\n\t\t}\n\t\tnamespaceModels[semanticModel.modelName] = {\n\t\t\tstorage: {\n\t\t\t\ttable: tableName,\n\t\t\t\tnamespaceId,\n\t\t\t\tfields: storageFields\n\t\t\t},\n\t\t\tfields: domainFields,\n\t\t\trelations: modelRelations\n\t\t};\n\t}\n\tconst rootTableNameCounts = /* @__PURE__ */ new Map();\n\tfor (const entry of rootEntries) rootTableNameCounts.set(entry.tableName, (rootTableNameCounts.get(entry.tableName) ?? 0) + 1);\n\tconst roots = {};\n\tfor (const entry of rootEntries) {\n\t\tconst key = (rootTableNameCounts.get(entry.tableName) ?? 0) > 1 ? `${entry.namespaceId}.${entry.tableName}` : entry.tableName;\n\t\troots[key] = entry.ref;\n\t}\n\tconst rawStorageTypes = definition.storageTypes ?? {};\n\tconst documentTypes = Object.fromEntries(Object.entries(rawStorageTypes).map(([name, entry]) => [name, toStorageTypeInstance({\n\t\tcodecId: entry.codecId,\n\t\tdataType: sqlDataTypeOfCodec(entry.codecId, lookups).id,\n\t\ttypeParams: entry.typeParams\n\t})]));\n\tconst namespaceCoordinateIds = collectStorageNamespaceCoordinateIds(definition);\n\tconst domainEnumsByNs = {};\n\tconst storageValueSetsByNs = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclarationKey: enumName,\n\t\t\treason: \"key-name-mismatch\"\n\t\t} });\n\t\tconst nsId = defaultNamespaceId;\n\t\tlet domainSlot = domainEnumsByNs[nsId];\n\t\tif (domainSlot === void 0) {\n\t\t\tdomainSlot = {};\n\t\t\tdomainEnumsByNs[nsId] = domainSlot;\n\t\t}\n\t\tconst storedMembers = encodeEnumMembers(handle, codecLookup);\n\t\tdomainSlot[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: storedMembers\n\t\t};\n\t\tlet storageSlot = storageValueSetsByNs[nsId];\n\t\tif (storageSlot === void 0) {\n\t\t\tstorageSlot = {};\n\t\t\tstorageValueSetsByNs[nsId] = storageSlot;\n\t\t}\n\t\tstorageSlot[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: storedMembers.map((member) => member.value)\n\t\t};\n\t}\n\tconst { createNamespace } = definition;\n\tconst entityTypesByDiscriminator = collectEntityTypeDescriptorsByDiscriminator(definition);\n\tconst namespaces = Object.fromEntries([...namespaceCoordinateIds].sort().map((id) => {\n\t\tconst entitiesForNs = mergeColumnAndAttachedEntities(id, definition.attachedEntities?.[id], collectedColumnEntities[id]);\n\t\tassertNoManagedEntityKinds(id, entitiesForNs);\n\t\tconst enumValueSetEntries = storageValueSetsByNs[id];\n\t\tconst packValueSetEntries = deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator);\n\t\tconst valueSetEntries = enumValueSetEntries !== void 0 || packValueSetEntries !== void 0 ? mergeNamespaceValueSets(id, enumValueSetEntries, packValueSetEntries) : void 0;\n\t\tconst nsInput = {\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\ttable: tablesByNamespace[id] ?? {},\n\t\t\t\t...entitiesForNs,\n\t\t\t\t...valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0 ? { valueSet: valueSetEntries } : {}\n\t\t\t}\n\t\t};\n\t\treturn [id, createNamespace(nsInput)];\n\t}));\n\tconst storageWithoutHash = {\n\t\t...Object.keys(documentTypes).length > 0 ? { types: documentTypes } : {},\n\t\tnamespaces: defaultNamespaceId === UNBOUND_NAMESPACE_ID ? ensureUnboundNamespaceSlot(namespaces, createNamespace) : namespaces\n\t};\n\tconst storageHash = definition.storageHash ? coreHash(definition.storageHash) : computeStorageHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tstorage: blindCast(storageWithoutHash),\n\t\t...sqlContractCanonicalizationHooks\n\t});\n\tconst storage = new SqlStorage({\n\t\t...storageWithoutHash,\n\t\tstorageHash\n\t});\n\tconst extensionNamespaces = definition.extensions ? Object.values(definition.extensions).map((pack) => pack.id) : void 0;\n\tconst extensions = { ...definition.extensions || {} };\n\tif (extensionNamespaces) {\n\t\tfor (const namespace of extensionNamespaces) if (!Object.hasOwn(extensions, namespace)) extensions[namespace] = {};\n\t}\n\tconst capabilities = mergeCapabilityMatrices({}, [definition.target, ...Object.values(definition.extensions ?? {})]);\n\tconst profileHash = computeProfileHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tcapabilities: {}\n\t});\n\tconst executionWithHash = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: executionDefaults\n\t});\n\tconst valueObjects = definition.valueObjects && definition.valueObjects.length > 0 ? Object.fromEntries(definition.valueObjects.map((vo) => [vo.name, { fields: Object.fromEntries(vo.fields.map((f) => [f.fieldName, buildDomainField(f, defaultNamespaceId, definition.storageTypes ?? {})])) }])) : void 0;\n\tconst domainNamespaceIds = new Set(Object.keys(modelsByNamespace));\n\tif (domainNamespaceIds.size === 0) domainNamespaceIds.add(defaultNamespaceId);\n\tif (valueObjects !== void 0) domainNamespaceIds.add(defaultNamespaceId);\n\tfor (const nsId of Object.keys(domainEnumsByNs)) domainNamespaceIds.add(nsId);\n\tconst domainNamespaces = Object.fromEntries([...domainNamespaceIds].sort().map((namespaceId) => {\n\t\tconst modelsInNs = modelsByNamespace[namespaceId] ?? {};\n\t\tconst enumsInNs = domainEnumsByNs[namespaceId];\n\t\treturn [namespaceId, {\n\t\t\tmodels: modelsInNs,\n\t\t\t...namespaceId === defaultNamespaceId && valueObjects !== void 0 ? { valueObjects } : {},\n\t\t\t...enumsInNs !== void 0 && Object.keys(enumsInNs).length > 0 ? { enum: enumsInNs } : {}\n\t\t}];\n\t}));\n\tconst contract = {\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\tdomain: { namespaces: domainNamespaces },\n\t\troots,\n\t\tstorage,\n\t\t...executionWithHash ? { execution: executionWithHash } : {},\n\t\textensions,\n\t\tcapabilities,\n\t\tprofileHash,\n\t\tmeta: {}\n\t};\n\tassertStorageSemantics(definition, contract);\n\tflushAuthoringWarnings(authoringWarnings);\n\treturn contract;\n}\n//#endregion\n//#region src/derived-checks.ts\n/**\n* The one step every SQL contract specifier funnels its loaded contract\n* through: stamp the specifier's default control policy, then strip derived\n* checks from every table the stamped policy leaves non-managed. Composing the\n* two here is what keeps the managed-only consequence from being skipped on\n* any specifier route.\n*/\nfunction applySqlSpecifierControlPolicy(contract, defaultControlPolicy, createNamespace) {\n\treturn stripDerivedChecksFromNonManagedTables(applySpecifierDefaultControlPolicy(contract, defaultControlPolicy), createNamespace);\n}\n/**\n* Removes generated enforcement checks from every table whose effective\n* control policy is not `managed`.\n*\n* A check is derived iff its wire prefix is one derivation would produce for\n* some column of its table — {@link derivedCheckPrefixes} enumerates that\n* set. Wire-naming alone no longer identifies derivation: an authored\n* `name:` check (`@@check` / `check()`) is wire-named too, so a bare\n* `check.prefix === undefined` test would delete an author's own constraint\n* from every non-`managed` table. The prefix-shape rule tests against the\n* table's own columns instead of the naming mode, so an authored check with\n* an unrelated prefix survives.\n*\n* The rule is weaker than recomputing the content hash `contract infer`\n* uses: that needs `postgresRenderCheckExpressions` to know what a kind\n* renders, and this funnel has no target descriptor to reach it through. It\n* can only ask whether some column could have produced a prefix of this\n* shape, not whether this exact column produced this exact check. The gap\n* that opens — an authored name that collides with a derived-prefix shape —\n* is closed at authoring time instead: such a name is rejected\n* (`CONTRACT.CHECK_NAME_RESERVED`) before it ever reaches storage.\n*\n* Why derivation stops at the namespace boundary: the contract *describes* an\n* external schema, it does not *prescribe* enforcement for it. Deriving a check\n* for a table Prisma 8 never creates declares a constraint the live database\n* has no reason to carry, and `external` fails verify on a declared shape the\n* database lacks — an unfixable failure, since no plan may emit DDL there\n* either.\n*\n* This is the post-build half of the rule. Authoring skips derivation for a\n* table whose policy is known in the source; this pass catches the policy a\n* contract *specifier* applies after the contract is already built, which is\n* the only signal a pack like the Supabase extension gives. Specifiers reach\n* it through `applySqlSpecifierControlPolicy` above.\n*\n* Returns the contract unchanged (same reference) when nothing is stripped.\n* When something is, the storage hash is recomputed — the stripped contract\n* describes different storage.\n*/\nfunction stripDerivedChecksFromNonManagedTables(contract, createNamespace) {\n\tconst storage = contract.storage;\n\tif (!isSqlStorageShaped(storage)) return contract;\n\tlet anyStripped = false;\n\tconst namespaces = {};\n\tfor (const [namespaceId, namespace] of Object.entries(storage.namespaces)) {\n\t\tif (!isMaterializedSqlNamespace(namespace)) return contract;\n\t\tconst tables = namespace.entries[\"table\"];\n\t\tif (tables === void 0) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tlet namespaceStripped = false;\n\t\tconst nextTables = {};\n\t\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\t\tconst stripped = StorageTable.is(table) ? withoutDerivedChecks(tableName, table, contract.defaultControlPolicy) : table;\n\t\t\tif (stripped !== table) namespaceStripped = true;\n\t\t\tnextTables[tableName] = stripped;\n\t\t}\n\t\tif (!namespaceStripped) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tanyStripped = true;\n\t\tnamespaces[namespaceId] = createNamespace({\n\t\t\tid: namespace.id,\n\t\t\tentries: {\n\t\t\t\t...namespace.entries,\n\t\t\t\ttable: nextTables\n\t\t\t}\n\t\t});\n\t}\n\tif (!anyStripped) return contract;\n\tconst storageWithoutHash = {\n\t\tnamespaces,\n\t\t...ifDefined(\"types\", storage.types)\n\t};\n\treturn {\n\t\t...contract,\n\t\tstorage: new SqlStorage({\n\t\t\t...storageWithoutHash,\n\t\t\tstorageHash: computeStorageHash({\n\t\t\t\ttarget: contract.target,\n\t\t\t\ttargetFamily: contract.targetFamily,\n\t\t\t\tstorage: storageWithoutHash,\n\t\t\t\t...sqlContractCanonicalizationHooks\n\t\t\t})\n\t\t})\n\t};\n}\n/**\n* Structural stand-in for `instanceof SqlStorage`: like the checks it wraps, a\n* storage instance can arrive from a realm whose IR classes are a separate\n* copy (the dist e2e shape), where an `instanceof` test would miss.\n*/\nfunction isSqlStorageShaped(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"namespaces\" in x)) return false;\n\treturn typeof x.namespaces === \"object\" && x.namespaces !== null;\n}\n/** The table itself when it keeps every check, a rebuilt one when it does not. */\nfunction withoutDerivedChecks(tableName, table, contractDefault) {\n\tconst checks = table.checks;\n\tif (checks === void 0 || checks.length === 0) return table;\n\tif (effectiveControlPolicy(table.control, contractDefault) === \"managed\") return table;\n\tconst columnNames = Object.keys(table.columns);\n\tinvariant(columnNames.length > 0, `withoutDerivedChecks: table \"${tableName}\" carries checks but its column map is empty. The caller must pass the table's real, complete column set — an empty or partial map makes every check misclassify as non-derived and survive the strip.`);\n\tconst derivedPrefixes = derivedCheckPrefixes(tableName, columnNames);\n\tconst kept = checks.filter((check) => check.prefix === void 0 || !derivedPrefixes.has(check.prefix));\n\tif (kept.length === checks.length) return table;\n\treturn new StorageTable({\n\t\tcolumns: table.columns,\n\t\tuniques: table.uniques,\n\t\tindexes: table.indexes,\n\t\tforeignKeys: table.foreignKeys,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey),\n\t\t...ifDefined(\"control\", table.control),\n\t\t...kept.length > 0 ? { checks: kept.map((check) => checkConstraintInputFromSerialized({\n\t\t\tname: check.name,\n\t\t\t...ifDefined(\"prefix\", check.prefix),\n\t\t\texpression: check.expression\n\t\t})) } : {}\n\t});\n}\n//#endregion\nexport { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, contractError as o, toOneNullabilityContradictionMessage as r, applySqlSpecifierControlPolicy as t };\n\n//# sourceMappingURL=derived-checks-D5zdlyyh.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,SAAS,mBAAmB,OAAO;CAClC,OAAO,MAAM,QAAQ,CAAC,MAAM;AAC7B;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,qBAAqB;AAC7B;AAGA,SAAS,qCAAqC,UAAU,eAAe;CACtE,OAAO,kBAAkB,sBAAsB,GAAG,SAAS,8DAA8D,GAAG,SAAS;AACtI;;;;AAMA,SAAS,YAAY,SAAS,YAAY,aAAa;CACtD,OAAO,YAAY,aAAa;EAC/B;EACA,GAAG,UAAU,cAAc,eAAe,KAAK,IAAI,KAAK,IAAI,UAAU,UAAU,CAAC;CAClF,CAAC;AACF;;AAEA,SAAS,eAAe,OAAO,OAAO;CACrC,IAAI,OAAO;EACV,MAAM,OAAO,MAAM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;AACF"}
|
package/dist/{derived-checks-DpPkO6Dt-BituyKFg.d.mts → derived-checks-DpPkO6Dt-D3M7YEr2.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { a as SqlNamespaceBase, c as SqlNamespaceInput } from "./sql-storage-BTlJLUID-O6fBB_am.mjs";
|
|
2
|
+
import "./types-BURWzacK.mjs";
|
|
3
3
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
4
4
|
//#region ../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DpPkO6Dt.d.mts
|
|
5
5
|
//#region src/derived-checks.d.ts
|
|
@@ -18,4 +18,4 @@ type SqlNamespaceFactory = (input: SqlNamespaceInput) => SqlNamespaceBase;
|
|
|
18
18
|
declare function applySqlSpecifierControlPolicy(contract: Contract, defaultControlPolicy: ControlPolicy | undefined, createNamespace: SqlNamespaceFactory): Contract;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { applySqlSpecifierControlPolicy as n, SqlNamespaceFactory as t };
|
|
21
|
-
//# sourceMappingURL=derived-checks-DpPkO6Dt-
|
|
21
|
+
//# sourceMappingURL=derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derived-checks-DpPkO6Dt-
|
|
1
|
+
{"version":3,"file":"derived-checks-DpPkO6Dt-D3M7YEr2.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-DpPkO6Dt.d.mts"],"mappings":";;;;;;;;;KAOK,uBAAuB,OAAO,sBAAsB;;;;;;;;iBAQxC,+BAA+B,UAAU,UAAU,sBAAsB,2BAA2B,iBAAiB,sBAAsB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { l as SqlStorage } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-O6fBB_am.mjs";
|
|
2
|
+
import "./types-BURWzacK.mjs";
|
|
3
3
|
import { y as SqlSchemaIRNode } from "./types-CLsPsUiw-Db1BsN9R.mjs";
|
|
4
4
|
import "./types-D6XuABFQ.mjs";
|
|
5
|
-
import "./control-adapter-CkFfBVei-
|
|
6
|
-
import { n as CodecControlHooks } from "./types-CzxOObSY-
|
|
7
|
-
import { t as SqlSchemaDiffFn } from "./schema-differ-CqWOkoW9
|
|
5
|
+
import "./control-adapter-CkFfBVei-BLYeKcLW.mjs";
|
|
6
|
+
import { n as CodecControlHooks } from "./types-CzxOObSY-DEfjmbj1.mjs";
|
|
7
|
+
import { t as SqlSchemaDiffFn } from "./schema-differ-CqWOkoW9-BABSAGGB.mjs";
|
|
8
8
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
9
9
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
10
10
|
import { DiffSubjectGranularity, SchemaDiffIssue, VerifierIssueCategory, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
@@ -101,4 +101,4 @@ interface VerifySqlSchemaByDiffInput {
|
|
|
101
101
|
declare function verifySqlSchemaByDiff(input: VerifySqlSchemaByDiffInput): VerifyDatabaseSchemaResult;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { VerifySqlSchemaByDiffInput as a, computeSqlDiffVerdict as c, StorageTypeVerdictInput as i, computeStorageTypeVerdict as l, SqlDiffVerdictInput as n, classifyDiffSubjectGranularity as o, StorageTypeVerdict as r, classifySqlDiffIssue as s, SqlDiffVerdict as t, verifySqlSchemaByDiff as u };
|
|
104
|
-
//# sourceMappingURL=diff-
|
|
104
|
+
//# sourceMappingURL=diff-CBqsNkxe.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-
|
|
1
|
+
{"version":3,"file":"diff-CBqsNkxe.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as resolvedTypeParams } from "./types-
|
|
1
|
+
import { d as resolvedTypeParams } from "./types-C7oOtFcJ.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { UNBOUND_NAMESPACE_ID, entityAt } from "@prisma/orm-framework/components/ir";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -435,4 +435,4 @@ function generateStorageNamespacesType(namespaces) {
|
|
|
435
435
|
//#endregion
|
|
436
436
|
export { sqlEmission as t };
|
|
437
437
|
|
|
438
|
-
//# sourceMappingURL=dist-
|
|
438
|
+
//# sourceMappingURL=dist-Dm_hQ-hh.mjs.map
|