@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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as frozenCodecRef, V as isAggregateFn, z as aggregateFnNames } from "./types-CSP6WmWn-DVuxsZJW.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
4
|
import { aggregateDescriptorKey, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, settleAggregateOverloads } from "@prisma/orm-framework/components/components";
|
|
@@ -17,7 +17,7 @@ function namedOutputRef(output, input) {
|
|
|
17
17
|
/**
|
|
18
18
|
* Validate every contributed aggregate descriptor and settle its matches against the composed codec set.
|
|
19
19
|
*
|
|
20
|
-
* Validation covers the descriptor's own shape, a second claim on one `(operation, input)` pair, and two trait descriptors that both claim a registered codec for one operation — the last of which only a composed stack can detect, which is why it is settled here rather than at contribution.
|
|
20
|
+
* Validation covers the descriptor's own shape, the lowering rule — an operation outside the closed SQL aggregate alphabet must carry a `lower` hook, there being no plain `AggregateExpr` form for it — a second claim on one `(operation, input)` pair, and two trait descriptors that both claim a registered codec for one operation — the last of which only a composed stack can detect, which is why it is settled here rather than at contribution.
|
|
21
21
|
*/
|
|
22
22
|
function buildSqlAggregateDescriptorRegistry(descriptors, codecDescriptors) {
|
|
23
23
|
const validated = [];
|
|
@@ -29,6 +29,14 @@ function buildSqlAggregateDescriptorRegistry(descriptors, codecDescriptors) {
|
|
|
29
29
|
meta: { descriptor: describeCandidate(candidate) }
|
|
30
30
|
});
|
|
31
31
|
const key = aggregateDescriptorKey(candidate);
|
|
32
|
+
if (!isAggregateFn(candidate.operation) && candidate.lower === void 0) throw structuredError("RUNTIME.AGGREGATE_LOWERING_MISSING", `Aggregate descriptor '${key}' declares operation '${candidate.operation}', which is outside the SQL aggregate alphabet (${[...aggregateFnNames].join(", ")}) and carries no lowering hook.`, {
|
|
33
|
+
why: "An operation in the alphabet lowers to a plain aggregate call; renderers know no other operation, so any other name must build its expression through a `lower` hook from existing nodes.",
|
|
34
|
+
fix: "Declare a `lower` hook on the descriptor, or use an operation name from the SQL aggregate alphabet.",
|
|
35
|
+
meta: {
|
|
36
|
+
operation: candidate.operation,
|
|
37
|
+
key
|
|
38
|
+
}
|
|
39
|
+
});
|
|
32
40
|
if (claimedKeys.has(key)) throw structuredError("RUNTIME.DUPLICATE_AGGREGATE_DESCRIPTOR", `Duplicate aggregate descriptor for '${key}'.`, {
|
|
33
41
|
why: "Each operation/input pair resolves to exactly one result codec, so exactly one component may claim it.",
|
|
34
42
|
fix: "Remove the duplicate target, adapter, or extension contribution.",
|
|
@@ -108,4 +116,4 @@ function describeCandidate(value) {
|
|
|
108
116
|
//#endregion
|
|
109
117
|
export { isSqlAggregateDescriptor as n, buildSqlAggregateDescriptorRegistry as t };
|
|
110
118
|
|
|
111
|
-
//# sourceMappingURL=aggregate-descriptor-registry-
|
|
119
|
+
//# sourceMappingURL=aggregate-descriptor-registry-DvPrQwzY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-descriptor-registry-DvPrQwzY.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/aggregate-descriptor-registry.mjs"],"sourcesContent":["import { B as isAggregateFn, G as frozenCodecRef, z as aggregateFnNames } from \"../types-CSP6WmWn.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { aggregateDescriptorKey, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, settleAggregateOverloads } from \"@internal/framework-components/components\";\n//#region src/aggregate-descriptor.ts\n/** Structural validation of a contributed SQL aggregate descriptor: the declarative shape plus a callable lowering hook where one is declared. */\nfunction isSqlAggregateDescriptor(value) {\n\tif (!isAggregateDescriptor(value)) return false;\n\treturn !(\"lower\" in value) || value.lower === void 0 || typeof value.lower === \"function\";\n}\n//#endregion\n//#region src/aggregate-descriptor-registry.ts\nfunction namedOutputRef(output, input) {\n\treturn frozenCodecRef({\n\t\tcodecId: output.codecId,\n\t\t...ifDefined(\"typeParams\", output.typeParams?.(input))\n\t});\n}\n/**\n* Validate every contributed aggregate descriptor and settle its matches against the composed codec set.\n*\n* Validation covers the descriptor's own shape, the lowering rule — an operation outside the closed SQL aggregate alphabet must carry a `lower` hook, there being no plain `AggregateExpr` form for it — a second claim on one `(operation, input)` pair, and two trait descriptors that both claim a registered codec for one operation — the last of which only a composed stack can detect, which is why it is settled here rather than at contribution.\n*/\nfunction buildSqlAggregateDescriptorRegistry(descriptors, codecDescriptors) {\n\tconst validated = [];\n\tconst claimedKeys = /* @__PURE__ */ new Set();\n\tfor (const candidate of descriptors) {\n\t\tif (!isSqlAggregateDescriptor(candidate)) throw structuredError(\"RUNTIME.AGGREGATE_DESCRIPTOR_INVALID\", `Contributed value ${describeCandidate(candidate)} is not a valid SQL aggregate descriptor.`, {\n\t\t\twhy: \"Aggregate resolution reads a declared operation, input match, result codec, and nullability; a lowering hook, where present, must be callable.\",\n\t\t\tfix: \"Declare `operation`, `input` (`none` / `any` / `codec` / `trait`), `output` (`self` / `codec`), and `nullable` on the descriptor.\",\n\t\t\tmeta: { descriptor: describeCandidate(candidate) }\n\t\t});\n\t\tconst key = aggregateDescriptorKey(candidate);\n\t\tif (!isAggregateFn(candidate.operation) && candidate.lower === void 0) throw structuredError(\"RUNTIME.AGGREGATE_LOWERING_MISSING\", `Aggregate descriptor '${key}' declares operation '${candidate.operation}', which is outside the SQL aggregate alphabet (${[...aggregateFnNames].join(\", \")}) and carries no lowering hook.`, {\n\t\t\twhy: \"An operation in the alphabet lowers to a plain aggregate call; renderers know no other operation, so any other name must build its expression through a `lower` hook from existing nodes.\",\n\t\t\tfix: \"Declare a `lower` hook on the descriptor, or use an operation name from the SQL aggregate alphabet.\",\n\t\t\tmeta: {\n\t\t\t\toperation: candidate.operation,\n\t\t\t\tkey\n\t\t\t}\n\t\t});\n\t\tif (claimedKeys.has(key)) throw structuredError(\"RUNTIME.DUPLICATE_AGGREGATE_DESCRIPTOR\", `Duplicate aggregate descriptor for '${key}'.`, {\n\t\t\twhy: \"Each operation/input pair resolves to exactly one result codec, so exactly one component may claim it.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: { key }\n\t\t});\n\t\tclaimedKeys.add(key);\n\t\tvalidated.push(candidate);\n\t}\n\tconst settled = settleAggregateOverloads(validated, codecDescriptors.values());\n\tconst ambiguity = settled.ambiguities[0];\n\tif (ambiguity !== void 0) throw structuredError(\"RUNTIME.AMBIGUOUS_AGGREGATE_DESCRIPTOR\", `Ambiguous aggregate descriptors for '${ambiguity.operation}' over codec '${ambiguity.codecId}': traits ${ambiguity.traits.join(\", \")} all claim it.`, {\n\t\twhy: \"A codec advertising several claimed traits leaves the result codec undetermined.\",\n\t\tfix: `Contribute an exact descriptor for '${ambiguity.operation}' over '${ambiguity.codecId}', or narrow the overlapping trait contributions.`,\n\t\tmeta: {\n\t\t\toperation: ambiguity.operation,\n\t\t\tcodecId: ambiguity.codecId,\n\t\t\ttraits: ambiguity.traits\n\t\t}\n\t});\n\tfor (const descriptor of validated) {\n\t\tconst outputCodecId = descriptor.output.kind === \"codec\" ? descriptor.output.codecId : descriptor.input.kind === \"codec\" ? descriptor.input.codecId : void 0;\n\t\tif (outputCodecId !== void 0 && codecDescriptors.descriptorFor(outputCodecId) === void 0) {\n\t\t\tconst key = aggregateDescriptorKey(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.AGGREGATE_OUTPUT_CODEC_MISSING\", `Aggregate descriptor '${key}' names result codec '${outputCodecId}', which the composed stack does not register.`, {\n\t\t\t\twhy: \"A resolved aggregate decodes its result through the declared codec; a codec the stack does not compose cannot decode anything.\",\n\t\t\t\tfix: \"Register the codec on the composed stack, or declare a result codec the stack composes.\",\n\t\t\t\tmeta: {\n\t\t\t\t\toperation: descriptor.operation,\n\t\t\t\t\tkey,\n\t\t\t\t\toutputCodecId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tconst tables = /* @__PURE__ */ new Map();\n\tfor (const [operation, entry] of settled.operations) tables.set(operation, {\n\t\twithoutInput: resolveWithoutInput(operation, entry.noInput) ?? resolveWithoutInput(operation, entry.anyInput),\n\t\tbyCodecId: entry.byCodecId,\n\t\tanyInput: entry.anyInput\n\t});\n\treturn {\n\t\tresolve(operation, input) {\n\t\t\tconst table = tables.get(operation);\n\t\t\tif (table === void 0) return void 0;\n\t\t\tif (input === void 0) return table.withoutInput;\n\t\t\tconst descriptor = table.byCodecId.get(input.codecId) ?? table.anyInput;\n\t\t\tif (descriptor === void 0) return void 0;\n\t\t\treturn {\n\t\t\t\toperation,\n\t\t\t\toutput: descriptor.output.kind === \"self\" ? frozenCodecRef(input) : namedOutputRef(descriptor.output, input),\n\t\t\t\tnullable: descriptor.nullable,\n\t\t\t\tlower: descriptor.lower\n\t\t\t};\n\t\t},\n\t\t*values() {\n\t\t\tyield* validated;\n\t\t}\n\t};\n}\n/**\n* Resolve the overload that answers a call carrying no input. Both kinds that qualify name their result codec outright, there being no input codec to reuse.\n*/\nfunction resolveWithoutInput(operation, descriptor) {\n\tif (descriptor === void 0) return void 0;\n\tif (!isNoInputAggregateDescriptor(descriptor) && !isAnyInputAggregateDescriptor(descriptor)) return;\n\treturn {\n\t\toperation,\n\t\toutput: namedOutputRef(descriptor.output, void 0),\n\t\tnullable: descriptor.nullable,\n\t\tlower: descriptor.lower\n\t};\n}\nfunction describeCandidate(value) {\n\tif (typeof value === \"object\" && value !== null && \"operation\" in value) return `'${String(value.operation)}'`;\n\treturn `of type ${typeof value}`;\n}\n//#endregion\nexport { buildSqlAggregateDescriptorRegistry, isSqlAggregateDescriptor };\n\n//# sourceMappingURL=aggregate-descriptor-registry.mjs.map"],"mappings":";;;;;;AAMA,SAAS,yBAAyB,OAAO;CACxC,IAAI,CAAC,sBAAsB,KAAK,GAAG,OAAO;CAC1C,OAAO,EAAE,WAAW,UAAU,MAAM,UAAU,KAAK,KAAK,OAAO,MAAM,UAAU;A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A6B,UAAU,KAAK,CAAC,8BAA8B,UAAU,GAAG;CAC7F,OAAO;EACN;EACA,QAAQ,eAAe,WAAW,QAAQ,KAAK,CAAC;EAChD,UAAU,WAAW;EACrB,OAAO,WAAW;CACnB;AACD;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,OAAO,OAAO,IAAI,OAAO,MAAM,SAAS,EAAE;CAC5G,OAAO,WAAW,OAAO;AAC1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as frozenCodecRef } from "./types-CSP6WmWn-DVuxsZJW.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { type } from "arktype";
|
|
4
4
|
import { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
@@ -322,4 +322,4 @@ const sqlTimestampColumn = (params = {}) => column(sqlTimestampDescriptor.factor
|
|
|
322
322
|
//#endregion
|
|
323
323
|
export { sqlFloatDescriptor as A, sqlTextEncode as B, sqlCharDecode as C, sqlFloatColumn as D, sqlCharRenderOutputType as E, sqlIntDescriptor as F, sqlTimestampEncode as G, sqlTimestampDecode as H, sqlIntEncode as I, sqlVarcharColumn as J, sqlTimestampEncodeJson as K, sqlTextColumn as L, sqlFloatEncodeJson as M, sqlIntColumn as N, sqlFloatDecode as O, sqlIntDecode as P, sqlVarcharRenderOutputType as Q, sqlTextDecode as R, sqlCharColumn as S, sqlCharEncode as T, sqlTimestampDecodeJson as U, sqlTimestampColumn as V, sqlTimestampDescriptor as W, sqlVarcharDescriptor as X, sqlVarcharDecode as Y, sqlVarcharEncode as Z, SqlTextDescriptor as _, SQL_FLOAT_CODEC_ID as a, SqlVarcharCodec as b, SQL_TIMESTAMP_CODEC_ID as c, SqlCharDescriptor as d, SqlFloatCodec as f, SqlTextCodec as g, SqlIntDescriptor as h, SQL_CHAR_CODEC_ID as i, sqlFloatEncode as j, sqlFloatDecodeJson as k, SQL_VARCHAR_CODEC_ID as l, SqlIntCodec as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlFloatDescriptor as p, sqlTimestampRenderOutputType as q, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharCodec as u, SqlTimestampCodec as v, sqlCharDescriptor as w, SqlVarcharDescriptor as x, SqlTimestampDescriptor as y, sqlTextDescriptor as z };
|
|
324
324
|
|
|
325
|
-
//# sourceMappingURL=ast-
|
|
325
|
+
//# sourceMappingURL=ast-B-eeN74F.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-B-eeN74F.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { A as PreparedParamRef, B as isAggregateFn, C as LiteralExpr, D as OrExpr, E as OperationExpr, F as SubqueryExpr, G as frozenCodecRef, H as isWhereExpr, I as TableSource, L as UpdateAst, M as RawExpr, N as RawSqlExpr, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, U as queryAstKinds, V as isQueryAst, W as whereExprKinds, _ as InsertAst, a as CastExpr, b as JsonArrayAggExpr, c as DeleteAst, d as DoUpdateSetConflictAction, f as EqColJoinOn, g as IdentifierRef, h as FunctionSource, i as CaseExpr, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst, z as aggregateFnNames } from \"../types-CSP6WmWn.mjs\";\nimport { a as ForeignKeyConstraint, c as PrimaryKeyConstraint, i as DdlNode, l as UniqueConstraint, n as DdlColumn, o as FunctionColumnDefault, r as DdlColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as isDdlNode } from \"../ddl-types-BMp2bWVS.mjs\";\nimport { n as compact, t as collectOrderedParamRefs } from \"../util-DQQgv2j1.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/ast/json-value-projection.ts\nvar JsonValueProjection = class {\n\tvalue;\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n\tfold(folder) {\n\t\treturn this.value.fold(folder);\n\t}\n\tcollectColumnRefs() {\n\t\treturn this.value.collectColumnRefs();\n\t}\n\tcollectParamRefs() {\n\t\treturn this.value.collectParamRefs();\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar CodecJsonValueProjection = class CodecJsonValueProjection extends JsonValueProjection {\n\tkind = \"codec\";\n\tcodec;\n\tconstructor(value, codec) {\n\t\tsuper(value);\n\t\tthis.codec = frozenCodecRef(codec);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.codec(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new CodecJsonValueProjection(this.value.rewrite(rewriter), this.codec);\n\t}\n};\nvar NativeJsonValueProjection = class NativeJsonValueProjection extends JsonValueProjection {\n\tkind = \"native\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.native(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new NativeJsonValueProjection(this.value.rewrite(rewriter));\n\t}\n};\nvar JsonDocumentProjection = class JsonDocumentProjection extends JsonValueProjection {\n\tkind = \"document\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.document(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new JsonDocumentProjection(this.value.rewrite(rewriter));\n\t}\n};\n//#endregion\n//#region src/ast/sql-codec-helpers.ts\nconst SQL_CHAR_CODEC_ID = \"sql/char@1\";\nconst SQL_VARCHAR_CODEC_ID = \"sql/varchar@1\";\nconst SQL_INT_CODEC_ID = \"sql/int@1\";\nconst SQL_FLOAT_CODEC_ID = \"sql/float@1\";\nconst SQL_TEXT_CODEC_ID = \"sql/text@1\";\nconst SQL_TIMESTAMP_CODEC_ID = \"sql/timestamp@1\";\nconst sqlCharEncode = (value) => value;\nconst sqlCharDecode = (wire) => wire.trimEnd();\nconst sqlCharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Char, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_CHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Char<${length}>`;\n};\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlVarcharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Varchar, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_VARCHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Varchar<${length}>`;\n};\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\n/**\n* JSON has no spelling for a non-finite number, and a database that holds one\n* emits it as a string — PostgreSQL writes `\"NaN\"` and `\"Infinity\"`. This\n* codec's application type is `number`, so both directions reject rather than\n* carry a value that type cannot hold.\n*/\nconst sqlFloatEncodeJson = (value) => {\n\tif (!Number.isFinite(value)) throw structuredError(\"RUNTIME.ENCODE_FAILED\", `${SQL_FLOAT_CODEC_ID} application value must be a finite number, got ${value}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn value;\n};\nconst sqlFloatDecodeJson = (json) => {\n\tif (typeof json !== \"number\" || !Number.isFinite(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a finite number for ${SQL_FLOAT_CODEC_ID}, got ${JSON.stringify(json)}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn json;\n};\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\nconst ZONELESS_ISO_TIMESTAMP = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,6})?$/;\nconst sqlTimestampEncode = (value) => value;\nconst sqlTimestampDecode = (wire) => wire;\n/**\n* A `timestamp` carries no zone, so its JSON form is the ISO rendering without a\n* trailing `Z` — `2026-01-02T03:04:05.678` — and {@link sqlTimestampDecodeJson}\n* reads that form back as UTC.\n*/\nconst sqlTimestampEncodeJson = (value) => value.toISOString().slice(0, -1);\nconst sqlTimestampDecodeJson = (json) => {\n\tif (typeof json !== \"string\") throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected ISO date string for sql/timestamp@1, got ${typeof json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\tif (!ZONELESS_ISO_TIMESTAMP.test(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a zone-less ISO date-time (YYYY-MM-DDTHH:MM:SS[.sss]) for sql/timestamp@1, got ${json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\tconst date = /* @__PURE__ */ new Date(`${json}Z`);\n\tif (Number.isNaN(date.getTime())) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Invalid ISO date string for sql/timestamp@1: ${json}`, { meta: { codec: SQL_TIMESTAMP_CODEC_ID } });\n\treturn date;\n};\nconst sqlTimestampRenderOutputType = (typeParams) => {\n\tconst precision = typeParams.precision;\n\tif (precision === void 0) return \"Timestamp\";\n\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"precision\" in typeParams for Timestamp, got ${String(precision)}`, { meta: {\n\t\tcodec: SQL_TIMESTAMP_CODEC_ID,\n\t\tparam: \"precision\",\n\t\treceived: String(precision)\n\t} });\n\treturn `Timestamp<${precision}>`;\n};\n//#endregion\n//#region src/ast/sql-codecs.ts\nconst lengthParamsSchema = type({ \"length?\": \"number.integer > 0\" });\nconst precisionParamsSchema = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nvar SqlTextCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlTextDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"text\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlTextCodec(this);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0, \"text\");\nvar SqlIntCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlIntDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"int\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlIntCodec(this);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0, \"int\");\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlFloatEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlFloatDecodeJson(json);\n\t}\n};\nvar SqlFloatDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_FLOAT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\ttargetTypes = [\"float\"];\n\tparamsSchema = voidParamsSchema;\n\tfactory() {\n\t\treturn () => new SqlFloatCodec(this);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0, \"float\");\nvar SqlCharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlCharDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_CHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"char\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlCharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlCharCodec(this);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params, \"char\");\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\n\t}\n};\nvar SqlVarcharDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_VARCHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\ttargetTypes = [\"varchar\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlVarcharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlVarcharCodec(this);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, \"varchar\");\nvar SqlTimestampCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTimestampEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTimestampDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlTimestampEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlTimestampDecodeJson(json);\n\t}\n};\nvar SqlTimestampDescriptor = class extends CodecDescriptorImpl {\n\tcodecId = SQL_TIMESTAMP_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\ttargetTypes = [\"timestamp\"];\n\tparamsSchema = precisionParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlTimestampRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlTimestampCodec(this);\n\t}\n};\nconst sqlTimestampDescriptor = new SqlTimestampDescriptor();\nconst sqlTimestampColumn = (params = {}) => column(sqlTimestampDescriptor.factory(params), sqlTimestampDescriptor.codecId, params, \"timestamp\");\n//#endregion\nexport { AggregateExpr, AndExpr, BinaryExpr, CaseExpr, CastExpr, CheckExpressionConstraint, CodecJsonValueProjection, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawSqlExpr, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlTimestampCodec, SqlTimestampDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, aggregateFnNames, collectOrderedParamRefs, compact, frozenCodecRef, isAggregateFn, isDdlNode, isQueryAst, isWhereExpr, queryAstKinds, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlTimestampColumn, sqlTimestampDecode, sqlTimestampDecodeJson, sqlTimestampDescriptor, sqlTimestampEncode, sqlTimestampEncodeJson, sqlTimestampRenderOutputType, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;AAOA,IAAI,sBAAsB,MAAM;CAC/B;CACA,YAAY,OAAO;EAClB,KAAK,QAAQ;CACd;CACA,KAAK,QAAQ;EACZ,OAAO,KAAK,MAAM,KAAK,MAAM;CAC9B;CACA,oBAAoB;EACnB,OAAO,KAAK,MAAM,kBAAkB;CACrC;CACA,mBAAmB;EAClB,OAAO,KAAK,MAAM,iBAAiB;CACpC;CACA,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,2BAA2B,MAAM,iCAAiC,oBAAoB;CACzF,OAAO;CACP;CACA,YAAY,OAAO,OAAO;EACzB,MAAM,KAAK;EACX,KAAK,QAAQ,eAAe,KAAK;EACjC,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EACf,OAAO,QAAQ,MAAM,IAAI;CAC1B;CACA,QAAQ,UAAU;EACjB,OAAO,IAAI,yBAAyB,KAAK,MAAM,QAAQ,QAAQ,GAAG,KAAK,KAAK;CAC7E;AACD;AACA,IAAI,4BAA4B,MAAM,kCAAkC,oBAAoB;CAC3F,OAAO;CACP,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EACf,OAAO,QAAQ,OAAO,IAAI;CAC3B;CACA,QAAQ,UAAU;EACjB,OAAO,IAAI,0BAA0B,KAAK,MAAM,QAAQ,QAAQ,CAAC;CAClE;AACD;AACA,IAAI,yBAAyB,MAAM,+BAA+B,oBAAoB;CACrF,OAAO;CACP,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,OAAO;CACb;CACA,OAAO,SAAS;EAC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EACxB,OAAO,iBAAiB,IAAI;CAC7B;CACA,WAAW,OAAO;EACjB,OAAO;CACR;CACA,WAAW,MAAM;EAChB,OAAO;CACR;AACD;AACA,IAAI,uBAAuB,cAAc,oBAAoB;CAC5D,UAAU;CACV,SAAS;EACR;EACA;EACA;CACD;CACA,cAAc,CAAC,SAAS;CACxB,eAAe;CACf,iBAAiB,QAAQ;EACxB,OAAO,2BAA2B,MAAM;CACzC;CACA,QAAQ,SAAS;EAChB,aAAa,IAAI,gBAAgB,IAAI;CACtC;AACD;AACA,MAAM,uBAAuB,IAAI,qBAAqB;AACtD,MAAM,oBAAoB,SAAS,CAAC,MAAM,OAAO,qBAAqB,QAAQ,MAAM,GAAG,qBAAqB,SAAS,QAAQ,SAAS;AACtI,IAAI,oBAAoB,cAAc,UAAU;CAC/C,MAAM,OAAO,OAAO,MAAM;EACzB,OAAO,mBAAmB,KAAK;CAChC;CACA,MAAM,OAAO,MAAM,MAAM;EACxB,OAAO,mBAAmB,IAAI;CAC/B;CACA,WAAW,OAAO;EACjB,OAAO,uBAAuB,KAAK;CACpC;CACA,WAAW,MAAM;EAChB,OAAO,uBAAuB,IAAI;CACnC;AACD;AACA,IAAI,yBAAyB,cAAc,oBAAoB;CAC9D,UAAU;CACV,SAAS,CAAC,YAAY,OAAO;CAC7B,cAAc,CAAC,WAAW;CAC1B,eAAe;CACf,iBAAiB,QAAQ;EACxB,OAAO,6BAA6B,MAAM;CAC3C;CACA,QAAQ,SAAS;EAChB,aAAa,IAAI,kBAAkB,IAAI;CACxC;AACD;AACA,MAAM,yBAAyB,IAAI,uBAAuB;AAC1D,MAAM,sBAAsB,SAAS,CAAC,MAAM,OAAO,uBAAuB,QAAQ,MAAM,GAAG,uBAAuB,SAAS,QAAQ,WAAW"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as AnyQueryAst, p as AnyParamRef, ut as LoweredStatement } from "./types-
|
|
2
|
-
import "./ddl-types-
|
|
1
|
+
import { m as AnyQueryAst, p as AnyParamRef, ut as LoweredStatement } from "./types-ZzeQKmYD-PJlaIsww.mjs";
|
|
2
|
+
import "./ddl-types-CBTOCoND-Ct-Dz4gJ.mjs";
|
|
3
3
|
import { ContractMarkerRecord, JsonValue } from "@prisma/orm-framework/contract/types";
|
|
4
4
|
import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -280,4 +280,4 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
|
|
|
280
280
|
declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
|
|
281
281
|
//#endregion
|
|
282
282
|
export { sqlTextDecode as $, SqlTimestampCodec as A, sqlCharEncode as B, SqlFloatDescriptor as C, SqlStatementStats as D, SqlQueryable as E, collectOrderedParamRefs as F, sqlFloatDescriptor as G, sqlFloatColumn as H, compact as I, sqlIntColumn as J, sqlFloatEncode as K, sqlCharColumn as L, SqlTransaction as M, SqlVarcharCodec as N, SqlTextCodec as O, SqlVarcharDescriptor as P, sqlTextColumn as Q, sqlCharDecode as R, SqlFloatCodec as S, SqlIntDescriptor as T, sqlFloatDecode as U, sqlCharRenderOutputType as V, sqlFloatDecodeJson as W, sqlIntDescriptor as X, sqlIntDecode as Y, sqlIntEncode as Z, SqlConnection as _, LowererContext as a, sqlTimestampDescriptor as at, SqlExecuteRequest as b, PreparedStatementHandle as c, sqlTimestampRenderOutputType as ct, SQL_INT_CODEC_ID as d, sqlVarcharDescriptor as dt, sqlTextDescriptor as et, SQL_TEXT_CODEC_ID as f, sqlVarcharEncode as ft, SqlCharDescriptor as g, SqlCharCodec as h, Lowerer as i, sqlTimestampDecodeJson as it, SqlTimestampDescriptor as j, SqlTextDescriptor as k, SQL_CHAR_CODEC_ID as l, sqlVarcharColumn as lt, SQL_VARCHAR_CODEC_ID as m, AdapterProfile as n, sqlTimestampColumn as nt, MarkerReadResult as o, sqlTimestampEncode as ot, SQL_TIMESTAMP_CODEC_ID as p, sqlVarcharRenderOutputType as pt, sqlFloatEncodeJson as q, AdapterTarget as r, sqlTimestampDecode as rt, PreparedExecuteRequest as s, sqlTimestampEncodeJson as st, Adapter as t, sqlTextEncode as tt, SQL_FLOAT_CODEC_ID as u, sqlVarcharDecode as ut, SqlDriver as v, SqlIntCodec as w, SqlExplainResult as x, SqlDriverState as y, sqlCharDescriptor as z };
|
|
283
|
-
//# sourceMappingURL=ast-
|
|
283
|
+
//# sourceMappingURL=ast-BwBkpAM7.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-
|
|
1
|
+
{"version":3,"file":"ast-BwBkpAM7.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;;;;;;;;UAcU;EACR;EACA,IAAI;;UAEI;WACC;WACA;WACA,0BAA0B;;UAE3B,+BAA+B;WAC9B,yBAAyB;;UAE1B;WACC;;UAED,iBAAiB,MAAM;WACtB,MAAM,cAAc;;KAE1B;UACK,UAAU,yBAAyB;WAClC,QAAQ;EACjB,QAAQ,SAAS,WAAW;EAC5B,qBAAqB,QAAQ;EAC7B,SAAS;;UAED,sBAAsB;EAC9B,oBAAoB,QAAQ;;;;;;;EAO5B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAwBX,QAAQ,mBAAmB;;UAEnB,uBAAuB;EAC/B,UAAU;EACV,YAAY;;UAEJ;EACR,MAAM,MAAM,yBAAyB,SAAS,oBAAoB,cAAc;EAChF,QAAQ,SAAS,oBAAoB,QAAQ;EAC7C,SAAS,SAAS,oBAAoB,QAAQ;;;;KAI3C;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ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4M.mjs";
|
|
2
2
|
import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
//#region ../../../2-sql/9-family/dist/authoring-type-constructors-Blqoa2Ua.mjs
|
|
@@ -313,4 +313,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
|
|
|
313
313
|
//#endregion
|
|
314
314
|
export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringFieldPresets as t };
|
|
315
315
|
|
|
316
|
-
//# sourceMappingURL=authoring-type-constructors-Blqoa2Ua-
|
|
316
|
+
//# sourceMappingURL=authoring-type-constructors-Blqoa2Ua-BR5-FhUN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-type-constructors-Blqoa2Ua-DymjrX_a.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-Blqoa2Ua.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { blindCast } from \"@internal/utils/casts\";\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-Blqoa2Ua.mjs.map"],"mappings":";;;;AAGA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,eAAe,OAAO,QAAQ,MAAM,UAAU,GAAG;GACxE,IAAI;GACJ,IAA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N,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
|
|
1
|
+
{"version":3,"file":"authoring-type-constructors-Blqoa2Ua-BR5-FhUN.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-Blqoa2Ua.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { blindCast } from \"@internal/utils/casts\";\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-Blqoa2Ua.mjs.map"],"mappings":";;;;AAGA,MAAM,uBAAuB,EAA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,OAAO;KACP,MAAM,CAAC,MAAM;KACb,SAAS;IACV,EAAE;IACF,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;KACJ,QAAQ,EAAE,MAAM;MACf,MAAM;MACN,OAAO;MACP,MAAM,CAAC,MAAM;KACd,EAAE;IACH,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;CACD;AACD;AAGA,MAAM,0BAA0B,EAAE,KAAK,EAAE,QAAQ;CAChD,MAAM;CACN,MAAM,CAAC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
|
package/dist/builder.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as Expression, u as ScopeField } from "./expression-
|
|
2
|
-
import { c as GroupedQuery, d as QueryContext, f as ResolveRow, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, v as TableProxy, x as UpdateQuery } from "./db-
|
|
1
|
+
import { a as Expression, u as ScopeField } from "./expression-X88ppPyv.mjs";
|
|
2
|
+
import { c as GroupedQuery, d as QueryContext, f as ResolveRow, h as Subquery, i as DeleteQuery, l as InsertQuery, m as SelectQuery, o as Functions, p as Scope, r as Db, s as GatedMethod, t as AggregateFunctions, v as TableProxy, x as UpdateQuery } from "./db-C5jmOFPM-DeJH09un.mjs";
|
|
3
3
|
export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as SqlStorage } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { i as SqlOperationEntry } from "./index-
|
|
4
|
-
import { s as AnyExpression } from "./types-
|
|
5
|
-
import "./ast-
|
|
6
|
-
import { a as Expression, o as RawCodecInferer, u as ScopeField } from "./expression-
|
|
7
|
-
import { a as FieldProxy, d as QueryContext, o as Functions, p as Scope, r as Db, t as AggregateFunctions, y as TableProxyContract } from "./db-
|
|
8
|
-
import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-
|
|
9
|
-
import "./query-lane-context-
|
|
1
|
+
import { c as SqlStorage } from "./sql-storage-DCUlYs47-Cosit03s.mjs";
|
|
2
|
+
import "./types-DuriYH5B.mjs";
|
|
3
|
+
import { i as SqlOperationEntry } from "./index-CwtBEMZr.mjs";
|
|
4
|
+
import { s as AnyExpression } from "./types-ZzeQKmYD-PJlaIsww.mjs";
|
|
5
|
+
import "./ast-BwBkpAM7.mjs";
|
|
6
|
+
import { a as Expression, o as RawCodecInferer, u as ScopeField } from "./expression-X88ppPyv.mjs";
|
|
7
|
+
import { a as FieldProxy, d as QueryContext, o as Functions, p as Scope, r as Db, t as AggregateFunctions, y as TableProxyContract } from "./db-C5jmOFPM-DeJH09un.mjs";
|
|
8
|
+
import { c as SqlAggregateDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-CONNlrCx-D2biFONs.mjs";
|
|
9
|
+
import "./query-lane-context-7V5_yUIr.mjs";
|
|
10
10
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
11
11
|
import { CodecRef } from "@prisma/orm-framework/components/codec";
|
|
12
12
|
//#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.d.mts
|
|
@@ -1,61 +1,10 @@
|
|
|
1
|
-
import { C as LiteralExpr, D as OrExpr, F as SubqueryExpr, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, S as ListExpression, T as NullCheckExpr, _ as InsertAst, c as DeleteAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, y as JoinAst } from "./types-
|
|
1
|
+
import { C as LiteralExpr, D as OrExpr, F as SubqueryExpr, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, S as ListExpression, T as NullCheckExpr, V as isAggregateFn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, y as JoinAst } from "./types-CSP6WmWn-DVuxsZJW.mjs";
|
|
2
2
|
import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
|
|
3
|
-
import { a as toExpr, n as codecOf, r as createRawSql } from "./expression-
|
|
4
|
-
import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-
|
|
3
|
+
import { a as toExpr, n as codecOf, r as createRawSql } from "./expression-CYVKobXp.mjs";
|
|
4
|
+
import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-BQPj9q8O.mjs";
|
|
5
5
|
import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
|
|
6
6
|
//#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
|
|
7
7
|
/**
|
|
8
|
-
* 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.
|
|
9
|
-
*
|
|
10
|
-
* `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`.
|
|
11
|
-
*
|
|
12
|
-
* `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.
|
|
13
|
-
*/
|
|
14
|
-
var ExpressionImpl = class {
|
|
15
|
-
ast;
|
|
16
|
-
projectionAst;
|
|
17
|
-
returnType;
|
|
18
|
-
codec;
|
|
19
|
-
constructor(ast, returnType, codec, projectionAst) {
|
|
20
|
-
this.ast = ast;
|
|
21
|
-
this.returnType = returnType;
|
|
22
|
-
this.codec = codec;
|
|
23
|
-
this.projectionAst = projectionAst;
|
|
24
|
-
}
|
|
25
|
-
buildAst() {
|
|
26
|
-
return this.ast;
|
|
27
|
-
}
|
|
28
|
-
buildProjectionAst() {
|
|
29
|
-
return this.projectionAst ?? this.ast;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* 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.
|
|
34
|
-
*/
|
|
35
|
-
function projectionAstOf(expr) {
|
|
36
|
-
return expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();
|
|
37
|
-
}
|
|
38
|
-
function createFieldProxy(scope) {
|
|
39
|
-
return new Proxy({}, { get(_target, prop) {
|
|
40
|
-
if (Object.hasOwn(scope.topLevel, prop)) {
|
|
41
|
-
const topField = scope.topLevel[prop];
|
|
42
|
-
if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);
|
|
43
|
-
}
|
|
44
|
-
if (Object.hasOwn(scope.namespaces, prop)) {
|
|
45
|
-
const nsFields = scope.namespaces[prop];
|
|
46
|
-
if (nsFields) return createNamespaceProxy(prop, nsFields);
|
|
47
|
-
}
|
|
48
|
-
} });
|
|
49
|
-
}
|
|
50
|
-
function createNamespaceProxy(namespaceName, fields) {
|
|
51
|
-
return new Proxy({}, { get(_target, prop) {
|
|
52
|
-
if (Object.hasOwn(fields, prop)) {
|
|
53
|
-
const field = fields[prop];
|
|
54
|
-
if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);
|
|
55
|
-
}
|
|
56
|
-
} });
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
8
|
* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**
|
|
60
9
|
*
|
|
61
10
|
* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes
|
|
@@ -134,6 +83,105 @@ function structuredError(code, message, options) {
|
|
|
134
83
|
...ifDefined("docsUrl", options?.docsUrl)
|
|
135
84
|
});
|
|
136
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* 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.
|
|
88
|
+
*
|
|
89
|
+
* `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`.
|
|
90
|
+
*
|
|
91
|
+
* `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.
|
|
92
|
+
*/
|
|
93
|
+
var ExpressionImpl = class {
|
|
94
|
+
ast;
|
|
95
|
+
projectionAst;
|
|
96
|
+
returnType;
|
|
97
|
+
codec;
|
|
98
|
+
constructor(ast, returnType, codec, projectionAst) {
|
|
99
|
+
this.ast = ast;
|
|
100
|
+
this.returnType = returnType;
|
|
101
|
+
this.codec = codec;
|
|
102
|
+
this.projectionAst = projectionAst;
|
|
103
|
+
}
|
|
104
|
+
buildAst() {
|
|
105
|
+
return this.ast;
|
|
106
|
+
}
|
|
107
|
+
buildProjectionAst() {
|
|
108
|
+
return this.projectionAst ?? this.ast;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* 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.
|
|
113
|
+
*
|
|
114
|
+
* 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).
|
|
115
|
+
*/
|
|
116
|
+
var ProjectionOnlyExpressionImpl = class extends ExpressionImpl {
|
|
117
|
+
operation;
|
|
118
|
+
constructor(operation, lowered, returnType) {
|
|
119
|
+
super(lowered, returnType, void 0, lowered);
|
|
120
|
+
this.operation = operation;
|
|
121
|
+
}
|
|
122
|
+
buildAst() {
|
|
123
|
+
throw 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.`, {
|
|
124
|
+
why: "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.",
|
|
125
|
+
fix: `Project '${this.operation}' in a select and filter or order on the projected value, or use an operation from the SQL aggregate alphabet.`,
|
|
126
|
+
meta: { operation: this.operation }
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* 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.
|
|
132
|
+
*/
|
|
133
|
+
function projectionAstOf(expr) {
|
|
134
|
+
return expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();
|
|
135
|
+
}
|
|
136
|
+
function createFieldProxy(scope) {
|
|
137
|
+
return new Proxy({}, { get(_target, prop) {
|
|
138
|
+
if (Object.hasOwn(scope.topLevel, prop)) {
|
|
139
|
+
const topField = scope.topLevel[prop];
|
|
140
|
+
if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);
|
|
141
|
+
}
|
|
142
|
+
if (Object.hasOwn(scope.namespaces, prop)) {
|
|
143
|
+
const nsFields = scope.namespaces[prop];
|
|
144
|
+
if (nsFields) return createNamespaceProxy(prop, nsFields);
|
|
145
|
+
}
|
|
146
|
+
} });
|
|
147
|
+
}
|
|
148
|
+
function createNamespaceProxy(namespaceName, fields) {
|
|
149
|
+
return new Proxy({}, { get(_target, prop) {
|
|
150
|
+
if (Object.hasOwn(fields, prop)) {
|
|
151
|
+
const field = fields[prop];
|
|
152
|
+
if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);
|
|
153
|
+
}
|
|
154
|
+
} });
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* A bug in Prisma Next, not a user error. Never catch this except at the
|
|
158
|
+
* outermost boundary for crash reporting — an InternalError means an invariant
|
|
159
|
+
* broke and the process cannot reliably continue. User-facing failures use
|
|
160
|
+
* `structuredError` with a dotted code instead.
|
|
161
|
+
*/
|
|
162
|
+
var InternalError = class extends Error {
|
|
163
|
+
isPrismaInternalError = true;
|
|
164
|
+
constructor(message, options) {
|
|
165
|
+
super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
166
|
+
this.name = "InternalError";
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Asserts that a value is defined (not null or undefined).
|
|
171
|
+
* Use for invariants where the value should always exist at runtime.
|
|
172
|
+
*
|
|
173
|
+
* @throws Error if value is null or undefined
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const table = storage.namespaces[namespaceId].entries.table[tableName];
|
|
178
|
+
* assertDefined(table, `Table "${tableName}" not found`);
|
|
179
|
+
* // table is now narrowed to non-nullable
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
function assertDefined(value, message) {
|
|
183
|
+
if (value === null || value === void 0) throw new InternalError(message);
|
|
184
|
+
}
|
|
137
185
|
const BOOL_FIELD = {
|
|
138
186
|
codecId: "pg/bool@1",
|
|
139
187
|
nullable: false
|
|
@@ -210,30 +258,42 @@ function inOrNotIn(expr, valuesOrSubquery, op) {
|
|
|
210
258
|
* invocation, instead of executing SQL whose result no declaration types or
|
|
211
259
|
* decodes — SQLite's `sum` over text, which reads whatever leading numbers the
|
|
212
260
|
* rows happened to hold, is the shape of value that path would hand back.
|
|
261
|
+
*
|
|
262
|
+
* An operation outside the SQL aggregate alphabet has no plain form at all:
|
|
263
|
+
* its whole expression is what the lowering hook builds, so the result is
|
|
264
|
+
* projection-only and refuses predicate and ordering positions.
|
|
213
265
|
*/
|
|
214
|
-
function aggregate(aggregates,
|
|
266
|
+
function aggregate(aggregates, operation, expr) {
|
|
215
267
|
const field = expr?.returnType;
|
|
216
268
|
const inputCodec = field === void 0 ? void 0 : field.codec ?? { codecId: field.codecId };
|
|
217
|
-
const resolved = aggregates.resolve(
|
|
218
|
-
if (resolved === void 0) throw structuredError("ORM.AGGREGATE_UNSUPPORTED", inputCodec === void 0 ? `The composed target declares no '${
|
|
269
|
+
const resolved = aggregates.resolve(operation, inputCodec);
|
|
270
|
+
if (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}'.`, {
|
|
219
271
|
why: "An aggregate result decodes through the codec its target declares; an undeclared pair has no declared result to type or decode.",
|
|
220
|
-
fix: `Aggregate an input the target declares '${
|
|
272
|
+
fix: `Aggregate an input the target declares '${operation}' for, or contribute an aggregate descriptor for this pair.`,
|
|
221
273
|
meta: {
|
|
222
|
-
operation
|
|
274
|
+
operation,
|
|
223
275
|
...ifDefined("inputCodecId", inputCodec?.codecId)
|
|
224
276
|
}
|
|
225
277
|
});
|
|
226
278
|
const inputAst = expr?.buildAst();
|
|
227
|
-
const
|
|
279
|
+
const returnType = {
|
|
280
|
+
codecId: resolved.output.codecId,
|
|
281
|
+
nullable: resolved.nullable,
|
|
282
|
+
codec: resolved.output
|
|
283
|
+
};
|
|
284
|
+
if (!isAggregateFn(operation)) {
|
|
285
|
+
assertDefined(resolved.lower, `registry resolved '${operation}' outside the SQL aggregate alphabet without a lowering hook`);
|
|
286
|
+
return new ProjectionOnlyExpressionImpl(operation, resolved.lower({
|
|
287
|
+
expr: inputAst,
|
|
288
|
+
inputCodec
|
|
289
|
+
}), returnType);
|
|
290
|
+
}
|
|
291
|
+
const ast = new AggregateExpr(operation, inputAst);
|
|
228
292
|
const projectionAst = resolved.lower?.({
|
|
229
293
|
expr: inputAst,
|
|
230
294
|
inputCodec
|
|
231
295
|
});
|
|
232
|
-
return new ExpressionImpl(ast,
|
|
233
|
-
codecId: resolved.output.codecId,
|
|
234
|
-
nullable: resolved.nullable,
|
|
235
|
-
codec: resolved.output
|
|
236
|
-
}, void 0, projectionAst);
|
|
296
|
+
return new ExpressionImpl(ast, returnType, void 0, projectionAst);
|
|
237
297
|
}
|
|
238
298
|
function createBuiltinFunctions(rawCodecInferer) {
|
|
239
299
|
return {
|
|
@@ -253,20 +313,23 @@ function createBuiltinFunctions(rawCodecInferer) {
|
|
|
253
313
|
};
|
|
254
314
|
}
|
|
255
315
|
/**
|
|
256
|
-
* The aggregate implementations,
|
|
316
|
+
* The aggregate implementations, one per operation the registry contributes,
|
|
317
|
+
* erased.
|
|
257
318
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
319
|
+
* The method set is the registry's operation vocabulary — the runtime mirror
|
|
320
|
+
* of the contract's emitted aggregate map, both settled from the same
|
|
321
|
+
* contributed descriptors. What each returns is the contract's answer — a
|
|
322
|
+
* function of the target's map and the input's codec — which no runtime value
|
|
323
|
+
* can state. The typed surface is `AggregateFunctions<QC>`, applied where
|
|
324
|
+
* these are handed out.
|
|
261
325
|
*/
|
|
262
326
|
function createAggregateOnlyFunctions(aggregates) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
};
|
|
327
|
+
const methods = /* @__PURE__ */ new Map();
|
|
328
|
+
for (const { operation } of aggregates.values()) {
|
|
329
|
+
if (methods.has(operation)) continue;
|
|
330
|
+
methods.set(operation, (expr) => aggregate(aggregates, operation, expr));
|
|
331
|
+
}
|
|
332
|
+
return Object.fromEntries(methods);
|
|
270
333
|
}
|
|
271
334
|
function createFunctions(operations, rawCodecInferer) {
|
|
272
335
|
const builtins = createBuiltinFunctions(rawCodecInferer);
|
|
@@ -280,8 +343,7 @@ function createAggregateFunctions(operations, rawCodecInferer, aggregateRegistry
|
|
|
280
343
|
const baseFns = createFunctions(operations, rawCodecInferer);
|
|
281
344
|
const aggregates = createAggregateOnlyFunctions(aggregateRegistry);
|
|
282
345
|
return new Proxy({}, { get(_target, prop) {
|
|
283
|
-
|
|
284
|
-
if (agg) return agg;
|
|
346
|
+
if (Object.hasOwn(aggregates, prop)) return aggregates[prop];
|
|
285
347
|
return baseFns[prop];
|
|
286
348
|
} });
|
|
287
349
|
}
|