@prisma/orm-family-sql 8.0.0-rc.1-dev.30 → 8.0.0-rc.1-dev.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ast-Px7aAd_0.d.mts → ast-DRbUiQ-9.d.mts} +3 -3
- package/dist/{ast-Px7aAd_0.d.mts.map → ast-DRbUiQ-9.d.mts.map} +1 -1
- package/dist/authored-check-naming-BWBe-PVE.d.mts +30 -0
- package/dist/authored-check-naming-BWBe-PVE.d.mts.map +1 -0
- package/dist/authored-check-naming-Hf9990DV.mjs +47 -0
- package/dist/authored-check-naming-Hf9990DV.mjs.map +1 -0
- package/dist/{authoring-type-constructors-Blqoa2Ua-OP7GsSm3.mjs → authoring-type-constructors-Blqoa2Ua-CvHn00xx.mjs} +2 -2
- package/dist/{authoring-type-constructors-Blqoa2Ua-OP7GsSm3.mjs.map → authoring-type-constructors-Blqoa2Ua-CvHn00xx.mjs.map} +1 -1
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +9 -9
- package/dist/builder__runtime.mjs +1 -1
- package/dist/builder__types.d.mts +2 -2
- package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts +44 -0
- package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts.map +1 -0
- package/dist/{codec-descriptor-registry-DMUcCfyb.mjs → codec-descriptor-registry-N0dhtKaH.mjs} +2 -2
- package/dist/{codec-descriptor-registry-DMUcCfyb.mjs.map → codec-descriptor-registry-N0dhtKaH.mjs.map} +1 -1
- package/dist/{config-types-D7vjxNMf.mjs → config-types-B6cQRwJw.mjs} +2 -2
- package/dist/{config-types-D7vjxNMf.mjs.map → config-types-B6cQRwJw.mjs.map} +1 -1
- package/dist/{config-types-ktywvY7L.d.mts → config-types-D9fdKG3g.d.mts} +4 -4
- package/dist/{config-types-ktywvY7L.d.mts.map → config-types-D9fdKG3g.d.mts.map} +1 -1
- package/dist/{contract-builder-Dqnem9IW.d.mts → contract-builder-CG_tGDbB.d.mts} +45 -10
- package/dist/contract-builder-CG_tGDbB.d.mts.map +1 -0
- package/dist/{contract-builder-BFN7WSed.mjs → contract-builder-vdfvmuiO.mjs} +25 -5
- package/dist/contract-builder-vdfvmuiO.mjs.map +1 -0
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-psl.d.mts +3 -3
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__provider.d.mts +2 -2
- package/dist/contract-psl__provider.mjs +3 -3
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +5 -5
- package/dist/contract-ts.mjs +4 -4
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +4 -4
- package/dist/contract-ts__contract-builder.mjs +3 -3
- package/dist/{contract-view-C2LYZzWr.d.mts → contract-view-CPHxoAEX.d.mts} +2 -2
- package/dist/{contract-view-C2LYZzWr.d.mts.map → contract-view-CPHxoAEX.d.mts.map} +1 -1
- package/dist/contract.d.mts +17 -15
- package/dist/contract.mjs +10 -9
- package/dist/contract__authored-check-naming.d.mts +2 -0
- package/dist/contract__authored-check-naming.mjs +2 -0
- package/dist/contract__contract-view.d.mts +1 -1
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.mjs +1 -1
- package/dist/contract__index-naming.d.mts +1 -1
- package/dist/contract__index-naming.mjs +1 -1
- package/dist/contract__index-type-validation.d.mts +1 -1
- package/dist/contract__resolve-storage-table.d.mts +1 -1
- package/dist/contract__types.d.mts +7 -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-f9B6b5c2.mjs → control-DAkNosoF.mjs} +9 -9
- package/dist/{control-f9B6b5c2.mjs.map → control-DAkNosoF.mjs.map} +1 -1
- package/dist/{control-0OFuH6HK.d.mts → control-DI9DC2AS.d.mts} +14 -14
- package/dist/{control-0OFuH6HK.d.mts.map → control-DI9DC2AS.d.mts.map} +1 -1
- package/dist/control-adapter-BdOcXTOm.d.mts +1 -0
- package/dist/{control-adapter-C99J7aEF-B4MyB0B0.d.mts → control-adapter-C99J7aEF-DsxImHyk.d.mts} +8 -8
- package/dist/{control-adapter-C99J7aEF-B4MyB0B0.d.mts.map → control-adapter-C99J7aEF-DsxImHyk.d.mts.map} +1 -1
- package/dist/{db-C5jmOFPM-BRijskUO.d.mts → db-C5jmOFPM-BGm-QfKd.d.mts} +9 -9
- package/dist/{db-C5jmOFPM-BRijskUO.d.mts.map → db-C5jmOFPM-BGm-QfKd.d.mts.map} +1 -1
- package/dist/{ddl-types-CnLSuwXa-Dsz9N7Wm.d.mts → ddl-types-CnLSuwXa-Bv46yIe9.d.mts} +3 -3
- package/dist/{ddl-types-CnLSuwXa-Dsz9N7Wm.d.mts.map → ddl-types-CnLSuwXa-Bv46yIe9.d.mts.map} +1 -1
- package/dist/{derived-checks-CmJgg-N0-CugkINPW.mjs → derived-checks-DFMRmiAu-8jmha26I.mjs} +69 -22
- package/dist/derived-checks-DFMRmiAu-8jmha26I.mjs.map +1 -0
- package/dist/{derived-checks-DPdD01O0-CE4vJKET.d.mts → derived-checks-DPdD01O0-DGqOFjs6.d.mts} +3 -3
- package/dist/{derived-checks-DPdD01O0-CE4vJKET.d.mts.map → derived-checks-DPdD01O0-DGqOFjs6.d.mts.map} +1 -1
- package/dist/{diff-dX8KnmWc.d.mts → diff-DVvZXmFv.d.mts} +8 -8
- package/dist/{diff-dX8KnmWc.d.mts.map → diff-DVvZXmFv.d.mts.map} +1 -1
- package/dist/{dist-DtLVFgdI.mjs → dist-ZK6oeI5e.mjs} +2 -2
- package/dist/{dist-DtLVFgdI.mjs.map → dist-ZK6oeI5e.mjs.map} +1 -1
- package/dist/{entity-kinds-DZzdcuU5.d.mts → entity-kinds-B5cUFU22.d.mts} +5 -4
- package/dist/entity-kinds-B5cUFU22.d.mts.map +1 -0
- package/dist/{entity-kinds-CCzdAMq3-x9-uzHu1.mjs → entity-kinds-D7vwoN_T-CCBwFJy0.mjs} +4 -4
- package/dist/{entity-kinds-CCzdAMq3-x9-uzHu1.mjs.map → entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map} +1 -1
- package/dist/{expression-E67TGFZA.d.mts → expression-D7H1kyVG.d.mts} +5 -5
- package/dist/{expression-E67TGFZA.d.mts.map → expression-D7H1kyVG.d.mts.map} +1 -1
- package/dist/{factories-C8VyKQ90.d.mts → factories-P3qBQhO-.d.mts} +4 -4
- package/dist/{factories-C8VyKQ90.d.mts.map → factories-P3qBQhO-.d.mts.map} +1 -1
- package/dist/{factories-BIzyHng2.mjs → factories-SVor5xIT.mjs} +3 -3
- package/dist/{factories-BIzyHng2.mjs.map → factories-SVor5xIT.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-ziwobURR.mjs → foreign-key-materialization-DLOi1Ps0.mjs} +2 -2
- package/dist/{foreign-key-materialization-ziwobURR.mjs.map → foreign-key-materialization-DLOi1Ps0.mjs.map} +1 -1
- package/dist/{foreign-key-materialization-CDDVZI8R.d.mts → foreign-key-materialization-DO9dvG7v.d.mts} +2 -2
- package/dist/{foreign-key-materialization-CDDVZI8R.d.mts.map → foreign-key-materialization-DO9dvG7v.d.mts.map} +1 -1
- package/dist/{index-DbDTloZS.d.mts → index-C5I8D-MB.d.mts} +3 -3
- package/dist/{index-DbDTloZS.d.mts.map → index-C5I8D-MB.d.mts.map} +1 -1
- package/dist/{index-BIj_Z-Yu.d.mts → index-Ddquditw.d.mts} +16 -16
- package/dist/{index-BIj_Z-Yu.d.mts.map → index-Ddquditw.d.mts.map} +1 -1
- package/dist/{index-naming-BQXnMcXt.d.mts → index-naming-Ct65z5Xk.d.mts} +7 -7
- package/dist/{index-naming-BQXnMcXt.d.mts.map → index-naming-Ct65z5Xk.d.mts.map} +1 -1
- package/dist/{index-naming-BoGBcMmI-CoehgjMK.mjs → index-naming-DREt6js7-CRH27yUv.mjs} +15 -13
- package/dist/index-naming-DREt6js7-CRH27yUv.mjs.map +1 -0
- package/dist/{index-type-validation-DS9n07WO.d.mts → index-type-validation-CZ5L2lli.d.mts} +3 -3
- package/dist/{index-type-validation-DS9n07WO.d.mts.map → index-type-validation-CZ5L2lli.d.mts.map} +1 -1
- package/dist/{interpreter-BDZ_Y5U--CMEJIQ40.mjs → interpreter-DaBA2fm--FFkq_gGd.mjs} +75 -5
- package/dist/interpreter-DaBA2fm--FFkq_gGd.mjs.map +1 -0
- package/dist/{ir-CVhRa-4t.d.mts → ir-Bghjt-FG.d.mts} +3 -3
- package/dist/{ir-CVhRa-4t.d.mts.map → ir-Bghjt-FG.d.mts.map} +1 -1
- package/dist/lane-query-builder.d.mts +4 -4
- package/dist/{middleware-Bp5oIYM0-9a28aLnt.d.mts → middleware-Bp5oIYM0-Ek8bISDH.d.mts} +2 -2
- package/dist/{middleware-Bp5oIYM0-9a28aLnt.d.mts.map → middleware-Bp5oIYM0-Ek8bISDH.d.mts.map} +1 -1
- package/dist/middleware-aFpB1ZhU.d.mts +1 -0
- package/dist/{migration-C8MAouav.d.mts → migration-Dtymew3g.d.mts} +4 -4
- package/dist/{migration-C8MAouav.d.mts.map → migration-Dtymew3g.d.mts.map} +1 -1
- package/dist/{naming-BsvzQPOq-qOWmknyp.d.mts → naming-CV9j2pXl-KARaDReS.d.mts} +16 -3
- package/dist/naming-CV9j2pXl-KARaDReS.d.mts.map +1 -0
- package/dist/{naming-BWkuWJJK-zuGIIJ49.mjs → naming-DKr4TJd7-Cszhq9RV.mjs} +26 -4
- package/dist/naming-DKr4TJd7-Cszhq9RV.mjs.map +1 -0
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +11 -11
- package/dist/orm-client.mjs +1 -1
- package/dist/{plan-DfLDIdep-CoshEetE.d.mts → plan-DfLDIdep-6R1mLkcW.d.mts} +4 -4
- package/dist/{plan-DfLDIdep-CoshEetE.d.mts.map → plan-DfLDIdep-6R1mLkcW.d.mts.map} +1 -1
- package/dist/plan-HWPzzUxh.d.mts +2 -0
- package/dist/{psl-infer-DmFgn-Ub.d.mts → psl-infer-CCAD6FWA.d.mts} +3 -3
- package/dist/{psl-infer-DmFgn-Ub.d.mts.map → psl-infer-CCAD6FWA.d.mts.map} +1 -1
- package/dist/{psl-infer-Z4wA2xpx.mjs → psl-infer-YhbKkybN.mjs} +2 -2
- package/dist/{psl-infer-Z4wA2xpx.mjs.map → psl-infer-YhbKkybN.mjs.map} +1 -1
- package/dist/{query-lane-context-DyDSQVS--ByM80KpV.d.mts → query-lane-context-DyDSQVS--CyCznt67.d.mts} +5 -5
- package/dist/{query-lane-context-DyDSQVS--ByM80KpV.d.mts.map → query-lane-context-DyDSQVS--CyCznt67.d.mts.map} +1 -1
- package/dist/query-lane-context-qfJzguc9.d.mts +1 -0
- package/dist/relational-core.d.mts +11 -11
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__ast.d.mts +3 -3
- package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__contract-free.d.mts +3 -3
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__plan.d.mts +3 -3
- package/dist/relational-core__query-lane-context.d.mts +2 -2
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{resolve-storage-table-DFhpOR0X.d.mts → resolve-storage-table-Nyrgk4h8.d.mts} +3 -3
- package/dist/{resolve-storage-table-DFhpOR0X.d.mts.map → resolve-storage-table-Nyrgk4h8.d.mts.map} +1 -1
- package/dist/{runtime-VGVRdwBD.d.mts → runtime-CjXCGPS4.d.mts} +3 -3
- package/dist/{runtime-VGVRdwBD.d.mts.map → runtime-CjXCGPS4.d.mts.map} +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-differ-DpG_gnur-B7QINE8f.d.mts → schema-differ-DpG_gnur-DFAtGezx.d.mts} +5 -5
- package/dist/{schema-differ-DpG_gnur-B7QINE8f.d.mts.map → schema-differ-DpG_gnur-DFAtGezx.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-U3MX28Zu.mjs → schema-verify-C_PEdlAr-Dxxjm6EM.mjs} +2 -2
- package/dist/{schema-verify-C_PEdlAr-U3MX28Zu.mjs.map → schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map} +1 -1
- package/dist/{serialized-index-D9YgVREe-KaLdoijn.d.mts → serialized-index-CrgG8ct1-DG3JpHc7.d.mts} +4 -4
- package/dist/serialized-index-CrgG8ct1-DG3JpHc7.d.mts.map +1 -0
- package/dist/{serialized-index-DMOkKJdP-JPETIsd7.mjs → serialized-index-nBTwanKy-_ddEK4tk.mjs} +5 -5
- package/dist/{serialized-index-DMOkKJdP-JPETIsd7.mjs.map → serialized-index-nBTwanKy-_ddEK4tk.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs → sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs} +5 -5
- package/dist/{sql-contract-serializer-2oBWuxTe-US2zhmuA.mjs.map → sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map} +1 -1
- package/dist/{sql-execution-plan-qxvHnFcA-DdIwfSmv.d.mts → sql-execution-plan-qxvHnFcA-HjRSS3l9.d.mts} +2 -2
- package/dist/{sql-execution-plan-qxvHnFcA-DdIwfSmv.d.mts.map → sql-execution-plan-qxvHnFcA-HjRSS3l9.d.mts.map} +1 -1
- package/dist/{sql-index-ByAAE7K8-C1h4IS27.d.mts → sql-index-ByAAE7K8-DKj2V86p.d.mts} +2 -2
- package/dist/{sql-index-ByAAE7K8-C1h4IS27.d.mts.map → sql-index-ByAAE7K8-DKj2V86p.d.mts.map} +1 -1
- package/dist/{sql-storage-CySVsLrY-e9C5Gszx.d.mts → sql-storage-8LqxeLAY-DH4DdUXx.d.mts} +4 -4
- package/dist/{sql-storage-CySVsLrY-e9C5Gszx.d.mts.map → sql-storage-8LqxeLAY-DH4DdUXx.d.mts.map} +1 -1
- package/dist/{storage-table-BLcRrDzz-D4JOM8FC.d.mts → storage-table-DSeWszOL-CI-cItEK.d.mts} +6 -44
- package/dist/storage-table-DSeWszOL-CI-cItEK.d.mts.map +1 -0
- package/dist/{storage-table-D8o37IKw-bbcikEu-.mjs → storage-table-ZzbR-xzQ-BRoTQE_2.mjs} +4 -4
- package/dist/{storage-table-D8o37IKw-bbcikEu-.mjs.map → storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map} +1 -1
- package/dist/{types-CRlrNF8_-xtE1f_Ya.mjs → types-4YenawkP-CwaaZSid.mjs} +3 -3
- package/dist/{types-CRlrNF8_-xtE1f_Ya.mjs.map → types-4YenawkP-CwaaZSid.mjs.map} +1 -1
- package/dist/types-4u1EPYY6.d.mts +1 -0
- package/dist/{types-C89S13jo-CGy-V60b.d.mts → types-BDUG29Df-LE85dIXP.d.mts} +7 -6
- package/dist/types-BDUG29Df-LE85dIXP.d.mts.map +1 -0
- package/dist/{types-CLN9Y3BH-B9xrXW2L.d.mts → types-CLN9Y3BH-BHUrV7MD.d.mts} +10 -10
- package/dist/{types-CLN9Y3BH-B9xrXW2L.d.mts.map → types-CLN9Y3BH-BHUrV7MD.d.mts.map} +1 -1
- package/dist/{types-DYXr7yN6.mjs → types-CUsJrvEl.mjs} +2 -2
- package/dist/{types-DYXr7yN6.mjs.map → types-CUsJrvEl.mjs.map} +1 -1
- package/dist/types-Dwcw0F8X.d.mts +1 -0
- package/dist/{types-IqZMLrFC-Sr3TZmGu.d.mts → types-IqZMLrFC-Dk3bHKmk.d.mts} +9 -9
- package/dist/{types-IqZMLrFC-Sr3TZmGu.d.mts.map → types-IqZMLrFC-Dk3bHKmk.d.mts.map} +1 -1
- package/dist/{types-D6ST3Gkf.d.mts → types-UcHa2cTe.d.mts} +7 -6
- package/dist/types-UcHa2cTe.d.mts.map +1 -0
- package/dist/{types-H7xjfrKl-CHqi_h5i.d.mts → types-YStFFkKs-D9UAmnON.d.mts} +3 -3
- package/dist/{types-H7xjfrKl-CHqi_h5i.d.mts.map → types-YStFFkKs-D9UAmnON.d.mts.map} +1 -1
- package/dist/{types-ZzeQKmYD-D1hXGIgd.d.mts → types-ZzeQKmYD-kI_QWHEx.d.mts} +2 -2
- package/dist/{types-ZzeQKmYD-D1hXGIgd.d.mts.map → types-ZzeQKmYD-kI_QWHEx.d.mts.map} +1 -1
- package/dist/{validators-DQHTuehE.d.mts → validators-Belo8QqM.d.mts} +3 -3
- package/dist/{validators-DQHTuehE.d.mts.map → validators-Belo8QqM.d.mts.map} +1 -1
- package/dist/{validators-Bvxcp487.mjs → validators-CrWD6bSP.mjs} +0 -0
- package/dist/{validators-Bvxcp487.mjs.map → validators-CrWD6bSP.mjs.map} +1 -1
- package/package.json +19 -18
- package/dist/contract-builder-BFN7WSed.mjs.map +0 -1
- package/dist/contract-builder-Dqnem9IW.d.mts.map +0 -1
- package/dist/control-adapter-CTyZpWUT.d.mts +0 -1
- package/dist/derived-checks-CmJgg-N0-CugkINPW.mjs.map +0 -1
- package/dist/entity-kinds-DZzdcuU5.d.mts.map +0 -1
- package/dist/index-naming-BoGBcMmI-CoehgjMK.mjs.map +0 -1
- package/dist/interpreter-BDZ_Y5U--CMEJIQ40.mjs.map +0 -1
- package/dist/middleware-Pe2hkf2T.d.mts +0 -1
- package/dist/naming-BWkuWJJK-zuGIIJ49.mjs.map +0 -1
- package/dist/naming-BsvzQPOq-qOWmknyp.d.mts.map +0 -1
- package/dist/plan-DduVZV0X.d.mts +0 -2
- package/dist/query-lane-context-DojOMvih.d.mts +0 -1
- package/dist/serialized-index-D9YgVREe-KaLdoijn.d.mts.map +0 -1
- package/dist/storage-table-BLcRrDzz-D4JOM8FC.d.mts.map +0 -1
- package/dist/types-C0QjlN2G.d.mts +0 -1
- package/dist/types-C89S13jo-CGy-V60b.d.mts.map +0 -1
- package/dist/types-D6ST3Gkf.d.mts.map +0 -1
- package/dist/types-yvAngq6d.d.mts +0 -1
package/dist/{foreign-key-materialization-ziwobURR.mjs → foreign-key-materialization-DLOi1Ps0.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as lowerAuthoredIndex } from "./index-naming-
|
|
1
|
+
import { n as lowerAuthoredIndex } from "./index-naming-DREt6js7-CRH27yUv.mjs";
|
|
2
2
|
//#region ../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs
|
|
3
3
|
/**
|
|
4
4
|
* The column-list keys (`"colA,colB"`, order preserved) a table's own
|
|
@@ -69,4 +69,4 @@ function materializeForeignKeysAndIndexes(tableName, foreignKeys, declaredIndexe
|
|
|
69
69
|
//#endregion
|
|
70
70
|
export { isBackedByColumnKeys as n, materializeForeignKeysAndIndexes as r, backingIndexColumnKeys as t };
|
|
71
71
|
|
|
72
|
-
//# sourceMappingURL=foreign-key-materialization-
|
|
72
|
+
//# sourceMappingURL=foreign-key-materialization-DLOi1Ps0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key-materialization-
|
|
1
|
+
{"version":3,"file":"foreign-key-materialization-DLOi1Ps0.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { n as lowerAuthoredIndex } from \"./index-naming-DREt6js7.mjs\";\n//#region src/foreign-key-materialization.ts\n/**\n* The column-list keys (`\"colA,colB\"`, order preserved) a table's own\n* indexes, unique constraints, and primary key already back. A foreign key\n* whose source columns join to one of these keys needs no separately\n* derived backing index.\n*\n* Shared by {@link isBackedByColumnKeys}'s callers: `materializeForeignKeysAndIndexes`\n* (deriving the discrete backing-index entities persisted at `contract emit`)\n* and the postgres PSL inferrer (deciding whether an introspected relation\n* needs an explicit `index: false`).\n*/\nfunction backingIndexColumnKeys(table) {\n\treturn [\n\t\t...table.indexes.flatMap((index) => index.columns !== void 0 ? [index.columns.join(\",\")] : []),\n\t\t...table.uniques.map((unique) => unique.columns.join(\",\")),\n\t\t...table.primaryKey ? [table.primaryKey.columns.join(\",\")] : []\n\t];\n}\n/**\n* Whether `columns`, in order, matches one of `backingKeys` (see\n* {@link backingIndexColumnKeys}). Order-sensitive: `(a, b)` does not\n* satisfy a backing index declared as `(b, a)`.\n*/\nfunction isBackedByColumnKeys(columns, backingKeys) {\n\treturn backingKeys.includes(columns.join(\",\"));\n}\n/**\n* Lowers a table's authored foreign keys into the discrete entities\n* `contract.json` persists: a `constraint: false` FK contributes no\n* `foreignKeys[]` entry, and an `index: true` FK whose columns aren't already\n* backed by a declared index/unique/primary-key contributes a wire-named\n* `indexes[]` entry (default prefix + content-hash wire name). Declared\n* indexes always survive unchanged; a second FK sharing already-synthesized\n* backing columns does not mint a duplicate index.\n*/\nfunction materializeForeignKeysAndIndexes(tableName, foreignKeys, declaredIndexes, uniques, primaryKey) {\n\tconst satisfiedIndexColumns = new Set(backingIndexColumnKeys({\n\t\tindexes: declaredIndexes,\n\t\tuniques,\n\t\tprimaryKey\n\t}));\n\tconst synthesizedIndexes = [];\n\tconst materializedForeignKeys = [];\n\tfor (const { constraint, index, ...reference } of foreignKeys) {\n\t\tif (constraint !== false) materializedForeignKeys.push(reference);\n\t\tif (index !== false) {\n\t\t\tconst key = reference.source.columns.join(\",\");\n\t\t\tif (!satisfiedIndexColumns.has(key)) {\n\t\t\t\tsynthesizedIndexes.push(lowerAuthoredIndex(tableName, {\n\t\t\t\t\tcolumns: reference.source.columns,\n\t\t\t\t\twhere: void 0,\n\t\t\t\t\tunique: void 0,\n\t\t\t\t\tmap: void 0,\n\t\t\t\t\tname: void 0,\n\t\t\t\t\ttype: void 0,\n\t\t\t\t\toptions: void 0\n\t\t\t\t}));\n\t\t\t\tsatisfiedIndexColumns.add(key);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tforeignKeys: materializedForeignKeys,\n\t\tindexes: [...declaredIndexes, ...synthesizedIndexes]\n\t};\n}\n//#endregion\nexport { backingIndexColumnKeys, isBackedByColumnKeys, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,uBAAuB,OAAO;CACtC,OAAO;EACN,GAAG,MAAM,QAAQ,SAAS,UAAU,MAAM,YAAY,KAAK,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;EAC7F,GAAG,MAAM,QAAQ,KAAK,WAAW,OAAO,QAAQ,KAAK,GAAG,CAAC;EACzD,GAAG,MAAM,aAAa,CAAC,MAAM,WAAW,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC;CAC/D;AACD;;;;;;AAMA,SAAS,qBAAqB,SAAS,aAAa;CACnD,OAAO,YAAY,SAAS,QAAQ,KAAK,GAAG,CAAC;AAC9C;;;;;;;;;;AAUA,SAAS,iCAAiC,WAAW,aAAa,iBAAiB,SAAS,YAAY;CACvG,MAAM,wBAAwB,IAAI,IAAI,uBAAuB;EAC5D,SAAS;EACT;EACA;CACD,CAAC,CAAC;CACF,MAAM,qBAAqB,CAAC;CAC5B,MAAM,0BAA0B,CAAC;CACjC,KAAK,MAAM,EAAE,YAAY,OAAO,GAAG,eAAe,aAAa;EAC9D,IAAI,eAAe,OAAO,wBAAwB,KAAK,SAAS;EAChE,IAAI,UAAU,OAAO;GACpB,MAAM,MAAM,UAAU,OAAO,QAAQ,KAAK,GAAG;GAC7C,IAAI,CAAC,sBAAsB,IAAI,GAAG,GAAG;IACpC,mBAAmB,KAAK,mBAAmB,WAAW;KACrD,SAAS,UAAU,OAAO;KAC1B,OAAO,KAAK;KACZ,QAAQ,KAAK;KACb,KAAK,KAAK;KACV,MAAM,KAAK;KACX,MAAM,KAAK;KACX,SAAS,KAAK;IACf,CAAC,CAAC;IACF,sBAAsB,IAAI,GAAG;GAC9B;EACD;CACD;CACA,OAAO;EACN,aAAa;EACb,SAAS,CAAC,GAAG,iBAAiB,GAAG,kBAAkB;CACpD;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ReferentialAction, i as ForeignKeyReferenceInput, n as ForeignKeyInput } from "./foreign-key-C-iTPuRT-C9ip8zFx.mjs";
|
|
2
2
|
import { i as UniqueConstraintInput, n as PrimaryKeyInput } from "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
|
|
3
|
-
import { r as IndexInput } from "./sql-index-ByAAE7K8-
|
|
3
|
+
import { r as IndexInput } from "./sql-index-ByAAE7K8-DKj2V86p.mjs";
|
|
4
4
|
//#region ../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts
|
|
5
5
|
//#region src/foreign-key-materialization.d.ts
|
|
6
6
|
type BackingIndexCandidates = {
|
|
@@ -62,4 +62,4 @@ interface MaterializedTableConstraints {
|
|
|
62
62
|
declare function materializeForeignKeysAndIndexes(tableName: string, foreignKeys: readonly ForeignKeyAuthoringInput[], declaredIndexes: readonly IndexInput[], uniques: readonly UniqueConstraintInput[], primaryKey: PrimaryKeyInput | undefined): MaterializedTableConstraints;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { isBackedByColumnKeys as a, backingIndexColumnKeys as i, ForeignKeyAuthoringInput as n, materializeForeignKeysAndIndexes as o, MaterializedTableConstraints as r, BackingIndexCandidates as t };
|
|
65
|
-
//# sourceMappingURL=foreign-key-materialization-
|
|
65
|
+
//# sourceMappingURL=foreign-key-materialization-DO9dvG7v.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key-materialization-
|
|
1
|
+
{"version":3,"file":"foreign-key-materialization-DO9dvG7v.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts"],"mappings":";;;;;KAIK;WACM;aACE;;WAEF;aACE;;WAEF;aACE;;;;;;;;;;;;;;iBAcI,uBAAuB,OAAO;;;;;;iBAM9B,qBAAqB,4BAA4B;;;;;;UAMxD;WACC,QAAQ;WACR,QAAQ;WACR;WACA,WAAW;WACX,WAAW;WACX;WACA;;UAED;WACC,sBAAsB;WACtB,kBAAkB;;;;;;;;;;;iBAWZ,iCAAiC,mBAAmB,sBAAsB,4BAA4B,0BAA0B,cAAc,kBAAkB,yBAAyB,YAAY,8BAA8B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { w as QueryOperationTypeEntry } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { w as QueryOperationTypeEntry } from "./types-BDUG29Df-LE85dIXP.mjs";
|
|
2
|
+
import "./types-UcHa2cTe.mjs";
|
|
3
3
|
import { OperationDescriptor, OperationDescriptors, OperationRegistry } from "@prisma/orm-framework/operations";
|
|
4
4
|
//#region ../../../2-sql/1-core/operations/dist/index.d.mts
|
|
5
5
|
//#region src/index.d.ts
|
|
@@ -22,4 +22,4 @@ type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;
|
|
|
22
22
|
declare function createSqlOperationRegistry(): SqlOperationRegistry;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { SqlOperationRegistry as a, SqlOperationEntry as i, SqlOperationDescriptor as n, createSqlOperationRegistry as o, SqlOperationDescriptors as r, SqlLoweringSpec as t };
|
|
25
|
-
//# sourceMappingURL=index-
|
|
25
|
+
//# sourceMappingURL=index-C5I8D-MB.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-C5I8D-MB.d.mts","names":[],"sources":["../../../../2-sql/1-core/operations/dist/index.d.mts"],"mappings":";;;;;UAGU;WACC;WACA;WACA;;;;;;;;;KASN,oBAAoB;KACpB,yBAAyB,oBAAoB;KAC7C,0BAA0B,qBAAqB;KAC/C,uBAAuB,kBAAkB;iBAC7B,8BAA8B"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as SqlStorage } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { r as SqlOperationDescriptors } from "./index-
|
|
4
|
-
import { Et as SqlCodecCallContext, O as ContractCodecRegistry, T as CodecRef$1, lt as LoweredParam, m as AnyQueryAst, ut as LoweredStatement, x as Codec$1 } from "./types-ZzeQKmYD-
|
|
5
|
-
import { E as SqlQueryable, _ as SqlConnection, o as MarkerReadResult, t as Adapter, v as SqlDriver } from "./ast-
|
|
6
|
-
import { a as Expression, i as CodecValue, o as RawCodecInferer, r as CodecTypesBase } from "./expression-
|
|
7
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-qxvHnFcA-
|
|
8
|
-
import { t as SqlQueryPlan } from "./plan-DfLDIdep-
|
|
9
|
-
import "./plan-
|
|
10
|
-
import { n as CodecDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-DyDSQVS--
|
|
11
|
-
import "./query-lane-context-
|
|
12
|
-
import { i as SqlParamRefMutator } from "./middleware-Bp5oIYM0-
|
|
13
|
-
import "./middleware-
|
|
14
|
-
import { y as RuntimeScope } from "./types-CLN9Y3BH-
|
|
15
|
-
import "./types-
|
|
1
|
+
import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
|
|
2
|
+
import "./types-UcHa2cTe.mjs";
|
|
3
|
+
import { r as SqlOperationDescriptors } from "./index-C5I8D-MB.mjs";
|
|
4
|
+
import { Et as SqlCodecCallContext, O as ContractCodecRegistry, T as CodecRef$1, lt as LoweredParam, m as AnyQueryAst, ut as LoweredStatement, x as Codec$1 } from "./types-ZzeQKmYD-kI_QWHEx.mjs";
|
|
5
|
+
import { E as SqlQueryable, _ as SqlConnection, o as MarkerReadResult, t as Adapter, v as SqlDriver } from "./ast-DRbUiQ-9.mjs";
|
|
6
|
+
import { a as Expression, i as CodecValue, o as RawCodecInferer, r as CodecTypesBase } from "./expression-D7H1kyVG.mjs";
|
|
7
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-qxvHnFcA-HjRSS3l9.mjs";
|
|
8
|
+
import { t as SqlQueryPlan } from "./plan-DfLDIdep-6R1mLkcW.mjs";
|
|
9
|
+
import "./plan-HWPzzUxh.mjs";
|
|
10
|
+
import { n as CodecDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-DyDSQVS--CyCznt67.mjs";
|
|
11
|
+
import "./query-lane-context-qfJzguc9.mjs";
|
|
12
|
+
import { i as SqlParamRefMutator } from "./middleware-Bp5oIYM0-Ek8bISDH.mjs";
|
|
13
|
+
import "./middleware-aFpB1ZhU.mjs";
|
|
14
|
+
import { y as RuntimeScope } from "./types-CLN9Y3BH-BHUrV7MD.mjs";
|
|
15
|
+
import "./types-4u1EPYY6.mjs";
|
|
16
16
|
import { Contract, JsonValue, PlanMeta } from "@prisma/orm-framework/contract/types";
|
|
17
17
|
import { AnyCodecDescriptor, CodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
18
18
|
import { AfterExecuteResult, AfterExecuteResult as AfterExecuteResult$1, AsyncIterableResult, ExecutionPlan, RuntimeCore, RuntimeExecuteOptions, RuntimeLog, RuntimeLog as Log, RuntimeMiddleware, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
|
|
@@ -507,4 +507,4 @@ interface LintsOptions {
|
|
|
507
507
|
declare function lints(options?: LintsOptions): SqlMiddleware;
|
|
508
508
|
//#endregion
|
|
509
509
|
export { RuntimeQueryable as A, SqlRuntimeDriverInstance as B, PreparedStatementImpl as C, RuntimeFamilyAdapter as D, RuntimeConnection as E, SqlMiddleware as F, TelemetryOutcome as G, SqlRuntimeExtensionInstance as H, SqlMiddlewareContext as I, createExecutionContext as J, TransactionContext as K, SqlRuntimeAdapterDescriptor as L, RuntimeTransaction as M, SqlExecutionStack as N, RuntimeMutationDefaultGenerator as O, SqlExecutionStackWithDriver as P, withTransaction as Q, SqlRuntimeAdapterInstance as R, PreparedStatement as S, Runtime as T, SqlRuntimeTargetDescriptor as U, SqlRuntimeExtensionDescriptor as V, SqlStaticContributions as W, deriveParamMetadata as X, createSqlExecutionStack as Y, encodeParamsWithMetadata as Z, GeneratorStability as _, budgets as a, ParamsFromDeclaration as b, lints as c, validateContractCodecMappings as d, BindSiteParams as f, DeclaredNullable as g, DeclaredCodecId as h, Log as i, RuntimeTelemetryEvent as j, RuntimeParameterizedCodecDescriptor as k, lowerSqlPlan as l, Declaration as m, BudgetsOptions as n, createAstCodecRegistry as o, ConnectionProvider as p, VerifyMarkerOption as q, LintsOptions as r, extractCodecIds as s, AfterExecuteResult$1 as t, validateCodecRegistryCompleteness as u, MarkerReader as v, PreparedStatementInternals as w, PrepareCallback as x, ParamSpec as y, SqlRuntimeBase as z };
|
|
510
|
-
//# sourceMappingURL=index-
|
|
510
|
+
//# sourceMappingURL=index-Ddquditw.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Ddquditw.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/prepared-statement-D4zOlprk.d.mts","../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAaU;WACC,OAAO;WACP;;iBAEM,oBAAoB,KAA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AAM,UAAU,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as IndexInput } from "./sql-index-ByAAE7K8-
|
|
1
|
+
import { r as IndexInput } from "./sql-index-ByAAE7K8-DKj2V86p.mjs";
|
|
2
2
|
import { AuthoringWarning, AuthoringWarningSink } from "@prisma/orm-framework/components/authoring";
|
|
3
3
|
//#region ../../../2-sql/1-core/contract/dist/index-naming.d.mts
|
|
4
4
|
//#region src/index-naming.d.ts
|
|
@@ -43,12 +43,12 @@ type AuthoredIndexInput = AuthoredIndexElements & AuthoredIndexMethod & {
|
|
|
43
43
|
/**
|
|
44
44
|
* Mints the exact-name body-comparison warning for a `map:`-named object
|
|
45
45
|
* carrying a hand-authorable SQL body — fully formed, so the transport and
|
|
46
|
-
* the flush stay generic. `subject`
|
|
47
|
-
*
|
|
48
|
-
* subject-specific end to end, so a batched summary
|
|
49
|
-
* code + summary) is true of every object it covers.
|
|
46
|
+
* the flush stay generic. `subject` distinguishes the index, policy, and
|
|
47
|
+
* check callers that mint this same warning; the feature name and the
|
|
48
|
+
* remediation are subject-specific end to end, so a batched summary
|
|
49
|
+
* (grouped on code + summary) is true of every object it covers.
|
|
50
50
|
*/
|
|
51
|
-
declare function exactNameBodyWarning(subject: 'index' | 'policy', exactName: string): AuthoringWarning;
|
|
51
|
+
declare function exactNameBodyWarning(subject: 'index' | 'policy' | 'check', exactName: string): AuthoringWarning;
|
|
52
52
|
/**
|
|
53
53
|
* Lowers an authored index into the name-identified entity `contract.json`
|
|
54
54
|
* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire
|
|
@@ -59,4 +59,4 @@ declare function exactNameBodyWarning(subject: 'index' | 'policy', exactName: st
|
|
|
59
59
|
declare function lowerAuthoredIndex(tableName: string, authored: AuthoredIndexInput, warnings?: AuthoringWarningSink): IndexInput;
|
|
60
60
|
//#endregion
|
|
61
61
|
export { lowerAuthoredIndex as i, AuthoredIndexMethod as n, exactNameBodyWarning as r, AuthoredIndexInput as t };
|
|
62
|
-
//# sourceMappingURL=index-naming-
|
|
62
|
+
//# sourceMappingURL=index-naming-Ct65z5Xk.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-naming-
|
|
1
|
+
{"version":3,"file":"index-naming-Ct65z5Xk.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming.d.mts"],"mappings":";;;;;;;;KAOK;WACM;WACA;;WAEA;WACA;;;;;;;;;KASN;WACM;WACA;;WAEA;WACA,SAAS;;;;;;;;;KASf,qBAAqB,wBAAwB;WACvC;WACA;WACA;WACA;;;;;;;;;;iBAUM,qBAAqB,uCAAuC,oBAAoB;;;;;;;;iBAQhF,mBAAmB,mBAAmB,UAAU,oBAAoB,WAAW,uBAAuB"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
-
import { a as computeIndexContentHash, n as assertWireNamePrefixLength, o as defaultIndexName } from "./naming-
|
|
2
|
+
import { a as computeIndexContentHash, n as assertWireNamePrefixLength, o as defaultIndexName } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
|
|
3
3
|
import { flushAuthoringWarnings } from "@prisma/orm-framework/components/authoring";
|
|
4
|
-
//#region ../../../2-sql/1-core/contract/dist/index-naming-
|
|
4
|
+
//#region ../../../2-sql/1-core/contract/dist/index-naming-DREt6js7.mjs
|
|
5
5
|
const EXACT_NAME_BODY_PREAMBLE = "Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.";
|
|
6
6
|
/**
|
|
7
|
-
* Per-subject remediation: an index moves to wire naming via
|
|
8
|
-
* a policy has no such parameter — dropping `@@map` makes the
|
|
9
|
-
* the wire prefix.
|
|
7
|
+
* Per-subject remediation: an index or check moves to wire naming via
|
|
8
|
+
* `name:`; a policy has no such parameter — dropping `@@map` makes the
|
|
9
|
+
* block's head the wire prefix.
|
|
10
10
|
*/
|
|
11
11
|
const EXACT_NAME_BODY_REMEDIATION = {
|
|
12
12
|
index: "For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted object to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.",
|
|
13
|
-
policy: "For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration."
|
|
13
|
+
policy: "For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration.",
|
|
14
|
+
check: "For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted check to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration."
|
|
14
15
|
};
|
|
15
|
-
/** What the user actually wrote, per subject: index `map:`, policy `@@map`. */
|
|
16
|
+
/** What the user actually wrote, per subject: index and check `map:`, policy `@@map`. */
|
|
16
17
|
const EXACT_NAME_FEATURE = {
|
|
17
18
|
index: "map:",
|
|
18
|
-
policy: "@@map"
|
|
19
|
+
policy: "@@map",
|
|
20
|
+
check: "map:"
|
|
19
21
|
};
|
|
20
22
|
const EXACT_NAME_BODY_WARNING_CODE = "PN_EXACT_NAME_BODY_COMPARISON";
|
|
21
23
|
/**
|
|
22
24
|
* Mints the exact-name body-comparison warning for a `map:`-named object
|
|
23
25
|
* carrying a hand-authorable SQL body — fully formed, so the transport and
|
|
24
|
-
* the flush stay generic. `subject`
|
|
25
|
-
*
|
|
26
|
-
* subject-specific end to end, so a batched summary
|
|
27
|
-
* code + summary) is true of every object it covers.
|
|
26
|
+
* the flush stay generic. `subject` distinguishes the index, policy, and
|
|
27
|
+
* check callers that mint this same warning; the feature name and the
|
|
28
|
+
* remediation are subject-specific end to end, so a batched summary
|
|
29
|
+
* (grouped on code + summary) is true of every object it covers.
|
|
28
30
|
*/
|
|
29
31
|
function exactNameBodyWarning(subject, exactName) {
|
|
30
32
|
const item = `${subject} "${exactName}"`;
|
|
@@ -105,4 +107,4 @@ function lowerAuthoredIndex(tableName, authored, warnings) {
|
|
|
105
107
|
//#endregion
|
|
106
108
|
export { lowerAuthoredIndex as n, exactNameBodyWarning as t };
|
|
107
109
|
|
|
108
|
-
//# sourceMappingURL=index-naming-
|
|
110
|
+
//# sourceMappingURL=index-naming-DREt6js7-CRH27yUv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-naming-DREt6js7-CRH27yUv.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming-DREt6js7.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName } from \"@internal/sql-schema-ir/naming\";\n//#region src/index-naming.ts\nconst EXACT_NAME_BODY_PREAMBLE = \"Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.\";\n/**\n* Per-subject remediation: an index or check moves to wire naming via\n* `name:`; a policy has no such parameter — dropping `@@map` makes the\n* block's head the wire prefix.\n*/\nconst EXACT_NAME_BODY_REMEDIATION = {\n\tindex: \"For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted object to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\",\n\tpolicy: \"For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration.\",\n\tcheck: \"For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted check to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\"\n};\n/** What the user actually wrote, per subject: index and check `map:`, policy `@@map`. */\nconst EXACT_NAME_FEATURE = {\n\tindex: \"map:\",\n\tpolicy: \"@@map\",\n\tcheck: \"map:\"\n};\nconst EXACT_NAME_BODY_WARNING_CODE = \"PN_EXACT_NAME_BODY_COMPARISON\";\n/**\n* Mints the exact-name body-comparison warning for a `map:`-named object\n* carrying a hand-authorable SQL body — fully formed, so the transport and\n* the flush stay generic. `subject` distinguishes the index, policy, and\n* check callers that mint this same warning; the feature name and the\n* remediation are subject-specific end to end, so a batched summary\n* (grouped on code + summary) is true of every object it covers.\n*/\nfunction exactNameBodyWarning(subject, exactName) {\n\tconst item = `${subject} \"${exactName}\"`;\n\tconst feature = EXACT_NAME_FEATURE[subject];\n\tconst tail = `with a SQL body. ${EXACT_NAME_BODY_PREAMBLE} ${EXACT_NAME_BODY_REMEDIATION[subject]}`;\n\treturn {\n\t\tcode: EXACT_NAME_BODY_WARNING_CODE,\n\t\tmessage: `${item} uses ${feature} ${tail}`,\n\t\titem,\n\t\tsummary: `objects use ${feature} ${tail}`\n\t};\n}\n/**\n* Lowers an authored index into the name-identified entity `contract.json`\n* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire\n* mode appends the content-hash suffix to the authored or default prefix.\n* The cross-field guards are the shared enforcement backstop for both\n* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).\n*/\nfunction lowerAuthoredIndex(tableName, authored, warnings) {\n\tif (authored.columns === void 0 === (authored.expression === void 0)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an index takes either fields (columns) or an expression — exactly one, not both.`);\n\tif (authored.map !== void 0 && authored.name !== void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index \"${authored.map}\" on table \"${tableName}\": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);\n\tif (authored.expression !== void 0 && authored.name === void 0 && authored.map === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an expression index requires an explicit name (name:) or exact physical name (map:) — a default name cannot be derived from an expression.`);\n\tif (authored.options !== void 0 && authored.type === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": options requires an explicit type — an index with options but no type cannot round-trip through contract infer (the emitted type: would change the wire name).`);\n\tconst unique = authored.unique ?? false;\n\tif (authored.map !== void 0) {\n\t\tif (authored.expression !== void 0 || authored.where !== void 0) {\n\t\t\tconst warning = exactNameBodyWarning(\"index\", authored.map);\n\t\t\tif (warnings !== void 0) warnings.push(warning);\n\t\t\telse flushAuthoringWarnings([warning]);\n\t\t}\n\t\tconst carried = {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: authored.map\n\t\t\t},\n\t\t\twhere: authored.where,\n\t\t\tunique,\n\t\t\ttype: authored.type,\n\t\t\toptions: authored.options\n\t\t};\n\t\treturn authored.expression !== void 0 ? {\n\t\t\t...carried,\n\t\t\texpression: authored.expression\n\t\t} : {\n\t\t\t...carried,\n\t\t\tcolumns: authored.columns ?? []\n\t\t};\n\t}\n\tconst prefix = authored.name ?? defaultIndexName(tableName, authored.columns ?? []);\n\tassertWireNamePrefixLength(prefix, \"index prefix\");\n\tconst carried = {\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix,\n\t\t\thash: computeIndexContentHash({\n\t\t\t\t...authored.columns !== void 0 && { columns: authored.columns },\n\t\t\t\t...authored.expression !== void 0 && { expression: authored.expression },\n\t\t\t\t...authored.where !== void 0 && { where: authored.where },\n\t\t\t\tunique,\n\t\t\t\t...authored.type !== void 0 && { type: authored.type },\n\t\t\t\t...authored.options !== void 0 && { options: authored.options }\n\t\t\t})\n\t\t},\n\t\twhere: authored.where,\n\t\tunique,\n\t\ttype: authored.type,\n\t\toptions: authored.options\n\t};\n\treturn authored.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: authored.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: authored.columns ?? []\n\t};\n}\n//#endregion\nexport { lowerAuthoredIndex as n, exactNameBodyWarning as t };\n\n//# sourceMappingURL=index-naming-DREt6js7.mjs.map"],"mappings":";;;;AAIA,MAAM,2BAA2B;;;;;;AAMjC,MAAM,8BAA8B;CACnC,OAAO;CACP,QAAQ;CAC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,SAAS;GACf,SAAS,SAAS;EACnB;EACA,OAAO,SAAS,eAAe,KAAK,IAAI;GACvC,GAAG;GACH,YAAY,SAAS;EACtB,IAAI;GACH,GAAG;GACH,SAAS,SAAS,WAAW,CAAC;EAC/B;CACD;CACA,MAAM,SAAS,SAAS,QAAQ,iBAAiB,WAAW,SAAS,WAAW,CAAC,CAAC;CAClF,2BAA2B,QAAQ,cAAc;CACjD,MAAM,UAAU;EACf,QAAQ;GACP,MAAM;GACN;GACA,MAAM,wBAAwB;IAC7B,GAAG,SAAS,YAAY,KAAK,KAAK,EAAE,SAAS,SAAS,QAAQ;IAC9D,GAAG,SAAS,eAAe,KAAK,KAAK,EAAE,YAAY,SAAS,WAAW;IACvE,GAAG,SAAS,UAAU,KAAK,KAAK,EAAE,OAAO,SAAS,MAAM;IACxD;IACA,GAAG,SAAS,SAAS,KAAK,KAAK,EAAE,MAAM,SAAS,KAAK;IACrD,GAAG,SAAS,YAAY,KAAK,KAAK,EAAE,SAAS,SAAS,QAAQ;GAC/D,CAAC;EACF;EACA,OAAO,SAAS;EAChB;EACA,MAAM,SAAS;EACf,SAAS,SAAS;CACnB;CACA,OAAO,SAAS,eAAe,KAAK,IAAI;EACvC,GAAG;EACH,YAAY,SAAS;CACtB,IAAI;EACH,GAAG;EACH,SAAS,SAAS,WAAW,CAAC;CAC/B;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SqlStorage } from "./sql-storage-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
|
|
2
|
+
import "./types-BDUG29Df-LE85dIXP.mjs";
|
|
3
3
|
import { a as IndexTypeRegistry } from "./index-types-DPVhsW0v-D-BikM4h.mjs";
|
|
4
4
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
//#region ../../../2-sql/1-core/contract/dist/index-type-validation.d.mts
|
|
@@ -7,4 +7,4 @@ import { Contract } from "@prisma/orm-framework/contract/types";
|
|
|
7
7
|
declare function validateIndexTypes(contract: Contract<SqlStorage>, indexTypeRegistry: IndexTypeRegistry): void;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { validateIndexTypes as t };
|
|
10
|
-
//# sourceMappingURL=index-type-validation-
|
|
10
|
+
//# sourceMappingURL=index-type-validation-CZ5L2lli.d.mts.map
|
package/dist/{index-type-validation-DS9n07WO.d.mts.map → index-type-validation-CZ5L2lli.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-type-validation-
|
|
1
|
+
{"version":3,"file":"index-type-validation-CZ5L2lli.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-type-validation.d.mts"],"mappings":";;;;;;iBAKiB,mBAAmB,UAAU,SAAS,aAAa,mBAAmB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
|
|
2
|
-
import { n as buildSqlContractFromDefinition } from "./derived-checks-
|
|
3
|
-
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
2
|
+
import { n as buildSqlContractFromDefinition } from "./derived-checks-DFMRmiAu-8jmha26I.mjs";
|
|
4
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
+
import { hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, validateAuthoringHelperArguments } from "@prisma/orm-framework/components/authoring";
|
|
5
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
5
6
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
6
7
|
import { crossRef } from "@prisma/orm-framework/contract/types";
|
|
7
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
8
|
-
import { hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, validateAuthoringHelperArguments } from "@prisma/orm-framework/components/authoring";
|
|
9
9
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
10
10
|
import { bool, entityRef, fieldAttribute, fieldRef, findBlockDescriptor, funcCall, identifier, interpretAttribute, keywordPslSpan, leafDiagnostic, list, modelAttribute, nodePslSpan, num, oneOf, optional, record, str } from "@prisma/orm-framework/psl-parser";
|
|
11
11
|
import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
|
|
12
12
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
13
|
-
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-
|
|
13
|
+
//#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-DaBA2fm-.mjs
|
|
14
14
|
function contractError(code, message, options) {
|
|
15
15
|
return structuredError(code, message, options);
|
|
16
16
|
}
|
|
@@ -514,6 +514,31 @@ const indexModelSpec = modelAttribute("index", {
|
|
|
514
514
|
return diagnostics;
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
|
+
const PSL_CHECK_REQUIRES_NAME_OR_MAP = "PSL_CHECK_REQUIRES_NAME_OR_MAP";
|
|
518
|
+
const PSL_CHECK_NAME_XOR_MAP = "PSL_CHECK_NAME_XOR_MAP";
|
|
519
|
+
const PSL_CHECK_EXPRESSION_EMPTY = "PSL_CHECK_EXPRESSION_EMPTY";
|
|
520
|
+
/**
|
|
521
|
+
* A single-table-inheritance variant (`@@base` with no own `@@map`) shares
|
|
522
|
+
* its base model's storage table and has no table of its own to declare a
|
|
523
|
+
* check on — raised from {@link interpretPslDocumentToSqlContract}, not from
|
|
524
|
+
* this spec's own `refine`, because the rule needs the model's `@@base`
|
|
525
|
+
* declaration, which a single attribute's `refine` cannot see.
|
|
526
|
+
*/
|
|
527
|
+
const PSL_CHECK_ON_STI_VARIANT = "PSL_CHECK_ON_STI_VARIANT";
|
|
528
|
+
const checkModelSpec = modelAttribute("check", {
|
|
529
|
+
named: {
|
|
530
|
+
expression: str(),
|
|
531
|
+
name: optional(str()),
|
|
532
|
+
map: optional(str())
|
|
533
|
+
},
|
|
534
|
+
refine: (value, ctx, attributeNode) => {
|
|
535
|
+
const diagnostics = [];
|
|
536
|
+
if (value.expression.trim().length === 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, "`@@check` expression must not be empty — an empty predicate is not a constraint", PSL_CHECK_EXPRESSION_EMPTY));
|
|
537
|
+
if (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, "`@@check` requires a `name` or `map` argument (a default name cannot be derived — a check has no column tuple to name itself after)", PSL_CHECK_REQUIRES_NAME_OR_MAP));
|
|
538
|
+
if (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, "`@@check` takes at most one of `name` and `map`", PSL_CHECK_NAME_XOR_MAP));
|
|
539
|
+
return diagnostics;
|
|
540
|
+
}
|
|
541
|
+
});
|
|
517
542
|
const controlModelSpec = modelAttribute("control", { positional: [{
|
|
518
543
|
key: "policy",
|
|
519
544
|
type: oneOf(identifier("managed"), identifier("tolerated"), identifier("external"), identifier("observed"))
|
|
@@ -2369,6 +2394,7 @@ function buildModelNodeFromPsl(input) {
|
|
|
2369
2394
|
...ifDefined("name", field.uniqueName)
|
|
2370
2395
|
}));
|
|
2371
2396
|
const indexNodes = [];
|
|
2397
|
+
const checkNodes = [];
|
|
2372
2398
|
const foreignKeyNodes = [];
|
|
2373
2399
|
const modelAttributeNodes = Array.from(model.node.attributes());
|
|
2374
2400
|
for (const [attributeIndex, modelAttribute] of model.attributes.entries()) {
|
|
@@ -2524,6 +2550,34 @@ function buildModelNodeFromPsl(input) {
|
|
|
2524
2550
|
}));
|
|
2525
2551
|
continue;
|
|
2526
2552
|
}
|
|
2553
|
+
if (modelAttribute.name === "check") {
|
|
2554
|
+
const node = modelAttributeNodes[attributeIndex];
|
|
2555
|
+
if (node === void 0) continue;
|
|
2556
|
+
if (input.capabilities["sql"]?.["checkConstraint"] !== true) {
|
|
2557
|
+
diagnostics.push({
|
|
2558
|
+
code: "PSL_CHECK_UNSUPPORTED_TARGET",
|
|
2559
|
+
message: `Model "${model.name}" declares "@@check", but target "${input.targetId}" does not support check constraints (the adapter does not report the "checkConstraint" capability). Remove the check or author it against a target that supports check constraints.`,
|
|
2560
|
+
sourceId,
|
|
2561
|
+
span: modelAttribute.span
|
|
2562
|
+
});
|
|
2563
|
+
continue;
|
|
2564
|
+
}
|
|
2565
|
+
const parsed = interpretModelAttribute({
|
|
2566
|
+
node,
|
|
2567
|
+
spec: checkModelSpec,
|
|
2568
|
+
model,
|
|
2569
|
+
sourceFile: input.sourceFile,
|
|
2570
|
+
sourceId,
|
|
2571
|
+
diagnostics
|
|
2572
|
+
});
|
|
2573
|
+
if (parsed === void 0) continue;
|
|
2574
|
+
checkNodes.push({
|
|
2575
|
+
expression: parsed.expression,
|
|
2576
|
+
name: parsed.name,
|
|
2577
|
+
map: parsed.map
|
|
2578
|
+
});
|
|
2579
|
+
continue;
|
|
2580
|
+
}
|
|
2527
2581
|
const contributedModelAttribute = input.modelAttributesByName.get(modelAttribute.name);
|
|
2528
2582
|
if (contributedModelAttribute !== void 0) {
|
|
2529
2583
|
if (declaredContributedModelAttributes.has(modelAttribute.name)) {
|
|
@@ -2831,6 +2885,7 @@ function buildModelNodeFromPsl(input) {
|
|
|
2831
2885
|
...ifDefined("id", primaryKey),
|
|
2832
2886
|
...uniqueConstraints.length > 0 ? { uniques: uniqueConstraints } : {},
|
|
2833
2887
|
...indexNodes.length > 0 ? { indexes: indexNodes } : {},
|
|
2888
|
+
...checkNodes.length > 0 ? { checks: checkNodes } : {},
|
|
2834
2889
|
...foreignKeyNodes.length > 0 ? { foreignKeys: foreignKeyNodes } : {},
|
|
2835
2890
|
...ifDefined("control", controlPolicy)
|
|
2836
2891
|
},
|
|
@@ -3521,6 +3576,21 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3521
3576
|
const { discriminatorDeclarations, baseDeclarations } = collectPolymorphismDeclarations(models, sourceFile, sourceId, diagnostics);
|
|
3522
3577
|
const stiVariantNames = /* @__PURE__ */ new Set();
|
|
3523
3578
|
for (const variantName of baseDeclarations.keys()) if (!(modelMappings.get(variantName)?.model.attributes.some((attr) => attr.name === "map") ?? false)) stiVariantNames.add(variantName);
|
|
3579
|
+
for (const variantName of stiVariantNames) {
|
|
3580
|
+
const variantMapping = modelMappings.get(variantName);
|
|
3581
|
+
if (variantMapping === void 0) continue;
|
|
3582
|
+
const baseDecl = baseDeclarations.get(variantName);
|
|
3583
|
+
invariant(baseDecl !== void 0, `stiVariantNames is derived from baseDeclarations.keys(), so "${variantName}" must have a base declaration`);
|
|
3584
|
+
for (const attribute of variantMapping.model.node.attributes()) {
|
|
3585
|
+
if (attribute.name()?.isSimpleName("check") !== true) continue;
|
|
3586
|
+
diagnostics.push({
|
|
3587
|
+
code: PSL_CHECK_ON_STI_VARIANT,
|
|
3588
|
+
message: `Model "${variantName}" declares "@@check", but it shares its base model "${baseDecl.baseName}"'s storage table (single-table inheritance via @@base) and has no table of its own to declare a check constraint on. Declare the check on "${baseDecl.baseName}" instead.`,
|
|
3589
|
+
sourceId,
|
|
3590
|
+
span: nodePslSpan(attribute.syntax, sourceFile)
|
|
3591
|
+
});
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3524
3594
|
const { modelNodes: mtiLinkedModelNodes, syntheticPkFieldsByVariant } = materializeMtiVariantStorageLinks(modelNodes, baseDeclarations, stiVariantNames);
|
|
3525
3595
|
const { modelNodes: stiColumnModelNodes, stiBaseFieldsByBase } = materializeStiVariantStorageColumns(mtiLinkedModelNodes, baseDeclarations, stiVariantNames);
|
|
3526
3596
|
const valueObjects = buildValueObjects({
|
|
@@ -3607,4 +3677,4 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3607
3677
|
//#endregion
|
|
3608
3678
|
export { interpretPslDocumentToSqlContract as t };
|
|
3609
3679
|
|
|
3610
|
-
//# sourceMappingURL=interpreter-
|
|
3680
|
+
//# sourceMappingURL=interpreter-DaBA2fm--FFkq_gGd.mjs.map
|