@prisma/orm-family-sql 8.0.0-rc.1-dev.9 → 8.0.0-rc.1-dev.11
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/{aggregate-descriptor-registry-DPV4z8MS.mjs → aggregate-descriptor-registry-DvPrQwzY.mjs} +11 -3
- package/dist/aggregate-descriptor-registry-DvPrQwzY.mjs.map +1 -0
- package/dist/{ast-DDAyIKdt.mjs → ast-B-eeN74F.mjs} +2 -2
- package/dist/ast-B-eeN74F.mjs.map +1 -0
- package/dist/{ast-UfF480P2.d.mts → ast-BwBkpAM7.d.mts} +3 -3
- package/dist/{ast-UfF480P2.d.mts.map → ast-BwBkpAM7.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs → authoring-type-constructors-Blqoa2Ua-BR5-FhUN.mjs} +2 -2
- package/dist/{authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs.map → authoring-type-constructors-Blqoa2Ua-BR5-FhUN.mjs.map} +1 -1
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +9 -9
- package/dist/builder__runtime.mjs +140 -78
- package/dist/builder__runtime.mjs.map +1 -1
- package/dist/builder__types.d.mts +2 -2
- package/dist/{codec-descriptor-registry-BK_ZTP-3.mjs → codec-descriptor-registry-BQPj9q8O.mjs} +2 -2
- package/dist/{codec-descriptor-registry-BK_ZTP-3.mjs.map → codec-descriptor-registry-BQPj9q8O.mjs.map} +1 -1
- package/dist/{config-types-DuhCZxnc.d.mts → config-types-JLo8FI3b.d.mts} +4 -4
- package/dist/{config-types-DuhCZxnc.d.mts.map → config-types-JLo8FI3b.d.mts.map} +1 -1
- package/dist/{config-types-1lEI_abO.mjs → config-types-THGAJYUu.mjs} +2 -2
- package/dist/{config-types-1lEI_abO.mjs.map → config-types-THGAJYUu.mjs.map} +1 -1
- package/dist/{contract-builder-B5ztYYVI.d.mts → contract-builder-94EfE12M.d.mts} +25 -7
- package/dist/{contract-builder-B5ztYYVI.d.mts.map → contract-builder-94EfE12M.d.mts.map} +1 -1
- package/dist/{contract-builder-DQ02XiKy.mjs → contract-builder-bNftqD4M.mjs} +18 -3
- package/dist/contract-builder-bNftqD4M.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 +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +5 -4
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +4 -3
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/{contract-view-DB7yHLAp.d.mts → contract-view-CX3RJUrm.d.mts} +2 -2
- package/dist/{contract-view-DB7yHLAp.d.mts.map → contract-view-CX3RJUrm.d.mts.map} +1 -1
- package/dist/contract.d.mts +14 -14
- package/dist/contract.mjs +8 -8
- package/dist/contract__contract-view.d.mts +1 -1
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +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 +6 -6
- package/dist/contract__types.mjs +3 -3
- package/dist/contract__validators.d.mts +1 -1
- package/dist/contract__validators.mjs +2 -2
- package/dist/control-adapter-B71_6j-D.d.mts +1 -0
- package/dist/{control-adapter-C99J7aEF-BvoknoRl.d.mts → control-adapter-C99J7aEF-D9Lhjafk.d.mts} +8 -8
- package/dist/{control-adapter-C99J7aEF-BvoknoRl.d.mts.map → control-adapter-C99J7aEF-D9Lhjafk.d.mts.map} +1 -1
- package/dist/{control-JKCfuZLF.d.mts → control-ewQAyuM8.d.mts} +14 -14
- package/dist/{control-JKCfuZLF.d.mts.map → control-ewQAyuM8.d.mts.map} +1 -1
- package/dist/{control-Bj2zT_YF.mjs → control-jeE2ibQ5.mjs} +8 -8
- package/dist/{control-Bj2zT_YF.mjs.map → control-jeE2ibQ5.mjs.map} +1 -1
- package/dist/{db-B5PMfDDd-ZnA9Kuky.d.mts → db-C5jmOFPM-DeJH09un.d.mts} +43 -25
- package/dist/db-C5jmOFPM-DeJH09un.d.mts.map +1 -0
- package/dist/{ddl-types-h_3_pXmq-DzkUGplM.d.mts → ddl-types-CBTOCoND-Ct-Dz4gJ.d.mts} +4 -4
- package/dist/{ddl-types-h_3_pXmq-DzkUGplM.d.mts.map → ddl-types-CBTOCoND-Ct-Dz4gJ.d.mts.map} +1 -1
- package/dist/{derived-checks-BDG-r9XD-CrpFUaO7.mjs → derived-checks-CmJgg-N0-Dt3bpEKZ.mjs} +93 -43
- package/dist/derived-checks-CmJgg-N0-Dt3bpEKZ.mjs.map +1 -0
- package/dist/{derived-checks-DPdD01O0-CXFJD5al.d.mts → derived-checks-DPdD01O0-BusNrgPr.d.mts} +3 -3
- package/dist/{derived-checks-DPdD01O0-CXFJD5al.d.mts.map → derived-checks-DPdD01O0-BusNrgPr.d.mts.map} +1 -1
- package/dist/{diff-DDfez6HZ.d.mts → diff-B_ttICMr.d.mts} +8 -8
- package/dist/{diff-DDfez6HZ.d.mts.map → diff-B_ttICMr.d.mts.map} +1 -1
- package/dist/{entity-kinds-3IFQq7Ho-DB6IN-V6.mjs → entity-kinds-BP9JRPX9-oeJ-t1iG.mjs} +14 -5
- package/dist/entity-kinds-BP9JRPX9-oeJ-t1iG.mjs.map +1 -0
- package/dist/{entity-kinds-FB5fUkUH.d.mts → entity-kinds-CcRX_9l5.d.mts} +4 -4
- package/dist/{entity-kinds-FB5fUkUH.d.mts.map → entity-kinds-CcRX_9l5.d.mts.map} +1 -1
- package/dist/{expression-Da4F0ehj.mjs → expression-CYVKobXp.mjs} +2 -2
- package/dist/{expression-Da4F0ehj.mjs.map → expression-CYVKobXp.mjs.map} +1 -1
- package/dist/{expression-CBHseNtv.d.mts → expression-X88ppPyv.d.mts} +5 -5
- package/dist/{expression-CBHseNtv.d.mts.map → expression-X88ppPyv.d.mts.map} +1 -1
- package/dist/{factories-BPmhxoFd.d.mts → factories-DBqPbIcf.d.mts} +4 -4
- package/dist/{factories-BPmhxoFd.d.mts.map → factories-DBqPbIcf.d.mts.map} +1 -1
- package/dist/{factories-BtnISekg.mjs → factories-MZugewOe.mjs} +3 -3
- package/dist/{factories-BtnISekg.mjs.map → factories-MZugewOe.mjs.map} +1 -1
- package/dist/family.d.mts +11 -11
- package/dist/family.mjs +4 -4
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +2 -2
- 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-CetaZvuu.d.mts → foreign-key-materialization-CS5yxHpq.d.mts} +2 -2
- package/dist/{foreign-key-materialization-CetaZvuu.d.mts.map → foreign-key-materialization-CS5yxHpq.d.mts.map} +1 -1
- package/dist/{foreign-key-materialization-fH6cObko.mjs → foreign-key-materialization-ziwobURR.mjs} +2 -2
- package/dist/{foreign-key-materialization-fH6cObko.mjs.map → foreign-key-materialization-ziwobURR.mjs.map} +1 -1
- package/dist/{index-avHHFCFT.d.mts → index-CwtBEMZr.d.mts} +3 -3
- package/dist/{index-avHHFCFT.d.mts.map → index-CwtBEMZr.d.mts.map} +1 -1
- package/dist/{index-COS9qF9d.d.mts → index-DKWhjgoj.d.mts} +16 -16
- package/dist/{index-COS9qF9d.d.mts.map → index-DKWhjgoj.d.mts.map} +1 -1
- package/dist/{index-naming-BfRyBZR4.d.mts → index-naming-BD2dqoTC.d.mts} +2 -2
- package/dist/{index-naming-BfRyBZR4.d.mts.map → index-naming-BD2dqoTC.d.mts.map} +1 -1
- package/dist/{index-naming-BoGBcMmI-DE0Eu71F.mjs → index-naming-BoGBcMmI-CoehgjMK.mjs} +2 -2
- package/dist/{index-naming-BoGBcMmI-DE0Eu71F.mjs.map → index-naming-BoGBcMmI-CoehgjMK.mjs.map} +1 -1
- package/dist/{index-type-validation-0NdkDB_n.d.mts → index-type-validation-ko-AixNA.d.mts} +3 -3
- package/dist/{index-type-validation-0NdkDB_n.d.mts.map → index-type-validation-ko-AixNA.d.mts.map} +1 -1
- package/dist/{interpreter-5WgpL-ax-BIbrd_Xv.mjs → interpreter-BDZ_Y5U--CWQ831IX.mjs} +88 -4
- package/dist/interpreter-BDZ_Y5U--CWQ831IX.mjs.map +1 -0
- package/dist/{ir-VWQX6aGP.d.mts → ir-DS7g_cyQ.d.mts} +3 -3
- package/dist/{ir-VWQX6aGP.d.mts.map → ir-DS7g_cyQ.d.mts.map} +1 -1
- package/dist/lane-query-builder.d.mts +5 -5
- package/dist/{middleware-eb7YwdD4-CiyaANOv.d.mts → middleware-Bp5oIYM0-B-m0jAm8.d.mts} +3 -3
- package/dist/{middleware-eb7YwdD4-CiyaANOv.d.mts.map → middleware-Bp5oIYM0-B-m0jAm8.d.mts.map} +1 -1
- package/dist/middleware-g3HMYfJq.d.mts +1 -0
- package/dist/{migration-DvCs5-4I.d.mts → migration-D8_nHECs.d.mts} +4 -4
- package/dist/{migration-DvCs5-4I.d.mts.map → migration-D8_nHECs.d.mts.map} +1 -1
- package/dist/{naming-CEGRBbyW-BOa9Eun0.mjs → naming-BWkuWJJK-zuGIIJ49.mjs} +18 -3
- package/dist/naming-BWkuWJJK-zuGIIJ49.mjs.map +1 -0
- package/dist/{naming-DvlNocom-ClcApdiR.d.mts → naming-BsvzQPOq-qOWmknyp.d.mts} +17 -3
- package/dist/naming-BsvzQPOq-qOWmknyp.d.mts.map +1 -0
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +150 -100
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +238 -196
- package/dist/orm-client.mjs.map +1 -1
- package/dist/plan-D3FQ6FXy.d.mts +2 -0
- package/dist/{plan-Bmp5R9sq-mVFXvLM7.d.mts → plan-DfLDIdep-qOGizVoO.d.mts} +5 -5
- package/dist/plan-DfLDIdep-qOGizVoO.d.mts.map +1 -0
- package/dist/{psl-infer-f5BgyRKm.mjs → psl-infer-Z4wA2xpx.mjs} +2 -2
- package/dist/{psl-infer-f5BgyRKm.mjs.map → psl-infer-Z4wA2xpx.mjs.map} +1 -1
- package/dist/{psl-infer-Dp_hwubv.d.mts → psl-infer-zSNyTUPT.d.mts} +3 -3
- package/dist/{psl-infer-Dp_hwubv.d.mts.map → psl-infer-zSNyTUPT.d.mts.map} +1 -1
- package/dist/query-lane-context-7V5_yUIr.d.mts +1 -0
- package/dist/{query-lane-context-DjyAyYht-DdovdGjc.d.mts → query-lane-context-CONNlrCx-D2biFONs.d.mts} +8 -6
- package/dist/query-lane-context-CONNlrCx-D2biFONs.d.mts.map +1 -0
- package/dist/relational-core.d.mts +12 -12
- package/dist/relational-core.mjs +4 -5
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +2 -2
- package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
- package/dist/relational-core__ast.d.mts +4 -4
- package/dist/relational-core__ast.mjs +3 -4
- 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__contract-free.mjs +1 -1
- package/dist/relational-core__contract-free.mjs.map +1 -1
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__expression.mjs +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-BJYVl94P.d.mts → resolve-storage-table-CQsGt37y.d.mts} +3 -3
- package/dist/{resolve-storage-table-BJYVl94P.d.mts.map → resolve-storage-table-CQsGt37y.d.mts.map} +1 -1
- package/dist/{runtime-CiGC1spO.d.mts → runtime-BNtp1bfZ.d.mts} +3 -3
- package/dist/{runtime-CiGC1spO.d.mts.map → runtime-BNtp1bfZ.d.mts.map} +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-differ-DpG_gnur-BgbN2De2.d.mts → schema-differ-DpG_gnur-BYIE9qrd.d.mts} +5 -5
- package/dist/{schema-differ-DpG_gnur-BgbN2De2.d.mts.map → schema-differ-DpG_gnur-BYIE9qrd.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-C_PEdlAr-JK3UgFWU.mjs → schema-verify-C_PEdlAr-CIgsqZ4M.mjs} +2 -2
- package/dist/{schema-verify-C_PEdlAr-JK3UgFWU.mjs.map → schema-verify-C_PEdlAr-CIgsqZ4M.mjs.map} +1 -1
- package/dist/{serialized-index-B6udRZV1-Ciet0tVA.mjs → serialized-index-BhiuLIBO-CRf7KRr_.mjs} +4 -4
- package/dist/{serialized-index-B6udRZV1-Ciet0tVA.mjs.map → serialized-index-BhiuLIBO-CRf7KRr_.mjs.map} +1 -1
- package/dist/{serialized-index-CvprUx-6-CX0DYGLe.d.mts → serialized-index-CEzaHjsj-DM-61QzZ.d.mts} +4 -4
- package/dist/serialized-index-CEzaHjsj-DM-61QzZ.d.mts.map +1 -0
- package/dist/{sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs → sql-contract-serializer-2oBWuxTe-UyjGkOIq.mjs} +4 -4
- package/dist/{sql-contract-serializer-2oBWuxTe-Bp9QfUjI.mjs.map → sql-contract-serializer-2oBWuxTe-UyjGkOIq.mjs.map} +1 -1
- package/dist/{sql-execution-plan-Da_d82pz-g3khvnbo.d.mts → sql-execution-plan-qxvHnFcA-eC6n5Ek9.d.mts} +3 -3
- package/dist/sql-execution-plan-qxvHnFcA-eC6n5Ek9.d.mts.map +1 -0
- package/dist/{sql-index-DsI8HAeK-SazZYeA2.d.mts → sql-index-DsI8HAeK-DsSFxBGF.d.mts} +2 -2
- package/dist/{sql-index-DsI8HAeK-SazZYeA2.d.mts.map → sql-index-DsI8HAeK-DsSFxBGF.d.mts.map} +1 -1
- package/dist/{sql-storage-aEsH6Fnv-_bWH3uY3.d.mts → sql-storage-DCUlYs47-Cosit03s.d.mts} +3 -3
- package/dist/{sql-storage-aEsH6Fnv-_bWH3uY3.d.mts.map → sql-storage-DCUlYs47-Cosit03s.d.mts.map} +1 -1
- package/dist/{storage-table-BcDudZC5-DZNZhjf2.mjs → storage-table-BDY-lx9O-t7-IoZ2B.mjs} +4 -3
- package/dist/{storage-table-BcDudZC5-DZNZhjf2.mjs.map → storage-table-BDY-lx9O-t7-IoZ2B.mjs.map} +1 -1
- package/dist/{storage-table-BTVeIKBx-Ba6wCjG5.d.mts → storage-table-DBbCqpt7-PAuyeZA6.d.mts} +8 -4
- package/dist/storage-table-DBbCqpt7-PAuyeZA6.d.mts.map +1 -0
- package/dist/types-BgOhriVC.d.mts +1 -0
- package/dist/{types-UhDfY1iX-C5wOQ0D5.mjs → types-Bj2O1m67-BLTU_6HK.mjs} +3 -3
- package/dist/{types-UhDfY1iX-C5wOQ0D5.mjs.map → types-Bj2O1m67-BLTU_6HK.mjs.map} +1 -1
- package/dist/{types-D-_2ZCos-9q6j1gKx.mjs → types-CSP6WmWn-DVuxsZJW.mjs} +35 -4
- package/dist/types-CSP6WmWn-DVuxsZJW.mjs.map +1 -0
- package/dist/{types-BpPwiK2b-DCMVWQ_F.d.mts → types-CYq2Cbzw-xEntZSCk.d.mts} +6 -6
- package/dist/{types-BpPwiK2b-DCMVWQ_F.d.mts.map → types-CYq2Cbzw-xEntZSCk.d.mts.map} +1 -1
- package/dist/types-DEBm1lFa.d.mts +1 -0
- package/dist/{types-CuvwcWTE.mjs → types-DHzMt9jy.mjs} +2 -2
- package/dist/{types-CuvwcWTE.mjs.map → types-DHzMt9jy.mjs.map} +1 -1
- package/dist/{types-dD8JJfeD-CS9uMlzW.d.mts → types-Dkm5SRCi-DOcQZ0KX.d.mts} +11 -11
- package/dist/{types-dD8JJfeD-CS9uMlzW.d.mts.map → types-Dkm5SRCi-DOcQZ0KX.d.mts.map} +1 -1
- package/dist/{types-C1F8xk0m-7rMwgIR6.d.mts → types-DtDXwS0i-BjB1HLTY.d.mts} +3 -3
- package/dist/{types-C1F8xk0m-7rMwgIR6.d.mts.map → types-DtDXwS0i-BjB1HLTY.d.mts.map} +1 -1
- package/dist/{types-BL_h3id0.d.mts → types-DuriYH5B.d.mts} +6 -6
- package/dist/{types-BL_h3id0.d.mts.map → types-DuriYH5B.d.mts.map} +1 -1
- package/dist/{types-IqZMLrFC-CcORLTOK.d.mts → types-IqZMLrFC-oV8-d-Fc.d.mts} +9 -9
- package/dist/{types-IqZMLrFC-CcORLTOK.d.mts.map → types-IqZMLrFC-oV8-d-Fc.d.mts.map} +1 -1
- package/dist/{types-BwePDa3m-CrVQ_8YI.d.mts → types-ZzeQKmYD-PJlaIsww.d.mts} +10 -4
- package/dist/types-ZzeQKmYD-PJlaIsww.d.mts.map +1 -0
- package/dist/{validators-w7IJlTcR.mjs → validators-Bgam9aM2.mjs} +0 -0
- package/dist/{validators-w7IJlTcR.mjs.map → validators-Bgam9aM2.mjs.map} +1 -1
- package/dist/{validators-Bl1TVj5n.d.mts → validators-CMi9UZNw.d.mts} +4 -3
- package/dist/validators-CMi9UZNw.d.mts.map +1 -0
- package/package.json +18 -18
- package/dist/aggregate-descriptor-registry-DPV4z8MS.mjs.map +0 -1
- package/dist/ast-DDAyIKdt.mjs.map +0 -1
- package/dist/codec-types-B_xmJL2m-CC_Q-_u9.mjs +0 -24
- package/dist/codec-types-B_xmJL2m-CC_Q-_u9.mjs.map +0 -1
- package/dist/contract-builder-DQ02XiKy.mjs.map +0 -1
- package/dist/control-adapter-BjSrEp2V.d.mts +0 -1
- package/dist/db-B5PMfDDd-ZnA9Kuky.d.mts.map +0 -1
- package/dist/derived-checks-BDG-r9XD-CrpFUaO7.mjs.map +0 -1
- package/dist/entity-kinds-3IFQq7Ho-DB6IN-V6.mjs.map +0 -1
- package/dist/interpreter-5WgpL-ax-BIbrd_Xv.mjs.map +0 -1
- package/dist/middleware-B8QoWWIx.d.mts +0 -1
- package/dist/naming-CEGRBbyW-BOa9Eun0.mjs.map +0 -1
- package/dist/naming-DvlNocom-ClcApdiR.d.mts.map +0 -1
- package/dist/plan-Bmp5R9sq-mVFXvLM7.d.mts.map +0 -1
- package/dist/plan-Cl6aCuij.d.mts +0 -2
- package/dist/query-lane-context-BhDJZFMh.d.mts +0 -1
- package/dist/query-lane-context-DjyAyYht-DdovdGjc.d.mts.map +0 -1
- package/dist/serialized-index-CvprUx-6-CX0DYGLe.d.mts.map +0 -1
- package/dist/sql-execution-plan-Da_d82pz-g3khvnbo.d.mts.map +0 -1
- package/dist/storage-table-BTVeIKBx-Ba6wCjG5.d.mts.map +0 -1
- package/dist/types--gTlnnvl.d.mts +0 -1
- package/dist/types-BwePDa3m-CrVQ_8YI.d.mts.map +0 -1
- package/dist/types-C-KBovJY.d.mts +0 -1
- package/dist/types-D-_2ZCos-9q6j1gKx.mjs.map +0 -1
- package/dist/validators-Bl1TVj5n.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder__runtime.mjs","names":["#state","#buildLateral","#addLateralJoin","#addJoin","#tableSource","#tableName","#namespaceId","#table","#scope","#rows","#returningColumns","#rowFields","#annotations","#setExpressions","#whereExprs","#whereCallbacks","#fromSource","#toJoined"],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs"],"sourcesContent":["import { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DeleteAst, DerivedTableSource, ExistsExpr, IdentifierRef, InsertAst, JoinAst, ListExpression, LiteralExpr, NullCheckExpr, OrExpr, OrderByItem, ParamRef, ProjectionItem, SelectAst, SubqueryExpr, TableSource, UpdateAst, collectOrderedParamRefs } from \"@internal/sql-relational-core/ast\";\nimport { codecOf, createRawSql, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { codecRefForStorageColumn } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { assertAnnotationsApplicable } from \"@internal/framework-components/runtime\";\n//#region src/runtime/expression-impl.ts\n/**\n* Runtime wrapper around a relational-core AST expression node. Carries ScopeField metadata (codecId, nullable) so aggregate-like combinators can propagate the input codec onto their result.\n*\n* `codec` records the column-bound {@link CodecRef} when the field-proxy knows the binding — both the namespaced form (`f.user.email` → `ColumnRef`) and the top-level shortcut (`f.email` → `IdentifierRef`) stamp the ref derived from contract storage. `codecOf(expression)` exposes it for operation implementations forwarding the ref to `toExpr`.\n*\n* `projectionAst` carries the descriptor-lowered rendering of the expression, where a target declares one (e.g. SQLite's `CAST(count(*) AS TEXT)`). Lowering exists to carry the value across the driver boundary, so only the projection site consumes it — predicate and ordering positions (`buildAst()`) keep the plain form, where the rendering would change SQL semantics.\n*/\nvar ExpressionImpl = class {\n\tast;\n\tprojectionAst;\n\treturnType;\n\tcodec;\n\tconstructor(ast, returnType, codec, projectionAst) {\n\t\tthis.ast = ast;\n\t\tthis.returnType = returnType;\n\t\tthis.codec = codec;\n\t\tthis.projectionAst = projectionAst;\n\t}\n\tbuildAst() {\n\t\treturn this.ast;\n\t}\n\tbuildProjectionAst() {\n\t\treturn this.projectionAst ?? this.ast;\n\t}\n};\n/**\n* The AST to project for an expression: the descriptor-lowered form when the expression carries one, the plain form otherwise. `resolveSelectArgs` calls this where a lane expression becomes a `ProjectionItem` — the one place the value crosses the driver boundary.\n*/\nfunction projectionAstOf(expr) {\n\treturn expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();\n}\n//#endregion\n//#region src/runtime/field-proxy.ts\nfunction createFieldProxy(scope) {\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(scope.topLevel, prop)) {\n\t\t\tconst topField = scope.topLevel[prop];\n\t\t\tif (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);\n\t\t}\n\t\tif (Object.hasOwn(scope.namespaces, prop)) {\n\t\t\tconst nsFields = scope.namespaces[prop];\n\t\t\tif (nsFields) return createNamespaceProxy(prop, nsFields);\n\t\t}\n\t} });\n}\nfunction createNamespaceProxy(namespaceName, fields) {\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(fields, prop)) {\n\t\t\tconst field = fields[prop];\n\t\t\tif (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);\n\t\t}\n\t} });\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/casts-DpaahrlC.mjs\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/defined-BQWA85QH.mjs\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/structured-error.mjs\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\n//#endregion\n//#region src/runtime/functions.ts\nconst BOOL_FIELD = {\n\tcodecId: \"pg/bool@1\",\n\tnullable: false\n};\nconst resolve = toExpr;\n/**\n* Resolve a binary-comparison operand into an AST expression, threading the column-bound side's {@link CodecRef} to the raw-value side.\n*\n* For `fns.eq(f.email, 'alice@example.com')`, `f.email` is the column-bound expression carrying a `ColumnRef` AST and a `CodecRef` derived from contract storage; the raw string operand has no codec context. By deriving the codec context from the column-bound side and forwarding it via `toExpr(value, codec)`, the resulting `ParamRef` carries the `CodecRef` that encode-side dispatch needs to materialise the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction resolveOperand(operand, otherCodec) {\n\tif (isExpressionLike(operand)) return operand.buildAst();\n\treturn toExpr(operand, otherCodec);\n}\nfunction isExpressionLike(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Resolves an Expression via `buildAst()`, or wraps a raw value as a `LiteralExpr` — an SQL literal inlined into the query text, not a bound parameter.\n*\n* Used for `and` / `or` operands. The usual operand is an `Expression<bool>` (e.g. the result of `fns.eq`), which this function passes through by calling `buildAst()`. The only time the raw-value branch fires is when the caller writes `fns.and(true, x)` or similar — inlining `TRUE`/`FALSE` literals lets the SQL planner statically simplify `TRUE AND x` to `x`, which it cannot do for an opaque `ParamRef`.\n*/\nfunction toLiteralExpr(value) {\n\tif (typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\") return value.buildAst();\n\treturn new LiteralExpr(value);\n}\nfunction boolExpr(astNode) {\n\treturn new ExpressionImpl(astNode, BOOL_FIELD);\n}\nfunction binaryWithSharedCodec(a, b, build) {\n\tconst aCodec = codecOf(a);\n\treturn build(resolveOperand(a, codecOf(b)), resolveOperand(b, aCodec));\n}\nfunction eq(a, b) {\n\tif (b === null) return boolExpr(NullCheckExpr.isNull(resolve(a)));\n\tif (a === null) return boolExpr(NullCheckExpr.isNull(resolve(b)));\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(\"eq\", l, r)));\n}\nfunction ne(a, b) {\n\tif (b === null) return boolExpr(NullCheckExpr.isNotNull(resolve(a)));\n\tif (a === null) return boolExpr(NullCheckExpr.isNotNull(resolve(b)));\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(\"neq\", l, r)));\n}\nfunction comparison(a, b, op) {\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(op, l, r)));\n}\nfunction inOrNotIn(expr, valuesOrSubquery, op) {\n\tconst left = expr.buildAst();\n\tconst leftCodec = codecOf(expr);\n\tconst binaryFn = op === \"in\" ? BinaryExpr.in : BinaryExpr.notIn;\n\tif (Array.isArray(valuesOrSubquery)) {\n\t\tconst refs = valuesOrSubquery.map((v) => resolveOperand(v, leftCodec));\n\t\treturn boolExpr(binaryFn(left, ListExpression.of(refs)));\n\t}\n\treturn boolExpr(binaryFn(left, SubqueryExpr.of(valuesOrSubquery.buildAst())));\n}\n/**\n* Build an aggregate through the target's own answer for it.\n*\n* What an aggregate returns is neither the input's codec nor a fixed id: a\n* target widens `sum` over small integers, takes `avg` somewhere else again,\n* and may want the result rendered a particular way. All three come from the\n* registry, and the result carries the codec it declared so decoding resolves\n* through the ordinary path.\n*\n* The declared rendering (`lower`) exists to carry the value across the driver\n* boundary — a projection concern. It is carried beside the plain form so only\n* the projection site consumes it; HAVING and ORDER BY compare the value inside\n* the database, where the rendering would change SQL semantics (SQLite's\n* `CAST(count(*) AS TEXT)` compares and sorts lexicographically).\n*\n* A pair the target declares no overload for is rejected outright. The typed\n* surface already makes it inexpressible; this backs that up for dynamic\n* invocation, instead of executing SQL whose result no declaration types or\n* decodes — SQLite's `sum` over text, which reads whatever leading numbers the\n* rows happened to hold, is the shape of value that path would hand back.\n*/\nfunction aggregate(aggregates, fn, expr) {\n\tconst field = expr?.returnType;\n\tconst inputCodec = field === void 0 ? void 0 : field.codec ?? { codecId: field.codecId };\n\tconst resolved = aggregates.resolve(fn, inputCodec);\n\tif (resolved === void 0) throw structuredError(\"ORM.AGGREGATE_UNSUPPORTED\", inputCodec === void 0 ? `The composed target declares no '${fn}' aggregate for a call without an input.` : `The composed target declares no '${fn}' aggregate over codec '${inputCodec.codecId}'.`, {\n\t\twhy: \"An aggregate result decodes through the codec its target declares; an undeclared pair has no declared result to type or decode.\",\n\t\tfix: `Aggregate an input the target declares '${fn}' for, or contribute an aggregate descriptor for this pair.`,\n\t\tmeta: {\n\t\t\toperation: fn,\n\t\t\t...ifDefined(\"inputCodecId\", inputCodec?.codecId)\n\t\t}\n\t});\n\tconst inputAst = expr?.buildAst();\n\tconst ast = new AggregateExpr(fn, inputAst);\n\tconst projectionAst = resolved.lower?.({\n\t\texpr: inputAst,\n\t\tinputCodec\n\t});\n\treturn new ExpressionImpl(ast, {\n\t\tcodecId: resolved.output.codecId,\n\t\tnullable: resolved.nullable,\n\t\tcodec: resolved.output\n\t}, void 0, projectionAst);\n}\nfunction createBuiltinFunctions(rawCodecInferer) {\n\treturn {\n\t\teq: (a, b) => eq(a, b),\n\t\tne: (a, b) => ne(a, b),\n\t\tgt: (a, b) => comparison(a, b, \"gt\"),\n\t\tgte: (a, b) => comparison(a, b, \"gte\"),\n\t\tlt: (a, b) => comparison(a, b, \"lt\"),\n\t\tlte: (a, b) => comparison(a, b, \"lte\"),\n\t\tand: (...exprs) => boolExpr(AndExpr.of(exprs.map(toLiteralExpr))),\n\t\tor: (...exprs) => boolExpr(OrExpr.of(exprs.map(toLiteralExpr))),\n\t\texists: (subquery) => boolExpr(ExistsExpr.exists(subquery.buildAst())),\n\t\tnotExists: (subquery) => boolExpr(ExistsExpr.notExists(subquery.buildAst())),\n\t\tin: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, \"in\"),\n\t\tnotIn: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, \"notIn\"),\n\t\traw: createRawSql(rawCodecInferer)\n\t};\n}\n/**\n* The aggregate implementations, erased.\n*\n* What each returns is the contract's answer — a function of the target's map\n* and the input's codec — which no runtime value can state. The typed surface\n* is `AggregateFunctions<QC>`, applied where these are handed out.\n*/\nfunction createAggregateOnlyFunctions(aggregates) {\n\treturn {\n\t\tcount: (expr) => aggregate(aggregates, \"count\", expr),\n\t\tsum: (expr) => aggregate(aggregates, \"sum\", expr),\n\t\tavg: (expr) => aggregate(aggregates, \"avg\", expr),\n\t\tmin: (expr) => aggregate(aggregates, \"min\", expr),\n\t\tmax: (expr) => aggregate(aggregates, \"max\", expr)\n\t};\n}\nfunction createFunctions(operations, rawCodecInferer) {\n\tconst builtins = createBuiltinFunctions(rawCodecInferer);\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(builtins, prop)) return builtins[prop];\n\t\tconst op = operations[prop];\n\t\tif (op) return op.impl;\n\t} });\n}\nfunction createAggregateFunctions(operations, rawCodecInferer, aggregateRegistry) {\n\tconst baseFns = createFunctions(operations, rawCodecInferer);\n\tconst aggregates = createAggregateOnlyFunctions(aggregateRegistry);\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tconst agg = aggregates[prop];\n\t\tif (agg) return agg;\n\t\treturn baseFns[prop];\n\t} });\n}\n//#endregion\n//#region src/runtime/resolve-table.ts\nfunction resolveTableInNamespace(storage, namespaceId, tableName) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace === void 0) return void 0;\n\tconst tables = namespace.entries.table;\n\tif (tables === void 0 || !Object.hasOwn(tables, tableName)) return void 0;\n\treturn tables[tableName];\n}\n//#endregion\n//#region src/runtime/builder-base.ts\nvar BuilderBase = class {\n\tctx;\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx;\n\t}\n\t_gate(required, methodName, method) {\n\t\treturn ((...args) => {\n\t\t\tassertCapability(this.ctx, required, methodName);\n\t\t\treturn method(...args);\n\t\t});\n\t}\n};\n/**\n* Derive the canonical {@link CodecRef} for a `(table, column)` from the builder context's storage. Returns `undefined` when the builder context has no storage attached or when the column is unknown to the contract.\n*/\nfunction codecRefFor(ctx, namespaceId, tableName, columnName) {\n\tif (!ctx.storage) return void 0;\n\treturn codecRefForStorageColumn(ctx.storage, namespaceId, tableName, columnName);\n}\nfunction emptyState(from, scope) {\n\treturn {\n\t\tfrom,\n\t\tjoins: [],\n\t\tprojections: [],\n\t\twhere: [],\n\t\torderBy: [],\n\t\tgroupBy: [],\n\t\thaving: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0,\n\t\tdistinct: void 0,\n\t\tdistinctOn: void 0,\n\t\tscope,\n\t\trowFields: {},\n\t\tannotations: /* @__PURE__ */ new Map()\n\t};\n}\nfunction cloneState(state, overrides) {\n\treturn {\n\t\t...state,\n\t\t...overrides\n\t};\n}\nfunction combineWhereExprs(exprs) {\n\tif (exprs.length === 0) return void 0;\n\tif (exprs.length === 1) return exprs[0];\n\treturn AndExpr.of(exprs);\n}\nfunction buildSelectAst(state) {\n\tconst where = combineWhereExprs(state.where);\n\treturn new SelectAst({\n\t\tfrom: state.from,\n\t\tjoins: state.joins.length > 0 ? state.joins : void 0,\n\t\tprojection: state.projections,\n\t\twhere,\n\t\torderBy: state.orderBy.length > 0 ? state.orderBy : void 0,\n\t\tdistinct: state.distinct,\n\t\tdistinctOn: state.distinctOn && state.distinctOn.length > 0 ? state.distinctOn : void 0,\n\t\tgroupBy: state.groupBy.length > 0 ? state.groupBy : void 0,\n\t\thaving: state.having,\n\t\tlimit: state.limit,\n\t\toffset: state.offset,\n\t\tselectAllIntent: void 0\n\t});\n}\nfunction buildQueryPlan(ast, ctx, annotations) {\n\tconst paramValues = collectOrderedParamRefs(ast).map((r) => r.kind === \"param-ref\" ? r.value : void 0);\n\tconst annotationsRecord = annotations !== void 0 && annotations.size > 0 ? Object.freeze(Object.fromEntries(annotations)) : void 0;\n\tconst meta = Object.freeze({\n\t\ttarget: ctx.target,\n\t\tstorageHash: ctx.storageHash,\n\t\tlane: \"dsl\",\n\t\t...ifDefined(\"annotations\", annotationsRecord)\n\t});\n\treturn Object.freeze({\n\t\tast,\n\t\tparams: paramValues,\n\t\tmeta\n\t});\n}\nfunction buildPlan(state, ctx) {\n\treturn buildQueryPlan(buildSelectAst(state), ctx, state.annotations);\n}\nfunction tableToScope(alias, table, options) {\n\tconst storage = options?.storage;\n\tconst lookupName = options?.tableName;\n\tconst namespaceId = options?.namespaceId;\n\tconst fields = {};\n\tfor (const [colName, col] of Object.entries(table.columns)) {\n\t\tconst codec = storage && lookupName && namespaceId !== void 0 ? codecRefForStorageColumn(storage, namespaceId, lookupName, colName) : void 0;\n\t\tfields[colName] = {\n\t\t\tcodecId: col.codecId,\n\t\t\tnullable: col.nullable,\n\t\t\t...col.many ? { many: true } : {},\n\t\t\t...codec !== void 0 ? { codec } : {}\n\t\t};\n\t}\n\treturn {\n\t\ttopLevel: { ...fields },\n\t\tnamespaces: { [alias]: fields }\n\t};\n}\nfunction mergeScopes(a, b) {\n\tconst topLevel = {};\n\tfor (const [k, v] of Object.entries(a.topLevel)) if (!(k in b.topLevel)) topLevel[k] = v;\n\tfor (const [k, v] of Object.entries(b.topLevel)) if (!(k in a.topLevel)) topLevel[k] = v;\n\treturn {\n\t\ttopLevel,\n\t\tnamespaces: {\n\t\t\t...a.namespaces,\n\t\t\t...b.namespaces\n\t\t}\n\t};\n}\nfunction nullableScope(scope) {\n\tconst mkNullable = (tbl) => {\n\t\tconst result = {};\n\t\tfor (const [k, v] of Object.entries(tbl)) result[k] = {\n\t\t\tcodecId: v.codecId,\n\t\t\tnullable: true,\n\t\t\t...v.codec !== void 0 ? { codec: v.codec } : {}\n\t\t};\n\t\treturn result;\n\t};\n\tconst namespaces = {};\n\tfor (const [k, v] of Object.entries(scope.namespaces)) namespaces[k] = mkNullable(v);\n\treturn {\n\t\ttopLevel: mkNullable(scope.topLevel),\n\t\tnamespaces\n\t};\n}\nfunction orderByScopeOf(scope, rowFields) {\n\treturn {\n\t\ttopLevel: {\n\t\t\t...scope.topLevel,\n\t\t\t...rowFields\n\t\t},\n\t\tnamespaces: scope.namespaces\n\t};\n}\nfunction assertCapability(ctx, required, methodName) {\n\tfor (const [ns, keys] of Object.entries(required)) for (const key of Object.keys(keys)) if (!ctx.capabilities[ns]?.[key]) throw structuredError(\"ORM.CAPABILITY_MISSING\", `${methodName}() requires capability ${ns}.${key}`, { meta: {\n\t\tmethod: methodName,\n\t\tcapability: `${ns}.${key}`\n\t} });\n}\nfunction resolveSelectArgs(args, scope, ctx) {\n\tconst projections = [];\n\tconst newRowFields = {};\n\tif (args.length === 0) return {\n\t\tprojections,\n\t\tnewRowFields\n\t};\n\tif (typeof args[0] === \"string\" && (args.length === 1 || typeof args[1] !== \"function\")) {\n\t\tfor (const colName of args) {\n\t\t\tconst field = scope.topLevel[colName];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope`, { meta: { column: colName } });\n\t\t\tprojections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), field.codec));\n\t\t\tnewRowFields[colName] = field;\n\t\t}\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tif (typeof args[0] === \"string\" && typeof args[1] === \"function\") {\n\t\tconst alias = args[0];\n\t\tconst exprFn = args[1];\n\t\tconst fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);\n\t\tconst result = exprFn(createFieldProxy(scope), fns);\n\t\tconst field = result.returnType;\n\t\tprojections.push(ProjectionItem.of(alias, projectionAstOf(result), field.codec));\n\t\tnewRowFields[alias] = field;\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tif (typeof args[0] === \"function\") {\n\t\tconst callbackFn = args[0];\n\t\tconst fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);\n\t\tconst record = callbackFn(createFieldProxy(scope), fns);\n\t\tfor (const [key, expr] of Object.entries(record)) {\n\t\t\tconst field = expr.returnType;\n\t\t\tprojections.push(ProjectionItem.of(key, projectionAstOf(expr), field.codec));\n\t\t\tnewRowFields[key] = field;\n\t\t}\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid .select() arguments\");\n}\nfunction resolveOrderBy(arg, options, scope, rowFields, ctx, useAggregateFns) {\n\tconst dir = options?.direction ?? \"asc\";\n\tif (typeof arg === \"string\") {\n\t\tif (!(arg in orderByScopeOf(scope, rowFields).topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${arg}\" not found in scope for orderBy`, { meta: { column: arg } });\n\t\tconst expr = IdentifierRef.of(arg);\n\t\treturn dir === \"asc\" ? OrderByItem.asc(expr) : OrderByItem.desc(expr);\n\t}\n\tif (typeof arg === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = useAggregateFns ? createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates) : createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\tconst result = arg(createFieldProxy(combined), fns);\n\t\treturn dir === \"asc\" ? OrderByItem.asc(result.buildAst()) : OrderByItem.desc(result.buildAst());\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid orderBy argument\");\n}\nfunction resolveGroupBy(args, scope, rowFields, ctx) {\n\tif (typeof args[0] === \"string\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\treturn args.map((colName) => {\n\t\t\tif (!(colName in combined.topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope for groupBy`, { meta: { column: colName } });\n\t\t\treturn IdentifierRef.of(colName);\n\t\t});\n\t}\n\tif (typeof args[0] === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\treturn [args[0](createFieldProxy(combined), fns).buildAst()];\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid groupBy arguments\");\n}\nfunction resolveDistinctOn(args, scope, rowFields, ctx) {\n\tif (args.length === 1 && typeof args[0] === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\treturn [args[0](createFieldProxy(combined), fns).buildAst()];\n\t}\n\tconst combined = orderByScopeOf(scope, rowFields);\n\treturn args.map((colName) => {\n\t\tif (!(colName in combined.topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope for distinctOn`, { meta: { column: colName } });\n\t\treturn IdentifierRef.of(colName);\n\t});\n}\n//#endregion\n//#region src/runtime/query-impl.ts\nvar QueryBase = class extends BuilderBase {\n\tstate;\n\tconstructor(state, ctx) {\n\t\tsuper(ctx);\n\t\tthis.state = state;\n\t}\n\tdistinctOn = this._gate({ postgres: { distinctOn: true } }, \"distinctOn\", (...args) => {\n\t\tconst exprs = resolveDistinctOn(args, this.state.scope, this.state.rowFields, this.ctx);\n\t\treturn this.clone(cloneState(this.state, { distinctOn: [...this.state.distinctOn ?? [], ...exprs] }));\n\t});\n\tlimit(count) {\n\t\tconst limit = typeof count === \"number\" ? count : toExpr(count);\n\t\treturn this.clone(cloneState(this.state, { limit }));\n\t}\n\toffset(count) {\n\t\tconst offset = typeof count === \"number\" ? count : toExpr(count);\n\t\treturn this.clone(cloneState(this.state, { offset }));\n\t}\n\tdistinct() {\n\t\treturn this.clone(cloneState(this.state, { distinct: true }));\n\t}\n\t/**\n\t* Attach one or more annotations to this query plan.\n\t*\n\t* Read builders (`SelectQueryImpl`, `GroupedQueryImpl`) accept\n\t* annotations whose declared `applicableTo` includes `'read'`.\n\t* The type-level `As & ValidAnnotations<'read', As>` gate rejects\n\t* write-only annotations at the call site; the runtime check below\n\t* fails closed for callers that bypass the type gate (cast / `any`).\n\t*\n\t* Multiple `.annotate(...)` calls compose; duplicate namespaces use\n\t* last-write-wins. The accumulated annotations are merged into\n\t* `plan.meta.annotations` at `.build()` time, alongside any framework-\n\t* internal metadata under reserved namespaces (e.g. `codecs`).\n\t*\n\t* Chainable in any position (before / after `.where`, `.select`,\n\t* `.limit`, etc.); the returned builder has the same row type.\n\t*/\n\tannotate(...annotations) {\n\t\tassertAnnotationsApplicable(annotations, \"read\", \"sql-dsl.annotate\");\n\t\tconst next = new Map(this.state.annotations);\n\t\tfor (const annotation of annotations) next.set(annotation.namespace, annotation);\n\t\treturn this.clone(cloneState(this.state, { annotations: next }));\n\t}\n\tgroupBy(...args) {\n\t\tconst exprs = resolveGroupBy(args, this.state.scope, this.state.rowFields, this.ctx);\n\t\treturn new GroupedQueryImpl(cloneState(this.state, { groupBy: [...this.state.groupBy, ...exprs] }), this.ctx);\n\t}\n\tas(alias) {\n\t\tconst ast = buildSelectAst(this.state);\n\t\tconst derivedSource = DerivedTableSource.as(alias, ast);\n\t\tconst scope = {\n\t\t\ttopLevel: this.state.rowFields,\n\t\t\tnamespaces: { [alias]: this.state.rowFields }\n\t\t};\n\t\treturn {\n\t\t\tgetJoinOuterScope: () => scope,\n\t\t\tbuildAst: () => derivedSource\n\t\t};\n\t}\n\tgetRowFields() {\n\t\treturn this.state.rowFields;\n\t}\n\tbuildAst() {\n\t\treturn buildSelectAst(this.state);\n\t}\n\tbuild() {\n\t\treturn buildPlan(this.state, this.ctx);\n\t}\n};\nvar SelectQueryImpl = class SelectQueryImpl extends QueryBase {\n\tclone(state) {\n\t\treturn new SelectQueryImpl(state, this.ctx);\n\t}\n\tselect(...args) {\n\t\tconst { projections, newRowFields } = resolveSelectArgs(args, this.state.scope, this.ctx);\n\t\treturn new SelectQueryImpl(cloneState(this.state, {\n\t\t\tprojections: [...this.state.projections, ...projections],\n\t\t\trowFields: {\n\t\t\t\t...this.state.rowFields,\n\t\t\t\t...newRowFields\n\t\t\t}\n\t\t}), this.ctx);\n\t}\n\twhere(expr) {\n\t\tconst result = expr(createFieldProxy(this.state.scope), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\treturn new SelectQueryImpl(cloneState(this.state, { where: [...this.state.where, result.buildAst()] }), this.ctx);\n\t}\n\torderBy(arg, options) {\n\t\tconst item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, false);\n\t\treturn this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));\n\t}\n};\nvar GroupedQueryImpl = class GroupedQueryImpl extends QueryBase {\n\tclone(state) {\n\t\treturn new GroupedQueryImpl(state, this.ctx);\n\t}\n\thaving(expr) {\n\t\tconst combined = orderByScopeOf(this.state.scope, this.state.rowFields);\n\t\tconst fns = createAggregateFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer, this.ctx.aggregates);\n\t\tconst result = expr(createFieldProxy(combined), fns);\n\t\treturn new GroupedQueryImpl(cloneState(this.state, { having: result.buildAst() }), this.ctx);\n\t}\n\torderBy(arg, options) {\n\t\tconst item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, true);\n\t\treturn this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));\n\t}\n};\n//#endregion\n//#region src/runtime/joined-tables-impl.ts\nvar JoinedTablesImpl = class JoinedTablesImpl extends BuilderBase {\n\t#state;\n\tconstructor(state, ctx) {\n\t\tsuper(ctx);\n\t\tthis.#state = state;\n\t}\n\tlateralJoin = this._gate({ sql: { lateral: true } }, \"lateralJoin\", (alias, builder) => {\n\t\tconst { derivedSource, lateralScope } = this.#buildLateral(alias, builder);\n\t\tconst resultScope = mergeScopes(this.#state.scope, lateralScope);\n\t\treturn this.#addLateralJoin(\"inner\", resultScope, derivedSource);\n\t});\n\touterLateralJoin = this._gate({ sql: { lateral: true } }, \"outerLateralJoin\", (alias, builder) => {\n\t\tconst { derivedSource, lateralScope } = this.#buildLateral(alias, builder);\n\t\tconst resultScope = mergeScopes(this.#state.scope, nullableScope(lateralScope));\n\t\treturn this.#addLateralJoin(\"left\", resultScope, derivedSource);\n\t});\n\tselect(...args) {\n\t\tconst { projections, newRowFields } = resolveSelectArgs(args, this.#state.scope, this.ctx);\n\t\treturn new SelectQueryImpl(cloneState(this.#state, {\n\t\t\tprojections: [...this.#state.projections, ...projections],\n\t\t\trowFields: {\n\t\t\t\t...this.#state.rowFields,\n\t\t\t\t...newRowFields\n\t\t\t}\n\t\t}), this.ctx);\n\t}\n\tinnerJoin(other, on) {\n\t\tconst targetScope = mergeScopes(this.#state.scope, other.getJoinOuterScope());\n\t\treturn this.#addJoin(other, \"inner\", targetScope, on);\n\t}\n\touterLeftJoin(other, on) {\n\t\tconst targetScope = mergeScopes(this.#state.scope, nullableScope(other.getJoinOuterScope()));\n\t\treturn this.#addJoin(other, \"left\", targetScope, on);\n\t}\n\touterRightJoin(other, on) {\n\t\tconst targetScope = mergeScopes(nullableScope(this.#state.scope), other.getJoinOuterScope());\n\t\treturn this.#addJoin(other, \"right\", targetScope, on);\n\t}\n\touterFullJoin(other, on) {\n\t\tconst targetScope = mergeScopes(nullableScope(this.#state.scope), nullableScope(other.getJoinOuterScope()));\n\t\treturn this.#addJoin(other, \"full\", targetScope, on);\n\t}\n\t#addJoin(other, joinType, resultScope, onExpr) {\n\t\tconst onResult = onExpr(createFieldProxy(mergeScopes(this.#state.scope, other.getJoinOuterScope())), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\tconst joinAst = new JoinAst(joinType, other.buildAst(), onResult.buildAst());\n\t\treturn new JoinedTablesImpl(cloneState(this.#state, {\n\t\t\tjoins: [...this.#state.joins, joinAst],\n\t\t\tscope: resultScope\n\t\t}), this.ctx);\n\t}\n\t#buildLateral(alias, builderFn) {\n\t\tconst subquery = builderFn({ from: (other) => {\n\t\t\tconst otherScope = other.getJoinOuterScope();\n\t\t\tconst parentMerged = mergeScopes(this.#state.scope, otherScope);\n\t\t\treturn new SelectQueryImpl(emptyState(other.buildAst(), parentMerged), this.ctx);\n\t\t} });\n\t\tconst subqueryAst = subquery.buildAst();\n\t\tconst derivedSource = DerivedTableSource.as(alias, subqueryAst);\n\t\tconst subqueryRowFields = subquery.getRowFields();\n\t\treturn {\n\t\t\tderivedSource,\n\t\t\tlateralScope: {\n\t\t\t\ttopLevel: subqueryRowFields,\n\t\t\t\tnamespaces: { [alias]: subqueryRowFields }\n\t\t\t}\n\t\t};\n\t}\n\t#addLateralJoin(joinType, resultScope, derivedSource) {\n\t\tconst joinAst = new JoinAst(joinType, derivedSource, AndExpr.of([]), true);\n\t\treturn new JoinedTablesImpl(cloneState(this.#state, {\n\t\t\tjoins: [...this.#state.joins, joinAst],\n\t\t\tscope: resultScope\n\t\t}), this.ctx);\n\t}\n};\n//#endregion\n//#region src/runtime/mutation-impl.ts\n/**\n* Validates and merges a variadic annotations call into a builder's\n* accumulated user-annotations map. Used by `.annotate(...)` on each of\n* the three mutation builders (`InsertQueryImpl`, `UpdateQueryImpl`,\n* `DeleteQueryImpl`); the read builders share the same logic via\n* `QueryBase.annotate()` in `./query-impl.ts`.\n*\n* Runs `assertAnnotationsApplicable` at call time (not at `.build()`) so\n* inapplicable annotations forced through casts surface immediately\n* rather than at plan-construction time.\n*/\nfunction mergeWriteAnnotations(current, annotations) {\n\tassertAnnotationsApplicable(annotations, \"write\", \"sql-dsl.annotate\");\n\tconst next = new Map(current);\n\tfor (const annotation of annotations) next.set(annotation.namespace, annotation);\n\treturn next;\n}\nfunction buildParamValues(values, namespaceId, table, tableName, op, ctx) {\n\tconst params = {};\n\tfor (const [col, value] of Object.entries(values)) {\n\t\tconst codec = table.columns[col] ? codecRefFor(ctx, namespaceId, tableName, col) : void 0;\n\t\tparams[col] = ParamRef.of(value, codec ? { codec } : void 0);\n\t}\n\tfor (const def of ctx.applyMutationDefaults({\n\t\top,\n\t\tnamespace: namespaceId,\n\t\ttable: tableName,\n\t\tvalues\n\t})) {\n\t\tconst codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;\n\t\tparams[def.column] = ParamRef.of(def.value, codec ? { codec } : void 0);\n\t}\n\treturn params;\n}\nfunction buildReturningProjections(tableName, columns, rowFields) {\n\treturn columns.map((col) => ProjectionItem.of(col, ColumnRef.of(tableName, col), rowFields[col]?.codec));\n}\nfunction evaluateWhere(whereCallback, scope, queryOperationTypes, rawCodecInferer) {\n\treturn whereCallback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer)).buildAst();\n}\nfunction evaluateUpdateCallback(callback, scope, queryOperationTypes, rawCodecInferer) {\n\tconst result = callback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer));\n\tconst set = {};\n\tfor (const [col, expr] of Object.entries(result)) if (expr !== void 0) set[col] = expr.buildAst();\n\treturn set;\n}\nfunction buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {\n\tconst set = { ...exprs };\n\tfor (const def of ctx.applyMutationDefaults({\n\t\top,\n\t\tnamespace: namespaceId,\n\t\ttable: tableName,\n\t\tvalues: exprs\n\t})) if (!(def.column in set)) {\n\t\tconst codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;\n\t\tset[def.column] = ParamRef.of(def.value, ifDefined(\"codec\", codec));\n\t}\n\treturn set;\n}\nvar InsertQueryImpl = class InsertQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#namespaceId;\n\t#table;\n\t#scope;\n\t#rows;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, namespaceId, table, scope, rows, ctx, returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#namespaceId = namespaceId;\n\t\tthis.#table = table;\n\t\tthis.#scope = scope;\n\t\tthis.#rows = rows;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new InsertQueryImpl(this.#tableSource, this.#namespaceId, this.#table, this.#scope, this.#rows, this.ctx, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* The type-level `As & ValidAnnotations<'write', As>` gate rejects\n\t* read-only annotations at the call site; the runtime check fails\n\t* closed for callers that bypass the type gate. See `QueryBase.annotate`\n\t* in `./query-impl.ts` for the read-builder counterpart.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new InsertQueryImpl(this.#tableSource, this.#namespaceId, this.#table, this.#scope, this.#rows, this.ctx, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tif (this.#rows.length === 0) throw structuredError(\"ORM.MUTATION_DATA_MISSING\", \"insert() called with an empty row array — at least one row is required\");\n\t\tconst paramRows = this.#rows.map((rowValues) => buildParamValues(rowValues, this.#namespaceId, this.#table, this.#tableName, \"create\", this.ctx));\n\t\tlet ast = InsertAst.into(this.#tableSource).withRows(paramRows);\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\nvar UpdateQueryImpl = class UpdateQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#scope;\n\t#setExpressions;\n\t#whereExprs;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, scope, setExpressions, ctx, whereExprs = [], returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#scope = scope;\n\t\tthis.#setExpressions = setExpressions;\n\t\tthis.#whereExprs = whereExprs;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\twhere(expr) {\n\t\tconst result = expr(createFieldProxy(this.#scope), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, [...this.#whereExprs, result.buildAst()], this.#returningColumns, this.#rowFields, this.#annotations);\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, this.#whereExprs, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* See `InsertQueryImpl.annotate` for semantics; the runtime check\n\t* fails closed for callers that bypass the type-level gate.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, this.#whereExprs, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tlet ast = UpdateAst.table(this.#tableSource).withSet(this.#setExpressions).withWhere(combineWhereExprs(this.#whereExprs));\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\nvar DeleteQueryImpl = class DeleteQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#scope;\n\t#whereCallbacks;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, scope, ctx, whereCallbacks = [], returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#scope = scope;\n\t\tthis.#whereCallbacks = whereCallbacks;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\twhere(expr) {\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, [...this.#whereCallbacks, expr], this.#returningColumns, this.#rowFields, this.#annotations);\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, this.#whereCallbacks, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* See `InsertQueryImpl.annotate` for semantics.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, this.#whereCallbacks, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tconst whereExpr = combineWhereExprs(this.#whereCallbacks.map((cb) => evaluateWhere(cb, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer)));\n\t\tlet ast = DeleteAst.from(this.#tableSource).withWhere(whereExpr);\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\n//#endregion\n//#region src/runtime/table-source-for-proxy.ts\nfunction tableSourceForProxy(tableName, alias, namespaceId) {\n\treturn TableSource.named(tableName, alias !== tableName ? alias : void 0, namespaceId);\n}\n//#endregion\n//#region src/runtime/table-proxy-impl.ts\nvar TableProxyImpl = class TableProxyImpl extends BuilderBase {\n\t#tableName;\n\t#table;\n\t#namespaceId;\n\t#fromSource;\n\t#scope;\n\tconstructor(tableName, table, alias, ctx, namespaceId) {\n\t\tsuper(ctx);\n\t\tthis.#tableName = tableName;\n\t\tthis.#table = table;\n\t\tthis.#namespaceId = namespaceId;\n\t\tthis.#scope = tableToScope(alias, table, {\n\t\t\tstorage: ctx.storage,\n\t\t\ttableName,\n\t\t\tnamespaceId\n\t\t});\n\t\tthis.#fromSource = tableSourceForProxy(tableName, alias, namespaceId);\n\t}\n\tlateralJoin = this._gate({ sql: { lateral: true } }, \"lateralJoin\", (alias, builder) => {\n\t\treturn this.#toJoined().lateralJoin(alias, builder);\n\t});\n\touterLateralJoin = this._gate({ sql: { lateral: true } }, \"outerLateralJoin\", (alias, builder) => {\n\t\treturn this.#toJoined().outerLateralJoin(alias, builder);\n\t});\n\tgetJoinOuterScope() {\n\t\treturn this.#scope;\n\t}\n\tbuildAst() {\n\t\treturn this.#fromSource;\n\t}\n\tas(newAlias) {\n\t\treturn new TableProxyImpl(this.#tableName, this.#table, newAlias, this.ctx, this.#namespaceId);\n\t}\n\tselect(...args) {\n\t\treturn new SelectQueryImpl(emptyState(this.#fromSource, this.#scope), this.ctx).select(...args);\n\t}\n\tinnerJoin(other, on) {\n\t\treturn this.#toJoined().innerJoin(other, on);\n\t}\n\touterLeftJoin(other, on) {\n\t\treturn this.#toJoined().outerLeftJoin(other, on);\n\t}\n\touterRightJoin(other, on) {\n\t\treturn this.#toJoined().outerRightJoin(other, on);\n\t}\n\touterFullJoin(other, on) {\n\t\treturn this.#toJoined().outerFullJoin(other, on);\n\t}\n\tinsert(rows) {\n\t\treturn new InsertQueryImpl(this.#fromSource, this.#namespaceId, this.#table, this.#scope, rows, this.ctx);\n\t}\n\tupdate(setOrCallback) {\n\t\tif (typeof setOrCallback === \"function\") {\n\t\t\tconst setExpressions = buildSetExpressions(evaluateUpdateCallback(setOrCallback, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer), this.#namespaceId, this.#table, this.#tableName, \"update\", this.ctx);\n\t\t\treturn new UpdateQueryImpl(this.#fromSource, this.#scope, setExpressions, this.ctx);\n\t\t}\n\t\tconst setExpressions = buildParamValues(setOrCallback, this.#namespaceId, this.#table, this.#tableName, \"update\", this.ctx);\n\t\treturn new UpdateQueryImpl(this.#fromSource, this.#scope, setExpressions, this.ctx);\n\t}\n\tdelete() {\n\t\treturn new DeleteQueryImpl(this.#fromSource, this.#scope, this.ctx);\n\t}\n\t#toJoined() {\n\t\treturn new JoinedTablesImpl(emptyState(this.#fromSource, this.#scope), this.ctx);\n\t}\n};\n//#endregion\n//#region src/runtime/sql.ts\nfunction sql(options) {\n\tconst { context, rawCodecInferer } = options;\n\tconst ctx = {\n\t\tcapabilities: context.contract.capabilities,\n\t\tqueryOperationTypes: context.queryOperations.entries(),\n\t\ttarget: context.contract.target ?? \"unknown\",\n\t\tstorageHash: context.contract.storage.storageHash ?? \"unknown\",\n\t\tstorage: context.contract.storage,\n\t\tapplyMutationDefaults: (options) => context.applyMutationDefaults(options),\n\t\trawCodecInferer,\n\t\taggregates: context.aggregateDescriptors\n\t};\n\tconst { storage } = context.contract;\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (typeof prop !== \"string\") return;\n\t\tif (!Object.hasOwn(storage.namespaces, prop)) return;\n\t\tconst namespaceId = prop;\n\t\treturn new Proxy({}, { get(_facetTarget, tableName) {\n\t\t\tif (typeof tableName !== \"string\") return;\n\t\t\tconst table = resolveTableInNamespace(storage, namespaceId, tableName);\n\t\t\tif (table) return new TableProxyImpl(tableName, table, tableName, ctx, namespaceId);\n\t\t} });\n\t} });\n}\n//#endregion\nexport { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, sql };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;AAYA,IAAI,iBAAiB,MAAM;CAC1B;CACA;CACA;CACA;CACA,YAAY,KAAK,YAAY,OAAO,eAAe;EAClD,KAAK,MAAM;EACX,KAAK,aAAa;EAClB,KAAK,QAAQ;EACb,KAAK,gBAAgB;CACtB;CACA,WAAW;EACV,OAAO,KAAK;CACb;CACA,qBAAqB;EACpB,OAAO,KAAK,iBAAiB,KAAK;CACnC;AACD;;;;AAIA,SAAS,gBAAgB,MAAM;CAC9B,OAAO,gBAAgB,iBAAiB,KAAK,mBAAmB,IAAI,KAAK,SAAS;AACnF;AAGA,SAAS,iBAAiB,OAAO;CAChC,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,SAAS,MAAM;EACzC,IAAI,OAAO,OAAO,MAAM,UAAU,IAAI,GAAG;GACxC,MAAM,WAAW,MAAM,SAAS;GAChC,IAAI,UAAU,OAAO,IAAI,eAAe,cAAc,GAAG,IAAI,GAAG,UAAU,SAAS,KAAK;EACzF;EACA,IAAI,OAAO,OAAO,MAAM,YAAY,IAAI,GAAG;GAC1C,MAAM,WAAW,MAAM,WAAW;GAClC,IAAI,UAAU,OAAO,qBAAqB,MAAM,QAAQ;EACzD;CACD,EAAE,CAAC;AACJ;AACA,SAAS,qBAAqB,eAAe,QAAQ;CACpD,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,SAAS,MAAM;EACzC,IAAI,OAAO,OAAO,QAAQ,IAAI,GAAG;GAChC,MAAM,QAAQ,OAAO;GACrB,IAAI,OAAO,OAAO,IAAI,eAAe,UAAU,GAAG,eAAe,IAAI,GAAG,OAAO,MAAM,KAAK;EAC3F;CACD,EAAE,CAAC;AACJ;;;;;;;;;;;;;;;;;;;;;;;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namespaceId","#table","#scope","#rows","#returningColumns","#rowFields","#annotations","#setExpressions","#whereExprs","#whereCallbacks","#fromSource","#toJoined"],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs"],"sourcesContent":["import { AggregateExpr, AndExpr, BinaryExpr, ColumnRef, DeleteAst, DerivedTableSource, ExistsExpr, IdentifierRef, InsertAst, JoinAst, ListExpression, LiteralExpr, NullCheckExpr, OrExpr, OrderByItem, ParamRef, ProjectionItem, SelectAst, SubqueryExpr, TableSource, UpdateAst, collectOrderedParamRefs, isAggregateFn } from \"@internal/sql-relational-core/ast\";\nimport { codecOf, createRawSql, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { codecRefForStorageColumn } from \"@internal/sql-relational-core/codec-descriptor-registry\";\nimport { assertAnnotationsApplicable } from \"@internal/framework-components/runtime\";\n//#region ../../../1-framework/0-foundation/utils/dist/casts-DpaahrlC.mjs\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/defined-BQWA85QH.mjs\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/structured-error.mjs\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\n//#endregion\n//#region src/runtime/expression-impl.ts\n/**\n* Runtime wrapper around a relational-core AST expression node. Carries ScopeField metadata (codecId, nullable) so aggregate-like combinators can propagate the input codec onto their result.\n*\n* `codec` records the column-bound {@link CodecRef} when the field-proxy knows the binding — both the namespaced form (`f.user.email` → `ColumnRef`) and the top-level shortcut (`f.email` → `IdentifierRef`) stamp the ref derived from contract storage. `codecOf(expression)` exposes it for operation implementations forwarding the ref to `toExpr`.\n*\n* `projectionAst` carries the descriptor-lowered rendering of the expression, where a target declares one (e.g. SQLite's `CAST(count(*) AS TEXT)`). Lowering exists to carry the value across the driver boundary, so only the projection site consumes it — predicate and ordering positions (`buildAst()`) keep the plain form, where the rendering would change SQL semantics.\n*/\nvar ExpressionImpl = class {\n\tast;\n\tprojectionAst;\n\treturnType;\n\tcodec;\n\tconstructor(ast, returnType, codec, projectionAst) {\n\t\tthis.ast = ast;\n\t\tthis.returnType = returnType;\n\t\tthis.codec = codec;\n\t\tthis.projectionAst = projectionAst;\n\t}\n\tbuildAst() {\n\t\treturn this.ast;\n\t}\n\tbuildProjectionAst() {\n\t\treturn this.projectionAst ?? this.ast;\n\t}\n};\n/**\n* An aggregate whose operation lies outside the SQL aggregate alphabet: the expression exists only in its descriptor-lowered form, so only the projection may consume it.\n*\n* Predicate and ordering positions build the plain form through `buildAst()` and are refused at authoring time — the lowered rendering exists to carry the value across the driver boundary, and comparing or sorting by it inside the database would change SQL semantics (a textual rendering compares lexicographically).\n*/\nvar ProjectionOnlyExpressionImpl = class extends ExpressionImpl {\n\toperation;\n\tconstructor(operation, lowered, returnType) {\n\t\tsuper(lowered, returnType, void 0, lowered);\n\t\tthis.operation = operation;\n\t}\n\tbuildAst() {\n\t\tthrow structuredError(\"ORM.AGGREGATE_PROJECTION_ONLY\", `Aggregate operation '${this.operation}' is projection-only: it has no plain SQL form for HAVING, ORDER BY, or comparison positions.`, {\n\t\t\twhy: \"An operation outside the SQL aggregate alphabet reaches SQL only through its descriptor's lowering hook — a rendering for the driver boundary. HAVING and ORDER BY compare the value inside the database, where that rendering would change SQL semantics.\",\n\t\t\tfix: `Project '${this.operation}' in a select and filter or order on the projected value, or use an operation from the SQL aggregate alphabet.`,\n\t\t\tmeta: { operation: this.operation }\n\t\t});\n\t}\n};\n/**\n* The AST to project for an expression: the descriptor-lowered form when the expression carries one, the plain form otherwise. `resolveSelectArgs` calls this where a lane expression becomes a `ProjectionItem` — the one place the value crosses the driver boundary.\n*/\nfunction projectionAstOf(expr) {\n\treturn expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();\n}\n//#endregion\n//#region src/runtime/field-proxy.ts\nfunction createFieldProxy(scope) {\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(scope.topLevel, prop)) {\n\t\t\tconst topField = scope.topLevel[prop];\n\t\t\tif (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);\n\t\t}\n\t\tif (Object.hasOwn(scope.namespaces, prop)) {\n\t\t\tconst nsFields = scope.namespaces[prop];\n\t\t\tif (nsFields) return createNamespaceProxy(prop, nsFields);\n\t\t}\n\t} });\n}\nfunction createNamespaceProxy(namespaceName, fields) {\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(fields, prop)) {\n\t\t\tconst field = fields[prop];\n\t\t\tif (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);\n\t\t}\n\t} });\n}\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/internal-error-BIc-ehme.mjs\n/**\n* A bug in Prisma Next, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\n//#endregion\n//#region ../../../1-framework/0-foundation/utils/dist/assertions.mjs\n/**\n* Asserts that a value is defined (not null or undefined).\n* Use for invariants where the value should always exist at runtime.\n*\n* @throws Error if value is null or undefined\n*\n* @example\n* ```typescript\n* const table = storage.namespaces[namespaceId].entries.table[tableName];\n* assertDefined(table, `Table \"${tableName}\" not found`);\n* // table is now narrowed to non-nullable\n* ```\n*/\nfunction assertDefined(value, message) {\n\tif (value === null || value === void 0) throw new InternalError(message);\n}\n//#endregion\n//#region src/runtime/functions.ts\nconst BOOL_FIELD = {\n\tcodecId: \"pg/bool@1\",\n\tnullable: false\n};\nconst resolve = toExpr;\n/**\n* Resolve a binary-comparison operand into an AST expression, threading the column-bound side's {@link CodecRef} to the raw-value side.\n*\n* For `fns.eq(f.email, 'alice@example.com')`, `f.email` is the column-bound expression carrying a `ColumnRef` AST and a `CodecRef` derived from contract storage; the raw string operand has no codec context. By deriving the codec context from the column-bound side and forwarding it via `toExpr(value, codec)`, the resulting `ParamRef` carries the `CodecRef` that encode-side dispatch needs to materialise the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).\n*/\nfunction resolveOperand(operand, otherCodec) {\n\tif (isExpressionLike(operand)) return operand.buildAst();\n\treturn toExpr(operand, otherCodec);\n}\nfunction isExpressionLike(value) {\n\treturn typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\";\n}\n/**\n* Resolves an Expression via `buildAst()`, or wraps a raw value as a `LiteralExpr` — an SQL literal inlined into the query text, not a bound parameter.\n*\n* Used for `and` / `or` operands. The usual operand is an `Expression<bool>` (e.g. the result of `fns.eq`), which this function passes through by calling `buildAst()`. The only time the raw-value branch fires is when the caller writes `fns.and(true, x)` or similar — inlining `TRUE`/`FALSE` literals lets the SQL planner statically simplify `TRUE AND x` to `x`, which it cannot do for an opaque `ParamRef`.\n*/\nfunction toLiteralExpr(value) {\n\tif (typeof value === \"object\" && value !== null && \"buildAst\" in value && typeof value.buildAst === \"function\") return value.buildAst();\n\treturn new LiteralExpr(value);\n}\nfunction boolExpr(astNode) {\n\treturn new ExpressionImpl(astNode, BOOL_FIELD);\n}\nfunction binaryWithSharedCodec(a, b, build) {\n\tconst aCodec = codecOf(a);\n\treturn build(resolveOperand(a, codecOf(b)), resolveOperand(b, aCodec));\n}\nfunction eq(a, b) {\n\tif (b === null) return boolExpr(NullCheckExpr.isNull(resolve(a)));\n\tif (a === null) return boolExpr(NullCheckExpr.isNull(resolve(b)));\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(\"eq\", l, r)));\n}\nfunction ne(a, b) {\n\tif (b === null) return boolExpr(NullCheckExpr.isNotNull(resolve(a)));\n\tif (a === null) return boolExpr(NullCheckExpr.isNotNull(resolve(b)));\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(\"neq\", l, r)));\n}\nfunction comparison(a, b, op) {\n\treturn boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(op, l, r)));\n}\nfunction inOrNotIn(expr, valuesOrSubquery, op) {\n\tconst left = expr.buildAst();\n\tconst leftCodec = codecOf(expr);\n\tconst binaryFn = op === \"in\" ? BinaryExpr.in : BinaryExpr.notIn;\n\tif (Array.isArray(valuesOrSubquery)) {\n\t\tconst refs = valuesOrSubquery.map((v) => resolveOperand(v, leftCodec));\n\t\treturn boolExpr(binaryFn(left, ListExpression.of(refs)));\n\t}\n\treturn boolExpr(binaryFn(left, SubqueryExpr.of(valuesOrSubquery.buildAst())));\n}\n/**\n* Build an aggregate through the target's own answer for it.\n*\n* What an aggregate returns is neither the input's codec nor a fixed id: a\n* target widens `sum` over small integers, takes `avg` somewhere else again,\n* and may want the result rendered a particular way. All three come from the\n* registry, and the result carries the codec it declared so decoding resolves\n* through the ordinary path.\n*\n* The declared rendering (`lower`) exists to carry the value across the driver\n* boundary — a projection concern. It is carried beside the plain form so only\n* the projection site consumes it; HAVING and ORDER BY compare the value inside\n* the database, where the rendering would change SQL semantics (SQLite's\n* `CAST(count(*) AS TEXT)` compares and sorts lexicographically).\n*\n* A pair the target declares no overload for is rejected outright. The typed\n* surface already makes it inexpressible; this backs that up for dynamic\n* invocation, instead of executing SQL whose result no declaration types or\n* decodes — SQLite's `sum` over text, which reads whatever leading numbers the\n* rows happened to hold, is the shape of value that path would hand back.\n*\n* An operation outside the SQL aggregate alphabet has no plain form at all:\n* its whole expression is what the lowering hook builds, so the result is\n* projection-only and refuses predicate and ordering positions.\n*/\nfunction aggregate(aggregates, operation, expr) {\n\tconst field = expr?.returnType;\n\tconst inputCodec = field === void 0 ? void 0 : field.codec ?? { codecId: field.codecId };\n\tconst resolved = aggregates.resolve(operation, inputCodec);\n\tif (resolved === void 0) throw structuredError(\"ORM.AGGREGATE_UNSUPPORTED\", inputCodec === void 0 ? `The composed target declares no '${operation}' aggregate for a call without an input.` : `The composed target declares no '${operation}' aggregate over codec '${inputCodec.codecId}'.`, {\n\t\twhy: \"An aggregate result decodes through the codec its target declares; an undeclared pair has no declared result to type or decode.\",\n\t\tfix: `Aggregate an input the target declares '${operation}' for, or contribute an aggregate descriptor for this pair.`,\n\t\tmeta: {\n\t\t\toperation,\n\t\t\t...ifDefined(\"inputCodecId\", inputCodec?.codecId)\n\t\t}\n\t});\n\tconst inputAst = expr?.buildAst();\n\tconst returnType = {\n\t\tcodecId: resolved.output.codecId,\n\t\tnullable: resolved.nullable,\n\t\tcodec: resolved.output\n\t};\n\tif (!isAggregateFn(operation)) {\n\t\tassertDefined(resolved.lower, `registry resolved '${operation}' outside the SQL aggregate alphabet without a lowering hook`);\n\t\treturn new ProjectionOnlyExpressionImpl(operation, resolved.lower({\n\t\t\texpr: inputAst,\n\t\t\tinputCodec\n\t\t}), returnType);\n\t}\n\tconst ast = new AggregateExpr(operation, inputAst);\n\tconst projectionAst = resolved.lower?.({\n\t\texpr: inputAst,\n\t\tinputCodec\n\t});\n\treturn new ExpressionImpl(ast, returnType, void 0, projectionAst);\n}\nfunction createBuiltinFunctions(rawCodecInferer) {\n\treturn {\n\t\teq: (a, b) => eq(a, b),\n\t\tne: (a, b) => ne(a, b),\n\t\tgt: (a, b) => comparison(a, b, \"gt\"),\n\t\tgte: (a, b) => comparison(a, b, \"gte\"),\n\t\tlt: (a, b) => comparison(a, b, \"lt\"),\n\t\tlte: (a, b) => comparison(a, b, \"lte\"),\n\t\tand: (...exprs) => boolExpr(AndExpr.of(exprs.map(toLiteralExpr))),\n\t\tor: (...exprs) => boolExpr(OrExpr.of(exprs.map(toLiteralExpr))),\n\t\texists: (subquery) => boolExpr(ExistsExpr.exists(subquery.buildAst())),\n\t\tnotExists: (subquery) => boolExpr(ExistsExpr.notExists(subquery.buildAst())),\n\t\tin: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, \"in\"),\n\t\tnotIn: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, \"notIn\"),\n\t\traw: createRawSql(rawCodecInferer)\n\t};\n}\n/**\n* The aggregate implementations, one per operation the registry contributes,\n* erased.\n*\n* The method set is the registry's operation vocabulary — the runtime mirror\n* of the contract's emitted aggregate map, both settled from the same\n* contributed descriptors. What each returns is the contract's answer — a\n* function of the target's map and the input's codec — which no runtime value\n* can state. The typed surface is `AggregateFunctions<QC>`, applied where\n* these are handed out.\n*/\nfunction createAggregateOnlyFunctions(aggregates) {\n\tconst methods = /* @__PURE__ */ new Map();\n\tfor (const { operation } of aggregates.values()) {\n\t\tif (methods.has(operation)) continue;\n\t\tmethods.set(operation, (expr) => aggregate(aggregates, operation, expr));\n\t}\n\treturn Object.fromEntries(methods);\n}\nfunction createFunctions(operations, rawCodecInferer) {\n\tconst builtins = createBuiltinFunctions(rawCodecInferer);\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(builtins, prop)) return builtins[prop];\n\t\tconst op = operations[prop];\n\t\tif (op) return op.impl;\n\t} });\n}\nfunction createAggregateFunctions(operations, rawCodecInferer, aggregateRegistry) {\n\tconst baseFns = createFunctions(operations, rawCodecInferer);\n\tconst aggregates = createAggregateOnlyFunctions(aggregateRegistry);\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (Object.hasOwn(aggregates, prop)) return aggregates[prop];\n\t\treturn baseFns[prop];\n\t} });\n}\n//#endregion\n//#region src/runtime/resolve-table.ts\nfunction resolveTableInNamespace(storage, namespaceId, tableName) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace === void 0) return void 0;\n\tconst tables = namespace.entries.table;\n\tif (tables === void 0 || !Object.hasOwn(tables, tableName)) return void 0;\n\treturn tables[tableName];\n}\n//#endregion\n//#region src/runtime/builder-base.ts\nvar BuilderBase = class {\n\tctx;\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx;\n\t}\n\t_gate(required, methodName, method) {\n\t\treturn ((...args) => {\n\t\t\tassertCapability(this.ctx, required, methodName);\n\t\t\treturn method(...args);\n\t\t});\n\t}\n};\n/**\n* Derive the canonical {@link CodecRef} for a `(table, column)` from the builder context's storage. Returns `undefined` when the builder context has no storage attached or when the column is unknown to the contract.\n*/\nfunction codecRefFor(ctx, namespaceId, tableName, columnName) {\n\tif (!ctx.storage) return void 0;\n\treturn codecRefForStorageColumn(ctx.storage, namespaceId, tableName, columnName);\n}\nfunction emptyState(from, scope) {\n\treturn {\n\t\tfrom,\n\t\tjoins: [],\n\t\tprojections: [],\n\t\twhere: [],\n\t\torderBy: [],\n\t\tgroupBy: [],\n\t\thaving: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0,\n\t\tdistinct: void 0,\n\t\tdistinctOn: void 0,\n\t\tscope,\n\t\trowFields: {},\n\t\tannotations: /* @__PURE__ */ new Map()\n\t};\n}\nfunction cloneState(state, overrides) {\n\treturn {\n\t\t...state,\n\t\t...overrides\n\t};\n}\nfunction combineWhereExprs(exprs) {\n\tif (exprs.length === 0) return void 0;\n\tif (exprs.length === 1) return exprs[0];\n\treturn AndExpr.of(exprs);\n}\nfunction buildSelectAst(state) {\n\tconst where = combineWhereExprs(state.where);\n\treturn new SelectAst({\n\t\tfrom: state.from,\n\t\tjoins: state.joins.length > 0 ? state.joins : void 0,\n\t\tprojection: state.projections,\n\t\twhere,\n\t\torderBy: state.orderBy.length > 0 ? state.orderBy : void 0,\n\t\tdistinct: state.distinct,\n\t\tdistinctOn: state.distinctOn && state.distinctOn.length > 0 ? state.distinctOn : void 0,\n\t\tgroupBy: state.groupBy.length > 0 ? state.groupBy : void 0,\n\t\thaving: state.having,\n\t\tlimit: state.limit,\n\t\toffset: state.offset,\n\t\tselectAllIntent: void 0\n\t});\n}\nfunction buildQueryPlan(ast, ctx, annotations) {\n\tconst paramValues = collectOrderedParamRefs(ast).map((r) => r.kind === \"param-ref\" ? r.value : void 0);\n\tconst annotationsRecord = annotations !== void 0 && annotations.size > 0 ? Object.freeze(Object.fromEntries(annotations)) : void 0;\n\tconst meta = Object.freeze({\n\t\ttarget: ctx.target,\n\t\tstorageHash: ctx.storageHash,\n\t\tlane: \"dsl\",\n\t\t...ifDefined(\"annotations\", annotationsRecord)\n\t});\n\treturn Object.freeze({\n\t\tast,\n\t\tparams: paramValues,\n\t\tmeta\n\t});\n}\nfunction buildPlan(state, ctx) {\n\treturn buildQueryPlan(buildSelectAst(state), ctx, state.annotations);\n}\nfunction tableToScope(alias, table, options) {\n\tconst storage = options?.storage;\n\tconst lookupName = options?.tableName;\n\tconst namespaceId = options?.namespaceId;\n\tconst fields = {};\n\tfor (const [colName, col] of Object.entries(table.columns)) {\n\t\tconst codec = storage && lookupName && namespaceId !== void 0 ? codecRefForStorageColumn(storage, namespaceId, lookupName, colName) : void 0;\n\t\tfields[colName] = {\n\t\t\tcodecId: col.codecId,\n\t\t\tnullable: col.nullable,\n\t\t\t...col.many ? { many: true } : {},\n\t\t\t...codec !== void 0 ? { codec } : {}\n\t\t};\n\t}\n\treturn {\n\t\ttopLevel: { ...fields },\n\t\tnamespaces: { [alias]: fields }\n\t};\n}\nfunction mergeScopes(a, b) {\n\tconst topLevel = {};\n\tfor (const [k, v] of Object.entries(a.topLevel)) if (!(k in b.topLevel)) topLevel[k] = v;\n\tfor (const [k, v] of Object.entries(b.topLevel)) if (!(k in a.topLevel)) topLevel[k] = v;\n\treturn {\n\t\ttopLevel,\n\t\tnamespaces: {\n\t\t\t...a.namespaces,\n\t\t\t...b.namespaces\n\t\t}\n\t};\n}\nfunction nullableScope(scope) {\n\tconst mkNullable = (tbl) => {\n\t\tconst result = {};\n\t\tfor (const [k, v] of Object.entries(tbl)) result[k] = {\n\t\t\tcodecId: v.codecId,\n\t\t\tnullable: true,\n\t\t\t...v.codec !== void 0 ? { codec: v.codec } : {}\n\t\t};\n\t\treturn result;\n\t};\n\tconst namespaces = {};\n\tfor (const [k, v] of Object.entries(scope.namespaces)) namespaces[k] = mkNullable(v);\n\treturn {\n\t\ttopLevel: mkNullable(scope.topLevel),\n\t\tnamespaces\n\t};\n}\nfunction orderByScopeOf(scope, rowFields) {\n\treturn {\n\t\ttopLevel: {\n\t\t\t...scope.topLevel,\n\t\t\t...rowFields\n\t\t},\n\t\tnamespaces: scope.namespaces\n\t};\n}\nfunction assertCapability(ctx, required, methodName) {\n\tfor (const [ns, keys] of Object.entries(required)) for (const key of Object.keys(keys)) if (!ctx.capabilities[ns]?.[key]) throw structuredError(\"ORM.CAPABILITY_MISSING\", `${methodName}() requires capability ${ns}.${key}`, { meta: {\n\t\tmethod: methodName,\n\t\tcapability: `${ns}.${key}`\n\t} });\n}\nfunction resolveSelectArgs(args, scope, ctx) {\n\tconst projections = [];\n\tconst newRowFields = {};\n\tif (args.length === 0) return {\n\t\tprojections,\n\t\tnewRowFields\n\t};\n\tif (typeof args[0] === \"string\" && (args.length === 1 || typeof args[1] !== \"function\")) {\n\t\tfor (const colName of args) {\n\t\t\tconst field = scope.topLevel[colName];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope`, { meta: { column: colName } });\n\t\t\tprojections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), field.codec));\n\t\t\tnewRowFields[colName] = field;\n\t\t}\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tif (typeof args[0] === \"string\" && typeof args[1] === \"function\") {\n\t\tconst alias = args[0];\n\t\tconst exprFn = args[1];\n\t\tconst fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);\n\t\tconst result = exprFn(createFieldProxy(scope), fns);\n\t\tconst field = result.returnType;\n\t\tprojections.push(ProjectionItem.of(alias, projectionAstOf(result), field.codec));\n\t\tnewRowFields[alias] = field;\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tif (typeof args[0] === \"function\") {\n\t\tconst callbackFn = args[0];\n\t\tconst fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);\n\t\tconst record = callbackFn(createFieldProxy(scope), fns);\n\t\tfor (const [key, expr] of Object.entries(record)) {\n\t\t\tconst field = expr.returnType;\n\t\t\tprojections.push(ProjectionItem.of(key, projectionAstOf(expr), field.codec));\n\t\t\tnewRowFields[key] = field;\n\t\t}\n\t\treturn {\n\t\t\tprojections,\n\t\t\tnewRowFields\n\t\t};\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid .select() arguments\");\n}\nfunction resolveOrderBy(arg, options, scope, rowFields, ctx, useAggregateFns) {\n\tconst dir = options?.direction ?? \"asc\";\n\tif (typeof arg === \"string\") {\n\t\tif (!(arg in orderByScopeOf(scope, rowFields).topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${arg}\" not found in scope for orderBy`, { meta: { column: arg } });\n\t\tconst expr = IdentifierRef.of(arg);\n\t\treturn dir === \"asc\" ? OrderByItem.asc(expr) : OrderByItem.desc(expr);\n\t}\n\tif (typeof arg === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = useAggregateFns ? createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates) : createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\tconst result = arg(createFieldProxy(combined), fns);\n\t\treturn dir === \"asc\" ? OrderByItem.asc(result.buildAst()) : OrderByItem.desc(result.buildAst());\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid orderBy argument\");\n}\nfunction resolveGroupBy(args, scope, rowFields, ctx) {\n\tif (typeof args[0] === \"string\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\treturn args.map((colName) => {\n\t\t\tif (!(colName in combined.topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope for groupBy`, { meta: { column: colName } });\n\t\t\treturn IdentifierRef.of(colName);\n\t\t});\n\t}\n\tif (typeof args[0] === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\treturn [args[0](createFieldProxy(combined), fns).buildAst()];\n\t}\n\tthrow structuredError(\"ORM.ARGUMENT_INVALID\", \"Invalid groupBy arguments\");\n}\nfunction resolveDistinctOn(args, scope, rowFields, ctx) {\n\tif (args.length === 1 && typeof args[0] === \"function\") {\n\t\tconst combined = orderByScopeOf(scope, rowFields);\n\t\tconst fns = createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);\n\t\treturn [args[0](createFieldProxy(combined), fns).buildAst()];\n\t}\n\tconst combined = orderByScopeOf(scope, rowFields);\n\treturn args.map((colName) => {\n\t\tif (!(colName in combined.topLevel)) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${colName}\" not found in scope for distinctOn`, { meta: { column: colName } });\n\t\treturn IdentifierRef.of(colName);\n\t});\n}\n//#endregion\n//#region src/runtime/query-impl.ts\nvar QueryBase = class extends BuilderBase {\n\tstate;\n\tconstructor(state, ctx) {\n\t\tsuper(ctx);\n\t\tthis.state = state;\n\t}\n\tdistinctOn = this._gate({ postgres: { distinctOn: true } }, \"distinctOn\", (...args) => {\n\t\tconst exprs = resolveDistinctOn(args, this.state.scope, this.state.rowFields, this.ctx);\n\t\treturn this.clone(cloneState(this.state, { distinctOn: [...this.state.distinctOn ?? [], ...exprs] }));\n\t});\n\tlimit(count) {\n\t\tconst limit = typeof count === \"number\" ? count : toExpr(count);\n\t\treturn this.clone(cloneState(this.state, { limit }));\n\t}\n\toffset(count) {\n\t\tconst offset = typeof count === \"number\" ? count : toExpr(count);\n\t\treturn this.clone(cloneState(this.state, { offset }));\n\t}\n\tdistinct() {\n\t\treturn this.clone(cloneState(this.state, { distinct: true }));\n\t}\n\t/**\n\t* Attach one or more annotations to this query plan.\n\t*\n\t* Read builders (`SelectQueryImpl`, `GroupedQueryImpl`) accept\n\t* annotations whose declared `applicableTo` includes `'read'`.\n\t* The type-level `As & ValidAnnotations<'read', As>` gate rejects\n\t* write-only annotations at the call site; the runtime check below\n\t* fails closed for callers that bypass the type gate (cast / `any`).\n\t*\n\t* Multiple `.annotate(...)` calls compose; duplicate namespaces use\n\t* last-write-wins. The accumulated annotations are merged into\n\t* `plan.meta.annotations` at `.build()` time, alongside any framework-\n\t* internal metadata under reserved namespaces (e.g. `codecs`).\n\t*\n\t* Chainable in any position (before / after `.where`, `.select`,\n\t* `.limit`, etc.); the returned builder has the same row type.\n\t*/\n\tannotate(...annotations) {\n\t\tassertAnnotationsApplicable(annotations, \"read\", \"sql-dsl.annotate\");\n\t\tconst next = new Map(this.state.annotations);\n\t\tfor (const annotation of annotations) next.set(annotation.namespace, annotation);\n\t\treturn this.clone(cloneState(this.state, { annotations: next }));\n\t}\n\tgroupBy(...args) {\n\t\tconst exprs = resolveGroupBy(args, this.state.scope, this.state.rowFields, this.ctx);\n\t\treturn new GroupedQueryImpl(cloneState(this.state, { groupBy: [...this.state.groupBy, ...exprs] }), this.ctx);\n\t}\n\tas(alias) {\n\t\tconst ast = buildSelectAst(this.state);\n\t\tconst derivedSource = DerivedTableSource.as(alias, ast);\n\t\tconst scope = {\n\t\t\ttopLevel: this.state.rowFields,\n\t\t\tnamespaces: { [alias]: this.state.rowFields }\n\t\t};\n\t\treturn {\n\t\t\tgetJoinOuterScope: () => scope,\n\t\t\tbuildAst: () => derivedSource\n\t\t};\n\t}\n\tgetRowFields() {\n\t\treturn this.state.rowFields;\n\t}\n\tbuildAst() {\n\t\treturn buildSelectAst(this.state);\n\t}\n\tbuild() {\n\t\treturn buildPlan(this.state, this.ctx);\n\t}\n};\nvar SelectQueryImpl = class SelectQueryImpl extends QueryBase {\n\tclone(state) {\n\t\treturn new SelectQueryImpl(state, this.ctx);\n\t}\n\tselect(...args) {\n\t\tconst { projections, newRowFields } = resolveSelectArgs(args, this.state.scope, this.ctx);\n\t\treturn new SelectQueryImpl(cloneState(this.state, {\n\t\t\tprojections: [...this.state.projections, ...projections],\n\t\t\trowFields: {\n\t\t\t\t...this.state.rowFields,\n\t\t\t\t...newRowFields\n\t\t\t}\n\t\t}), this.ctx);\n\t}\n\twhere(expr) {\n\t\tconst result = expr(createFieldProxy(this.state.scope), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\treturn new SelectQueryImpl(cloneState(this.state, { where: [...this.state.where, result.buildAst()] }), this.ctx);\n\t}\n\torderBy(arg, options) {\n\t\tconst item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, false);\n\t\treturn this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));\n\t}\n};\nvar GroupedQueryImpl = class GroupedQueryImpl extends QueryBase {\n\tclone(state) {\n\t\treturn new GroupedQueryImpl(state, this.ctx);\n\t}\n\thaving(expr) {\n\t\tconst combined = orderByScopeOf(this.state.scope, this.state.rowFields);\n\t\tconst fns = createAggregateFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer, this.ctx.aggregates);\n\t\tconst result = expr(createFieldProxy(combined), fns);\n\t\treturn new GroupedQueryImpl(cloneState(this.state, { having: result.buildAst() }), this.ctx);\n\t}\n\torderBy(arg, options) {\n\t\tconst item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, true);\n\t\treturn this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));\n\t}\n};\n//#endregion\n//#region src/runtime/joined-tables-impl.ts\nvar JoinedTablesImpl = class JoinedTablesImpl extends BuilderBase {\n\t#state;\n\tconstructor(state, ctx) {\n\t\tsuper(ctx);\n\t\tthis.#state = state;\n\t}\n\tlateralJoin = this._gate({ sql: { lateral: true } }, \"lateralJoin\", (alias, builder) => {\n\t\tconst { derivedSource, lateralScope } = this.#buildLateral(alias, builder);\n\t\tconst resultScope = mergeScopes(this.#state.scope, lateralScope);\n\t\treturn this.#addLateralJoin(\"inner\", resultScope, derivedSource);\n\t});\n\touterLateralJoin = this._gate({ sql: { lateral: true } }, \"outerLateralJoin\", (alias, builder) => {\n\t\tconst { derivedSource, lateralScope } = this.#buildLateral(alias, builder);\n\t\tconst resultScope = mergeScopes(this.#state.scope, nullableScope(lateralScope));\n\t\treturn this.#addLateralJoin(\"left\", resultScope, derivedSource);\n\t});\n\tselect(...args) {\n\t\tconst { projections, newRowFields } = resolveSelectArgs(args, this.#state.scope, this.ctx);\n\t\treturn new SelectQueryImpl(cloneState(this.#state, {\n\t\t\tprojections: [...this.#state.projections, ...projections],\n\t\t\trowFields: {\n\t\t\t\t...this.#state.rowFields,\n\t\t\t\t...newRowFields\n\t\t\t}\n\t\t}), this.ctx);\n\t}\n\tinnerJoin(other, on) {\n\t\tconst targetScope = mergeScopes(this.#state.scope, other.getJoinOuterScope());\n\t\treturn this.#addJoin(other, \"inner\", targetScope, on);\n\t}\n\touterLeftJoin(other, on) {\n\t\tconst targetScope = mergeScopes(this.#state.scope, nullableScope(other.getJoinOuterScope()));\n\t\treturn this.#addJoin(other, \"left\", targetScope, on);\n\t}\n\touterRightJoin(other, on) {\n\t\tconst targetScope = mergeScopes(nullableScope(this.#state.scope), other.getJoinOuterScope());\n\t\treturn this.#addJoin(other, \"right\", targetScope, on);\n\t}\n\touterFullJoin(other, on) {\n\t\tconst targetScope = mergeScopes(nullableScope(this.#state.scope), nullableScope(other.getJoinOuterScope()));\n\t\treturn this.#addJoin(other, \"full\", targetScope, on);\n\t}\n\t#addJoin(other, joinType, resultScope, onExpr) {\n\t\tconst onResult = onExpr(createFieldProxy(mergeScopes(this.#state.scope, other.getJoinOuterScope())), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\tconst joinAst = new JoinAst(joinType, other.buildAst(), onResult.buildAst());\n\t\treturn new JoinedTablesImpl(cloneState(this.#state, {\n\t\t\tjoins: [...this.#state.joins, joinAst],\n\t\t\tscope: resultScope\n\t\t}), this.ctx);\n\t}\n\t#buildLateral(alias, builderFn) {\n\t\tconst subquery = builderFn({ from: (other) => {\n\t\t\tconst otherScope = other.getJoinOuterScope();\n\t\t\tconst parentMerged = mergeScopes(this.#state.scope, otherScope);\n\t\t\treturn new SelectQueryImpl(emptyState(other.buildAst(), parentMerged), this.ctx);\n\t\t} });\n\t\tconst subqueryAst = subquery.buildAst();\n\t\tconst derivedSource = DerivedTableSource.as(alias, subqueryAst);\n\t\tconst subqueryRowFields = subquery.getRowFields();\n\t\treturn {\n\t\t\tderivedSource,\n\t\t\tlateralScope: {\n\t\t\t\ttopLevel: subqueryRowFields,\n\t\t\t\tnamespaces: { [alias]: subqueryRowFields }\n\t\t\t}\n\t\t};\n\t}\n\t#addLateralJoin(joinType, resultScope, derivedSource) {\n\t\tconst joinAst = new JoinAst(joinType, derivedSource, AndExpr.of([]), true);\n\t\treturn new JoinedTablesImpl(cloneState(this.#state, {\n\t\t\tjoins: [...this.#state.joins, joinAst],\n\t\t\tscope: resultScope\n\t\t}), this.ctx);\n\t}\n};\n//#endregion\n//#region src/runtime/mutation-impl.ts\n/**\n* Validates and merges a variadic annotations call into a builder's\n* accumulated user-annotations map. Used by `.annotate(...)` on each of\n* the three mutation builders (`InsertQueryImpl`, `UpdateQueryImpl`,\n* `DeleteQueryImpl`); the read builders share the same logic via\n* `QueryBase.annotate()` in `./query-impl.ts`.\n*\n* Runs `assertAnnotationsApplicable` at call time (not at `.build()`) so\n* inapplicable annotations forced through casts surface immediately\n* rather than at plan-construction time.\n*/\nfunction mergeWriteAnnotations(current, annotations) {\n\tassertAnnotationsApplicable(annotations, \"write\", \"sql-dsl.annotate\");\n\tconst next = new Map(current);\n\tfor (const annotation of annotations) next.set(annotation.namespace, annotation);\n\treturn next;\n}\nfunction buildParamValues(values, namespaceId, table, tableName, op, ctx) {\n\tconst params = {};\n\tfor (const [col, value] of Object.entries(values)) {\n\t\tconst codec = table.columns[col] ? codecRefFor(ctx, namespaceId, tableName, col) : void 0;\n\t\tparams[col] = ParamRef.of(value, codec ? { codec } : void 0);\n\t}\n\tfor (const def of ctx.applyMutationDefaults({\n\t\top,\n\t\tnamespace: namespaceId,\n\t\ttable: tableName,\n\t\tvalues\n\t})) {\n\t\tconst codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;\n\t\tparams[def.column] = ParamRef.of(def.value, codec ? { codec } : void 0);\n\t}\n\treturn params;\n}\nfunction buildReturningProjections(tableName, columns, rowFields) {\n\treturn columns.map((col) => ProjectionItem.of(col, ColumnRef.of(tableName, col), rowFields[col]?.codec));\n}\nfunction evaluateWhere(whereCallback, scope, queryOperationTypes, rawCodecInferer) {\n\treturn whereCallback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer)).buildAst();\n}\nfunction evaluateUpdateCallback(callback, scope, queryOperationTypes, rawCodecInferer) {\n\tconst result = callback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer));\n\tconst set = {};\n\tfor (const [col, expr] of Object.entries(result)) if (expr !== void 0) set[col] = expr.buildAst();\n\treturn set;\n}\nfunction buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {\n\tconst set = { ...exprs };\n\tfor (const def of ctx.applyMutationDefaults({\n\t\top,\n\t\tnamespace: namespaceId,\n\t\ttable: tableName,\n\t\tvalues: exprs\n\t})) if (!(def.column in set)) {\n\t\tconst codec = table.columns[def.column] ? codecRefFor(ctx, namespaceId, tableName, def.column) : void 0;\n\t\tset[def.column] = ParamRef.of(def.value, ifDefined(\"codec\", codec));\n\t}\n\treturn set;\n}\nvar InsertQueryImpl = class InsertQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#namespaceId;\n\t#table;\n\t#scope;\n\t#rows;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, namespaceId, table, scope, rows, ctx, returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#namespaceId = namespaceId;\n\t\tthis.#table = table;\n\t\tthis.#scope = scope;\n\t\tthis.#rows = rows;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new InsertQueryImpl(this.#tableSource, this.#namespaceId, this.#table, this.#scope, this.#rows, this.ctx, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* The type-level `As & ValidAnnotations<'write', As>` gate rejects\n\t* read-only annotations at the call site; the runtime check fails\n\t* closed for callers that bypass the type gate. See `QueryBase.annotate`\n\t* in `./query-impl.ts` for the read-builder counterpart.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new InsertQueryImpl(this.#tableSource, this.#namespaceId, this.#table, this.#scope, this.#rows, this.ctx, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tif (this.#rows.length === 0) throw structuredError(\"ORM.MUTATION_DATA_MISSING\", \"insert() called with an empty row array — at least one row is required\");\n\t\tconst paramRows = this.#rows.map((rowValues) => buildParamValues(rowValues, this.#namespaceId, this.#table, this.#tableName, \"create\", this.ctx));\n\t\tlet ast = InsertAst.into(this.#tableSource).withRows(paramRows);\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\nvar UpdateQueryImpl = class UpdateQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#scope;\n\t#setExpressions;\n\t#whereExprs;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, scope, setExpressions, ctx, whereExprs = [], returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#scope = scope;\n\t\tthis.#setExpressions = setExpressions;\n\t\tthis.#whereExprs = whereExprs;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\twhere(expr) {\n\t\tconst result = expr(createFieldProxy(this.#scope), createFunctions(this.ctx.queryOperationTypes, this.ctx.rawCodecInferer));\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, [...this.#whereExprs, result.buildAst()], this.#returningColumns, this.#rowFields, this.#annotations);\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, this.#whereExprs, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* See `InsertQueryImpl.annotate` for semantics; the runtime check\n\t* fails closed for callers that bypass the type-level gate.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new UpdateQueryImpl(this.#tableSource, this.#scope, this.#setExpressions, this.ctx, this.#whereExprs, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tlet ast = UpdateAst.table(this.#tableSource).withSet(this.#setExpressions).withWhere(combineWhereExprs(this.#whereExprs));\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\nvar DeleteQueryImpl = class DeleteQueryImpl extends BuilderBase {\n\t#tableSource;\n\t#tableName;\n\t#scope;\n\t#whereCallbacks;\n\t#returningColumns;\n\t#rowFields;\n\t#annotations;\n\tconstructor(tableSource, scope, ctx, whereCallbacks = [], returningColumns = [], rowFields = {}, annotations = /* @__PURE__ */ new Map()) {\n\t\tsuper(ctx);\n\t\tthis.#tableSource = tableSource;\n\t\tthis.#tableName = tableSource.name;\n\t\tthis.#scope = scope;\n\t\tthis.#whereCallbacks = whereCallbacks;\n\t\tthis.#returningColumns = returningColumns;\n\t\tthis.#rowFields = rowFields;\n\t\tthis.#annotations = annotations;\n\t}\n\twhere(expr) {\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, [...this.#whereCallbacks, expr], this.#returningColumns, this.#rowFields, this.#annotations);\n\t}\n\treturning = this._gate({ sql: { returning: true } }, \"returning\", (...columns) => {\n\t\tconst newRowFields = {};\n\t\tfor (const col of columns) {\n\t\t\tconst field = this.#scope.topLevel[col];\n\t\t\tif (!field) throw structuredError(\"ORM.COLUMN_UNKNOWN\", `Column \"${col}\" not found in scope`, { meta: { column: col } });\n\t\t\tnewRowFields[col] = field;\n\t\t}\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, this.#whereCallbacks, columns, newRowFields, this.#annotations);\n\t});\n\t/**\n\t* Attach one or more write-typed annotations to this query plan.\n\t* See `InsertQueryImpl.annotate` for semantics.\n\t*/\n\tannotate(...annotations) {\n\t\treturn new DeleteQueryImpl(this.#tableSource, this.#scope, this.ctx, this.#whereCallbacks, this.#returningColumns, this.#rowFields, mergeWriteAnnotations(this.#annotations, annotations));\n\t}\n\tbuild() {\n\t\tconst whereExpr = combineWhereExprs(this.#whereCallbacks.map((cb) => evaluateWhere(cb, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer)));\n\t\tlet ast = DeleteAst.from(this.#tableSource).withWhere(whereExpr);\n\t\tif (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));\n\t\treturn buildQueryPlan(ast, this.ctx, this.#annotations);\n\t}\n};\n//#endregion\n//#region src/runtime/table-source-for-proxy.ts\nfunction tableSourceForProxy(tableName, alias, namespaceId) {\n\treturn TableSource.named(tableName, alias !== tableName ? alias : void 0, namespaceId);\n}\n//#endregion\n//#region src/runtime/table-proxy-impl.ts\nvar TableProxyImpl = class TableProxyImpl extends BuilderBase {\n\t#tableName;\n\t#table;\n\t#namespaceId;\n\t#fromSource;\n\t#scope;\n\tconstructor(tableName, table, alias, ctx, namespaceId) {\n\t\tsuper(ctx);\n\t\tthis.#tableName = tableName;\n\t\tthis.#table = table;\n\t\tthis.#namespaceId = namespaceId;\n\t\tthis.#scope = tableToScope(alias, table, {\n\t\t\tstorage: ctx.storage,\n\t\t\ttableName,\n\t\t\tnamespaceId\n\t\t});\n\t\tthis.#fromSource = tableSourceForProxy(tableName, alias, namespaceId);\n\t}\n\tlateralJoin = this._gate({ sql: { lateral: true } }, \"lateralJoin\", (alias, builder) => {\n\t\treturn this.#toJoined().lateralJoin(alias, builder);\n\t});\n\touterLateralJoin = this._gate({ sql: { lateral: true } }, \"outerLateralJoin\", (alias, builder) => {\n\t\treturn this.#toJoined().outerLateralJoin(alias, builder);\n\t});\n\tgetJoinOuterScope() {\n\t\treturn this.#scope;\n\t}\n\tbuildAst() {\n\t\treturn this.#fromSource;\n\t}\n\tas(newAlias) {\n\t\treturn new TableProxyImpl(this.#tableName, this.#table, newAlias, this.ctx, this.#namespaceId);\n\t}\n\tselect(...args) {\n\t\treturn new SelectQueryImpl(emptyState(this.#fromSource, this.#scope), this.ctx).select(...args);\n\t}\n\tinnerJoin(other, on) {\n\t\treturn this.#toJoined().innerJoin(other, on);\n\t}\n\touterLeftJoin(other, on) {\n\t\treturn this.#toJoined().outerLeftJoin(other, on);\n\t}\n\touterRightJoin(other, on) {\n\t\treturn this.#toJoined().outerRightJoin(other, on);\n\t}\n\touterFullJoin(other, on) {\n\t\treturn this.#toJoined().outerFullJoin(other, on);\n\t}\n\tinsert(rows) {\n\t\treturn new InsertQueryImpl(this.#fromSource, this.#namespaceId, this.#table, this.#scope, rows, this.ctx);\n\t}\n\tupdate(setOrCallback) {\n\t\tif (typeof setOrCallback === \"function\") {\n\t\t\tconst setExpressions = buildSetExpressions(evaluateUpdateCallback(setOrCallback, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer), this.#namespaceId, this.#table, this.#tableName, \"update\", this.ctx);\n\t\t\treturn new UpdateQueryImpl(this.#fromSource, this.#scope, setExpressions, this.ctx);\n\t\t}\n\t\tconst setExpressions = buildParamValues(setOrCallback, this.#namespaceId, this.#table, this.#tableName, \"update\", this.ctx);\n\t\treturn new UpdateQueryImpl(this.#fromSource, this.#scope, setExpressions, this.ctx);\n\t}\n\tdelete() {\n\t\treturn new DeleteQueryImpl(this.#fromSource, this.#scope, this.ctx);\n\t}\n\t#toJoined() {\n\t\treturn new JoinedTablesImpl(emptyState(this.#fromSource, this.#scope), this.ctx);\n\t}\n};\n//#endregion\n//#region src/runtime/sql.ts\nfunction sql(options) {\n\tconst { context, rawCodecInferer } = options;\n\tconst ctx = {\n\t\tcapabilities: context.contract.capabilities,\n\t\tqueryOperationTypes: context.queryOperations.entries(),\n\t\ttarget: context.contract.target ?? \"unknown\",\n\t\tstorageHash: context.contract.storage.storageHash ?? \"unknown\",\n\t\tstorage: context.contract.storage,\n\t\tapplyMutationDefaults: (options) => context.applyMutationDefaults(options),\n\t\trawCodecInferer,\n\t\taggregates: context.aggregateDescriptors\n\t};\n\tconst { storage } = context.contract;\n\treturn new Proxy({}, { get(_target, prop) {\n\t\tif (typeof prop !== \"string\") return;\n\t\tif (!Object.hasOwn(storage.namespaces, prop)) return;\n\t\tconst namespaceId = prop;\n\t\treturn new Proxy({}, { get(_facetTarget, tableName) {\n\t\t\tif (typeof tableName !== \"string\") return;\n\t\t\tconst table = resolveTableInNamespace(storage, namespaceId, tableName);\n\t\t\tif (table) return new TableProxyImpl(tableName, table, tableName, ctx, namespaceId);\n\t\t} });\n\t} });\n}\n//#endregion\nexport { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, sql };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,UAAU,OAAO;CACzB,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAS,UAAU,KAAK,OAAO;CAC9B,OAAO,UAAU,KAAK,IAAI,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;AAC1D;AAGA,SAAS,gBAAgB,MAAM,SAAS,SAAS;CAChD,MAAM,QAAQ,SAAS,UAAU,KAAK,IAAI,IAAI,MAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC,IAAI,IAAI,MAAM,OAAO;CAC1G,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO,OAAO,OAAO,OAAO;EAC3B;EACA,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,SAAS,SAAS,KAAK;EACpC,GAAG,UAAU,YAAY,SAAS,QAAQ;EAC1C,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,WAAW,SAAS,OAAO;CACzC,CAAC;AACF;;;;;;;;AAUA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AKC,QAAQ,KAAKF,YAAY,UAAU,KAAK,GAAG;EAC1H,OAAO,IAAI,gBAAgB,KAAKW,aAAa,KAAKR,QAAQ,gBAAgB,KAAK,GAAG;CACnF;CACA,SAAS;EACR,OAAO,IAAI,gBAAgB,KAAKQ,aAAa,KAAKR,QAAQ,KAAK,GAAG;CACnE;CACA,YAAY;EACX,OAAO,IAAI,iBAAiB,WAAW,KAAKQ,aAAa,KAAKR,MAAM,GAAG,KAAK,GAAG;CAChF;AACD;AAGA,SAAS,IAAI,SAAS;CACrB,MAAM,EAAE,SAAS,oBAAoB;CACrC,MAAM,MAAM;EACX,cAAc,QAAQ,SAAS;EAC/B,qBAAqB,QAAQ,gBAAgB,QAAQ;EACrD,QAAQ,QAAQ,SAAS,UAAU;EACnC,aAAa,QAAQ,SAAS,QAAQ,eAAe;EACrD,SAAS,QAAQ,SAAS;EAC1B,wBAAwB,YAAY,QAAQ,sBAAsB,OAAO;EACzE;EACA,YAAY,QAAQ;CACrB;CACA,MAAM,EAAE,YAAY,QAAQ;CAC5B,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,SAAS,MAAM;EACzC,IAAI,OAAO,SAAS,UAAU;EAC9B,IAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,IAAI,GAAG;EAC9C,MAAM,cAAc;EACpB,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,cAAc,WAAW;GACnD,IAAI,OAAO,cAAc,UAAU;GACnC,MAAM,QAAQ,wBAAwB,SAAS,aAAa,SAAS;GACrE,IAAI,OAAO,OAAO,IAAI,eAAe,WAAW,OAAO,WAAW,KAAK,WAAW;EACnF,EAAE,CAAC;CACJ,EAAE,CAAC;AACJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Expression, u as ScopeField } from "./expression-
|
|
2
|
-
import { _ as TableNamesAcrossNamespaces, b as UnboundTables, c as GroupedQuery, d as QueryContext, f as ResolveRow, g as TableInAnyNamespace, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, n as BooleanCodecType, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, u as Namespace, v as TableProxy, x as UpdateQuery, y as TableProxyContract } from "./db-
|
|
1
|
+
import { a as Expression, u as ScopeField } from "./expression-X88ppPyv.mjs";
|
|
2
|
+
import { _ as TableNamesAcrossNamespaces, b as UnboundTables, c as GroupedQuery, d as QueryContext, f as ResolveRow, g as TableInAnyNamespace, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, n as BooleanCodecType, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, u as Namespace, v as TableProxy, x as UpdateQuery, y as TableProxyContract } from "./db-C5jmOFPM-DeJH09un.mjs";
|
|
3
3
|
export type { AggregateFunctions, BooleanCodecType, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, Namespace, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery };
|
package/dist/{codec-descriptor-registry-BK_ZTP-3.mjs → codec-descriptor-registry-BQPj9q8O.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
|
|
2
|
-
import { l as isStorageTypeInstance } from "./types-
|
|
2
|
+
import { l as isStorageTypeInstance } from "./types-DHzMt9jy.mjs";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
5
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs
|
|
@@ -93,4 +93,4 @@ function buildCodecDescriptorRegistry(allDescriptors, storage) {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { codecRefForStorageColumn as n, buildCodecDescriptorRegistry as t };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=codec-descriptor-registry-
|
|
96
|
+
//# sourceMappingURL=codec-descriptor-registry-BQPj9q8O.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-descriptor-registry-
|
|
1
|
+
{"version":3,"file":"codec-descriptor-registry-BQPj9q8O.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/codec-ref-for-column.ts\n/**\n* Derive the canonical {@link CodecRef} for a `(table, column)` pair against a {@link SqlStorage}. This is the build-time path every column-bound `ParamRef` / `ProjectionItem` uses to stamp its `codec` slot before the AST is handed to the runtime — the runtime resolver then materialises a memoised {@link import('@internal/sql-relational-core/ast').Codec} for the same `CodecRef` via `forCodecRef`.\n*\n* Resolution rules over namespace `entries.table[table].columns[column]`:\n*\n* - `typeRef` column → `{codecId, typeParams}` from `storage.types[typeRef]` (multiple columns sharing the typeRef share one ref → one memoised codec).\n* - inline `typeParams` column → `{codecId, typeParams}` from the column itself.\n* - non-parameterized column → `{codecId}` with `typeParams` undefined.\n*\n* Returns `undefined` when the table or column is unknown, or when a `typeRef` column references a `storage.types` entry that does not exist.\n*\n* `namespaceId` leads the coordinate args and is always supplied: every\n* model/table sits in an explicit namespace, so the table is resolved strictly\n* within that namespace (see {@link resolveStorageTable}).\n*/\nfunction codecRefForStorageColumn(storage, namespaceId, tableName, columnName) {\n\tconst resolved = resolveStorageTable(storage, tableName, namespaceId);\n\tif (resolved === void 0) return void 0;\n\tconst columnDef = resolved.table.columns[columnName];\n\tif (!columnDef) return void 0;\n\tif (columnDef.typeRef !== void 0) {\n\t\tconst instance = storage.types?.[columnDef.typeRef];\n\t\tif (!instance) return void 0;\n\t\tif (isStorageTypeInstance(instance)) {\n\t\t\tconst instanceParams = instance.typeParams;\n\t\t\treturn instanceParams !== void 0 && Object.keys(instanceParams).length > 0 ? {\n\t\t\t\tcodecId: instance.codecId,\n\t\t\t\ttypeParams: instanceParams\n\t\t\t} : { codecId: instance.codecId };\n\t\t}\n\t\treturn;\n\t}\n\tif (columnDef.typeParams !== void 0 && Object.keys(columnDef.typeParams).length > 0) {\n\t\tconst typeParams = blindCast(columnDef.typeParams);\n\t\treturn columnDef.many ? {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams,\n\t\t\tmany: true\n\t\t} : {\n\t\t\tcodecId: columnDef.codecId,\n\t\t\ttypeParams\n\t\t};\n\t}\n\treturn columnDef.many ? {\n\t\tcodecId: columnDef.codecId,\n\t\tmany: true\n\t} : { codecId: columnDef.codecId };\n}\n//#endregion\n//#region src/codec-descriptor-registry.ts\n/**\n* Build a {@link CodecDescriptorRegistry} from a flat descriptor list.\n*\n* Used by:\n* - Each codec-shipping package's `core/registry.ts` to expose a package-scoped registry as the public consumer surface (replacing raw descriptor-array exports). See ADR 208.\n* - The runtime's `buildExecutionContext` to construct the contract-bound combined registry from every contributor's `codecs:` slot.\n*\n* The descriptor map is heterogeneous in `P` — each codec id has its own params shape. The public {@link CodecDescriptorRegistry} interface widens to `CodecDescriptor<unknown>` and consumers narrow per codec id at the call site (the descriptor's `paramsSchema` validates JSON-sourced params before the factory ever sees them, so the runtime narrow is safe). The cast at registration goes through `unknown` because\n* `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly).\n*/\nfunction buildCodecDescriptorRegistry(allDescriptors, storage) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst byTargetType = /* @__PURE__ */ new Map();\n\tfor (const descriptor of allDescriptors) {\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate codec descriptor id: '${descriptor.codecId}' — registered twice during registry construction. Each codecId must be contributed by exactly one component (target / adapter / extension pack).`, { meta: { codecId: descriptor.codecId } });\n\t\tconst widened = descriptor;\n\t\tbyId.set(descriptor.codecId, widened);\n\t\tfor (const targetType of descriptor.targetTypes) {\n\t\t\tconst list = byTargetType.get(targetType);\n\t\t\tif (list) list.push(widened);\n\t\t\telse byTargetType.set(targetType, [widened]);\n\t\t}\n\t}\n\treturn {\n\t\tdescriptorFor(codecId) {\n\t\t\treturn byId.get(codecId);\n\t\t},\n\t\tcodecRefForColumn(namespaceId, table, column) {\n\t\t\tif (!storage) return void 0;\n\t\t\treturn codecRefForStorageColumn(storage, namespaceId, table, column);\n\t\t},\n\t\t*values() {\n\t\t\tyield* byId.values();\n\t\t},\n\t\tbyTargetType(targetType) {\n\t\t\treturn byTargetType.get(targetType) ?? Object.freeze([]);\n\t\t}\n\t};\n}\n//#endregion\nexport { buildCodecDescriptorRegistry, codecRefForStorageColumn };\n\n//# sourceMappingURL=codec-descriptor-registry.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,yBAAyB,SAAS,aAAa,WAAW,YAAY;CAC9E,MAAM,WAAW,oBAAoB,SAAS,WAAW,WAAW;CACpE,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;CACrC,MAAM,YAAY,SAAS,MAAM,QAAQ;CACzC,IAAI,CAAC,WAAW,OAAO,KAAK;CAC5B,IAAI,UAAU,YAAY,KAAK,GAAG;EACjC,MAAM,WAAW,QAAQ,QAAQ,UAAU;EAC3C,IAAI,CAAC,UAAU,OAAO,KAAK;EAC3B,IAAI,sBAAsB,QAAQ,GAAG;GACpC,MAAM,iBAAiB,SAAS;GAChC,OAAO,mBAAmB,KAAK,KAAK,OAAO,KAAK,cAAc,CAAC,CAAC,SAAS,IAAI;IAC5E,SAAS,SAAS;IAClB,YAAY;GACb,IAAI,EAAE,SAAS,SAAS,QAAQ;EACjC;EACA;CACD;CACA,IAAI,UAAU,eAAe,KAAK,KAAK,OAAO,KAAK,UAAU,UAAU,CAAC,CAAC,SAAS,GAAG;EACpF,MAAM,aAAa,UAAU,UAAU,UAAU;EACjD,OAAO,UAAU,OAAO;GACvB,SAAS,UAAU;GACnB;GACA,MAAM;EACP,IAAI;GACH,SAAS,UAAU;GACnB;EACD;CACD;CACA,OAAO,UAAU,OAAO;EACvB,SAAS,UAAU;EACnB,MAAM;CACP,IAAI,EAAE,SAAS,UAAU,QAAQ;AAClC;;;;;;;;;;;AAaA,SAAS,6BAA6B,gBAAgB,SAAS;CAC9D,MAAM,uBAAuB,IAAI,IAAI;CACrC,MAAM,+BAA+B,IAAI,IAAI;CAC7C,KAAK,MAAM,cAAc,gBAAgB;EACxC,IAAI,KAAK,IAAI,WAAW,OAAO,GAAG,MAAM,gBAAgB,2BAA2B,mCAAmC,WAAW,QAAQ,oJAAoJ,EAAE,MAAM,EAAE,SAAS,WAAW,QAAQ,EAAE,CAAC;EACtU,MAAM,UAAU;EAChB,KAAK,IAAI,WAAW,SAAS,OAAO;EACpC,KAAK,MAAM,cAAc,WAAW,aAAa;GAChD,MAAM,OAAO,aAAa,IAAI,UAAU;GACxC,IAAI,MAAM,KAAK,KAAK,OAAO;QACtB,aAAa,IAAI,YAAY,CAAC,OAAO,CAAC;EAC5C;CACD;CACA,OAAO;EACN,cAAc,SAAS;GACtB,OAAO,KAAK,IAAI,OAAO;EACxB;EACA,kBAAkB,aAAa,OAAO,QAAQ;GAC7C,IAAI,CAAC,SAAS,OAAO,KAAK;GAC1B,OAAO,yBAAyB,SAAS,aAAa,OAAO,MAAM;EACpE;EACA,CAAC,SAAS;GACT,OAAO,KAAK,OAAO;EACpB;EACA,aAAa,YAAY;GACxB,OAAO,aAAa,IAAI,UAAU,KAAK,OAAO,OAAO,CAAC,CAAC;EACxD;CACD;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-
|
|
1
|
+
import { i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-DCUlYs47-Cosit03s.mjs";
|
|
2
|
+
import "./types-DuriYH5B.mjs";
|
|
3
|
+
import { t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-BusNrgPr.mjs";
|
|
4
4
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import { TargetPackRef } from "@prisma/orm-framework/components/components";
|
|
6
6
|
import { ContractConfig, ContractConfig as ContractConfig$1 } from "@prisma/orm-framework/config/config-types";
|
|
@@ -25,4 +25,4 @@ declare function typescriptContract(contract: Contract, output?: string, options
|
|
|
25
25
|
declare function typescriptContractFromPath(contractPath: string, output?: string, options?: TypeScriptContractSpecifierOptions): ContractConfig;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { typescriptContractFromPath as i, emptyContract as n, typescriptContract as r, ContractConfig$1 as t };
|
|
28
|
-
//# sourceMappingURL=config-types-
|
|
28
|
+
//# sourceMappingURL=config-types-JLo8FI3b.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-
|
|
1
|
+
{"version":3,"file":"config-types-JLo8FI3b.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.d.mts"],"mappings":";;;;;;;;;;;;;UAWU;WACC,sBAAsB;WACtB,iBAAiB;;iBAEX,cAAc;WACpB;WACA,QAAQ;WACR,kBAAkB,OAAO,sBAAsB;WAC/C,uBAAuB;IAC9B;iBACa,mBAAmB,UAAU,UAAU,iBAAiB,UAAU,qCAAqC;iBACvG,2BAA2B,sBAAsB,iBAAiB,UAAU,qCAAqC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-
|
|
1
|
+
import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-CmJgg-N0-Dt3bpEKZ.mjs";
|
|
2
2
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { ok } from "@prisma/orm-framework/utils/result";
|
|
@@ -61,4 +61,4 @@ function typescriptContractFromPath(contractPath, output, options) {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { typescriptContract as n, typescriptContractFromPath as r, emptyContract as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=config-types-
|
|
64
|
+
//# sourceMappingURL=config-types-THGAJYUu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-
|
|
1
|
+
{"version":3,"file":"config-types-THGAJYUu.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-CmJgg-N0.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction typescriptContractFromPath(contractPath, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,cAAc,SAAS;CAC/B,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY;IACjB,OAAO,GAAG,+BAA+B,+BAA+B;KACvE,UAAU,KAAK;KACf,QAAQ,QAAQ;KAChB,iBAAiB,QAAQ;KACzB,QAAQ,CAAC;IACV,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC3D;EACD;EACA,GAAG,UAAU,UAAU,QAAQ,MAAM;CACtC;AACD;AACA,SAAS,mBAAmB,UAAU,QAAQ,SAAS;CACtD,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;EACrJ;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,2BAA2B,cAAc,QAAQ,SAAS;CAClE,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,YAAY;GACrB,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAK,GAAG,MAAM,IAAI,cAAc,8IAA8I;IACnM,MAAM,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;IACrD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,IAAI,aAAa,KAAK,GAAG,MAAM,cAAc,kCAAkC,0CAA0C,aAAa,2CAA2C,EAAE,MAAM,EAAE,MAAM,aAAa,EAAE,CAAC;IACjN,OAAO,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC1I;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { a as ReferentialAction } from "./foreign-key-BSy9u4O4-BnsOe5Nf.mjs";
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./types-
|
|
6
|
-
import "./
|
|
2
|
+
import { t as CheckKind } from "./naming-BsvzQPOq-qOWmknyp.mjs";
|
|
3
|
+
import { t as Index$1 } from "./sql-index-DsI8HAeK-DsSFxBGF.mjs";
|
|
4
|
+
import { c as SqlStorage, d as StorageTypeInstance, i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-DCUlYs47-Cosit03s.mjs";
|
|
5
|
+
import { P as TypeMaps, o as ContractWithTypeMaps } from "./types-CYq2Cbzw-xEntZSCk.mjs";
|
|
6
|
+
import "./types-DuriYH5B.mjs";
|
|
7
|
+
import "./derived-checks-DPdD01O0-BusNrgPr.mjs";
|
|
7
8
|
import { r as PackEntityHandle } from "./entity-handle-lowering-hook-CIvRKBfa.mjs";
|
|
8
|
-
import { n as AuthoredIndexMethod } from "./index-naming-
|
|
9
|
+
import { n as AuthoredIndexMethod } from "./index-naming-BD2dqoTC.mjs";
|
|
9
10
|
import { i as IndexTypeRegistration } from "./index-types-DPVhsW0v-D-BikM4h.mjs";
|
|
10
11
|
import "./index-types-CNhHgKHi.mjs";
|
|
11
12
|
import { StorageType } from "@prisma/orm-framework/components/ir";
|
|
@@ -34,6 +35,7 @@ type ScalarFieldState<Descriptor extends ColumnTypeDescriptor = ColumnTypeDescri
|
|
|
34
35
|
readonly default?: ColumnDefault | undefined;
|
|
35
36
|
readonly executionDefaults?: ExecutionMutationDefaultPhases | undefined;
|
|
36
37
|
readonly many?: Many extends true ? true : undefined;
|
|
38
|
+
readonly noCheck?: readonly CheckKind[] | undefined;
|
|
37
39
|
} & (IdSpec extends NamedConstraintSpec ? {
|
|
38
40
|
readonly id: IdSpec;
|
|
39
41
|
} : {
|
|
@@ -52,6 +54,7 @@ type AnyScalarFieldState = {
|
|
|
52
54
|
readonly default?: ColumnDefault | undefined;
|
|
53
55
|
readonly executionDefaults?: ExecutionMutationDefaultPhases | undefined;
|
|
54
56
|
readonly many?: boolean | undefined;
|
|
57
|
+
readonly noCheck?: readonly CheckKind[] | undefined;
|
|
55
58
|
readonly id?: NamedConstraintSpec | undefined;
|
|
56
59
|
readonly unique?: NamedConstraintSpec | undefined;
|
|
57
60
|
};
|
|
@@ -94,6 +97,14 @@ declare class ScalarFieldBuilder<State extends AnyScalarFieldState = AnyScalarFi
|
|
|
94
97
|
optional(): ScalarFieldBuilder<State extends ScalarFieldState<infer Descriptor, infer TypeRef, boolean, infer ColumnName, infer IdSpec, infer UniqueSpec, infer Many> ? ScalarFieldState<Descriptor, TypeRef, true, ColumnName, IdSpec, UniqueSpec, Many> : AnyScalarFieldState>;
|
|
95
98
|
column<ColumnName extends string>(name: ColumnName): ScalarFieldBuilder<State extends ScalarFieldState<infer Descriptor, infer TypeRef, infer Nullable, string | undefined, infer IdSpec, infer UniqueSpec, infer Many> ? ScalarFieldState<Descriptor, TypeRef, Nullable, ColumnName, IdSpec, UniqueSpec, Many> : AnyScalarFieldState>;
|
|
96
99
|
many(): ScalarFieldBuilder<State extends ScalarFieldState<infer Descriptor, infer TypeRef, infer Nullable, infer ColumnName, infer IdSpec, infer UniqueSpec, boolean> ? ScalarFieldState<Descriptor, TypeRef, Nullable, ColumnName, IdSpec, UniqueSpec, true> : AnyScalarFieldState>;
|
|
100
|
+
/**
|
|
101
|
+
* Declines enforcement of generated CHECK constraints on this column.
|
|
102
|
+
* With no arguments, waives every kind the column's shape derives;
|
|
103
|
+
* with arguments, waives exactly the named kinds. Declared types are
|
|
104
|
+
* unchanged — runtime values may diverge from them once enforcement
|
|
105
|
+
* is waived.
|
|
106
|
+
*/
|
|
107
|
+
noCheck(...kinds: readonly CheckKind[]): ScalarFieldBuilder<State>;
|
|
97
108
|
default(value: ColumnDefaultLiteralInputValue | ColumnDefault): ScalarFieldBuilder<State>;
|
|
98
109
|
defaultSql(expression: string): ScalarFieldBuilder<State>;
|
|
99
110
|
id<const Name extends string | undefined = undefined>(options?: NamedConstraintSpec<Name>): ScalarFieldBuilder<State extends ScalarFieldState<infer Descriptor, infer TypeRef, infer Nullable, infer ColumnName, NamedConstraintSpec | undefined, infer UniqueSpec, infer Many> ? ScalarFieldState<Descriptor, TypeRef, Nullable, ColumnName, NamedConstraintSpec<Name>, UniqueSpec, Many> : AnyScalarFieldState>;
|
|
@@ -1019,6 +1030,13 @@ interface FieldNode {
|
|
|
1019
1030
|
readonly default?: ColumnDefault;
|
|
1020
1031
|
readonly executionDefaults?: ExecutionMutationDefaultPhases;
|
|
1021
1032
|
readonly many?: boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* Generated-check kinds the author declined for this column. The PSL
|
|
1035
|
+
* interpreter always writes concrete kinds; the TS builder's bare
|
|
1036
|
+
* `noCheck()` arrives as `[]` and is resolved to the column shape's
|
|
1037
|
+
* derivable kinds at contract build time.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly noCheck?: readonly CheckKind[];
|
|
1022
1040
|
/** Present when the field was authored with `field.namedType(enumHandle)`. */
|
|
1023
1041
|
readonly enumTypeHandle?: EnumTypeHandle;
|
|
1024
1042
|
}
|
|
@@ -1304,4 +1322,4 @@ declare function defineContract<const Family extends FamilyPackRef<string>, cons
|
|
|
1304
1322
|
declare function buildContractDefinition(definition: ContractInput): ContractDefinition;
|
|
1305
1323
|
//#endregion
|
|
1306
1324
|
export { field as A, bindEnumType as C, defineContract as D, buildSqlContractFromDefinition as E, model as M, rel as N, enumType as O, UniqueConstraintNode as S, buildContractDefinition as T, ModelNode as _, ComposedAuthoringHelpers as a, ScalarFieldBuilder as b, ContractModelBuilder as c, ExtractCodecTypesFromPack as d, FieldNode as f, ModelLike as g, MergeEnums as h, CodecTypeMap as i, member as j, extensionModel as k, EnumMember as l, IndexNode as m, BoundEnumType as n, ContractDefinition as o, ForeignKeyNode as p, CodecInput as r, ContractInput as s, AttachedEntities as t, EnumTypeHandle as u, PrimaryKeyNode as v, buildBoundContract as w, TargetFieldRef as x, RelationNode as y };
|
|
1307
|
-
//# sourceMappingURL=contract-builder-
|
|
1325
|
+
//# sourceMappingURL=contract-builder-94EfE12M.d.mts.map
|