@prisma/orm-family-sql 8.0.0-rc.1-dev.2 → 8.0.0-rc.1-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ast-Bb6loOw9.d.mts → ast-UfF480P2.d.mts} +3 -3
- package/dist/{ast-Bb6loOw9.d.mts.map → ast-UfF480P2.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs → authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs} +2 -2
- package/dist/{authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs.map → authoring-type-constructors-Blqoa2Ua-DymjrX_a.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/{canonicalization-hooks-DfIc_lOO.mjs → canonicalization-hooks-dmXkOR4a.mjs} +6 -2
- package/dist/{canonicalization-hooks-DfIc_lOO.mjs.map → canonicalization-hooks-dmXkOR4a.mjs.map} +1 -1
- package/dist/{codec-descriptor-registry-BJVJRftS.mjs → codec-descriptor-registry-BK_ZTP-3.mjs} +2 -2
- package/dist/{codec-descriptor-registry-BJVJRftS.mjs.map → codec-descriptor-registry-BK_ZTP-3.mjs.map} +1 -1
- package/dist/{config-types-N7PJc6VN.mjs → config-types-1lEI_abO.mjs} +6 -7
- package/dist/config-types-1lEI_abO.mjs.map +1 -0
- package/dist/{config-types-DKKhWdzf.d.mts → config-types-DuhCZxnc.d.mts} +11 -4
- package/dist/config-types-DuhCZxnc.d.mts.map +1 -0
- package/dist/{contract-builder-Cj-lKWgM.d.mts → contract-builder-B5ztYYVI.d.mts} +7 -6
- package/dist/contract-builder-B5ztYYVI.d.mts.map +1 -0
- package/dist/{contract-builder-YjMQcvZ1.mjs → contract-builder-DQ02XiKy.mjs} +4 -4
- package/dist/contract-builder-DQ02XiKy.mjs.map +1 -0
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.d.mts +2 -2
- package/dist/contract-psl__provider.mjs +4 -4
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +4 -3
- package/dist/contract-ts.mjs +4 -4
- 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 +3 -2
- package/dist/contract-ts__contract-builder.mjs +3 -3
- package/dist/{contract-view-BbWQp6r4.d.mts → contract-view-DB7yHLAp.d.mts} +2 -2
- package/dist/{contract-view-BbWQp6r4.d.mts.map → contract-view-DB7yHLAp.d.mts.map} +1 -1
- package/dist/contract.d.mts +15 -15
- package/dist/contract.mjs +10 -10
- package/dist/contract__canonicalization-hooks.mjs +1 -1
- 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 +1 -1
- package/dist/contract__foreign-key-materialization.mjs +1 -1
- package/dist/contract__index-naming.d.mts +1 -1
- package/dist/contract__index-naming.mjs +1 -1
- package/dist/contract__index-type-validation.d.mts +1 -1
- package/dist/contract__resolve-storage-table.d.mts +1 -1
- package/dist/contract__types.d.mts +7 -7
- package/dist/contract__types.mjs +4 -4
- package/dist/contract__validators.d.mts +1 -1
- package/dist/contract__validators.mjs +2 -2
- package/dist/{control-C1EmRznB.mjs → control-Bj2zT_YF.mjs} +16 -75
- package/dist/control-Bj2zT_YF.mjs.map +1 -0
- package/dist/{control-BWngBFMj.d.mts → control-JKCfuZLF.d.mts} +15 -19
- package/dist/{control-BWngBFMj.d.mts.map → control-JKCfuZLF.d.mts.map} +1 -1
- package/dist/control-adapter-BjSrEp2V.d.mts +1 -0
- package/dist/{control-adapter-C99J7aEF-Cmay9zFj.d.mts → control-adapter-C99J7aEF-BvoknoRl.d.mts} +8 -8
- package/dist/{control-adapter-C99J7aEF-Cmay9zFj.d.mts.map → control-adapter-C99J7aEF-BvoknoRl.d.mts.map} +1 -1
- package/dist/{db-B5PMfDDd-BsvBY8Wh.d.mts → db-B5PMfDDd-ZnA9Kuky.d.mts} +9 -9
- package/dist/{db-B5PMfDDd-BsvBY8Wh.d.mts.map → db-B5PMfDDd-ZnA9Kuky.d.mts.map} +1 -1
- package/dist/{ddl-types-h_3_pXmq-QBLq6WbP.d.mts → ddl-types-h_3_pXmq-DzkUGplM.d.mts} +3 -3
- package/dist/{ddl-types-h_3_pXmq-QBLq6WbP.d.mts.map → ddl-types-h_3_pXmq-DzkUGplM.d.mts.map} +1 -1
- package/dist/{build-contract-DBCz_YSs-DO0wMHai.mjs → derived-checks-BDG-r9XD-CrpFUaO7.mjs} +199 -17
- package/dist/derived-checks-BDG-r9XD-CrpFUaO7.mjs.map +1 -0
- package/dist/derived-checks-DPdD01O0-CXFJD5al.d.mts +21 -0
- package/dist/derived-checks-DPdD01O0-CXFJD5al.d.mts.map +1 -0
- package/dist/diff-B16bL_IR.mjs.map +1 -1
- package/dist/{diff-DnLtQXpg.d.mts → diff-DDfez6HZ.d.mts} +11 -11
- package/dist/{diff-DnLtQXpg.d.mts.map → diff-DDfez6HZ.d.mts.map} +1 -1
- package/dist/{entity-kinds-DKxwKolf-CcsY-iYV.mjs → entity-kinds-3IFQq7Ho-DB6IN-V6.mjs} +16 -15
- package/dist/entity-kinds-3IFQq7Ho-DB6IN-V6.mjs.map +1 -0
- package/dist/{entity-kinds-Dh6VH4uK.d.mts → entity-kinds-FB5fUkUH.d.mts} +9 -8
- package/dist/entity-kinds-FB5fUkUH.d.mts.map +1 -0
- package/dist/{expression-KPBpeH4T.d.mts → expression-CBHseNtv.d.mts} +5 -5
- package/dist/{expression-KPBpeH4T.d.mts.map → expression-CBHseNtv.d.mts.map} +1 -1
- package/dist/{factories-MfcqTt5R.d.mts → factories-BPmhxoFd.d.mts} +4 -4
- package/dist/{factories-MfcqTt5R.d.mts.map → factories-BPmhxoFd.d.mts.map} +1 -1
- package/dist/{factories-CDG9zBxC.mjs → factories-BtnISekg.mjs} +3 -3
- package/dist/{factories-CDG9zBxC.mjs.map → factories-BtnISekg.mjs.map} +1 -1
- package/dist/family.d.mts +12 -12
- package/dist/family.mjs +5 -5
- 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.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-Ca-wRbmj.d.mts → foreign-key-materialization-CetaZvuu.d.mts} +2 -2
- package/dist/{foreign-key-materialization-Ca-wRbmj.d.mts.map → foreign-key-materialization-CetaZvuu.d.mts.map} +1 -1
- package/dist/{foreign-key-materialization-HI7BIQrG.mjs → foreign-key-materialization-fH6cObko.mjs} +2 -2
- package/dist/{foreign-key-materialization-HI7BIQrG.mjs.map → foreign-key-materialization-fH6cObko.mjs.map} +1 -1
- package/dist/{index-BOhWLVvH.d.mts → index-COS9qF9d.d.mts} +16 -16
- package/dist/{index-BOhWLVvH.d.mts.map → index-COS9qF9d.d.mts.map} +1 -1
- package/dist/{index-BZF7Wehu.d.mts → index-avHHFCFT.d.mts} +3 -3
- package/dist/{index-BZF7Wehu.d.mts.map → index-avHHFCFT.d.mts.map} +1 -1
- package/dist/{index-naming-BZWoh45T.d.mts → index-naming-BfRyBZR4.d.mts} +2 -2
- package/dist/{index-naming-BZWoh45T.d.mts.map → index-naming-BfRyBZR4.d.mts.map} +1 -1
- package/dist/{index-naming-BoGBcMmI-DiJAr66H.mjs → index-naming-BoGBcMmI-DE0Eu71F.mjs} +2 -2
- package/dist/{index-naming-BoGBcMmI-DiJAr66H.mjs.map → index-naming-BoGBcMmI-DE0Eu71F.mjs.map} +1 -1
- package/dist/{index-type-validation-D_vuj-76.d.mts → index-type-validation-0NdkDB_n.d.mts} +3 -3
- package/dist/{index-type-validation-D_vuj-76.d.mts.map → index-type-validation-0NdkDB_n.d.mts.map} +1 -1
- package/dist/{interpreter-5WgpL-ax-_nqHLUTr.mjs → interpreter-5WgpL-ax-BIbrd_Xv.mjs} +3 -3
- package/dist/{interpreter-5WgpL-ax-_nqHLUTr.mjs.map → interpreter-5WgpL-ax-BIbrd_Xv.mjs.map} +1 -1
- package/dist/{ir-Cvj3eU-K.d.mts → ir-VWQX6aGP.d.mts} +3 -3
- package/dist/{ir-Cvj3eU-K.d.mts.map → ir-VWQX6aGP.d.mts.map} +1 -1
- package/dist/lane-query-builder.d.mts +4 -4
- package/dist/middleware-B8QoWWIx.d.mts +1 -0
- package/dist/{middleware-eb7YwdD4-D0M6ACQ-.d.mts → middleware-eb7YwdD4-CiyaANOv.d.mts} +2 -2
- package/dist/{middleware-eb7YwdD4-D0M6ACQ-.d.mts.map → middleware-eb7YwdD4-CiyaANOv.d.mts.map} +1 -1
- package/dist/{migration-BvCT6g2N.d.mts → migration-DvCs5-4I.d.mts} +4 -4
- package/dist/{migration-BvCT6g2N.d.mts.map → migration-DvCs5-4I.d.mts.map} +1 -1
- package/dist/{naming-BwqqVcZy-BgTObIQw.mjs → naming-CEGRBbyW-BOa9Eun0.mjs} +54 -9
- package/dist/naming-CEGRBbyW-BOa9Eun0.mjs.map +1 -0
- package/dist/{naming-jLgdauLi-C84G_UHi.d.mts → naming-DvlNocom-ClcApdiR.d.mts} +33 -7
- package/dist/naming-DvlNocom-ClcApdiR.d.mts.map +1 -0
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +11 -11
- package/dist/orm-client.mjs +2 -2
- package/dist/{plan-Bmp5R9sq-DKMRkx6Z.d.mts → plan-Bmp5R9sq-mVFXvLM7.d.mts} +4 -4
- package/dist/{plan-Bmp5R9sq-DKMRkx6Z.d.mts.map → plan-Bmp5R9sq-mVFXvLM7.d.mts.map} +1 -1
- package/dist/plan-Cl6aCuij.d.mts +2 -0
- package/dist/{psl-infer-6je61Z6J.d.mts → psl-infer-Dp_hwubv.d.mts} +3 -3
- package/dist/{psl-infer-6je61Z6J.d.mts.map → psl-infer-Dp_hwubv.d.mts.map} +1 -1
- package/dist/{psl-infer-DGftl-HW.mjs → psl-infer-f5BgyRKm.mjs} +2 -2
- package/dist/{psl-infer-DGftl-HW.mjs.map → psl-infer-f5BgyRKm.mjs.map} +1 -1
- package/dist/query-lane-context-BhDJZFMh.d.mts +1 -0
- package/dist/{query-lane-context-DjyAyYht-HDNYE_oF.d.mts → query-lane-context-DjyAyYht-DdovdGjc.d.mts} +5 -5
- package/dist/{query-lane-context-DjyAyYht-HDNYE_oF.d.mts.map → query-lane-context-DjyAyYht-DdovdGjc.d.mts.map} +1 -1
- 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 +3 -3
- 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-DUwyRJmP.d.mts → resolve-storage-table-BJYVl94P.d.mts} +3 -3
- package/dist/{resolve-storage-table-DUwyRJmP.d.mts.map → resolve-storage-table-BJYVl94P.d.mts.map} +1 -1
- package/dist/{runtime-AvfMMERk.d.mts → runtime-CiGC1spO.d.mts} +3 -3
- package/dist/{runtime-AvfMMERk.d.mts.map → runtime-CiGC1spO.d.mts.map} +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-differ-DpG_gnur-zSwkxqxK.d.mts → schema-differ-DpG_gnur-BgbN2De2.d.mts} +5 -5
- package/dist/{schema-differ-DpG_gnur-zSwkxqxK.d.mts.map → schema-differ-DpG_gnur-BgbN2De2.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +1 -1
- package/dist/schema-ir.mjs +1 -1
- package/dist/schema-ir__naming.d.mts +2 -2
- package/dist/schema-ir__naming.mjs +2 -2
- package/dist/schema-ir__types.d.mts +2 -2
- package/dist/schema-ir__types.mjs +1 -1
- package/dist/{schema-verify-vtFZbmGq-BNfTr6fU.mjs → schema-verify-C_PEdlAr-JK3UgFWU.mjs} +7 -9
- package/dist/schema-verify-C_PEdlAr-JK3UgFWU.mjs.map +1 -0
- package/dist/{serialized-index-Dp5_EjXD-DMsw8jf3.mjs → serialized-index-B6udRZV1-Ciet0tVA.mjs} +15 -5
- package/dist/serialized-index-B6udRZV1-Ciet0tVA.mjs.map +1 -0
- package/dist/serialized-index-CvprUx-6-CX0DYGLe.d.mts +44 -0
- package/dist/serialized-index-CvprUx-6-CX0DYGLe.d.mts.map +1 -0
- package/dist/{sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs → sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs} +6 -6
- package/dist/{sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs.map → sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs.map} +1 -1
- package/dist/{sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts → sql-execution-plan-Da_d82pz-g3khvnbo.d.mts} +2 -2
- package/dist/{sql-execution-plan-Da_d82pz-IHBEmGSa.d.mts.map → sql-execution-plan-Da_d82pz-g3khvnbo.d.mts.map} +1 -1
- package/dist/{sql-index-DsI8HAeK-BJsn-jvD.d.mts → sql-index-DsI8HAeK-SazZYeA2.d.mts} +2 -2
- package/dist/{sql-index-DsI8HAeK-BJsn-jvD.d.mts.map → sql-index-DsI8HAeK-SazZYeA2.d.mts.map} +1 -1
- package/dist/{sql-storage-B0QwiTg6-B8DVctJm.d.mts → sql-storage-aEsH6Fnv-_bWH3uY3.d.mts} +3 -3
- package/dist/{sql-storage-B0QwiTg6-B8DVctJm.d.mts.map → sql-storage-aEsH6Fnv-_bWH3uY3.d.mts.map} +1 -1
- package/dist/{storage-table-BBaAmanc-BwR37LMA.d.mts → storage-table-BTVeIKBx-Ba6wCjG5.d.mts} +30 -22
- package/dist/storage-table-BTVeIKBx-Ba6wCjG5.d.mts.map +1 -0
- package/dist/{storage-table-_LWDmPfv-DFhU2dML.mjs → storage-table-BcDudZC5-DZNZhjf2.mjs} +39 -30
- package/dist/storage-table-BcDudZC5-DZNZhjf2.mjs.map +1 -0
- package/dist/types--gTlnnvl.d.mts +1 -0
- package/dist/{types-wy2-Y8wQ.d.mts → types-BL_h3id0.d.mts} +6 -6
- package/dist/{types-wy2-Y8wQ.d.mts.map → types-BL_h3id0.d.mts.map} +1 -1
- package/dist/{types-D_plAPEe-DqK5It_K.d.mts → types-BpPwiK2b-DCMVWQ_F.d.mts} +6 -6
- package/dist/{types-D_plAPEe-DqK5It_K.d.mts.map → types-BpPwiK2b-DCMVWQ_F.d.mts.map} +1 -1
- package/dist/{types-BwePDa3m-BVrPIi8V.d.mts → types-BwePDa3m-CrVQ_8YI.d.mts} +2 -2
- package/dist/{types-BwePDa3m-BVrPIi8V.d.mts.map → types-BwePDa3m-CrVQ_8YI.d.mts.map} +1 -1
- package/dist/types-C-KBovJY.d.mts +1 -0
- package/dist/{types-CvbBw1Jo-3KQdErJY.d.mts → types-C1F8xk0m-7rMwgIR6.d.mts} +30 -27
- package/dist/types-C1F8xk0m-7rMwgIR6.d.mts.map +1 -0
- package/dist/{types-CMMQS6aG.mjs → types-CuvwcWTE.mjs} +2 -2
- package/dist/types-CuvwcWTE.mjs.map +1 -0
- package/dist/{types-IqZMLrFC-D8PN7ygS.d.mts → types-IqZMLrFC-CcORLTOK.d.mts} +9 -9
- package/dist/{types-IqZMLrFC-D8PN7ygS.d.mts.map → types-IqZMLrFC-CcORLTOK.d.mts.map} +1 -1
- package/dist/{types-DmhUVq4u-BpqqjPJx.mjs → types-UhDfY1iX-C5wOQ0D5.mjs} +21 -29
- package/dist/types-UhDfY1iX-C5wOQ0D5.mjs.map +1 -0
- package/dist/{types-dD8JJfeD-BOvMw2Iu.d.mts → types-dD8JJfeD-CS9uMlzW.d.mts} +10 -10
- package/dist/{types-dD8JJfeD-BOvMw2Iu.d.mts.map → types-dD8JJfeD-CS9uMlzW.d.mts.map} +1 -1
- package/dist/{validators-Ds_fvIs_.d.mts → validators-Bl1TVj5n.d.mts} +7 -19
- package/dist/validators-Bl1TVj5n.d.mts.map +1 -0
- package/dist/{validators-C4PItWnf.mjs → validators-w7IJlTcR.mjs} +0 -0
- package/dist/validators-w7IJlTcR.mjs.map +1 -0
- package/package.json +18 -18
- package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs.map +0 -1
- package/dist/config-types-DKKhWdzf.d.mts.map +0 -1
- package/dist/config-types-N7PJc6VN.mjs.map +0 -1
- package/dist/contract-builder-Cj-lKWgM.d.mts.map +0 -1
- package/dist/contract-builder-YjMQcvZ1.mjs.map +0 -1
- package/dist/control-C1EmRznB.mjs.map +0 -1
- package/dist/control-adapter-DrCAQQpa.d.mts +0 -1
- package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs.map +0 -1
- package/dist/entity-kinds-Dh6VH4uK.d.mts.map +0 -1
- package/dist/middleware-ChwIEKBC.d.mts +0 -1
- package/dist/naming-BwqqVcZy-BgTObIQw.mjs.map +0 -1
- package/dist/naming-jLgdauLi-C84G_UHi.d.mts.map +0 -1
- package/dist/plan-mKgmSe0R.d.mts +0 -2
- package/dist/query-lane-context-Dcj4eXUl.d.mts +0 -1
- package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs.map +0 -1
- package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts +0 -26
- package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts.map +0 -1
- package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs.map +0 -1
- package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts.map +0 -1
- package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs.map +0 -1
- package/dist/types-CMMQS6aG.mjs.map +0 -1
- package/dist/types-Cty2fvYD.d.mts +0 -1
- package/dist/types-CvbBw1Jo-3KQdErJY.d.mts.map +0 -1
- package/dist/types-DmhUVq4u-BpqqjPJx.mjs.map +0 -1
- package/dist/types-TvBZ2Ne9.d.mts +0 -1
- package/dist/validators-C4PItWnf.mjs.map +0 -1
- package/dist/validators-Ds_fvIs_.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-C1EmRznB.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/control.mjs"],"sourcesContent":["import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from \"./authoring-type-constructors-Blqoa2Ua.mjs\";\nimport { n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, s as extractCodecControlHooks, t as classifyDiffEntityKind } from \"./schema-verify-vtFZbmGq.mjs\";\nimport { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { t as SqlContractSerializer } from \"./sql-contract-serializer-2oBWuxTe.mjs\";\nimport { t as collectSupportedCodecTypeIds } from \"./verify-E6Dd2vYp.mjs\";\nimport { a as timestampNowControlDescriptor, i as temporalCodecPresetWithPrecision, n as temporalAuthoringPresets, r as temporalCodecPreset } from \"./timestamp-now-generator-DRXygu32.mjs\";\nimport { sqlEmission } from \"@internal/sql-contract-emitter\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions } from \"@internal/framework-components/control\";\nimport { isPlainRecord } from \"@internal/framework-components/ir\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { StorageTable, isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/core/operation-preview.ts\nfunction isDdlStatement(sqlStatement) {\n\tconst trimmed = sqlStatement.trim().toLowerCase();\n\treturn trimmed.startsWith(\"create \") || trimmed.startsWith(\"alter \") || trimmed.startsWith(\"drop \");\n}\nfunction hasExecuteSteps(operation) {\n\tconst candidate = operation;\n\tif (!(\"execute\" in candidate) || !Array.isArray(candidate[\"execute\"])) return false;\n\treturn candidate[\"execute\"].every((step) => typeof step === \"object\" && step !== null && \"sql\" in step);\n}\n/**\n* Extracts a best-effort SQL DDL preview for CLI plan output.\n* Presentation-only: never used to decide migration correctness.\n*/\nfunction extractSqlDdl(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tif (!hasExecuteSteps(operation)) continue;\n\t\tfor (const step of operation.execute) if (typeof step.sql === \"string\" && isDdlStatement(step.sql)) statements.push(step.sql.trim());\n\t}\n\treturn statements;\n}\n/**\n* Wraps `extractSqlDdl` into the family-agnostic `OperationPreview` shape.\n* Each statement carries `language: 'sql'`.\n*/\nfunction sqlOperationsToPreview(operations) {\n\treturn { statements: extractSqlDdl(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"sql\"\n\t})) };\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction missingDescriptorOperationError(targetId, operation) {\n\treturn sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `SQL target \"${targetId}\" is missing the required ${operation} descriptor operation`, {\n\t\twhy: `The target descriptor does not contribute the ${operation} operation the SQL family requires for this call.`,\n\t\tfix: `Use a target package whose control descriptor implements ${operation}.`,\n\t\tmeta: {\n\t\t\ttargetId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction extractCodecTypeIdsFromContract(contract) {\n\tconst typeIds = /* @__PURE__ */ new Set();\n\tif (typeof contract === \"object\" && contract !== null && \"storage\" in contract && typeof contract.storage === \"object\" && contract.storage !== null && \"namespaces\" in contract.storage && typeof contract.storage.namespaces === \"object\" && contract.storage.namespaces !== null) {\n\t\tconst namespaces = contract.storage.namespaces;\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tconst tbls = ns.entries[\"table\"];\n\t\t\tif (typeof tbls !== \"object\" || tbls === null) continue;\n\t\t\tfor (const table of Object.values(tbls)) if (typeof table === \"object\" && table !== null && \"columns\" in table && typeof table.columns === \"object\" && table.columns !== null) {\n\t\t\t\tconst columns = table.columns;\n\t\t\t\tfor (const column of Object.values(columns)) if (column && typeof column === \"object\" && \"codecId\" in column && typeof column.codecId === \"string\") typeIds.add(column.codecId);\n\t\t\t}\n\t\t}\n\t}\n\treturn Array.from(typeIds).sort();\n}\nfunction createVerifyResult(options) {\n\tconst contract = { storageHash: options.contractStorageHash };\n\tif (options.contractProfileHash) contract.profileHash = options.contractProfileHash;\n\tconst target = { expected: options.expectedTargetId };\n\tif (options.actualTargetId) target.actual = options.actualTargetId;\n\tconst meta = { contractPath: options.contractPath };\n\tif (options.configPath) meta.configPath = options.configPath;\n\tconst result = {\n\t\tok: options.ok,\n\t\tsummary: options.summary,\n\t\tcontract,\n\t\ttarget,\n\t\tmeta,\n\t\ttimings: { total: options.totalTime }\n\t};\n\tif (options.code) result.code = options.code;\n\tif (options.marker) result.marker = {\n\t\tstorageHash: options.marker.storageHash,\n\t\tprofileHash: options.marker.profileHash\n\t};\n\tif (options.missingCodecs) result.missingCodecs = options.missingCodecs;\n\tif (options.codecCoverageSkipped) result.codecCoverageSkipped = options.codecCoverageSkipped;\n\treturn result;\n}\nfunction buildSqlTypeMetadataRegistry(options) {\n\tconst { target, adapter, extensions } = options;\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst targetId = adapter.targetId;\n\tconst descriptors = [\n\t\ttarget,\n\t\tadapter,\n\t\t...extensions\n\t];\n\tfor (const descriptor of descriptors) {\n\t\tconst storageTypes = descriptor.types?.storage;\n\t\tif (!storageTypes) continue;\n\t\tfor (const storageType of storageTypes) if (storageType.familyId === \"sql\" && storageType.targetId === targetId) registry.set(storageType.typeId, {\n\t\t\ttypeId: storageType.typeId,\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: storageType.targetId,\n\t\t\t...storageType.nativeType !== void 0 ? { nativeType: storageType.nativeType } : {}\n\t\t});\n\t}\n\treturn registry;\n}\n/**\n* Builds a map from each extension id to the set of extension ids it\n* transitively depends on. Uses the same declared-dependency data that\n* `buildExtensionLoadOrder` in control-stack uses.\n*/\nfunction buildTransitiveDependsOnMap(extensions) {\n\tconst directDeps = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tconst packs = ext.contractSpace?.contractJson?.extensions;\n\t\tconst deps = packs !== null && typeof packs === \"object\" ? Object.keys(packs) : [];\n\t\tdirectDeps.set(ext.id, deps);\n\t}\n\tconst result = /* @__PURE__ */ new Map();\n\tconst resolve = (id, visiting) => {\n\t\tconst cached = result.get(id);\n\t\tif (cached !== void 0) return cached;\n\t\tconst set = /* @__PURE__ */ new Set();\n\t\tresult.set(id, set);\n\t\tfor (const depId of directDeps.get(id) ?? []) {\n\t\t\tset.add(depId);\n\t\t\tif (!visiting.has(depId)) {\n\t\t\t\tvisiting.add(depId);\n\t\t\t\tfor (const transitive of resolve(depId, visiting)) set.add(transitive);\n\t\t\t\tvisiting.delete(depId);\n\t\t\t}\n\t\t}\n\t\treturn set;\n\t};\n\tfor (const ext of extensions) resolve(ext.id, /* @__PURE__ */ new Set([ext.id]));\n\treturn result;\n}\n/**\n* Asserts that no cross-space FK in any extension points against the\n* dependency direction.\n*\n* A cross-space FK (target.spaceId present) from extension A pointing at\n* space B is a violation when B depends on A (directly or transitively),\n* because that means A is pointing \"upward\" against the dependency arrows\n* established by the extension load order.\n*\n* Throws with a diagnostic naming the violating extension (source), the\n* target space, and the direction violation.\n*/\nfunction isObjectRecord(v) {\n\treturn typeof v === \"object\" && v !== null;\n}\nfunction assertNoCrossSpaceFkReverseReferences(extensions) {\n\tconst dependsOnMap = buildTransitiveDependsOnMap(extensions);\n\tfor (const ext of extensions) {\n\t\tconst namespaces = ext.contractSpace?.contractJson?.storage?.namespaces;\n\t\tif (!isObjectRecord(namespaces)) continue;\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tif (!isObjectRecord(ns)) continue;\n\t\t\tconst entries = ns[\"entries\"];\n\t\t\tif (!isObjectRecord(entries)) continue;\n\t\t\tfor (const slot of Object.values(entries)) {\n\t\t\t\tif (!isObjectRecord(slot)) continue;\n\t\t\t\tfor (const table of Object.values(slot)) {\n\t\t\t\t\tif (!isObjectRecord(table)) continue;\n\t\t\t\t\tconst foreignKeys = table[\"foreignKeys\"];\n\t\t\t\t\tif (!Array.isArray(foreignKeys)) continue;\n\t\t\t\t\tfor (const fk of foreignKeys) {\n\t\t\t\t\t\tif (!isObjectRecord(fk)) continue;\n\t\t\t\t\t\tconst target = fk[\"target\"];\n\t\t\t\t\t\tif (!isObjectRecord(target)) continue;\n\t\t\t\t\t\tif (target[\"spaceId\"] === void 0) continue;\n\t\t\t\t\t\tconst targetSpaceId = target[\"spaceId\"];\n\t\t\t\t\t\tif (typeof targetSpaceId !== \"string\") continue;\n\t\t\t\t\t\tif (dependsOnMap.get(targetSpaceId)?.has(ext.id)) throw sqlFamilyError(\"CONTRACT.FOREIGN_KEY_INVALID\", `Cross-space FK reverse-reference detected: extension \"${ext.id}\" has a cross-space FK targeting space \"${targetSpaceId}\", but \"${targetSpaceId}\" depends on \"${ext.id}\". Cross-space FKs must follow the dependency direction (a space can only reference spaces it depends on, not spaces that depend on it).`, {\n\t\t\t\t\t\t\twhy: \"The foreign key points against the contract-space dependency direction.\",\n\t\t\t\t\t\t\tfix: \"Move the foreign key to the depending space, or restructure the extension dependencies so the referencing space depends on the referenced one.\",\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\textensionId: ext.id,\n\t\t\t\t\t\t\t\ttargetSpaceId\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfunction createSqlFamilyInstance(stack) {\n\tif (!stack.adapter) throw new InternalError(\"SQL family requires an adapter descriptor in ControlStack\");\n\tconst target = stack.target;\n\tconst adapter = stack.adapter;\n\tconst extensions = stack.extensions;\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...sqlContractCanonicalizationHooks\n\t\t});\n\t}\n\tassertNoCrossSpaceFkReverseReferences(extensions);\n\tconst { codecTypeImports, extensionIds } = stack;\n\tconst typeMetadataRegistry = buildSqlTypeMetadataRegistry({\n\t\ttarget,\n\t\tadapter,\n\t\textensions\n\t});\n\tlet controlAdapter;\n\tconst getControlAdapter = () => controlAdapter ??= adapter.create(stack);\n\tconst targetSerializer = target.contractSerializer;\n\tconst targetInferPslContract = blindCast(target).inferPslContract;\n\tconst diffSchema = blindCast(target).diffSchema;\n\tconst targetGranularityOf = blindCast(target).classifySubjectGranularity;\n\tconst targetEntityKindOf = blindCast(target).classifyEntityKind;\n\tconst describedContracts = extensions.flatMap((extension) => extension.contractSpace ? [{\n\t\tspaceId: extension.id,\n\t\tcontract: extension.contractSpace.contractJson\n\t}] : []);\n\tconst deserializeWithTargetSerializer = (contractOrJson) => {\n\t\tconst serializer = targetSerializer ?? new SqlContractSerializer();\n\t\tconst json = targetSerializer !== void 0 && !isPlainRecord(contractOrJson) ? targetSerializer.serializeContract(blindCast(contractOrJson)) : contractOrJson;\n\t\treturn serializer.deserializeContract(json);\n\t};\n\treturn {\n\t\tfamilyId: \"sql\",\n\t\tcodecTypeImports,\n\t\textensionIds,\n\t\ttypeMetadataRegistry,\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn deserializeWithTargetSerializer(contractJson);\n\t\t},\n\t\tasync verify(verifyOptions) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = verifyOptions;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = deserializeWithTargetSerializer(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst marker = await getControlAdapter().readMarker(driver, APP_SPACE_ID);\n\t\t\tlet missingCodecs;\n\t\t\tlet codecCoverageSkipped = false;\n\t\t\tconst supportedTypeIds = collectSupportedCodecTypeIds([\n\t\t\t\tadapter,\n\t\t\t\ttarget,\n\t\t\t\t...extensions\n\t\t\t]);\n\t\t\tif (supportedTypeIds.length === 0) codecCoverageSkipped = true;\n\t\t\telse {\n\t\t\t\tconst supportedSet = new Set(supportedTypeIds);\n\t\t\t\tconst missing = extractCodecTypeIdsFromContract(contract).filter((id) => !supportedSet.has(id));\n\t\t\t\tif (missing.length > 0) missingCodecs = missing;\n\t\t\t}\n\t\t\tif (!marker) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractTarget !== expectedTargetId) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\treturn createVerifyResult({\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\tconst contract = deserializeWithTargetSerializer(options.contract);\n\t\t\tif (!diffSchema) throw missingDescriptorOperationError(target.targetId, \"diffSchema\");\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn verifySqlSchemaByDiff({\n\t\t\t\tcontract,\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\tdiffSchema,\n\t\t\t\tgranularityOf: targetGranularityOf\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject granularity on demand, by resolving\n\t\t* its node's `nodeKind` through the target's classifier — the\n\t\t* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability. Framework consumers spanning contract spaces (the\n\t\t* migration aggregate's unclaimed-elements sweep) detect and call this\n\t\t* instead of reaching into the concrete schema-IR node, which they\n\t\t* cannot read; nothing is stamped on the issue or the node.\n\t\t*/\n\t\tclassifySubjectGranularity(issue) {\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn classifyDiffSubjectGranularity(issue, targetGranularityOf);\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject storage `entityKind` on demand, by\n\t\t* resolving its node's `nodeKind` through the target's classifier —\n\t\t* the sibling of `classifySubjectGranularity` above, and part of the\n\t\t* same {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability.\n\t\t*/\n\t\tclassifyEntityKind(issue) {\n\t\t\tif (!targetEntityKindOf) throw missingDescriptorOperationError(target.targetId, \"classifyEntityKind\");\n\t\t\treturn classifyDiffEntityKind(issue, targetEntityKindOf);\n\t\t},\n\t\tasync sign(options) {\n\t\t\tconst { driver, contract: contractInput, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = deserializeWithTargetSerializer(contractInput);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = \"profileHash\" in contract && typeof contract.profileHash === \"string\" ? contract.profileHash : contractStorageHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst controlAdapter = getControlAdapter();\n\t\t\tconst lowererContext = { contract };\n\t\t\tfor (const query of controlAdapter.bootstrapSignMarkerQueries()) {\n\t\t\t\tconst lowered = await controlAdapter.lowerToExecuteRequest(query, lowererContext);\n\t\t\t\tawait driver.query(lowered.sql, lowered.params);\n\t\t\t}\n\t\t\tconst existingMarker = await controlAdapter.readMarker(driver, APP_SPACE_ID);\n\t\t\tlet markerCreated = false;\n\t\t\tlet markerUpdated = false;\n\t\t\tlet previousHashes;\n\t\t\tif (!existingMarker) {\n\t\t\t\tawait controlAdapter.insertMarker(driver, APP_SPACE_ID, {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t});\n\t\t\t\tmarkerCreated = true;\n\t\t\t} else {\n\t\t\t\tconst existingStorageHash = existingMarker.storageHash;\n\t\t\t\tconst existingProfileHash = existingMarker.profileHash;\n\t\t\t\tif (!(existingStorageHash === contractStorageHash) || !(existingProfileHash === contractProfileHash)) {\n\t\t\t\t\tpreviousHashes = {\n\t\t\t\t\t\tstorageHash: existingStorageHash,\n\t\t\t\t\t\tprofileHash: existingProfileHash\n\t\t\t\t\t};\n\t\t\t\t\tif (!await controlAdapter.updateMarker(driver, APP_SPACE_ID, existingStorageHash, {\n\t\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t\t})) throw sqlFamilyError(\"MIGRATION.MARKER_CAS_FAILURE\", \"CAS conflict: marker was modified by another process during sign\", {\n\t\t\t\t\t\twhy: \"Another process updated the contract marker between the read and the compare-and-swap write.\",\n\t\t\t\t\t\tfix: \"Re-run the sign command; if it keeps failing, make sure only one migration process runs at a time.\",\n\t\t\t\t\t\tmeta: { space: APP_SPACE_ID }\n\t\t\t\t\t});\n\t\t\t\t\tmarkerUpdated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet summary;\n\t\t\tif (markerCreated) summary = \"Database signed (marker created)\";\n\t\t\telse if (markerUpdated) summary = `Database signed (marker updated from ${previousHashes?.storageHash ?? \"unknown\"})`;\n\t\t\telse summary = \"Database already signed with this contract\";\n\t\t\tconst totalTime = Date.now() - startTime;\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tsummary,\n\t\t\t\tcontract: {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\texpected: contractTarget,\n\t\t\t\t\tactual: contractTarget\n\t\t\t\t},\n\t\t\t\tmarker: {\n\t\t\t\t\tcreated: markerCreated,\n\t\t\t\t\tupdated: markerUpdated,\n\t\t\t\t\t...previousHashes ? { previous: previousHashes } : {}\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcontractPath,\n\t\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t\t},\n\t\t\t\ttimings: { total: totalTime }\n\t\t\t};\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(options.driver, options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(options.driver);\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(options.driver, options.space);\n\t\t},\n\t\tasync initMarker(options) {\n\t\t\treturn getControlAdapter().initMarker(options.driver, options.space, options.destination);\n\t\t},\n\t\tasync updateMarker(options) {\n\t\t\treturn getControlAdapter().updateMarker(options.driver, options.space, options.expectedFrom, options.destination);\n\t\t},\n\t\tasync writeLedgerEntry(options) {\n\t\t\treturn getControlAdapter().writeLedgerEntry(options.driver, options.space, options.entry);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspect(options.driver, options.contract);\n\t\t},\n\t\tinferPslContract(schemaIR) {\n\t\t\tif (!targetInferPslContract) throw sqlFamilyError(\"CONTRACT.INFER_UNSUPPORTED\", `Target \"${target.targetId}\" does not support contract infer (no inferPslContract on its descriptor).`, {\n\t\t\t\twhy: \"The target descriptor does not provide the inferPslContract hook, so a PSL contract cannot be inferred from the database schema.\",\n\t\t\t\tfix: \"Use a target package that supports contract infer, or author the contract instead of inferring it.\",\n\t\t\t\tmeta: { targetId: target.targetId }\n\t\t\t});\n\t\t\treturn targetInferPslContract(schemaIR, describedContracts);\n\t\t},\n\t\tlowerAst(ast, context) {\n\t\t\treturn getControlAdapter().lowerToExecuteRequest(ast, context);\n\t\t},\n\t\tbootstrapControlTableQueries() {\n\t\t\treturn getControlAdapter().bootstrapControlTableQueries();\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn sqlOperationsToPreview(operations);\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\tconst root = blindCast(schema);\n\t\t\tconst namespaceEntries = root.namespaces !== void 0 ? Object.entries(root.namespaces).map(([namespaceKey, namespace]) => [namespaceKey, namespace.tables]) : [[void 0, root.tables ?? {}]];\n\t\t\tconst qualify = namespaceEntries.length > 1;\n\t\t\tconst tableNodes = namespaceEntries.flatMap(([namespaceKey, tables]) => Object.entries(tables).map(([tableName, table]) => [\n\t\t\t\tqualify && namespaceKey !== void 0 ? `${namespaceKey}.${tableName}` : tableName,\n\t\t\t\ttableName,\n\t\t\t\ttable\n\t\t\t])).map(([displayName, tableName, table]) => {\n\t\t\t\tconst children = [];\n\t\t\t\tconst columnNodes = [];\n\t\t\t\tfor (const [columnName, column] of Object.entries(table.columns)) {\n\t\t\t\t\tconst label = `${columnName}: ${column.nativeType} (${column.nullable ? \"nullable\" : \"not nullable\"})`;\n\t\t\t\t\tcolumnNodes.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t\tid: `column-${displayName}-${columnName}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tnativeType: column.nativeType,\n\t\t\t\t\t\t\tnullable: column.nullable,\n\t\t\t\t\t\t\t...ifDefined(\"default\", column.default)\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tif (columnNodes.length > 0) children.push(new SchemaTreeNode({\n\t\t\t\t\tkind: \"collection\",\n\t\t\t\t\tid: `columns-${displayName}`,\n\t\t\t\t\tlabel: \"columns\",\n\t\t\t\t\tchildren: columnNodes\n\t\t\t\t}));\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\tconst pkColumns = table.primaryKey.columns.join(\", \");\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `primary-key-${displayName}`,\n\t\t\t\t\t\tlabel: `primary key: ${pkColumns}`,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t\t\t\t\t...table.primaryKey.name ? { name: table.primaryKey.name } : {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const unique of table.uniques) {\n\t\t\t\t\tconst name = unique.name ?? `${tableName}_${unique.columns.join(\"_\")}_unique`;\n\t\t\t\t\tconst label = `unique ${name}`;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `unique-${displayName}-${name}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: unique.columns,\n\t\t\t\t\t\t\tunique: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const index of table.indexes) {\n\t\t\t\t\tconst name = index.name;\n\t\t\t\t\tconst label = index.unique ? `unique index ${name}` : `index ${name}`;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `index-${displayName}-${name}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: index.columns,\n\t\t\t\t\t\t\tunique: index.unique\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tconst tableMeta = {};\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\ttableMeta[\"primaryKey\"] = table.primaryKey.columns;\n\t\t\t\t\tif (table.primaryKey.name) tableMeta[\"primaryKeyName\"] = table.primaryKey.name;\n\t\t\t\t}\n\t\t\t\tif (table.foreignKeys.length > 0) tableMeta[\"foreignKeys\"] = table.foreignKeys.map((fk) => ({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\t...fk.name ? { name: fk.name } : {}\n\t\t\t\t}));\n\t\t\t\treturn new SchemaTreeNode({\n\t\t\t\t\tkind: \"entity\",\n\t\t\t\t\tid: `table-${displayName}`,\n\t\t\t\t\tlabel: `table ${displayName}`,\n\t\t\t\t\t...Object.keys(tableMeta).length > 0 ? { meta: tableMeta } : {},\n\t\t\t\t\t...children.length > 0 ? { children } : {}\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn { root: new SchemaTreeNode({\n\t\t\t\tkind: \"root\",\n\t\t\t\tid: \"sql-schema\",\n\t\t\t\tlabel: \"database\",\n\t\t\t\t...tableNodes.length > 0 ? { children: tableNodes } : {}\n\t\t\t}) };\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nvar SqlFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"sql\";\n\tfamilyId = \"sql\";\n\tversion = \"0.0.1\";\n\temission = sqlEmission;\n\tauthoring = {\n\t\tfield: sqlFamilyAuthoringFieldPresets,\n\t\ttype: sqlFamilyAuthoringTypes,\n\t\tentityTypes: sqlFamilyEntityTypes,\n\t\tpslBlockDescriptors: sqlFamilyPslBlockDescriptors\n\t};\n\tcreate(stack) {\n\t\treturn createSqlFamilyInstance(stack);\n\t}\n};\n//#endregion\n//#region src/core/migrations/contract-to-schema-ir.ts\nfunction convertColumn(name, column, storageTypes, expandNativeType, renderDefault, resolveDefault) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tconst baseNativeType = expandNativeType ? expandNativeType({\n\t\tnativeType: resolved.nativeType,\n\t\tcodecId: resolved.codecId,\n\t\t...ifDefined(\"typeParams\", resolved.typeParams)\n\t}) : resolved.nativeType;\n\tconst nativeType = baseNativeType;\n\tconst resolvedNativeType = column.many ? `${baseNativeType}[]` : baseNativeType;\n\tconst rawColumnDefault = column.default ?? void 0;\n\tconst resolvedColumnDefault = rawColumnDefault !== void 0 && resolveDefault ? resolveDefault(rawColumnDefault, resolvedNativeType) : rawColumnDefault;\n\treturn {\n\t\tname,\n\t\tnativeType,\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"many\", column.many),\n\t\t...ifDefined(\"default\", column.default != null && renderDefault ? renderDefault(column.default, column) : void 0),\n\t\tresolvedNativeType,\n\t\t...ifDefined(\"resolvedDefault\", resolvedColumnDefault),\n\t\tcodecRef: buildColumnCodecRef(resolved, column.many),\n\t\tcodecBaseNativeType: resolved.nativeType,\n\t\t...column.typeRef !== void 0 ? { codecNamedType: true } : {}\n\t};\n}\n/**\n* Builds the column's `CodecRef` from its resolved (post-`typeRef`) codec\n* identity — the same construction the query AST and the migration DDL\n* renderer already use (TML-2456, TML-2918).\n*/\nfunction buildColumnCodecRef(resolved, many) {\n\treturn {\n\t\tcodecId: resolved.codecId,\n\t\t...ifDefined(\"typeParams\", resolved.typeParams !== void 0 ? blindCast(resolved.typeParams) : void 0),\n\t\t...ifDefined(\"many\", many)\n\t};\n}\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referenced = storageTypes[column.typeRef];\n\tif (!referenced) throw sqlFamilyError(\"CONTRACT.TYPE_UNKNOWN\", `Column references storage type \"${column.typeRef}\" but it is not defined in storage.types.`, {\n\t\twhy: \"The column typeRef does not resolve to any entry in the contract storage.types map.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta: { typeRef: column.typeRef }\n\t});\n\tif (isStorageTypeInstance(referenced)) return {\n\t\tcodecId: referenced.codecId,\n\t\tnativeType: referenced.nativeType,\n\t\ttypeParams: referenced.typeParams\n\t};\n\tthrow new InternalError(`Storage type \"${column.typeRef}\" has an unknown polymorphic kind; expected a codec-typed StorageTypeInstance.`);\n}\n/**\n* Resolves a `ValueSetRef` to its permitted values from the contract storage.\n*\n* Throws when the referenced namespace or value-set is absent — this indicates\n* the contract was built incorrectly (the check and the value-set must be\n* co-emitted by the lowering step). Used by `convertCheck` (schema-IR\n* projection), `verifyCheckConstraints` (verification), and\n* `checkConstraintPlanCallStrategy` (migration planning) so all three agree on\n* the resolved values and the error behavior on a missing reference.\n*/\nfunction allStrings(values) {\n\treturn values.every((value) => typeof value === \"string\");\n}\nfunction resolveValueSetValues(ref, storage, contextLabel) {\n\tconst ns = storage.namespaces[ref.namespaceId];\n\tif (!ns) throw sqlFamilyError(\"CONTRACT.NAMESPACE_UNKNOWN\", `resolveValueSetValues: namespace \"${ref.namespaceId}\" not found in storage (${contextLabel})`, {\n\t\twhy: \"A value-set reference names a namespace the contract storage does not declare.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta: {\n\t\t\tnamespaceId: ref.namespaceId,\n\t\t\tcontext: contextLabel\n\t\t}\n\t});\n\tconst valueSet = ns.entries.valueSet?.[ref.entityName];\n\tif (!valueSet) throw sqlFamilyError(\"CONTRACT.ENUM_UNKNOWN\", `resolveValueSetValues: value-set \"${ref.entityName}\" not found in namespace \"${ref.namespaceId}\" (${contextLabel})`, {\n\t\twhy: \"A value-set reference names an entry its namespace does not declare.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta: {\n\t\t\tvalueSet: ref.entityName,\n\t\t\tnamespaceId: ref.namespaceId,\n\t\t\tcontext: contextLabel\n\t\t}\n\t});\n\tconst values = valueSet.values;\n\tif (!allStrings(values)) throw sqlFamilyError(\"CONTRACT.ENUM_INVALID\", `resolveValueSetValues: value-set \"${ref.entityName}\" in namespace \"${ref.namespaceId}\" has a non-string value; numeric-enum CHECK constraints are not yet supported (${contextLabel})`, {\n\t\twhy: \"Only string value-sets can be rendered as CHECK constraints; this value-set carries a non-string value.\",\n\t\tfix: \"Use string enum values, or drop the CHECK-constrained enum until numeric enums are supported.\",\n\t\tmeta: {\n\t\t\tvalueSet: ref.entityName,\n\t\t\tnamespaceId: ref.namespaceId,\n\t\t\tcontext: contextLabel\n\t\t}\n\t});\n\treturn values;\n}\n/**\n* Projects a `CheckConstraint` IR into an `SqlCheckConstraintIRInput` by\n* resolving the permitted values from the storage value-set it references.\n*\n* The `CheckConstraint.valueSet` ref points to\n* `storage.namespaces[namespaceId].entries.valueSet[name]`. The resolved\n* values are lifted directly from `StorageValueSet.values` so verification\n* compares value sets, not SQL predicate strings.\n*\n* Throws if the referenced namespace or value-set is absent — this\n* indicates the contract was built incorrectly (the check and the\n* value-set must be co-emitted by the lowering step).\n*/\nfunction convertCheck(check, storage) {\n\tconst permittedValues = resolveValueSetValues(check.valueSet, storage, `check \"${check.name}\"`);\n\treturn {\n\t\tname: check.name,\n\t\tcolumn: check.column,\n\t\tpermittedValues\n\t};\n}\nfunction convertUnique(unique, tableName) {\n\treturn {\n\t\tcolumns: unique.columns,\n\t\t...ifDefined(\"name\", unique.name),\n\t\tdependsOn: flatColumnDependsOn(tableName, unique.columns)\n\t};\n}\nfunction convertIndex(index, tableName, tableColumns) {\n\tconst base = {\n\t\tnaming: namingOf(index.name, index.prefix),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tpartial: index.where !== void 0,\n\t\ttype: index.type,\n\t\toptions: index.options,\n\t\tannotations: void 0,\n\t\tdependsOn: flatColumnDependsOn(tableName, index.columns ?? tableColumns)\n\t};\n\treturn index.expression !== void 0 ? {\n\t\t...base,\n\t\texpression: index.expression\n\t} : {\n\t\t...base,\n\t\tcolumns: index.columns ?? []\n\t};\n}\n/**\n* The referenced table's chain in the flat (single-schema) tree\n* `contractToSchemaIR`/`contractNamespaceToSchemaIR` build: the root\n* (`SqlSchemaIR`, fixed `'database'` id) followed by the table's own id.\n* Postgres discards this when it re-derives the FK against its own\n* multi-schema tree shape (`contractToPostgresDatabaseSchemaNode`); SQLite's\n* flat tree uses it as-is.\n*/\nfunction flatSchemaDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the flat tree. Dropping\n* a covered column auto-drops the object, so the object's drop must precede\n* the column's; the graph derives that direction from these edges.\n*/\nfunction flatColumnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\t\tid: \"database\"\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\t\tid: `column:${column}`\n\t\t}\n\t]);\n}\n/**\n* The FK's referenced-namespace identity comes from the target's namespace\n* node, not the raw namespace-id string. An unbound target namespace stamps\n* no `referencedSchema` at all — the FK node's id renders the absence as the\n* empty segment, which is what flat (single-schema) introspection produces,\n* so both diff sides' FK ids meet by construction. A bound namespace (or a\n* cross-space target whose namespace lives in another contract's storage)\n* stamps its coordinate verbatim; namespaced targets (Postgres) resolve the\n* real DDL schema downstream.\n*\n* `dependsOn` carries the referenced table (created before the FK, dropped\n* after it) plus the FK's own columns (dropped after the FK, since dropping a\n* column auto-drops the FK built on it).\n*/\nfunction convertForeignKey(fk, storage) {\n\tconst targetIsUnbound = storage.namespaces[fk.target.namespaceId]?.isUnbound === true;\n\treturn {\n\t\tcolumns: fk.source.columns,\n\t\treferencedTable: fk.target.tableName,\n\t\t...targetIsUnbound ? {} : { referencedSchema: fk.target.namespaceId },\n\t\treferencedColumns: fk.target.columns,\n\t\t...ifDefined(\"name\", fk.name),\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\tdependsOn: [flatSchemaDependsOn(fk.target.tableName), ...flatColumnDependsOn(fk.source.tableName, fk.source.columns)]\n\t};\n}\nfunction convertTable(name, table, storageTypes, expandNativeType, renderDefault, resolveDefault, storage) {\n\tconst columns = {};\n\tfor (const [colName, colDef] of Object.entries(table.columns)) columns[colName] = convertColumn(colName, colDef, storageTypes, expandNativeType, renderDefault, resolveDefault);\n\tconst checks = table.checks && table.checks.length > 0 ? table.checks.map((c) => convertCheck(c, storage)) : void 0;\n\treturn new SqlTableIR({\n\t\tname,\n\t\tcolumns,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey !== void 0 ? {\n\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t...ifDefined(\"name\", table.primaryKey.name),\n\t\t\tdependsOn: flatColumnDependsOn(name, table.primaryKey.columns)\n\t\t} : void 0),\n\t\tforeignKeys: table.foreignKeys.map((fk) => convertForeignKey(fk, storage)),\n\t\tuniques: table.uniques.map((u) => convertUnique(u, name)),\n\t\tindexes: table.indexes.map((i) => convertIndex(i, name, Object.keys(table.columns))),\n\t\t...ifDefined(\"checks\", checks)\n\t});\n}\n/**\n* Detects destructive changes between two contract storages.\n*\n* The additive-only planner silently ignores removals (tables, columns).\n* This function detects those removals so callers can report them as conflicts\n* rather than silently producing an empty plan.\n*\n* Returns an empty array if no destructive changes are found.\n*/\nfunction detectDestructiveChanges(from, to) {\n\tif (!from) return [];\n\tconst hasOwn = (value, key) => Object.hasOwn(value, key);\n\tconst conflicts = [];\n\tconst namespaceIds = [.../* @__PURE__ */ new Set([...Object.keys(from.namespaces), ...Object.keys(to.namespaces)])].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst fromNs = from.namespaces[namespaceId];\n\t\tconst toNs = to.namespaces[namespaceId];\n\t\tconst fromTables = fromNs?.entries.table;\n\t\tif (!fromTables) continue;\n\t\tfor (const tableName of Object.keys(fromTables)) {\n\t\t\tconst toTableRaw = toNs?.entries.table?.[tableName];\n\t\t\tif (!StorageTable.is(toTableRaw)) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tkind: \"tableRemoved\",\n\t\t\t\t\tsummary: `Table \"${tableName}\" was removed`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst toTable = toTableRaw;\n\t\t\tconst fromTableRaw = fromTables[tableName];\n\t\t\tif (!StorageTable.is(fromTableRaw)) continue;\n\t\t\tconst fromTable = fromTableRaw;\n\t\t\tfor (const columnName of Object.keys(fromTable.columns)) if (!hasOwn(toTable.columns, columnName)) conflicts.push({\n\t\t\t\tkind: \"columnRemoved\",\n\t\t\t\tsummary: `Column \"${tableName}\".\"${columnName}\" was removed`\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n/**\n* Converts a `Contract` to `SqlSchemaIR`.\n*\n* Reads `contract.storage` for tables and `contract.storage.types` for type\n* annotations. Storage-type annotations are written under\n* `options.annotationNamespace`.\n*\n* Drops codec metadata (`codecId`, `typeRef`) since the schema IR only represents\n* structural information. When `expandNativeType` is provided, parameterized types\n* are expanded (e.g. `character` + `{ length: 36 }` → `character(36)`) so the\n* resulting IR compares correctly against the \"to\" contract during planning.\n*\n* Returns an empty schema IR when `contract` is `null` (new project).\n*/\n/**\n* Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by\n* table name within that namespace. Unlike {@link contractToSchemaIR}, which\n* flattens every namespace's tables into one bare-keyed record (and throws on a\n* cross-namespace name collision), this scopes the table iteration to one\n* namespace so the same table name can exist in two schemas.\n*\n* The full `storage` is still passed to `convertTable`, so value-set / enum /\n* type resolution that legitimately spans namespaces is unaffected. Foreign\n* keys are built purely from the FK descriptor (`fk.target`), so cross-namespace\n* FKs survive per-namespace conversion. The `annotations` block (storage-type\n* derived) is omitted here — the per-namespace tree consumer reads only the\n* per-table fields.\n*/\nfunction contractNamespaceToSchemaIR(storage, namespaceId, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (!namespace) return new SqlSchemaIR({ tables: {} });\n\tconst storageTypes = { ...storage.types ?? {} };\n\tconst tables = {};\n\tfor (const [tableName, tableDefRaw] of Object.entries(namespace.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${namespaceId}.entries.table.${tableName}`);\n\t\ttables[tableName] = convertTable(tableName, tableDefRaw, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, storage);\n\t}\n\treturn new SqlSchemaIR({ tables });\n}\nfunction contractToSchemaIR(contract, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tif (!contract) return new SqlSchemaIR({ tables: {} });\n\tconst storage = contract.storage;\n\tconst storageTypes = { ...storage.types ?? {} };\n\tconst tables = {};\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, tableDefRaw] of Object.entries(ns.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${ns.id}.entries.table.${tableName}`);\n\t\tconst tableDef = tableDefRaw;\n\t\tif (tables[tableName] !== void 0) throw sqlFamilyError(\"CONTRACT.TABLE_AMBIGUOUS\", `contractToSchemaIR: duplicate SQL table name \"${tableName}\" across namespaces (ambiguous for flat SqlSchemaIR.tables).`, {\n\t\t\twhy: \"Two namespaces declare a table with the same name, which is ambiguous for the flat schema-IR table map.\",\n\t\t\tfix: \"Rename one of the tables so every table name is unique across namespaces.\",\n\t\t\tmeta: { table: tableName }\n\t\t});\n\t\ttables[tableName] = convertTable(tableName, tableDef, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, storage);\n\t}\n\treturn new SqlSchemaIR({\n\t\ttables,\n\t\t...ifDefined(\"annotations\", deriveAnnotations(storage, options.annotationNamespace, options.resolveEnumNamespaceSchema))\n\t});\n}\nfunction deriveAnnotations(storage, annotationNamespace, _resolveEnumNamespaceSchema) {\n\tconst storageTypes = {};\n\tfor (const typeInstance of Object.values(storage.types ?? {})) if (isStorageTypeInstance(typeInstance)) storageTypes[typeInstance.nativeType] = typeInstance;\n\tconst envelope = { ...Object.keys(storageTypes).length > 0 ? { storageTypes } : {} };\n\tif (Object.keys(envelope).length === 0) return void 0;\n\treturn { [annotationNamespace]: envelope };\n}\n//#endregion\n//#region src/core/migrations/control-policy.ts\n/**\n* The control policy that governs a single call. The `external` default is an\n* un-overridable namespace floor: when the contract default is `external`, no\n* per-object `managed` override can escalate DDL above the floor, so the\n* policy is forced to `external` regardless of the node's own declaration.\n* Every other default defers to the node's effective control policy.\n*/\nfunction controlPolicyForCall(subject, defaultControlPolicy) {\n\tif (defaultControlPolicy === \"external\") return \"external\";\n\treturn effectiveControlPolicy(subject?.explicitNodeControlPolicy, defaultControlPolicy);\n}\n/**\n* Whether a call is allowed to emit under a given control policy.\n*\n* - `managed` — full lifecycle, every op allowed.\n* - `tolerated` — create-if-absent only: allowed iff the call creates a whole\n* new top-level object (and its subject was positively resolved). Anything\n* that modifies an existing object, and anything whose subject could not be\n* resolved, is suppressed.\n* - `external` / `observed` — no DDL at all.\n*/\nfunction callAllowedUnderControlPolicy(policy, subject) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return subject?.createsNewObject === true;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\n/**\n* Partition the calls produced for a single set of subjects into those the\n* effective control policy permits (`kept`) and a list of\n* {@link SuppressionRecord}s describing the suppressed calls.\n*\n* **Prefer {@link partitionIssuesByControlPolicy}** for the schema-issue\n* pipeline: it filters subjects out of the planner's *input* so the planner\n* never has to reason about un-modeled state on `external`/`observed`\n* subjects. This call-level helper remains for paths that bypass the issue\n* pipeline — currently the codec-emitted field-event ops, which originate\n* from declared contract fields rather than from introspected schema state\n* and therefore cannot trip the diff engine.\n*/\nfunction partitionCallsByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst kept = [];\n\tconst suppressions = [];\n\tfor (const call of options.calls) {\n\t\tconst subject = options.resolveControlPolicySubject(call);\n\t\tconst policy = controlPolicyForCall(subject, defaultControlPolicy);\n\t\tif (callAllowedUnderControlPolicy(policy, subject)) kept.push(call);\n\t\telse suppressions.push({\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\tfactoryName: options.resolveFactoryName(call),\n\t\t\tcreatesNewObject: subject?.createsNewObject ?? false\n\t\t});\n\t}\n\treturn Object.freeze({\n\t\tkept: Object.freeze(kept),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\n/**\n* Partition a list of schema-issue-shaped inputs by the effective control\n* policy of each issue's subject *before* the planner is invoked.\n*\n* `plannable` is the list of issues whose subject's effective policy permits\n* the planner to act on them (`managed`, or `tolerated` for whole-object\n* creation issues only). Issues for `external`/`observed` subjects, and\n* non-creation issues for `tolerated` subjects, are dropped from the planner's\n* input entirely — they never enter introspection-driven planning, never feed\n* the diff engine, and never produce DDL calls that would have to be\n* post-filtered. This sidesteps a class of failure where the diff engine\n* cannot reason about the live shape of a subject the user marked as\n* out-of-scope (`external`).\n*\n* `suppressions` is one {@link SuppressionRecord} per suppressed subject (not\n* per suppressed issue). Its `factoryName` is the creation factory name when any\n* of the subject's issues is whole-object creation (e.g. `createTable`), else\n* `undefined` — the family never invents a modification verb for an op that\n* produced no call; the target renders the message.\n*\n* Unresolved-subject issues (`resolveControlPolicySubject` returns\n* `undefined`) emit one record each; they cannot be deduplicated because they\n* carry no subject coordinate.\n*/\nfunction partitionIssuesByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst plannable = [];\n\tconst suppressedSubjects = /* @__PURE__ */ new Map();\n\tconst unresolvedSuppressions = [];\n\tfor (const issue of options.issues) {\n\t\tconst subject = options.resolveControlPolicySubject(issue);\n\t\tconst policy = controlPolicyForCall(subject, defaultControlPolicy);\n\t\tconst creationFactoryName = options.resolveCreationFactoryName(issue);\n\t\tif (policy === \"managed\") {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (policy === \"tolerated\" && subject !== void 0 && creationFactoryName !== void 0 && subject.createsNewObject) {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (subject === void 0) {\n\t\t\tunresolvedSuppressions.push({\n\t\t\t\tsubject: void 0,\n\t\t\t\tpolicy,\n\t\t\t\tfactoryName: creationFactoryName,\n\t\t\t\tcreatesNewObject: false\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = subjectKey(subject);\n\t\tconst existing = suppressedSubjects.get(key);\n\t\tif (existing) {\n\t\t\tif (existing.creationFactoryName === void 0 && creationFactoryName !== void 0) existing.creationFactoryName = creationFactoryName;\n\t\t} else suppressedSubjects.set(key, {\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\t...ifDefined(\"creationFactoryName\", creationFactoryName)\n\t\t});\n\t}\n\tconst suppressions = [...unresolvedSuppressions];\n\tfor (const entry of suppressedSubjects.values()) suppressions.push({\n\t\tsubject: entry.subject,\n\t\tpolicy: entry.policy,\n\t\tfactoryName: entry.creationFactoryName,\n\t\tcreatesNewObject: entry.subject.createsNewObject\n\t});\n\treturn Object.freeze({\n\t\tplannable: Object.freeze(plannable),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\nfunction subjectKey(subject) {\n\treturn `${subject.namespaceId}\\u0000${subject.entityKind ?? \"\"}\\u0000${subject.entityName ?? \"\"}\\u0000${subject.rlsPolicy ?? \"\"}`;\n}\n//#endregion\n//#region src/core/migrations/field-event-planner.ts\nfunction planFieldEventOperations(options) {\n\tconst priorContract = options.priorContract;\n\tconst newContract = options.newContract;\n\tconst added = [];\n\tconst dropped = [];\n\tconst altered = [];\n\tconst namespaceIds = unionSorted(priorContract ? Object.keys(priorContract.storage.namespaces) : [], Object.keys(newContract.storage.namespaces));\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst priorNs = priorContract?.storage.namespaces[namespaceId];\n\t\tconst newNs = newContract.storage.namespaces[namespaceId];\n\t\tconst priorTables = priorNs?.entries.table;\n\t\tconst newTables = newNs?.entries.table;\n\t\tconst tableNames = unionSorted(priorTables ? Object.keys(priorTables) : [], newTables ? Object.keys(newTables) : []);\n\t\tfor (const tableName of tableNames) {\n\t\t\tconst priorTableRaw = priorTables?.[tableName];\n\t\t\tconst newTableRaw = newTables?.[tableName];\n\t\t\tconst priorTable = StorageTable.is(priorTableRaw) ? priorTableRaw : void 0;\n\t\t\tconst newTable = StorageTable.is(newTableRaw) ? newTableRaw : void 0;\n\t\t\tconst fieldNames = unionSorted(priorTable ? Object.keys(priorTable.columns) : [], newTable ? Object.keys(newTable.columns) : []);\n\t\t\tfor (const fieldName of fieldNames) {\n\t\t\t\tconst priorField = priorTable?.columns[fieldName];\n\t\t\t\tconst newField = newTable?.columns[fieldName];\n\t\t\t\tconst entry = {\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\ttableName,\n\t\t\t\t\tfieldName,\n\t\t\t\t\tpriorTable,\n\t\t\t\t\tnewTable,\n\t\t\t\t\tpriorField,\n\t\t\t\t\tnewField\n\t\t\t\t};\n\t\t\t\tif (priorField === void 0 && newField !== void 0) added.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField === void 0) dropped.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField !== void 0) {\n\t\t\t\t\tif (isAlteration(priorField, newField)) altered.push(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst calls = [];\n\tappendCalls(\"added\", added, options.codecHooks, calls, (e) => e.newField?.codecId);\n\tappendCalls(\"dropped\", dropped, options.codecHooks, calls, (e) => e.priorField?.codecId);\n\tappendCalls(\"altered\", altered, options.codecHooks, calls, (e) => e.newField?.codecId);\n\treturn calls;\n}\nfunction appendCalls(event, entries, codecHooks, calls, pickCodecId) {\n\tfor (const entry of entries) {\n\t\tconst codecId = pickCodecId(entry);\n\t\tif (codecId === void 0) continue;\n\t\tconst hook = codecHooks.get(codecId);\n\t\tif (!hook?.onFieldEvent) continue;\n\t\tconst ctx = buildContext(event, entry);\n\t\tconst emitted = hook.onFieldEvent(event, ctx);\n\t\tfor (const call of emitted) calls.push(call);\n\t}\n}\n/**\n* The context's prior/new sides are scoped to the event:\n*\n* - `'added'` — only `newTable` / `newField` populated.\n* - `'dropped'` — only `priorTable` / `priorField` populated.\n* - `'altered'` — both sides populated.\n*/\nfunction buildContext(event, entry) {\n\tconst base = {\n\t\tnamespaceId: entry.namespaceId,\n\t\ttableName: entry.tableName,\n\t\tfieldName: entry.fieldName\n\t};\n\tif (event === \"added\") return {\n\t\t...base,\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n\tif (event === \"dropped\") return {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {}\n\t};\n\treturn {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n}\n/**\n* `'altered'` predicate. Returns `false` whenever `codecId` differs —\n* any codec change suppresses the `altered` event entirely, including\n* cases where another property also differs in the same diff. Codec\n* rotation is a v1 non-goal; avoiding the mixed event keeps the\n* migration semantics for codec changes explicit rather than smuggling\n* them through as `altered`.\n*\n* For non-`codecId` diffs, returns `true` iff any other column property\n* differs.\n*/\nfunction isAlteration(prior, current) {\n\tif (prior.codecId !== current.codecId) return false;\n\treturn !sameStorageColumn(prior, current);\n}\nfunction sameStorageColumn(a, b) {\n\tif (a === b) return true;\n\tif (a.nativeType !== b.nativeType) return false;\n\tif (a.nullable !== b.nullable) return false;\n\tif (a.typeRef !== b.typeRef) return false;\n\tif (!sameJson(a.typeParams, b.typeParams)) return false;\n\tif (!sameJson(a.default, b.default)) return false;\n\treturn true;\n}\nfunction sameJson(a, b) {\n\tif (a === b) return true;\n\tif (a === void 0 || b === void 0) return false;\n\treturn JSON.stringify(a) === JSON.stringify(b);\n}\nfunction unionSorted(a, b) {\n\tconst set = /* @__PURE__ */ new Set();\n\tfor (const name of a) set.add(name);\n\tfor (const name of b) set.add(name);\n\treturn [...set].sort((x, y) => x < y ? -1 : x > y ? 1 : 0);\n}\n//#endregion\n//#region src/core/migrations/native-type-expander.ts\n/**\n* Builds the codec-hook-composed `expandNativeType` callback the contract→IR\n* derivation uses to expand parameterized native types (e.g. `character` +\n* `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework\n* components are supplied, so callers can omit the option entirely.\n*/\nfunction buildNativeTypeExpander(frameworkComponents) {\n\tif (!frameworkComponents) return;\n\tconst codecHooks = extractCodecControlHooks(frameworkComponents);\n\treturn (input) => {\n\t\tif (!input.typeParams) return input.nativeType;\n\t\tif (!input.codecId) return input.nativeType;\n\t\tconst hooks = codecHooks.get(input.codecId);\n\t\tif (!hooks?.expandNativeType) return input.nativeType;\n\t\treturn hooks.expandNativeType(input);\n\t};\n}\n//#endregion\n//#region src/core/migrations/plan-helpers.ts\nconst readOnlyEmptyObject = Object.freeze({});\nfunction cloneRecord(value) {\n\tif (value === readOnlyEmptyObject) return value;\n\treturn Object.freeze({ ...value });\n}\nfunction freezeSteps(steps) {\n\tif (steps.length === 0) return Object.freeze([]);\n\treturn Object.freeze(steps.map((step) => Object.freeze({\n\t\tdescription: step.description,\n\t\tsql: step.sql,\n\t\t...step.params ? { params: Object.freeze([...step.params]) } : {},\n\t\t...step.meta ? { meta: cloneRecord(step.meta) } : {}\n\t})));\n}\nfunction freezeDetailsValue(value) {\n\tif (value === null || value === void 0) return value;\n\tif (typeof value !== \"object\") return value;\n\tif (Array.isArray(value)) return Object.freeze([...value]);\n\treturn Object.freeze({ ...value });\n}\nfunction freezeTargetDetails(target) {\n\treturn Object.freeze({\n\t\tid: target.id,\n\t\t...target.details !== void 0 ? { details: freezeDetailsValue(target.details) } : {}\n\t});\n}\nfunction freezeOperation(operation) {\n\treturn Object.freeze({\n\t\tid: operation.id,\n\t\tlabel: operation.label,\n\t\t...operation.summary ? { summary: operation.summary } : {},\n\t\toperationClass: operation.operationClass,\n\t\t...operation.invariantId ? { invariantId: operation.invariantId } : {},\n\t\ttarget: freezeTargetDetails(operation.target),\n\t\tprecheck: freezeSteps(operation.precheck),\n\t\texecute: freezeSteps(operation.execute),\n\t\tpostcheck: freezeSteps(operation.postcheck),\n\t\t...operation.meta ? { meta: cloneRecord(operation.meta) } : {}\n\t});\n}\nfunction freezeOperations(operations) {\n\tif (operations.length === 0) return Object.freeze([]);\n\treturn Object.freeze(operations.map((operation) => freezeOperation(operation)));\n}\nfunction createMigrationPlan(options) {\n\treturn Object.freeze({\n\t\ttargetId: options.targetId,\n\t\tspaceId: options.spaceId,\n\t\t...options.origin !== void 0 ? { origin: options.origin ? Object.freeze({ ...options.origin }) : null } : {},\n\t\tdestination: Object.freeze({ ...options.destination }),\n\t\toperations: freezeOperations(options.operations),\n\t\tprovidedInvariants: Object.freeze([...options.providedInvariants]),\n\t\t...options.meta ? { meta: cloneRecord(options.meta) } : {}\n\t});\n}\nfunction plannerSuccess(plan, warnings) {\n\treturn Object.freeze({\n\t\tkind: \"success\",\n\t\tplan,\n\t\t...warnings && warnings.length > 0 ? { warnings: Object.freeze(warnings.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t}))) } : {}\n\t});\n}\nfunction plannerFailure(conflicts) {\n\treturn Object.freeze({\n\t\tkind: \"failure\",\n\t\tconflicts: Object.freeze(conflicts.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t})))\n\t});\n}\n/**\n* Creates a successful migration runner result.\n*/\nfunction runnerSuccess(value) {\n\treturn ok(Object.freeze({\n\t\toperationsPlanned: value.operationsPlanned,\n\t\toperationsExecuted: value.operationsExecuted\n\t}));\n}\n/**\n* Creates a failed migration runner result.\n*/\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(Object.freeze({\n\t\tcode,\n\t\tsummary,\n\t\t...options?.why ? { why: options.why } : {},\n\t\t...options?.meta ? { meta: cloneRecord(options.meta) } : {}\n\t}));\n}\n//#endregion\n//#region src/core/migrations/policies.ts\n/**\n* Policy used by `db init`: additive-only operations, no widening/destructive steps.\n*/\nconst INIT_ADDITIVE_POLICY = Object.freeze({ allowedOperationClasses: Object.freeze([\"additive\"]) });\n//#endregion\n//#region src/exports/control.ts\nvar control_default = new SqlFamilyDescriptor();\n//#endregion\nexport { INIT_ADDITIVE_POLICY, assembleAuthoringContributions, buildNativeTypeExpander, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, resolveValueSetValues, runnerFailure, runnerSuccess, temporalAuthoringPresets, temporalCodecPreset, temporalCodecPresetWithPrecision, timestampNowControlDescriptor };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,eAAe,cAAc;CACrC,MAAM,UAAU,aAAa,KAAK,CAAC,CAAC,YAAY;CAChD,OAAO,QAAQ,WAAW,SAAS,KAAK,QAAQ,WAAW,QAAQ,KAAK,QAAQ,WAAW,OAAO;AACnG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,OAAO;EAC1B;EACA;EACA,GAAG,SAAS,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EAC1C,GAAG,SAAS,OAAO,EAAE,MAAM,YAAY,QAAQ,IAAI,EAAE,IAAI,CAAC;CAC3D,CAAC,CAAC;AACH;;;;AAMA,MAAM,uBAAuB,OAAO,OAAO,EAAE,yBAAyB,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;AAGnG,IAAI,kBAAkB,IAAI,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./control-adapter-C99J7aEF-Cmay9zFj.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-kinds-DKxwKolf-CcsY-iYV.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds-DKxwKolf.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { c as Index, t as StorageTable } from \"./storage-table-_LWDmPfv.mjs\";\nimport { n as StorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-Dp5_EjXD.mjs\";\nimport { type } from \"arktype\";\n//#region src/ir/storage-entry-schemas.ts\nconst literalKindSchema = type(\"'literal'\");\nconst functionKindSchema = type(\"'function'\");\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst ColumnDefaultLiteralSchema = type.declare().type({\n\tkind: literalKindSchema,\n\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n});\nconst ColumnDefaultFunctionSchema = type.declare().type({\n\tkind: functionKindSchema,\n\texpression: \"string\"\n});\nconst ColumnDefaultSchema = ColumnDefaultLiteralSchema.or(ColumnDefaultFunctionSchema);\nconst StorageValueSetRefSchema = type({\n\tplane: \"'storage'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'valueSet'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\nconst StorageColumnSchema = type({\n\t\"+\": \"reject\",\n\tnativeType: \"string\",\n\tcodecId: \"string\",\n\tnullable: \"boolean\",\n\t\"many?\": \"boolean\",\n\t\"typeParams?\": \"Record<string, unknown>\",\n\t\"typeRef?\": \"string\",\n\t\"default?\": ColumnDefaultSchema,\n\t\"control?\": ControlPolicySchema,\n\t\"valueSet?\": StorageValueSetRefSchema\n}).narrow((col, ctx) => {\n\tif (col.typeParams !== void 0 && col.typeRef !== void 0) return ctx.mustBe(\"a column with either typeParams or typeRef, not both\");\n\treturn true;\n});\n/**\n* Storage value-set entry under `storage.namespaces[id].entries.valueSet[name]`.\n* Carries a `kind: 'valueSet'` discriminator (enumerable, survives JSON) and an\n* ordered `values` array of codec-encoded permitted values.\n*/\nconst StorageValueSetSchema = type({\n\tkind: \"'valueSet'\",\n\tvalues: type(\"string | number | boolean | null | unknown[] | Record<string, unknown>\").array().readonly()\n});\nconst PrimaryKeySchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst UniqueConstraintSchema = type.declare().type({\n\tcolumns: type.string.array().readonly(),\n\t\"name?\": \"string\"\n});\nconst IndexSchema = type({\n\tname: \"string\",\n\t\"prefix?\": \"string\",\n\t\"columns?\": type.string.array().readonly(),\n\t\"expression?\": \"string\",\n\t\"where?\": \"string\",\n\tunique: \"boolean\",\n\t\"type?\": \"string\",\n\t\"options?\": \"Record<string, unknown>\"\n});\nconst ForeignKeyReferenceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly(),\n\t\"spaceId?\": \"string\"\n});\nconst ForeignKeySourceSchema = type({\n\t\"+\": \"reject\",\n\tnamespaceId: \"string\",\n\ttableName: \"string\",\n\tcolumns: type.string.array().readonly()\n});\nconst ReferentialActionSchema = type.declare().type(\"'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'\");\nconst ForeignKeySchema = type.declare().type({\n\tsource: ForeignKeySourceSchema,\n\ttarget: ForeignKeyReferenceSchema,\n\t\"name?\": \"string\",\n\t\"onDelete?\": ReferentialActionSchema,\n\t\"onUpdate?\": ReferentialActionSchema\n});\nconst CheckConstraintSchema = type({\n\t\"+\": \"reject\",\n\tname: \"string\",\n\tcolumn: \"string\",\n\tvalueSet: StorageValueSetRefSchema\n});\nconst StorageTableSchema = type({\n\t\"+\": \"reject\",\n\tcolumns: type({ \"[string]\": StorageColumnSchema }),\n\t\"primaryKey?\": PrimaryKeySchema,\n\tuniques: UniqueConstraintSchema.array().readonly(),\n\tindexes: IndexSchema.array().readonly(),\n\tforeignKeys: ForeignKeySchema.array().readonly(),\n\t\"control?\": ControlPolicySchema,\n\t\"checks?\": CheckConstraintSchema.array().readonly()\n});\n//#endregion\n//#region src/entity-kinds.ts\nconst tableEntityKind = {\n\tkind: \"table\",\n\tschema: StorageTableSchema,\n\tconstruct: (input) => new StorageTable({\n\t\t...input,\n\t\tindexes: input.indexes.map((i) => i instanceof Index ? i : indexInputFromSerialized(i))\n\t})\n};\nconst valueSetEntityKind = {\n\tkind: \"valueSet\",\n\tschema: StorageValueSetSchema,\n\tconstruct: (input) => new StorageValueSet(input)\n};\n/**\n* Assembles the `kind → descriptor` registry for SQL namespaces: the built-in\n* `table` and `valueSet` kinds plus any target `packKinds`. This builds the\n* lookup table — it does not touch contract data. `hydrateNamespaceEntities`\n* later consumes this registry to turn a namespace's raw entries into IR\n* instances, and `createSqlContractSchema` derives validation from the same\n* registry. Throws on a duplicate kind.\n*/\nfunction composeSqlEntityKinds(packKinds = []) {\n\tconst kinds = /* @__PURE__ */ new Map([[\"table\", tableEntityKind], [\"valueSet\", valueSetEntityKind]]);\n\tfor (const descriptor of packKinds) {\n\t\tif (kinds.has(descriptor.kind)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `composeSqlEntityKinds: duplicate entity kind \"${descriptor.kind}\" — each kind may be registered only once`, { meta: { entityKind: descriptor.kind } });\n\t\tkinds.set(descriptor.kind, descriptor);\n\t}\n\treturn kinds;\n}\n//#endregion\nexport { ColumnDefaultFunctionSchema as a, ForeignKeyReferenceSchema as c, IndexSchema as d, ReferentialActionSchema as f, CheckConstraintSchema as i, ForeignKeySchema as l, StorageValueSetSchema as m, tableEntityKind as n, ColumnDefaultLiteralSchema as o, StorageTableSchema as p, valueSetEntityKind as r, ColumnDefaultSchema as s, composeSqlEntityKinds as t, ForeignKeySourceSchema as u };\n\n//# sourceMappingURL=entity-kinds-DKxwKolf.mjs.map"],"mappings":";;;;;AAKA,MAAM,oBAAoB,KAAK,WAAW;AAC1C,MAAM,qBAAqB,KAAK,YAAY;AAC5C,MAAM,sBAAsB,KAAK,mDAAmD;AACpF,MAAM,6BAA6B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACtD,MAAM;CACN,OAAO;AACR,CAAC;AACD,MAAM,8BAA8B,KAAK,QAAQ,CAAC,CAAC,KAAK;CACvD,MAAM;CACN,YAAY;AACb,CAAC;AACD,MAAM,sBAAsB,2BAA2B,GAAG,2BAA2B;AACrF,MAAM,2BAA2B,KAAK;CACrC,OAAO;CACP,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,YAAY;AACb,CAAC;AACD,MAAM,sBAAsB,KAAK;CAChC,KAAK;CACL,YAAY;CACZ,SAAS;CACT,UAAU;CACV,SAAS;CACT,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;AACd,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ;CACvB,IAAI,IAAI,eAAe,KAAK,KAAK,IAAI,YAAY,KAAK,GAAG,OAAO,IAAI,OAAO,sDAAsD;CACjI,OAAO;AACR,CAAC;;;;;;AAMD,MAAM,wBAAwB,KAAK;CAClC,MAAM;CACN,QAAQ,KAAK,wEAAwE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS;AACzG,CAAC;AACD,MAAM,mBAAmB,KAAK,QAAQ,CAAC,CAAC,KAAK;CAC5C,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;CACtC,SAAS;AACV,CAAC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B,CAAC,CAAC;CACvF,CAAC;AACF;AACA,MAAM,qBAAqB;CAC1B,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,gBAAgB,KAAK;AAChD;;;;;;;;;AASA,SAAS,sBAAsB,YAAY,CAAC,GAAG;CAC9C,MAAM,wBAAwB,IAAI,IAAI,CAAC,CAAC,SAAS,eAAe,GAAG,CAAC,YAAY,kBAAkB,CAAC,CAAC;CACpG,KAAK,MAAM,cAAc,WAAW;EACnC,IAAI,MAAM,IAAI,WAAW,IAAI,GAAG,MAAM,cAAc,sCAAsC,iDAAiD,WAAW,KAAK,4CAA4C,EAAE,MAAM,EAAE,YAAY,WAAW,KAAK,EAAE,CAAC;EAChP,MAAM,IAAI,WAAW,MAAM,UAAU;CACtC;CACA,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-kinds-Dh6VH4uK.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/entity-kinds.d.mts"],"mappings":";;;;;;;;;;;;KAWK,yBAAyB,KAAK;WACxB,SAAS,cAAc,QAAQ;;cAE5B,iBAAiB,qBAAqB,wBAAwB;cAC9D,oBAAoB,qBAAqB,sBAAsB;;;;;;;;;iBAS5D,sBAAsB,qBAAqB,4BAA4B,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./middleware-eb7YwdD4-D0M6ACQ-.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"naming-BwqqVcZy-BgTObIQw.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-BwqqVcZy.mjs"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/naming.ts\nfunction defaultIndexName(tableName, columns) {\n\treturn `${tableName}_${columns.join(\"_\")}_idx`;\n}\n/** The flat name the union describes. Inverse of {@link namingOf}. */\nfunction nameOf(naming) {\n\treturn naming.kind === \"wire\" ? formatWireName(naming.prefix, naming.hash) : naming.name;\n}\n/**\n* The naming a name-identified node was built with, read back off the flat\n* pair it stores. Inverse of {@link nameOf}, and total for that\n* reason: the constructor derived `name` from the union, so the two agree.\n* Flat data arriving from outside the process goes through\n* {@link parseNaming} instead.\n*/\nfunction namingOf(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix,\n\t\thash: name.slice(prefix.length + 1)\n\t};\n}\n/**\n* Reads naming out of flat stored data — deserialized contract JSON and the\n* literals a user may hand-edit, the one place a name and a prefix can still\n* disagree. Throws when a declared prefix does not parse back out of the name.\n*/\nfunction parseNaming(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\tconst parsed = parseWireName(name);\n\tif (parsed === void 0 || parsed.prefix !== prefix) throw new ContractValidationError(`\"${name}\": prefix \"${prefix}\" does not match the wire name (expected \"${formatWireName(prefix, \"<8hex>\")}\").`, \"storage\");\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix: parsed.prefix,\n\t\thash: parsed.hash\n\t};\n}\n/**\n* The naming an object read out of a live catalog has: a wire-shaped name\n* gets the wire arm so the rename pass can pair it by prefix, and every\n* other name is exact.\n*\n* The wire answer is a claim about the name's SHAPE only — the hash is\n* deliberately not recomputed from the object's content here. Nothing\n* downstream reads it as more than that: the differ always asks the\n* contract-derived side to choose the comparison, so a shape-only wire\n* claim on the introspected side never suppresses a body comparison, and\n* `contract infer` recomputes the hash independently before it will emit an\n* index as wire-named.\n*/\nfunction namingOfLiveName(name) {\n\tconst wire = parseWireName(name);\n\treturn wire === void 0 ? {\n\t\tkind: \"exact\",\n\t\tname\n\t} : {\n\t\tkind: \"wire\",\n\t\tprefix: wire.prefix,\n\t\thash: wire.hash\n\t};\n}\nconst WIRE_NAME_PATTERN = /^(.+)_([0-9a-f]{8})$/;\n/**\n* Assembles a wire name from its user-supplied prefix and its 8-hex\n* content-hash suffix. This module owns the `<prefix>_<hash>` format on both\n* sides — construction here and parsing in {@link parseWireName} — so the two\n* never drift.\n*/\nfunction formatWireName(prefix, hash) {\n\treturn `${prefix}_${hash}`;\n}\n/**\n* Splits a wire name (`<prefix>_<8hex>`) into its prefix and content-hash\n* suffix. Returns `undefined` when the name does not follow the wire-name\n* shape (e.g. an object created outside the toolchain) — callers treat such\n* names as all-prefix. Consumed by introspection (prefix extraction) and by\n* rename pairing (same hash, different prefix).\n*/\nfunction parseWireName(name) {\n\tconst match = WIRE_NAME_PATTERN.exec(name);\n\tconst prefix = match?.[1];\n\tconst hash = match?.[2];\n\tif (prefix === void 0 || hash === void 0) return void 0;\n\treturn {\n\t\tprefix,\n\t\thash\n\t};\n}\n/**\n* Stabilizes an authored SQL body (index expression, partial-index predicate,\n* RLS policy predicate) for hashing: trim, and collapse runs of internal\n* whitespace to a single space.\n*\n* This is deliberately minimal. The content hash is the equivalence relation\n* for a wire-named object, and the wire name (prefix + hash) is the only\n* thing ever compared — the hash is never recomputed from an introspected\n* body, so there is no need to match the database's reprinted form. Minimal\n* normalization also protects the no-collision property: aggressive rewriting\n* (lowercasing, paren-stripping, cast-alias folding) risks collapsing two\n* distinct bodies onto one hash.\n*\n* The normalizer is a stability commitment: any change re-suffixes all wire names.\n*/\nfunction normalizeSqlBody(sql) {\n\treturn sql.replace(/\\s+/g, \" \").trim();\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for an index:\n*\n* [normalizeSqlBody(expression), normalizeSqlBody(where), columns, unique, type, sortedOptions]\n*\n* Columns hash in authored order — column order is semantic in an index.\n* Option values are `String()`-coerced (matching the loose option equality\n* used for diffing) so a hash computed from typed contract values agrees with\n* one recomputed from introspected reloptions strings. The prefix, schema,\n* and table are excluded (they are orthogonal to index equivalence).\n*\n* The tuple order and encoding are a stability commitment with the same\n* status as the RLS tuple: any change re-suffixes every wire name.\n*/\n/**\n* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling:\n* JS booleans and the common catalog spellings (`pg_class.reloptions`\n* stores whatever spelling the DDL used, so a live index may carry\n* `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; everything\n* else via `String()` (fully specified for numbers, so no platform\n* variance). Shared by the wire-name hash tuple, the node's option\n* equality, and the DDL renderer, so an authored `{ fastupdate: true }`\n* agrees with a live index created under any boolean spelling.\n*/\nfunction normalizeIndexOptionValue(value) {\n\tif (value === true || value === \"true\" || value === \"on\") return \"on\";\n\tif (value === false || value === \"false\" || value === \"off\") return \"off\";\n\treturn String(value);\n}\nfunction computeIndexContentHash(parts) {\n\tconst sortedOptions = Object.entries(parts.options ?? {}).map(([key, value]) => [key, normalizeIndexOptionValue(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);\n\tconst tuple = JSON.stringify([\n\t\tnormalizeSqlBody(parts.expression ?? \"\"),\n\t\tnormalizeSqlBody(parts.where ?? \"\"),\n\t\tparts.columns ?? [],\n\t\tparts.unique,\n\t\tparts.type ?? \"\",\n\t\tsortedOptions\n\t]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/**\n* Postgres identifiers cap at 63 characters and the wire name appends a\n* 9-character `_<8hex>` suffix, so an authored prefix is bounded at 54.\n*/\nconst WIRE_NAME_PREFIX_MAX_LENGTH = 54;\n/**\n* Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_LENGTH}.\n* `subject` opens the error message (e.g. `defineContract: policy prefix`).\n*/\nfunction assertWireNamePrefixLength(prefix, subject) {\n\tif (prefix.length > 54) throw structuredError(\"CONTRACT.WIRE_NAME_PREFIX_TOO_LONG\", `${subject} \"${prefix}\" exceeds the 54-character maximum (Postgres identifiers cap at 63 characters and the wire name appends a 9-character hash suffix).`, { meta: {\n\t\tprefix,\n\t\tmaxLength: 54\n\t} });\n}\n//#endregion\nexport { formatWireName as a, namingOfLiveName as c, parseNaming as d, parseWireName as f, defaultIndexName as i, normalizeIndexOptionValue as l, assertWireNamePrefixLength as n, nameOf as o, computeIndexContentHash as r, namingOf as s, WIRE_NAME_PREFIX_MAX_LENGTH as t, normalizeSqlBody as u };\n\n//# sourceMappingURL=naming-BwqqVcZy.mjs.map"],"mappings":";;;;AAIA,SAAS,iBAAiB,WAAW,SAAS;CAC7C,OAAO,GAAG,UAAU,GAAG,QAAQ,KAAK,GAAG,EAAE;AAC1C;;AAEA,SAAS,OAAO,QAAQ;CACvB,OAAO,OAAO,SAAS,SAAS,eAAe,OAAO,QAAQ,OAAO,IAAI,IAAI,OAAO;AACrF;;;;;;;;AAQA,SAAS,SAAS,MAAM,QAAQ;CAC/B,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO;EACN,MAAM;EACN;EACA,MAAM,KAAK,MAAM,OAAO,SAAS,CAAC;CACnC;AACD;;;;;;AAMA,SAAS,YAAY,MAAM,QAAQ;CAClC,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,MAAM,SAAS,cAAc,IAAI;CACjC,IAAI,WAAW,KAAK,KAAK,OAAO,WAAW,QAAQ,MAAM,IAAI,wBAAwB,IAAI,KAAK,aAAa,OAAO,4CAA4C,eAAe,QAAQ,QAAQ,EAAE,MAAM,SAAS;CAC9M,OAAO;EACN,MAAM;EACN,QAAQ,OAAO;EACf,MAAM,OAAO;CACd;AACD;;;;;;;;;;;;;;AAcA,SAAS,iBAAiB,MAAM;CAC/B,MAAM,OAAO,cAAc,IAAI;CAC/B,OAAO,SAAS,KAAK,IAAI;EACxB,MAAM;EACN;CACD,IAAI;EACH,MAAM;EACN,QAAQ,KAAK;EACb,MAAM,KAAK;CACZ;AACD;AACA,MAAM,oBAAoB;;;;;;;AAO1B,SAAS,eAAe,QAAQ,MAAM;CACrC,OAAO,GAAG,OAAO,GAAG;AACrB;;;;;;;;AAQA,SAAS,cAAc,MAAM;CAC5B,MAAM,Q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
-
{"version":3,"file":"naming-jLgdauLi-C84G_UHi.d.mts","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-jLgdauLi.d.mts"],"mappings":";;iBACiB,iBAAiB,mBAAmB;UAC3C;;WAEC;;WAEA;;;;;;;;;;;KAWN;WACM;WACA;;WAEA;IACP;;iBAEa,OAAO,QAAQ;;;;;;;;iBAQf,SAAS,cAAc,6BAA6B;;;;;;iBAMpD,YAAY,cAAc,6BAA6B;;;;;;;;;;;;;;iBAcvD,iBAAiB,eAAe;;;;;;;iBAOhC,eAAe,gBAAgB;;;;;;;;iBAQ/B,cAAc,eAAe;;;;;;;;;;;;;;;;iBAgB7B,iBAAiB;UACxB;WACC;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BJ,0BAA0B;iBAC1B,wBAAwB,OAAO;;;;;cAKlC;;;;;iBAKG,2BAA2B,gBAAgB"}
|
package/dist/plan-mKgmSe0R.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./query-lane-context-DjyAyYht-HDNYE_oF.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-verify-vtFZbmGq-BNfTr6fU.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/schema-verify-vtFZbmGq.mjs"],"sourcesContent":["import { blindCast } from \"@internal/utils/casts\";\nimport { assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\n//#region src/core/assembly.ts\nfunction hasCodecControlHooks(descriptor) {\n\tif (typeof descriptor !== \"object\" || descriptor === null) return false;\n\tconst hooks = descriptor.types?.codecTypes?.controlPlaneHooks;\n\treturn hooks !== null && hooks !== void 0 && typeof hooks === \"object\";\n}\nfunction extractCodecControlHooks(descriptors) {\n\tconst hooks = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (typeof descriptor !== \"object\" || descriptor === null) continue;\n\t\tif (!hasCodecControlHooks(descriptor)) continue;\n\t\tconst controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;\n\t\tfor (const [codecId, hook] of Object.entries(controlPlaneHooks)) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId: descriptor.id,\n\t\t\t\tentityLabel: \"control hooks\",\n\t\t\t\tentityOwnershipLabel: \"owner\"\n\t\t\t});\n\t\t\thooks.set(codecId, hook);\n\t\t\towners.set(codecId, descriptor.id);\n\t\t}\n\t}\n\treturn hooks;\n}\n//#endregion\n//#region src/core/diff/verifier-disposition.ts\n/**\n* Classifies a codec `verifyType` hook finding into the target-neutral\n* categories the framework grades. A storage type is a named type instance\n* (e.g. a native enum); the only shape divergence it can carry is a change\n* to its value set, so a paired mismatch always classifies as `valueDrift`.\n*/\nfunction classifyStorageTypeDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return \"extraAuxiliary\";\n\treturn \"valueDrift\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));\n}\n//#endregion\n//#region src/core/diff/schema-verify.ts\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/**\n* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on\n* demand, from the issue's node's `nodeKind` via the target-provided\n* `granularityOf` map. The node carries only its `nodeKind` identity, never a\n* classification, and nothing is stamped onto the issue — every consumer\n* (the family verdict below, the framework aggregate's unclaimed-elements\n* sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})\n* calls this the same way, resolved by the family/target that owns the node\n* vocabulary. `undefined` for an issue with no node.\n*/\nfunction classifyDiffSubjectGranularity(issue, granularityOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : granularityOf(node.nodeKind);\n}\n/**\n* Resolves an issue's storage `entityKind` on demand, from the issue's\n* node's `nodeKind` via the target-provided `entityKindOf` map — the sibling\n* of {@link classifyDiffSubjectGranularity}, called the same way by the same\n* consumers (via\n* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).\n* `undefined` for an issue with no node, or for a node kind with no storage\n* entity of its own.\n*/\nfunction classifyDiffEntityKind(issue, entityKindOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : entityKindOf(node.nodeKind);\n}\n/**\n* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the\n* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the\n* issue reason. The vocabulary maps one-to-one: an undeclared live entity or\n* namespace is `extraTopLevelObject`, an undeclared live field\n* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,\n* defaults) and structural leaves (policies) `extraAuxiliary`; a value-set\n* drift on a check node is `valueDrift`; every other paired divergence is\n* `declaredIncompatible`; anything the database lacks is `declaredMissing`.\n* `granularityOf` is the target's classifier, so target and extension node\n* kinds classify without the family importing them.\n*/\nfunction classifySqlDiffIssue(issue, granularityOf) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\t\tif (granularity === \"entity\" || granularity === \"namespace\") return \"extraTopLevelObject\";\n\t\tif (granularity === \"field\") return \"extraNestedElement\";\n\t\treturn \"extraAuxiliary\";\n\t}\n\tif (issueNode(issue)?.nodeKind === RelationalSchemaNodeKind.check) return \"valueDrift\";\n\treturn \"declaredIncompatible\";\n}\n/**\n* Whether a `not-expected` issue is a strict-mode-only finding. The legacy\n* walk detected every relational extra (namespaces, entities, fields, and\n* their auxiliaries) only under `--strict`; the structural diff (roots, RLS\n* policies, roles) was never strict-gated — its extras fail in both modes.\n* Keyed on the issue's granularity, resolved via `granularityOf`.\n*/\nfunction isStrictOnlyExtra(issue, granularityOf) {\n\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\treturn granularity === \"namespace\" || granularity === \"entity\" || granularity === \"field\" || granularity === \"auxiliary\";\n}\n/**\n* Applies the two consumer filters to a diff issue list: strict gating\n* (relational `not-expected` findings drop in lenient mode) and\n* control-policy disposition (each surviving issue grades against its\n* subject table's effective policy; suppressed issues drop, `observed`\n* subjects warn). The verify verdict is `failures.length === 0`.\n*/\nfunction computeSqlDiffVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tfor (const issue of input.issues) {\n\t\tif (!input.strict && issueOutcome(issue) === \"not-expected\" && isStrictOnlyExtra(issue, input.granularityOf)) continue;\n\t\tconst disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));\n\t\tif (disposition === \"suppress\") continue;\n\t\tif (disposition === \"warn\") {\n\t\t\twarnings.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tfailures.push(issue);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction computeStorageTypeVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);\n\tfor (const pair of input.namespacePairs) {\n\t\tif (pair.actual === void 0) continue;\n\t\tfor (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {\n\t\t\tif (!isStorageTypeInstance(typeInstance)) continue;\n\t\t\tconst hook = input.codecHooks.get(typeInstance.codecId);\n\t\t\tif (!hook?.verifyType) continue;\n\t\t\tconst typeIssues = hook.verifyType({\n\t\t\t\ttypeName,\n\t\t\t\ttypeInstance,\n\t\t\t\tschema: pair.actual\n\t\t\t});\n\t\t\tfor (const issue of typeIssues) {\n\t\t\t\tconst disposition = verifierDisposition(policy, issue);\n\t\t\t\tif (disposition === \"suppress\") continue;\n\t\t\t\tif (disposition === \"warn\") {\n\t\t\t\t\twarnings.push(issue);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfailures.push(issue);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\n/**\n* THE SQL schema verify: runs the target's full-tree node diff, grades it\n* through the family's post-diff filters (strict gating + control-policy\n* disposition) plus the codec `verifyType` hook findings, and wraps the\n* verdict in the issue-based result envelope. `ok` holds exactly when both\n* issue lists are empty — the lists carry the verdict's failures.\n*/\nfunction verifySqlSchemaByDiff(input) {\n\tconst startTime = Date.now();\n\tconst verdictDiff = input.diffSchema({\n\t\tcontract: input.contract,\n\t\tschema: input.schema,\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst diffVerdict = computeSqlDiffVerdict({\n\t\tissues: verdictDiff.issues,\n\t\tresolveControlPolicy: verdictDiff.resolveControlPolicy,\n\t\tstrict: input.strict,\n\t\tdefaultControlPolicy: input.contract.defaultControlPolicy,\n\t\tgranularityOf: input.granularityOf\n\t});\n\tconst storageTypeVerdict = computeStorageTypeVerdict({\n\t\tcontract: input.contract,\n\t\tnamespacePairs: verdictDiff.namespacePairs,\n\t\tcodecHooks: extractCodecControlHooks(input.frameworkComponents)\n\t});\n\tconst failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;\n\tconst ok = failCount === 0;\n\tconst profileHash = \"profileHash\" in input.contract && typeof input.contract.profileHash === \"string\" ? input.contract.profileHash : void 0;\n\treturn {\n\t\tok,\n\t\t...ok ? {} : { code: \"CONTRACT.SCHEMA_VERIFICATION_FAILED\" },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? \"\" : \"s\"})`,\n\t\tcontract: {\n\t\t\tstorageHash: input.contract.storage.storageHash,\n\t\t\t...ifDefined(\"profileHash\", profileHash)\n\t\t},\n\t\ttarget: {\n\t\t\texpected: input.contract.target,\n\t\t\tactual: input.contract.target\n\t\t},\n\t\tschema: {\n\t\t\tissues: [...diffVerdict.failures, ...storageTypeVerdict.failures],\n\t\t\twarnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }\n\t\t},\n\t\tmeta: { strict: input.strict },\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\n//#endregion\nexport { computeStorageTypeVerdict as a, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, verifySqlSchemaByDiff as o, classifySqlDiffIssue as r, extractCodecControlHooks as s, classifyDiffEntityKind as t };\n\n//# sourceMappingURL=schema-verify-vtFZbmGq.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,qBAAqB,YAAY;CACzC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM,OAAO;CAClE,MAAM,QAAQ,WAAW,OAAO,YAAY;CAC5C,OAAO,UAAU,QAAQ,UAAU,KAAK,KAAK,OAAO,UAAU;AAC/D;AACA,SAAS,yBAAyB,aAAa;CAC9C,MAAM,wBAAwB,IAAI,IAAI;CACtC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,cAAc,aAAa;EACrC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM;EAC3D,IAAI,CAAC,qBAAqB,UAAU,GAAG;EACvC,MAAM,oBAAoB,WAAW,MAAM,WAAW;EACtD,KAAK,MAAM,CAAC,SAAS,SAAS,OAAO,QAAQ,iBAAiB,GAAG;GAChE,uBAAuB;IACtB;IACA;IACA,cAAc,WAAW;IACzB,aAAa;IACb,sBAAsB;GACvB,CAAC;GACD,MAAM,IAAI,SAAS,IAAI;GACvB,OAAO,IAAI,SAAS,WAAW,EAAE;EAClC;CACD;CACA,OAAO;AACR;;;;;;;AASA,SAAS,6BAA6B,OAAO;CAC5C,IAAI,aAAa,KAAK,MAAM,aAAa,OAAO;C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;EACpB,sBAAsB,YAAY;EAClC,QAAQ,MAAM;EACd,sBAAsB,MAAM,SAAS;EACrC,eAAe,MAAM;CACtB,CAAC;CACD,MAAM,qBAAqB,0BAA0B;EACpD,UAAU,MAAM;EAChB,gBAAgB,YAAY;EAC5B,YAAY,yBAAyB,MAAM,mBAAmB;CAC/D,CAAC;CACD,MAAM,YAAY,YAAY,SAAS,SAAS,mBAAmB,SAAS;CAC5E,MAAM,KAAK,cAAc;CACzB,MAAM,cAAc,iBAAiB,MAAM,YAAY,OAAO,MAAM,SAAS,gBAAgB,WAAW,MAAM,SAAS,cAAc,KAAK;CAC1I,OAAO;EACN;EACA,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,sCAAsC;EAC3D,SAAS,KAAK,uCAAuC,8CAA8C,UAAU,UAAU,cAAc,IAAI,KAAK,IAAI;EAClJ,UAAU;GACT,aAAa,MAAM,SAAS,QAAQ;GACpC,GAAG,UAAU,eAAe,WAAW;EACxC;EACA,QAAQ;GACP,UAAU,MAAM,SAAS;GACzB,QAAQ,MAAM,SAAS;EACxB;EACA,QAAQ;GACP,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ;GAChE,UAAU,EAAE,QAAQ,CAAC,GAAG,YAAY,UAAU,GAAG,mBAAmB,QAAQ,EAAE;EAC/E;EACA,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;CAC1C;AACD"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { n as IndexElements, r as IndexInput } from "./sql-index-DsI8HAeK-BJsn-jvD.mjs";
|
|
2
|
-
//#region ../../../2-sql/1-core/contract/dist/serialized-index-B96AwqtU.d.mts
|
|
3
|
-
//#region src/serialized-index.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* An index as `contract.json` stores it: full `name`, optional `prefix` whose
|
|
6
|
-
* presence marks wire mode. The `table` entity kind hydrates it through
|
|
7
|
-
* {@link indexInputFromSerialized}.
|
|
8
|
-
*/
|
|
9
|
-
type SerializedIndex = IndexElements & {
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly prefix?: string;
|
|
12
|
-
readonly where?: string;
|
|
13
|
-
readonly unique: boolean;
|
|
14
|
-
readonly type?: string;
|
|
15
|
-
readonly options?: Record<string, unknown>;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Hydrates one stored index into constructor input. The parameter is typed
|
|
19
|
-
* but the values are whatever the file held, so each field the union depends
|
|
20
|
-
* on is checked here rather than downstream — by the time `Index` sees the
|
|
21
|
-
* data it is already a valid union.
|
|
22
|
-
*/
|
|
23
|
-
declare function indexInputFromSerialized(flat: SerializedIndex): IndexInput;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { indexInputFromSerialized as n, SerializedIndex as t };
|
|
26
|
-
//# sourceMappingURL=serialized-index-B96AwqtU-DcqcB4q_.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialized-index-B96AwqtU-DcqcB4q_.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/serialized-index-B96AwqtU.d.mts"],"mappings":";;;;;;;;KAOK,kBAAkB;WACZ;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;iBAQJ,yBAAyB,MAAM,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialized-index-Dp5_EjXD-DMsw8jf3.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/serialized-index-Dp5_EjXD.mjs"],"sourcesContent":["import { l as SqlNode } from \"./storage-table-_LWDmPfv.mjs\";\nimport { freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { parseNaming } from \"@internal/sql-schema-ir/naming\";\n//#region src/ir/storage-value-set.ts\n/**\n* SQL Contract IR node for a value-set entry in a namespace's `valueSet`\n* map (`SqlNamespace.entries.valueSet`).\n*\n* A value-set records the ordered set of permitted codec-encoded values for\n* an enum-like column restriction. It does not carry a `codecId` — the\n* column that references it already holds the codec; the value-set holds\n* only the permitted values.\n*\n* The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope\n* carries the discriminator and the serializer hydration walker can\n* dispatch on it. This follows the per-leaf enumerable-kind convention\n* established in the SQL-node comment (future polymorphic dispatch on\n* namespace entries needs the discriminator in JSON).\n*\n* The entry's name is not on the class — value-sets are keyed by name in\n* the parent namespace's `valueSet: Record<string, StorageValueSet>` map.\n*/\nvar StorageValueSet = class extends SqlNode {\n\tkind = \"valueSet\";\n\tvalues;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.values = Object.freeze([...input.values]);\n\t\tfreezeNode(this);\n\t}\n};\nfunction isStorageValueSet(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"kind\" in value && value.kind === \"valueSet\" && \"values\" in value;\n}\n//#endregion\n//#region src/serialized-index.ts\n/**\n* Hydrates one stored index into constructor input. The parameter is typed\n* but the values are whatever the file held, so each field the union depends\n* on is checked here rather than downstream — by the time `Index` sees the\n* data it is already a valid union.\n*/\nfunction indexInputFromSerialized(flat) {\n\tif (flat.name === void 0 || flat.name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\tif (flat.columns === void 0 === (flat.expression === void 0)) throw new ContractValidationError(`Index \"${flat.name}\": exactly one of columns or expression must be set.`, \"storage\");\n\tconst carried = {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\twhere: flat.where,\n\t\tunique: flat.unique,\n\t\ttype: flat.type,\n\t\toptions: flat.options\n\t};\n\treturn flat.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: flat.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: flat.columns ?? []\n\t};\n}\n//#endregion\nexport { StorageValueSet as n, isStorageValueSet as r, indexInputFromSerialized as t };\n\n//# sourceMappingURL=serialized-index-Dp5_EjXD.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAI,kBAAkB,cAAc,QAAQ;CAC3C,OAAO;CACP;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,CAAC,GAAG,MAAM,MAAM,CAAC;EAC7C,WAAW,IAAI;CAChB;AACD;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,OAAO,UAAU,SAAS,MAAM,SAAS,cAAc,YAAY;AACpE;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,KAAK,WAAW,GAAG,MAAM,IAAI,wBAAwB,wJAAwJ,SAAS;CACvP,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,eAAe,KAAK,IAAI,MAAM,IAAI,wBAAwB,UAAU,KAAK,KAAK,uDAAuD,SAAS;CACpL,MAAM,UAAU;EACf,QAAQ,YAAY,KAAK,MAAM,KAAK,MAAM;EAC1C,OAAO,KAAK;EACZ,QAAQ,KAAK;EACb,MAAM,KAAK;EACX,SAAS,KAAK;CACf;CACA,OAAO,KAAK,eAAe,KAAK,IAAI;EACnC,GAAG;EACH,YAAY,KAAK;CAClB,IAAI;EACH,GAAG;EACH,SAAS,KAAK,WAAW,CAAC;CAC3B;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-table-BBaAmanc-BwR37LMA.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-BBaAmanc.d.mts"],"mappings":";;;;;;;;;;;;UAWU;WACC;WACA;WACA,UAAU;;;;;;;;;;;;;;;;cAgBP,wBAAwB;WAC3B;WACA;WACA,UAAU;EACnB,YAAY,OAAO;;;;;;;;;;;;;;UAcX;WACC;WACA;WACA;WACA;WACA,aAAa;WACb;WACA,UAAU;WACV,UAAU;WACV,WAAW;;;;;;;;;;;;;;;cAeR,sBAAsB;WACzB;WACA;WACA;WACA;WACA,aAAa;WACb;WACA,UAAU;WACV,UAAU;WACV,WAAW;EACpB,YAAY,OAAO;;;;UAIX;WACC,SAAS,eAAe,gBAAgB;WACxC,aAAa,aAAa;WAC1B,SAAS,cAAc,mBAAmB;WAC1C,SAAS,cAAc,QAAQ;WAC/B,aAAa,cAAc,aAAa;WACxC,UAAU;WACV,SAAS,cAAc,kBAAkB;;;;;;;;;;;;;;cActC,qBAAqB;WACxB,SAAS,SAAS,eAAe;WACjC,SAAS,cAAc;WACvB,SAAS,cAAc;WACvB,aAAa,cAAc;WAC3B,aAAa;WACb,UAAU;WACV,SAAS,cAAc;EAChC,YAAY,OAAO;;;;;;;;SAQZ,GAAG,OAAO,2BAA2B,SAAS;SAC9C,OAAO,OAAO,0BAA0B,6BAA6B,SAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-table-_LWDmPfv-DFhU2dML.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-_LWDmPfv.mjs"],"sourcesContent":["import { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ir/sql-index.ts\n/**\n* SQL Contract IR node for a table-level secondary index, name-identified:\n* `name` is the full physical name; a present `prefix` marks the index as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)`), an absent `prefix`\n* marks it exact (the name is adopted verbatim).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL supported natively by\n* Postgres and SQLite alike, and the family IR must be able to represent\n* anything any SQL target can introspect. A target declining to AUTHOR them\n* (SQLite's rejection at namespace construction) is a capability decision,\n* not evidence of target-specificity.\n*\n* Note that this class shadows the global TypeScript `Index` lib type\n* at the family-shared name; consumer files that need both should\n* alias one (e.g.\n* `import { Index as SqlIndexNode } from '@internal/sql-contract/types'`).\n*/\nvar Index = class extends SqlNode {\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new ContractValidationError(`Index \"${name}\": exactly one of columns or expression must be set.`, \"storage\");\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tif (input.type !== void 0) this.type = input.type;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/check-constraint.ts\n/**\n* SQL Contract IR node for a table-level check constraint that restricts\n* a column to the permitted values of a value-set.\n*\n* The constraint is **structured** (names a column and a value-set\n* reference), not a raw SQL expression. Each target renders its own DDL\n* from the structured form, keeping the contract target-agnostic.\n*\n* Construction is idempotent: passing an existing `CheckConstraint`\n* instance as input produces a new instance with identical fields.\n* The constructor does not use `instanceof` for input discrimination —\n* it reads plain named properties, which is sufficient since\n* `CheckConstraintInput` is a structural type.\n*/\nvar CheckConstraint = class extends SqlNode {\n\tname;\n\tcolumn;\n\tvalueSet;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.column = input.column;\n\t\tthis.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key-reference.ts\n/**\n* SQL Contract IR node for one side (source or target) of a foreign-key\n* declaration. Carries the full coordinate: namespace, table, and columns.\n*\n* Cross-space discrimination is based on `spaceId` presence: absent means\n* local (same contract-space); present means cross-space (the referenced\n* table lives in the contract-space identified by `spaceId`).\n*\n* For local references `spaceId` is absent from JSON, keeping the serialized\n* shape byte-identical to contracts authored before cross-space support was\n* added. For cross-space references `spaceId` appears in JSON so round-trips\n* are lossless.\n*\n* Use `UNBOUND_NAMESPACE_ID` from `@internal/framework-components/ir`\n* as the sentinel `namespaceId` for single-namespace (unbound) references.\n*/\nvar ForeignKeyReference = class extends SqlNode {\n\tnamespaceId;\n\ttableName;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.namespaceId = asNamespaceId(input.namespaceId);\n\t\tthis.tableName = input.tableName;\n\t\tthis.columns = input.columns;\n\t\tif (input.spaceId !== void 0) this.spaceId = input.spaceId;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key.ts\n/**\n* SQL Contract IR node for a table-level foreign-key declaration — the\n* referential constraint only (source, target, `onDelete`/`onUpdate`).\n*\n* A persisted `foreignKeys[]` entry always denotes a real constraint: whether\n* to emit the constraint at all, and whether to back it with an index, are\n* authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,\n* index })`) resolved once at `contract emit` — a `constraint: false` FK\n* simply has no entry here, and a backing index (if any) is its own discrete,\n* named entry in the table's `indexes[]`.\n*\n* Each FK carries explicit `source` and `target` {@link ForeignKeyReference}\n* coordinates (namespace, table, columns). For single-namespace contracts the\n* sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.\n*\n* The nested references are normalised to {@link ForeignKeyReference}\n* instances inside the constructor so downstream walks see a uniform AST\n* regardless of whether the input was a JSON literal or an already-constructed\n* class instance.\n*/\nvar ForeignKey = class extends SqlNode {\n\tsource;\n\ttarget;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.source = input.source instanceof ForeignKeyReference ? input.source : new ForeignKeyReference(input.source);\n\t\tthis.target = input.target instanceof ForeignKeyReference ? input.target : new ForeignKeyReference(input.target);\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* SQL Contract IR node for a table's primary-key constraint.\n*/\nvar PrimaryKey = class extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/storage-column.ts\n/**\n* SQL Contract IR node for a single column entry in `StorageTable.columns`.\n*\n* Single concrete family-shared class — every SQL target reads the\n* same column shape today, so there is no per-target subclass. The\n* class type accepts any caller that constructs via\n* `new StorageColumn(input)`; literal construction sites must pass\n* through the constructor or the family-base hydration walker.\n*\n* The column's `name` is not on the class — columns are keyed by name\n* in the parent `StorageTable.columns: Record<string, StorageColumn>`\n* map, so a `name` field would be redundant with the key.\n*/\nvar StorageColumn = class extends SqlNode {\n\tnativeType;\n\tcodecId;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.typeParams !== void 0) this.typeParams = input.typeParams;\n\t\tif (input.typeRef !== void 0) this.typeRef = input.typeRef;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.valueSet !== void 0) this.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/unique-constraint.ts\n/**\n* SQL Contract IR node for a table-level unique constraint.\n*/\nvar UniqueConstraint = class extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/storage-table.ts\n/**\n* SQL Contract IR node for a single table entry in a namespace's\n* `tables` map.\n*\n* The constructor normalises nested IR-class fields (columns, primary\n* key, uniques, indexes, foreign keys) into the appropriate class\n* instances so downstream walks see a uniform AST regardless of whether\n* the input was a JSON literal or an already-constructed class.\n*\n* The table's `name` is not on the class — tables are keyed by name in\n* the parent namespace's `tables: Record<string, StorageTable>` map.\n*/\nvar StorageTable = class StorageTable extends SqlNode {\n\tcolumns;\n\tuniques;\n\tindexes;\n\tforeignKeys;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([name, col]) => [name, col instanceof StorageColumn ? col : new StorageColumn(col)])));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = input.primaryKey instanceof PrimaryKey ? input.primaryKey : new PrimaryKey(input.primaryKey);\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof UniqueConstraint ? u : new UniqueConstraint(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map((i) => i instanceof Index ? i : new Index(i)));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof ForeignKey ? fk : new ForeignKey(fk)));\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map((cc) => new CheckConstraint(cc)));\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Runtime guard that a namespace `table` entry is really a `StorageTable`.\n\t* The compiler already types the entry as `StorageTable`, but a\n\t* freshly-deserialized contract may carry plain JSON at that slot until\n\t* hydration; this duck-types the structural shape. Accepts `undefined` so\n\t* optional-chained entry lookups pass straight through.\n\t*/\n\tstatic is(value) {\n\t\tif (typeof value !== \"object\" || value === null) return false;\n\t\treturn \"columns\" in value && \"uniques\" in value && \"indexes\" in value && \"foreignKeys\" in value;\n\t}\n\tstatic assert(value, coordinate) {\n\t\tif (!StorageTable.is(value)) throw new InternalError(`Expected a StorageTable at ${coordinate}`);\n\t}\n};\n//#endregion\nexport { ForeignKey as a, Index as c, PrimaryKey as i, SqlNode as l, UniqueConstraint as n, ForeignKeyReference as o, StorageColumn as r, CheckConstraint as s, StorageTable as t };\n\n//# sourceMappingURL=storage-table-_LWDmPfv.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAI,UAAU,cAAc,WAAW;CACtC;CAC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AAO,OAAO,YAAY;EAChC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,MAAM,IAAI,cAAc,8BAA8B,YAAY;CAChG;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-CMMQS6aG.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/types.mjs"],"sourcesContent":["import { a as ForeignKey, c as Index, i as PrimaryKey, l as SqlNode, n as UniqueConstraint, o as ForeignKeyReference, r as StorageColumn, s as CheckConstraint, t as StorageTable } from \"./storage-table-_LWDmPfv.mjs\";\nimport { n as StorageValueSet, r as isStorageValueSet, t as indexInputFromSerialized } from \"./serialized-index-Dp5_EjXD.mjs\";\nimport { NamespaceBase, freezeNode, isPlainRecord } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/ir/storage-type-instance.ts\n/**\n* Sentinel kind for the legacy codec-triple shape persisted under\n* `SqlStorage.types`. Plain JSON-clean object literals carry this\n* discriminator so the polymorphic slot dispatch can route them down\n* the codec path while target-specific IR class instances (e.g. the\n* Postgres enum class) keep their own narrower `kind` literal.\n*/\nconst CODEC_INSTANCE_KIND = \"codec-instance\";\n/**\n* Stamp the codec-instance `kind` discriminator on a caller-supplied\n* codec triple. Idempotent: input that already carries the discriminator\n* passes through unchanged. Missing `typeParams` is normalised to `{}`.\n*/\nfunction toStorageTypeInstance(input) {\n\treturn {\n\t\tkind: CODEC_INSTANCE_KIND,\n\t\tcodecId: input.codecId,\n\t\tnativeType: input.nativeType,\n\t\ttypeParams: input.typeParams ?? {}\n\t};\n}\n/**\n* Type-guard for codec-typed entries on the polymorphic\n* `SqlStorage.types` slot. Distinguishes `StorageTypeInstance` from\n* any class-instance kinds a target pack contributes.\n*/\nfunction isStorageTypeInstance(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn value.kind === CODEC_INSTANCE_KIND;\n}\n//#endregion\n//#region src/ir/sql-storage.ts\n/**\n* Narrows framework `AuthoringContributions` to the SQL-family shape by testing\n* for the SQL-specific `createNamespace` capability.\n*/\nfunction isSqlAuthoringContributions(authoring) {\n\tif (authoring === void 0 || !Object.hasOwn(authoring, \"createNamespace\")) return false;\n\treturn typeof Reflect.get(authoring, \"createNamespace\") === \"function\";\n}\n/**\n* Abstract SQL family namespace base class. Target concretions (`PostgresSchema`,\n* `SqliteDatabase`, …) extend this — it is never instantiated directly.\n* `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]`\n* addresses any entity.\n*/\nvar SqlNamespaceBase = class extends NamespaceBase {};\n/**\n* Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks\n* `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it\n* survives duplicate-module boundaries (e.g. dist e2e where the target and\n* the family carry separate copies of `@internal/framework-components`).\n*\n* Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`,\n* `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput`\n* objects (`{ id, entries }`) do not.\n*/\nfunction isMaterializedSqlNamespace(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"qualifyTable\" in x)) return false;\n\treturn typeof x.qualifyTable === \"function\";\n}\nvar SqlStorage = class extends SqlNode {\n\tstorageHash;\n\tnamespaces;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.storageHash = input.storageHash;\n\t\tthis.namespaces = Object.freeze(input.namespaces);\n\t\tif (input.types !== void 0) this.types = Object.freeze(Object.fromEntries(Object.entries(input.types).map(([name, ti]) => [name, normaliseTypeEntry(name, ti)])));\n\t\tfreezeNode(this);\n\t}\n};\n/**\n* Strict polymorphic-slot dispatch for `SqlStorage.types` entries.\n* Every entry must carry a `kind: 'codec-instance'` discriminator or\n* be an already-constructed `StorageTypeInstance`. Untagged or\n* unrecognised inputs throw a diagnostic naming the entry and its\n* `kind`, so format drift surfaces loudly at the deserializer\n* boundary instead of slipping past the seam and corrupting\n* downstream IR walks.\n*\n* Codec-triple authors that have an untagged shape on hand can call\n* `toStorageTypeInstance(...)` (which stamps the `'codec-instance'`\n* discriminator) before constructing `SqlStorage`. On-disk reads\n* cross `familyInstance.deserializeContract` first; the structural\n* arktype schema rejects untagged entries earlier, so this throw\n* only fires for in-memory authoring bugs.\n*/\nfunction normaliseTypeEntry(name, entry) {\n\tif (isStorageTypeInstance(entry)) {\n\t\tif (\"typeParams\" in entry) return entry;\n\t\treturn toStorageTypeInstance(entry);\n\t}\n\tconst rawKind = isPlainRecord(entry) ? entry[\"kind\"] : void 0;\n\tconst kindDescription = rawKind === void 0 ? \"missing `kind` discriminator\" : `unrecognised \\`kind\\` discriminator ${JSON.stringify(rawKind)}`;\n\tthrow new InternalError(`storage.types[${JSON.stringify(name)}] has ${kindDescription}; expected ${JSON.stringify(\"codec-instance\")}. Untagged codec triples should be wrapped with toStorageTypeInstance(...) before construction.`);\n}\n//#endregion\n//#region src/types.ts\nconst DEFAULT_FK_CONSTRAINT = true;\nconst DEFAULT_FK_INDEX = true;\nfunction applyFkDefaults(fk, overrideDefaults) {\n\treturn {\n\t\tconstraint: fk.constraint ?? overrideDefaults?.constraint ?? true,\n\t\tindex: fk.index ?? overrideDefaults?.index ?? true\n\t};\n}\n//#endregion\nexport { CODEC_INSTANCE_KIND, CheckConstraint, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, Index, PrimaryKey, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageValueSet, UniqueConstraint, applyFkDefaults, indexInputFromSerialized, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, toStorageTypeInstance };\n\n//# sourceMappingURL=types.mjs.map"],"mappings":";;;;;;;;;;;AAYA,MAAM,sBAAsB;;;;;;AAM5B,SAAS,sBAAsB,OAAO;CACrC,OAAO;EACN,MAAM;EACN,SAAS,MAAM;EACf,YAAY,MAAM;EAClB,YAAY,MAAM,cAAc,CAAC;CAClC;AACD;;;;;;AAMA,SAAS,s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;;;;;;;;EAQ1C,UAAU,OAAO;;;;;;;;;;;;;;;;;;;;;;EAsBjB,cAAc,OAAO,YAAY;aACtB;aACA;;;;;UAKH;WACC;WACA;WACA,cAAc;;;;;;WAMd,qBAAqB;;;;;;;;;;;;;cAalB,oBAAoB,2BAA2B;WAClD;WACA;WACA;WACA,cAAc;;WAEd,qBAAqB;EAC9B,YAAY,OAAO;MACf;EACJ,qBAAqB;SACd,GAAG,MAAM,kBAAkB,QAAQ;EAC1C,UAAU,OAAO;;;;UAIT;WACC;WACA,SAAS,eAAe,cAAc;WACtC,aAAa,cAAc,kBAAkB;WAC7C,SAAS,cAAc,cAAc;WACrC,SAAS,cAAc,aAAa;WACpC,aAAa,aAAa;WAC1B,cAAc;;WAEd,SAAS,cAAc,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;cAuB3C,mBAAmB,2BAA2B;WACjD;WACA;WACA,SAAS,SAAS,eAAe;WACjC,aAAa,cAAc;WAC3B,SAAS,cAAc;WACvB,SAAS,cAAc;WACvB,aAAa;WACb,cAAc;WACd,SAAS,cAAc;EAChC,YAAY,OAAO;MACf;EACJ,UAAU,OAAO;EACjB,qBAAqB;;;;UAIb;WACC,QAAQ,eAAe,aAAa;WACpC,cAAc;;;;;;;;;;;;;;;;;cAiBX,oBAAoB,2BAA2B;WAClD;WACA,QAAQ,SAAS,eAAe;WAChC,cAAc;EACvB,YAAY,OAAO;MACf;EACJ,UAAU,OAAO;EACjB,qBAAqB;;;;;;;;;UASb;;WAEC;;WAEA;;;;;WAKA;;;;;;UAMD;EACR,UAAU,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-DmhUVq4u-BpqqjPJx.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-DmhUVq4u.mjs"],"sourcesContent":["import { l as normalizeIndexOptionValue, o as nameOf } from \"./naming-BwqqVcZy.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint that restricts a\n* column to a set of permitted values (an enum-style `IN (...)` check).\n*\n* Carries the **resolved values** rather than a raw SQL predicate so\n* callers can compare value-sets without parsing SQL.\n*\n* Implements `DiffableNode` so a check constraint is directly a table's\n* diff-tree child: `id` is the constraint name. `isEqualTo` compares\n* `column` and the permitted-value set (order-insensitive — the database\n* does not guarantee `IN (...)` ordering).\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\tcolumn;\n\tpermittedValues;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.column = input.column;\n\t\tthis.permittedValues = Object.freeze([...input.permittedValues]);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\t/**\n\t* Compares the permitted-value sets only (unordered), matching the\n\t* relational walk's `verifyCheckConstraints`: two checks pairing by name\n\t* compare their value sets — the `column` field is descriptive, not part\n\t* of the comparison, so a name-paired check with equal values verifies\n\t* regardless of which column carries it.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tconst thisValues = new Set(this.permittedValues);\n\t\tconst otherValues = new Set(node.permittedValues);\n\t\tif (thisValues.size !== otherValues.size) return false;\n\t\treturn [...thisValues].every((v) => otherValues.has(v));\n\t}\n};\n//#endregion\n//#region src/ir/resolved-default-equality.ts\n/**\n* Structural equality for two resolved column defaults, ported from the\n* relational walk's `columnDefaultsEqual` normalized branch: kinds must\n* match; literal values are normalized (Date and temporal-typed strings to\n* ISO instants) then compared canonically (JSON objects match their\n* canonical string form); function expressions compare case- and\n* whitespace-insensitively.\n*\n* `nativeType` provides the temporal-normalization context (the actual\n* side's resolved native type in a diff comparison).\n*/\nfunction resolvedDefaultsEqual(expected, actual, nativeType) {\n\tif (expected.kind !== actual.kind) return false;\n\tif (expected.kind === \"literal\" && actual.kind === \"literal\") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType), normalizeLiteralValue(actual.value, nativeType));\n\tif (expected.kind === \"function\" && actual.kind === \"function\") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);\n\treturn false;\n}\nfunction normalizeFunctionExpression(expression) {\n\treturn expression.toLowerCase().replace(/\\s+/g, \"\");\n}\nfunction isTemporalNativeType(nativeType) {\n\tif (!nativeType) return false;\n\tconst normalized = nativeType.toLowerCase();\n\treturn normalized.includes(\"timestamp\") || normalized === \"date\";\n}\nfunction normalizeLiteralValue(value, nativeType) {\n\tif (value instanceof Date) return value.toISOString();\n\tif (typeof value === \"string\" && isTemporalNativeType(nativeType)) {\n\t\tconst parsed = new Date(value);\n\t\tif (!Number.isNaN(parsed.getTime())) return parsed.toISOString();\n\t}\n\treturn value;\n}\nfunction literalValuesEqual(a, b) {\n\tif (a === b) return true;\n\tif (typeof a === \"object\" && a !== null && typeof b === \"object\" && b !== null) return canonicalStringify(a) === canonicalStringify(b);\n\tif (typeof a === \"object\" && a !== null && typeof b === \"string\") try {\n\t\treturn canonicalStringify(a) === canonicalStringify(JSON.parse(b));\n\t} catch {\n\t\treturn false;\n\t}\n\tif (typeof a === \"string\" && typeof b === \"object\" && b !== null) try {\n\t\treturn canonicalStringify(JSON.parse(a)) === canonicalStringify(b);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn false;\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tif (input.nativeTypeContext !== void 0) this.nativeTypeContext = input.nativeTypeContext;\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Structured comparison with `this` as the expected side: both sides\n\t* resolved compare per the relational walk's `columnDefaultsEqual`\n\t* semantics; a declared expected default against an unparseable actual\n\t* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall\n\t* back to raw string equality.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tif (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext);\n\t\tif (this.resolved !== void 0 || node.resolved !== void 0) return false;\n\t\treturn this.raw === node.raw;\n\t}\n};\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"codecNamedType\", input.codecNamedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"nativeTypeContext\", this.resolvedNativeType),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map((i) => i instanceof SqlIndexIR ? i : new SqlIndexIR(i)));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = input.primaryKey instanceof PrimaryKey ? input.primaryKey : new PrimaryKey(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map((c) => c instanceof SqlCheckConstraintIR ? c : new SqlCheckConstraintIR(c)));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, SqlCheckConstraintIR as c, assertNode as d, defineNonEnumerable as f, relationalNodeGranularity as h, SqlIndexIR as i, PrimaryKey as l, relationalNodeEntityKind as m, SqlTableIR as n, SqlColumnIR as o, RelationalSchemaNodeKind as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, SqlSchemaIRNode as u };\n\n//# sourceMappingURL=types-DmhUVq4u.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,SAAS;EAClC,yBAAyB,gBAAgB;EACzC,yBAAyB,aAAa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