@prisma/orm-family-sql 8.0.0-rc.14-dev.29 → 8.0.0-rc.14-dev.31
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-CJF2KxUb.mjs → aggregate-descriptor-registry-B3RG0Zom.mjs} +2 -2
- package/dist/{aggregate-descriptor-registry-CJF2KxUb.mjs.map → aggregate-descriptor-registry-B3RG0Zom.mjs.map} +1 -1
- package/dist/{ast-dPjHeaNs.d.mts → ast-BUbHXpzG.d.mts} +7 -105
- package/dist/ast-BUbHXpzG.d.mts.map +1 -0
- package/dist/ast-CQZn-6Wd.mjs +310 -0
- package/dist/ast-CQZn-6Wd.mjs.map +1 -0
- package/dist/{authoring-entity-types-CZ-vdwYS-BfyaoH53.d.mts → authoring-entity-types-CZ-vdwYS-C25VGQVB.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-BfyaoH53.d.mts.map → authoring-entity-types-CZ-vdwYS-C25VGQVB.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-DIyheCzv-BSrAEZsD.mjs → authoring-type-constructors-dihiQslc-hldmqa1r.mjs} +22 -28
- package/dist/authoring-type-constructors-dihiQslc-hldmqa1r.mjs.map +1 -0
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +6 -6
- package/dist/builder__runtime.mjs +3 -3
- package/dist/builder__types.d.mts +2 -2
- package/dist/{codec-descriptor-registry-u6_e6WfA.mjs → codec-descriptor-registry-BW0REwkz.mjs} +2 -11
- package/dist/{codec-descriptor-registry-u6_e6WfA.mjs.map → codec-descriptor-registry-BW0REwkz.mjs.map} +1 -1
- package/dist/{config-types-DNRmpGNL.mjs → config-types-ump1oN82.mjs} +8 -4
- package/dist/config-types-ump1oN82.mjs.map +1 -0
- package/dist/{contract-builder-Br5TlHMh.d.mts → contract-builder-BXxFihYc.d.mts} +16 -11
- package/dist/contract-builder-BXxFihYc.d.mts.map +1 -0
- package/dist/{contract-builder-C3MYW38z.mjs → contract-builder-CQvwPGAW.mjs} +29 -24
- package/dist/contract-builder-CQvwPGAW.mjs.map +1 -0
- package/dist/contract-emitter.d.mts +1 -1
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-prisma7__provider.d.mts +2 -1
- package/dist/contract-prisma7__provider.d.mts.map +1 -1
- package/dist/contract-prisma7__provider.mjs +16 -9
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +4 -4
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +2 -2
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +1 -1
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +5 -3
- package/dist/contract.mjs +11 -8
- package/dist/contract__data-type-support.d.mts +2 -0
- package/dist/contract__data-type-support.mjs +2 -0
- package/dist/contract__data-type.d.mts +2 -0
- package/dist/contract__data-type.mjs +3 -0
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__sql-expression.d.mts +1 -1
- package/dist/contract__sql-expression.mjs +1 -1
- 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-BYOcSVih.mjs → control-BYT1Lgtm.mjs} +76 -117
- package/dist/control-BYT1Lgtm.mjs.map +1 -0
- package/dist/{control-DL9y6GfG.d.mts → control-Bpk8PtSL.d.mts} +40 -128
- package/dist/control-Bpk8PtSL.d.mts.map +1 -0
- package/dist/{control-adapter-WoXvPNj4-D64oWh9I.d.mts → control-adapter-BVN98SzR-C-H_T7s-.d.mts} +8 -20
- package/dist/control-adapter-BVN98SzR-C-H_T7s-.d.mts.map +1 -0
- package/dist/control-adapter-DSGwSagr.d.mts +1 -0
- package/dist/data-type-CAPmGXg9.mjs +297 -0
- package/dist/data-type-CAPmGXg9.mjs.map +1 -0
- package/dist/data-type-CpqSDmR_.d.mts +113 -0
- package/dist/data-type-CpqSDmR_.d.mts.map +1 -0
- package/dist/data-type-support-B_Dr1cxB.d.mts +92 -0
- package/dist/data-type-support-B_Dr1cxB.d.mts.map +1 -0
- package/dist/{ast-5hifzBHC.mjs → data-type-support-rpD1jyZd.mjs} +6 -329
- package/dist/data-type-support-rpD1jyZd.mjs.map +1 -0
- package/dist/{db-DLjWu9-f-BjAFEKe9.d.mts → db-DLjWu9-f-T8QbxDGY.d.mts} +6 -6
- package/dist/{db-DLjWu9-f-BjAFEKe9.d.mts.map → db-DLjWu9-f-T8QbxDGY.d.mts.map} +1 -1
- package/dist/{ddl-types-B48YmQSt-DLCUHORB.d.mts → ddl-types-BUqZdoZK-vyWnW2PW.d.mts} +3 -3
- package/dist/{ddl-types-B48YmQSt-DLCUHORB.d.mts.map → ddl-types-BUqZdoZK-vyWnW2PW.d.mts.map} +1 -1
- package/dist/{derived-checks-C_y1rk6O-DwCaGICl.mjs → derived-checks-CILnJKoa-D42YRW01.mjs} +48 -25
- package/dist/derived-checks-CILnJKoa-D42YRW01.mjs.map +1 -0
- package/dist/diff-B16bL_IR.mjs.map +1 -1
- package/dist/{diff-CJI5hKWL.d.mts → diff-BsHizC0z.d.mts} +6 -6
- package/dist/{diff-CJI5hKWL.d.mts.map → diff-BsHizC0z.d.mts.map} +1 -1
- package/dist/{dist-BdePIXOu.mjs → dist-C_HYPisk.mjs} +3 -3
- package/dist/{dist-BdePIXOu.mjs.map → dist-C_HYPisk.mjs.map} +1 -1
- package/dist/{entity-kinds-ChX-owgJ-DqGkW6Dq.mjs → entity-kinds-BNQFeECV-BOJmOArY.mjs} +4 -4
- package/dist/{entity-kinds-ChX-owgJ-DqGkW6Dq.mjs.map → entity-kinds-BNQFeECV-BOJmOArY.mjs.map} +1 -1
- package/dist/{expression-n9sdM2RA.d.mts → expression-Bf_MkeQS.d.mts} +3 -3
- package/dist/{expression-n9sdM2RA.d.mts.map → expression-Bf_MkeQS.d.mts.map} +1 -1
- package/dist/{expression-vAEOvq7J.mjs → expression-Bv8X6-Qg.mjs} +2 -2
- package/dist/{expression-vAEOvq7J.mjs.map → expression-Bv8X6-Qg.mjs.map} +1 -1
- package/dist/{factories-BnzIZxE1.mjs → factories-D6haP7by.mjs} +2 -2
- package/dist/{factories-BnzIZxE1.mjs.map → factories-D6haP7by.mjs.map} +1 -1
- package/dist/family.d.mts +13 -13
- package/dist/family.mjs +7 -7
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +5 -5
- package/dist/family__control.mjs +4 -4
- package/dist/family__diff.d.mts +3 -3
- package/dist/family__diff.mjs +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__psl-build.d.mts +2 -2
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__verify.mjs +1 -1
- package/dist/{index-BoQtw7lz.d.mts → index-D2ho4por.d.mts} +9 -9
- package/dist/{index-BoQtw7lz.d.mts.map → index-D2ho4por.d.mts.map} +1 -1
- package/dist/index-type-validation-COH4d78M.mjs.map +1 -1
- package/dist/{interpreter-C8cP92FD-BfjuQvb1.mjs → interpreter-CDflex9x-Bx84tcl5.mjs} +33 -29
- package/dist/interpreter-CDflex9x-Bx84tcl5.mjs.map +1 -0
- package/dist/{middleware-CuGBptK0-xrXqWhc7.d.mts → middleware-BtMX6nSF-DUnzMyGl.d.mts} +3 -3
- package/dist/{middleware-CuGBptK0-xrXqWhc7.d.mts.map → middleware-BtMX6nSF-DUnzMyGl.d.mts.map} +1 -1
- package/dist/middleware-pBMsszaq.d.mts +1 -0
- package/dist/{migration-CSEh4QPu.d.mts → migration-oet2BBxc.d.mts} +2 -2
- package/dist/{migration-CSEh4QPu.d.mts.map → migration-oet2BBxc.d.mts.map} +1 -1
- package/dist/numeral-text-Cqu87pVe-DJCqBaSC.mjs +20 -0
- package/dist/numeral-text-Cqu87pVe-DJCqBaSC.mjs.map +1 -0
- package/dist/orm-client.d.mts +101 -58
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +32 -368
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{pack-C3mqZevM.d.mts → pack-C-JTs3HQ.d.mts} +2 -16
- package/dist/pack-C-JTs3HQ.d.mts.map +1 -0
- package/dist/plan-BbkBYyGR.d.mts +2 -0
- package/dist/{plan-B7g2kDfQ-Dth0BeTe.d.mts → plan-BlQITcbP-DvbDlHXA.d.mts} +3 -3
- package/dist/plan-BlQITcbP-DvbDlHXA.d.mts.map +1 -0
- package/dist/{prepared-statement-Cv54gpY_-DbHPSN5Q.d.mts → prepared-statement-Cv54gpY_-dg9Qr8sK.d.mts} +14 -14
- package/dist/{prepared-statement-Cv54gpY_-DbHPSN5Q.d.mts.map → prepared-statement-Cv54gpY_-dg9Qr8sK.d.mts.map} +1 -1
- package/dist/{psl-build-zkIJwkdq.mjs → psl-build-B6nw6MAM.mjs} +18 -17
- package/dist/psl-build-B6nw6MAM.mjs.map +1 -0
- package/dist/{psl-build-BnM1ZTyK.d.mts → psl-build-BrW7lQMO.d.mts} +2 -2
- package/dist/psl-build-BrW7lQMO.d.mts.map +1 -0
- package/dist/{psl-column-resolution-sNpXQygQ-BBo4tqwO.d.mts → psl-column-resolution-BegCa1-t-BJJ9WB1c.d.mts} +4 -5
- package/dist/psl-column-resolution-BegCa1-t-BJJ9WB1c.d.mts.map +1 -0
- package/dist/{psl-field-resolution-_o74AUE4-C-vTNklI.mjs → psl-field-resolution-CKMm6Gx0-CdzpWIV5.mjs} +69 -17
- package/dist/psl-field-resolution-CKMm6Gx0-CdzpWIV5.mjs.map +1 -0
- package/dist/{psl-infer-BwbmOInx.d.mts → psl-infer-DzH2Khty.d.mts} +4 -4
- package/dist/{psl-infer-BwbmOInx.d.mts.map → psl-infer-DzH2Khty.d.mts.map} +1 -1
- package/dist/query-lane-context-CLtywrTY.d.mts +1 -0
- package/dist/{query-lane-context-BSmWfohZ-Jn0AbOQt.d.mts → query-lane-context-OSV9X636-CcPv1TZj.d.mts} +6 -10
- package/dist/query-lane-context-OSV9X636-CcPv1TZj.d.mts.map +1 -0
- package/dist/relational-core.d.mts +12 -12
- package/dist/relational-core.mjs +4 -4
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- 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 -3
- package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__contract-free.d.mts +4 -2
- package/dist/relational-core__contract-free.d.mts.map +1 -1
- package/dist/relational-core__contract-free.mjs +10 -4
- 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/runtime.d.mts +4 -4
- package/dist/runtime.mjs +6 -6
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-DpG_gnur-CUh9eZM-.d.mts → schema-differ-DpG_gnur-if2KDxZC.d.mts} +3 -3
- package/dist/{schema-differ-DpG_gnur-CUh9eZM-.d.mts.map → schema-differ-DpG_gnur-if2KDxZC.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +1 -1
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +1 -1
- package/dist/{schema-verify-Xmpe1PGb-Bcd_2avJ.mjs → schema-verify-lPfqY_aE-CZCO8my1.mjs} +32 -6
- package/dist/schema-verify-lPfqY_aE-CZCO8my1.mjs.map +1 -0
- package/dist/{serialized-index-B5X7s-oX-CVs8-5Rw.mjs → serialized-index-BeGqqsrC-PymnV1h-.mjs} +3 -3
- package/dist/{serialized-index-B5X7s-oX-CVs8-5Rw.mjs.map → serialized-index-BeGqqsrC-PymnV1h-.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-C90xg7_q-C_Okh4NM.mjs → sql-contract-serializer-C90xg7_q-4UVEMTWO.mjs} +5 -5
- package/dist/{sql-contract-serializer-C90xg7_q-C_Okh4NM.mjs.map → sql-contract-serializer-C90xg7_q-4UVEMTWO.mjs.map} +1 -1
- package/dist/{sql-execution-plan-Db0j752I-dJ-JGxbD.d.mts → sql-execution-plan-CV6K4o9N-DAIvJbkb.d.mts} +3 -3
- package/dist/sql-execution-plan-CV6K4o9N-DAIvJbkb.d.mts.map +1 -0
- package/dist/{sql-expression-BXx0Ilj-.mjs → sql-expression-D7GsLgDM.mjs} +2 -2
- package/dist/{sql-expression-BXx0Ilj-.mjs.map → sql-expression-D7GsLgDM.mjs.map} +1 -1
- package/dist/{sql-expression-D_hbJOgM.d.mts → sql-expression-DE_MTt3T.d.mts} +2 -2
- package/dist/{sql-expression-D_hbJOgM.d.mts.map → sql-expression-DE_MTt3T.d.mts.map} +1 -1
- package/dist/{storage-table-ADhJ4Imk-CwcQVFXC.mjs → storage-table-BwwDKQkD-BN9cZrGX.mjs} +2 -2
- package/dist/{storage-table-ADhJ4Imk-CwcQVFXC.mjs.map → storage-table-BwwDKQkD-BN9cZrGX.mjs.map} +1 -1
- package/dist/{type-map-DpfnXzun-DZaSuJXh.d.mts → type-map-DmIbL4o--BfPMblbZ.d.mts} +4 -4
- package/dist/type-map-DmIbL4o--BfPMblbZ.d.mts.map +1 -0
- package/dist/{types-BPi4d3WI-D8PIEqBU.mjs → types-BLnsGaJf-m-qTW3ox.mjs} +3 -3
- package/dist/{types-BPi4d3WI-D8PIEqBU.mjs.map → types-BLnsGaJf-m-qTW3ox.mjs.map} +1 -1
- package/dist/{types-ByKpjyVh-CtYwWrbL.d.mts → types-CcGO_LSh-BKHiJvvA.d.mts} +8 -26
- package/dist/types-CcGO_LSh-BKHiJvvA.d.mts.map +1 -0
- package/dist/{types-Z-l6gAVD.mjs → types-Cn4JEguu.mjs} +2 -2
- package/dist/{types-Z-l6gAVD.mjs.map → types-Cn4JEguu.mjs.map} +1 -1
- package/dist/{types-DAoMCSPl-D2ajBTpK.mjs → types-CyPuXMTn-pumFirZ6.mjs} +4 -7
- package/dist/types-CyPuXMTn-pumFirZ6.mjs.map +1 -0
- package/dist/types-DZA5xxDT.d.mts +1 -0
- package/dist/{types-BzpC_V7p-DyBYmK1f.d.mts → types-Da1Y_OI7-BPyFwdFU.d.mts} +4 -43
- package/dist/types-Da1Y_OI7-BPyFwdFU.d.mts.map +1 -0
- package/dist/{types-BGHABElw-C5dqoVCg.d.mts → types-DpwLgzPO-Cb9nQ-Wt.d.mts} +6 -6
- package/dist/{types-BGHABElw-C5dqoVCg.d.mts.map → types-DpwLgzPO-Cb9nQ-Wt.d.mts.map} +1 -1
- package/dist/{types-Yui2yFf6-DYiGm9ET.d.mts → types-Dskga3R1-BtXuRmbf.d.mts} +3 -3
- package/dist/{types-Yui2yFf6-DYiGm9ET.d.mts.map → types-Dskga3R1-BtXuRmbf.d.mts.map} +1 -1
- package/dist/types-QvcS13Qc.d.mts +1 -0
- package/dist/{validators-D1wQns12.d.mts → validators-B-4g3vwP.d.mts} +2 -2
- package/dist/{validators-D1wQns12.d.mts.map → validators-B-4g3vwP.d.mts.map} +1 -1
- package/dist/{validators-Cx6UXIBf.mjs → validators-IGdAEEIM.mjs} +4 -4
- package/dist/{validators-Cx6UXIBf.mjs.map → validators-IGdAEEIM.mjs.map} +1 -1
- package/dist/{verify-BVk5bjdH-BXgGLM2U.mjs → verify-BVk5bjdH-dq5M4iIh.mjs} +2 -2
- package/dist/{verify-BVk5bjdH-BXgGLM2U.mjs.map → verify-BVk5bjdH-dq5M4iIh.mjs.map} +1 -1
- package/package.json +20 -18
- package/dist/ast-5hifzBHC.mjs.map +0 -1
- package/dist/ast-dPjHeaNs.d.mts.map +0 -1
- package/dist/authoring-type-constructors-DIyheCzv-BSrAEZsD.mjs.map +0 -1
- package/dist/config-types-DNRmpGNL.mjs.map +0 -1
- package/dist/contract-builder-Br5TlHMh.d.mts.map +0 -1
- package/dist/contract-builder-C3MYW38z.mjs.map +0 -1
- package/dist/control-BYOcSVih.mjs.map +0 -1
- package/dist/control-DL9y6GfG.d.mts.map +0 -1
- package/dist/control-adapter-C1hjk3Ic.d.mts +0 -1
- package/dist/control-adapter-WoXvPNj4-D64oWh9I.d.mts.map +0 -1
- package/dist/derived-checks-C_y1rk6O-DwCaGICl.mjs.map +0 -1
- package/dist/interpreter-C8cP92FD-BfjuQvb1.mjs.map +0 -1
- package/dist/middleware-CN4vQuOi.d.mts +0 -1
- package/dist/pack-C3mqZevM.d.mts.map +0 -1
- package/dist/plan-B7g2kDfQ-Dth0BeTe.d.mts.map +0 -1
- package/dist/plan-CrKSowWJ.d.mts +0 -2
- package/dist/psl-build-BnM1ZTyK.d.mts.map +0 -1
- package/dist/psl-build-zkIJwkdq.mjs.map +0 -1
- package/dist/psl-column-resolution-sNpXQygQ-BBo4tqwO.d.mts.map +0 -1
- package/dist/psl-field-resolution-_o74AUE4-C-vTNklI.mjs.map +0 -1
- package/dist/query-lane-context-BSmWfohZ-Jn0AbOQt.d.mts.map +0 -1
- package/dist/query-lane-context-DWdmmnrN.d.mts +0 -1
- package/dist/schema-verify-Xmpe1PGb-Bcd_2avJ.mjs.map +0 -1
- package/dist/sql-execution-plan-Db0j752I-dJ-JGxbD.d.mts.map +0 -1
- package/dist/type-map-DpfnXzun-DZaSuJXh.d.mts.map +0 -1
- package/dist/types-ByKpjyVh-CtYwWrbL.d.mts.map +0 -1
- package/dist/types-BzpC_V7p-DyBYmK1f.d.mts.map +0 -1
- package/dist/types-CQBRYgDW.d.mts +0 -1
- package/dist/types-DAoMCSPl-D2ajBTpK.mjs.map +0 -1
- package/dist/types-DdTdsdMn.d.mts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as ReferentialAction } from "./foreign-key-C-iTPuRT-C9ip8zFx.mjs";
|
|
2
2
|
import "./types-B11MGgKr.mjs";
|
|
3
|
-
import { E as CodecRef$1, Ft as TableSource, Lt as UpdateAst, O as ColumnRef, Ot as SelectAst, St as ProjectionItem, Z as InsertAst, _t as OrderByItem, c as AnyExpression, et as JoinAst, l as AnyFromSource } from "./types-
|
|
4
|
-
import { d as LiteralColumnDefault, l as ForeignKeyConstraint, m as UniqueConstraint, n as CheckExpressionConstraint, p as PrimaryKeyConstraint, r as DdlColumn, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-
|
|
3
|
+
import { E as CodecRef$1, Ft as TableSource, Lt as UpdateAst, O as ColumnRef, Ot as SelectAst, St as ProjectionItem, Z as InsertAst, _t as OrderByItem, c as AnyExpression, et as JoinAst, l as AnyFromSource } from "./types-Dskga3R1-BtXuRmbf.mjs";
|
|
4
|
+
import { d as LiteralColumnDefault, l as ForeignKeyConstraint, m as UniqueConstraint, n as CheckExpressionConstraint, p as PrimaryKeyConstraint, r as DdlColumn, t as AnyDdlColumnDefault, u as FunctionColumnDefault } from "./ddl-types-BUqZdoZK-vyWnW2PW.mjs";
|
|
5
5
|
import { ColumnDefaultLiteralInputValue } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { ParamSpec } from "@prisma/orm-framework/operations";
|
|
7
7
|
//#region ../../../2-sql/4-lanes/relational-core/dist/exports/contract-free.d.mts
|
|
@@ -32,6 +32,8 @@ declare function checkExpression(name: string, expression: string): CheckExpress
|
|
|
32
32
|
interface ColumnDescriptor {
|
|
33
33
|
readonly codecId: string;
|
|
34
34
|
readonly nullable: boolean;
|
|
35
|
+
/** The column holds a list of the codec's values. */
|
|
36
|
+
readonly many?: true;
|
|
35
37
|
}
|
|
36
38
|
type ColumnSchema = Record<string, ColumnDescriptor>;
|
|
37
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relational-core__contract-free.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/contract-free.d.mts"],"mappings":";;;;;;;;UAMU;WACC;WACA;WACA,UAAU;WACV,WAAW;;iBAEL,IAAI,OAAO,iCAAiC;iBAC5C,GAAG,qBAAqB;iBACxB,IAAI,cAAc,cAAc,UAAU,mBAAmB;iBAC7D,WAAW,4BAA4B;WAC7C;IACP;iBACa,WAAW,4BAA4B,kBAAkB,+BAA+B;WAC9F;WACA,WAAW;WACX,WAAW;IAClB;iBACa,OAAO,4BAA4B;WACzC;IACP;iBACa,gBAAgB,cAAc,qBAAqB;;;UAG1D;WACC;WACA;;KAEN,eAAe,eAAe;;;;;;cAMrB;WACH,KAAK;EACd,YAAY,KAAK;EACjB,IAAI,OAAO,SAAS;EACpB,GAAG,OAAO,SAAS;EACnB,OAAO;EACP,UAAU;EACV,aAAa;EACb,MAAM,mCAAmC;EACzC,MAAM,mCAAmC;EACzC,QAAQ,gBAAgB,kBAAkB;EAC1C,OAAO,OAAO,SAAS;;UAEf;WACC;WACA;WACA,MAAM;WACN,OAAO,cAAc;WACrB,SAAS;;cAEN;EACZ,aAAa;EACb,IAAI,mCAAmC;EACvC,cAAc,eAAe;EAC7B,MAAM,gBAAgB,kBAAkB;;;;;;;EAOxC,GAAG,SAAS,cAAc;EAC1B,UAAU,mBAAmB,eAAe;EAC5C,MAAM,OAAO,cAAc,UAAU;;;;;;EAMrC,IAAI,aAAa,SAAS,YAAY;EACtC,OAAO,OAAO,oBAAoB;EAClC,UAAU,OAAO,oBAAoB;;;iBAGtB,QAAQ,cAAc,iBAAiB;cAC1C;mBACK;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Ac;;cAEf,cAAc,eAAe;mBACxB;mBACA;mBACA;mBACA;mBACA;EACjB,YAAY,KAAK,aAAa,QAAQ,QAAQ,WAAW,eAAe,SAAS,cAAc,cAAc,cAAc,WAAW,eAAe;EACrJ,SAAS;;cAEG,cAAc,eAAe;mBACxB;mBACA;mBACA;mBACA;mBACA;EACjB,YAAY,KAAK,aAAa,QAAQ,QAAQ,YAAY,eAAe,qBAAqB,YAAY,oBAAoB,iBAAiB,cAAc;EAC7J,IAAI,QAAQ,eAAe,UAAU,cAAc;EACnD,MAAM,MAAM,SAAS,cAAc;EACnC,aAAa,SAAS,cAAc,eAAe,cAAc;EACjE,SAAS;;cAEG;mBACK;mBACA;mBACA;mBACA;EACjB,YAAY,KAAK,aAAa,iBAAiB,cAAc,iBAAiB,YAAY,oBAAoB,eAAe,cAAc;EAC3I,MAAM,MAAM,SAAS;EACrB,QAAQ,QAAQ,aAAa,uBAAuB;EACpD,SAAS;;;;;;;;;;;;;;;;;;;;;iBAqBM,MAAM,eAAe,cAAc,QAAQ,aAAa,QAAQ,SAAS,YAAY"}
|
|
1
|
+
{"version":3,"file":"relational-core__contract-free.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/contract-free.d.mts"],"mappings":";;;;;;;;UAMU;WACC;WACA;WACA,UAAU;WACV,WAAW;;iBAEL,IAAI,OAAO,iCAAiC;iBAC5C,GAAG,qBAAqB;iBACxB,IAAI,cAAc,cAAc,UAAU,mBAAmB;iBAC7D,WAAW,4BAA4B;WAC7C;IACP;iBACa,WAAW,4BAA4B,kBAAkB,+BAA+B;WAC9F;WACA,WAAW;WACX,WAAW;IAClB;iBACa,OAAO,4BAA4B;WACzC;IACP;iBACa,gBAAgB,cAAc,qBAAqB;;;UAG1D;WACC;WACA;;WAEA;;KAEN,eAAe,eAAe;;;;;;cAMrB;WACH,KAAK;EACd,YAAY,KAAK;EACjB,IAAI,OAAO,SAAS;EACpB,GAAG,OAAO,SAAS;EACnB,OAAO;EACP,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Source, L as UpdateAst, M as RawExpr, O as OrderByItem, P as SelectAst, T as NullCheckExpr, _ as InsertAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, v as InsertOnConflict, y as JoinAst } from "./types-
|
|
1
|
+
import { C as LiteralExpr, D as OrExpr, E as OperationExpr, I as TableSource, L as UpdateAst, M as RawExpr, O as OrderByItem, P as SelectAst, T as NullCheckExpr, _ as InsertAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, v as InsertOnConflict, y as JoinAst } from "./types-BLnsGaJf-m-qTW3ox.mjs";
|
|
2
2
|
import { a as ForeignKeyConstraint, f as opaqueSql, l as PrimaryKeyConstraint, n as DdlColumn, o as FunctionColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as UniqueConstraint } from "./opaque-sql-CwvHZSr8-Ch9goXqx.mjs";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -42,6 +42,12 @@ function checkExpression(name, expression) {
|
|
|
42
42
|
expression: opaqueSql(expression)
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
function codecRefOf(desc) {
|
|
46
|
+
return desc.many === true ? {
|
|
47
|
+
codecId: desc.codecId,
|
|
48
|
+
many: true
|
|
49
|
+
} : { codecId: desc.codecId };
|
|
50
|
+
}
|
|
45
51
|
/**
|
|
46
52
|
* A composable WHERE / ON expression. Wraps an `AnyExpression` and exposes
|
|
47
53
|
* fluent boolean combinators, mirroring the spirit of `sql-builder`'s
|
|
@@ -349,7 +355,7 @@ function makeColumnProxy(tableName, columnName, desc) {
|
|
|
349
355
|
isNull: () => new CfExpr(NullCheckExpr.isNull(ref)),
|
|
350
356
|
isNotNull: () => new CfExpr(NullCheckExpr.isNotNull(ref)),
|
|
351
357
|
toRef: () => ref,
|
|
352
|
-
toProjectionItem: (alias = columnName) => ProjectionItem.of(alias, ref,
|
|
358
|
+
toProjectionItem: (alias = columnName) => ProjectionItem.of(alias, ref, codecRefOf(desc))
|
|
353
359
|
};
|
|
354
360
|
}
|
|
355
361
|
function buildExcludedProxy(schema) {
|
|
@@ -363,11 +369,11 @@ function toInsertValue(value, desc) {
|
|
|
363
369
|
const expr = value.toExpr();
|
|
364
370
|
if (expr.kind === "column-ref" || expr.kind === "param-ref" || expr.kind === "prepared-param-ref" || expr.kind === "raw-expr") return expr;
|
|
365
371
|
}
|
|
366
|
-
return ParamRef.of(value, { codec:
|
|
372
|
+
return ParamRef.of(value, { codec: codecRefOf(desc) });
|
|
367
373
|
}
|
|
368
374
|
function toSetExpression(value, desc) {
|
|
369
375
|
if (isExpressionSource(value)) return value.toExpr();
|
|
370
|
-
return ParamRef.of(value, { codec:
|
|
376
|
+
return ParamRef.of(value, { codec: codecRefOf(desc) });
|
|
371
377
|
}
|
|
372
378
|
function buildInsertRow(schema, values) {
|
|
373
379
|
const row = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relational-core__contract-free.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/contract-free.mjs"],"sourcesContent":["import { C as LiteralExpr, D as OrExpr, E as OperationExpr, I as TableSource, L as UpdateAst, M as RawExpr, O as OrderByItem, P as SelectAst, T as NullCheckExpr, _ as InsertAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, v as InsertOnConflict, y as JoinAst } from \"../types-BPi4d3WI.mjs\";\nimport { a as DdlColumn, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as CheckExpressionConstraint, l as FunctionColumnDefault, n as opaqueSql, u as LiteralColumnDefault } from \"../opaque-sql-CwvHZSr8.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/contract-free/column.ts\nfunction lit(value) {\n\treturn new LiteralColumnDefault(value);\n}\nfunction fn(expression) {\n\treturn new FunctionColumnDefault(opaqueSql(expression));\n}\nfunction col(name, type, options) {\n\treturn new DdlColumn({\n\t\tname,\n\t\ttype,\n\t\t...options\n\t});\n}\nfunction primaryKey(columns, options) {\n\treturn new PrimaryKeyConstraint({\n\t\tcolumns,\n\t\t...options\n\t});\n}\nfunction foreignKey(columns, refTable, refColumns, options) {\n\treturn new ForeignKeyConstraint({\n\t\tcolumns,\n\t\trefTable,\n\t\trefColumns,\n\t\t...options\n\t});\n}\nfunction unique(columns, options) {\n\treturn new UniqueConstraint({\n\t\tcolumns,\n\t\t...options\n\t});\n}\nfunction checkExpression(name, expression) {\n\treturn new CheckExpressionConstraint({\n\t\tname,\n\t\texpression: opaqueSql(expression)\n\t});\n}\n//#endregion\n//#region src/contract-free/table.ts\n/**\n* A composable WHERE / ON expression. Wraps an `AnyExpression` and exposes\n* fluent boolean combinators, mirroring the spirit of `sql-builder`'s\n* `Expression` interface without the contract-bound type machinery.\n*/\nvar CfExpr = class CfExpr {\n\tast;\n\tconstructor(ast) {\n\t\tthis.ast = ast;\n\t}\n\tand(other) {\n\t\treturn new CfExpr(AndExpr.of([this.ast, other.ast]));\n\t}\n\tor(other) {\n\t\treturn new CfExpr(OrExpr.of([this.ast, other.ast]));\n\t}\n\tnot() {\n\t\treturn new CfExpr(this.ast.not());\n\t}\n\tisNull() {\n\t\treturn new CfExpr(NullCheckExpr.isNull(this.ast));\n\t}\n\tisNotNull() {\n\t\treturn new CfExpr(NullCheckExpr.isNotNull(this.ast));\n\t}\n\teqLit(value) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, LiteralExpr.of(value)));\n\t}\n\tgtLit(value) {\n\t\treturn new CfExpr(BinaryExpr.gt(this.ast, LiteralExpr.of(value)));\n\t}\n\teqParam(value, codecId) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, ParamRef.of(value, { codec: { codecId } })));\n\t}\n\teqExpr(other) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, other.ast));\n\t}\n};\nconst cfExpr = {\n\tcountStar() {\n\t\treturn new CfExpr(AggregateExpr.count());\n\t},\n\tlit(value) {\n\t\treturn new CfExpr(LiteralExpr.of(value));\n\t},\n\tidentifierRef(name) {\n\t\treturn new CfExpr(IdentifierRef.of(name));\n\t},\n\tparam(value, codecId) {\n\t\treturn new CfExpr(ParamRef.of(value, { codec: { codecId } }));\n\t},\n\t/**\n\t* Catalog function call lowered via a `'function'`-strategy template\n\t* (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so\n\t* target packages only supply vocabulary: template, codec'd operands,\n\t* and return spec.\n\t*/\n\tfn(options) {\n\t\treturn new CfExpr(new OperationExpr({\n\t\t\tmethod: options.method,\n\t\t\tself: options.self.ast,\n\t\t\targs: options.args?.map((arg) => arg.ast),\n\t\t\treturns: options.returns,\n\t\t\tlowering: {\n\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\ttemplate: options.template\n\t\t\t}\n\t\t}));\n\t},\n\tcolumnRef(qualifier, name) {\n\t\treturn new CfExpr(ColumnRef.of(qualifier, name));\n\t},\n\tallOf(exprs) {\n\t\treturn new CfExpr(AndExpr.of(exprs.map((expr) => expr.ast)));\n\t},\n\t/**\n\t* Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a\n\t* `RawExpr`. For zero-operand catalog functions where a `'function'`\n\t* lowering template has nothing to substitute.\n\t*/\n\traw(sql, returns) {\n\t\treturn new CfExpr(new RawExpr({\n\t\t\tparts: [sql],\n\t\t\treturns\n\t\t}));\n\t},\n\texists(query) {\n\t\treturn new CfExpr(ExistsExpr.exists(query.build()));\n\t},\n\tnotExists(query) {\n\t\treturn new CfExpr(ExistsExpr.notExists(query.build()));\n\t}\n};\n/** Aliased table source for catalog queries (no namespace coordinate). */\nfunction cfTable(name, alias) {\n\treturn TableSource.named(name, alias);\n}\nvar CfExprSelectQuery = class CfExprSelectQuery {\n\tsrc;\n\tprojectionItems;\n\twhereExpr;\n\tjoinItems;\n\tlimitValue;\n\tconstructor(src, projectionItems, whereExpr, joinItems = [], limitValue = void 0) {\n\t\tthis.src = src;\n\t\tthis.projectionItems = projectionItems;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.joinItems = joinItems;\n\t\tthis.limitValue = limitValue;\n\t}\n\tfrom(source) {\n\t\treturn new CfExprSelectQuery(source, this.projectionItems, this.whereExpr, this.joinItems, this.limitValue);\n\t}\n\tjoin(source, on) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.inner(source, on.ast)], this.limitValue);\n\t}\n\tleftJoin(source, on) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.left(source, on.ast)], this.limitValue);\n\t}\n\tproject(alias, expr) {\n\t\treturn new CfExprSelectQuery(this.src, [...this.projectionItems, ProjectionItem.of(alias, expr.ast)], this.whereExpr, this.joinItems, this.limitValue);\n\t}\n\twhere(expr) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, expr, this.joinItems, this.limitValue);\n\t}\n\tlimit(value) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, this.joinItems, value);\n\t}\n\tbuild() {\n\t\tif (this.joinItems.length > 0 && this.src === void 0) throw structuredError(\"ORM.ARGUMENT_INVALID\", \"CfExprSelectQuery: cannot add a JOIN without a FROM clause\");\n\t\tconst base = this.src !== void 0 ? SelectAst.from(this.src).withProjection(this.projectionItems) : SelectAst.noFrom().withProjection(this.projectionItems);\n\t\tconst withJoins = this.joinItems.length > 0 ? base.withJoins(this.joinItems) : base;\n\t\tconst withWhere = this.whereExpr !== void 0 ? withJoins.withWhere(this.whereExpr.ast) : withJoins;\n\t\treturn this.limitValue !== void 0 ? withWhere.withLimit(this.limitValue) : withWhere;\n\t}\n};\nfunction exprSelect() {\n\treturn new CfExprSelectQuery(void 0, [], void 0);\n}\nvar CfInsertQuery = class CfInsertQuery {\n\tsrc;\n\tschema;\n\trowValues;\n\treturningItems;\n\tconstructor(src, schema, rowValues, returningItems = void 0) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.returningItems = returningItems;\n\t}\n\treturning(...columns) {\n\t\treturn new CfInsertQuery(this.src, this.schema, this.rowValues, columns.map((col) => col.toProjectionItem()));\n\t}\n\tbuild() {\n\t\tconst row = buildInsertRow(this.schema, this.rowValues);\n\t\tconst ast = InsertAst.into(this.src).withRows([row]);\n\t\treturn this.returningItems ? ast.withReturning(this.returningItems) : ast;\n\t}\n};\nvar CfUpsertBuilder = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconstructor(src, schema, rowValues) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t}\n\tonConflict(...columns) {\n\t\treturn new CfConflictClause(this.src, this.schema, this.rowValues, [...columns]);\n\t}\n};\nvar CfConflictClause = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconflictCols;\n\tconstructor(src, schema, rowValues, conflictCols) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.conflictCols = conflictCols;\n\t}\n\tdoUpdate(setOrCallback) {\n\t\tconst set = typeof setOrCallback === \"function\" ? setOrCallback(buildExcludedProxy(this.schema)) : setOrCallback;\n\t\treturn new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, set);\n\t}\n\tdoNothing() {\n\t\treturn new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, void 0);\n\t}\n};\nvar CfUpsertQuery = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconflictCols;\n\tupdateSet;\n\tconstructor(src, schema, rowValues, conflictCols, updateSet) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.conflictCols = conflictCols;\n\t\tthis.updateSet = updateSet;\n\t}\n\tbuild() {\n\t\tconst row = buildInsertRow(this.schema, this.rowValues);\n\t\tconst conflictRefs = this.conflictCols.map((col) => col.toRef());\n\t\tconst onConflict = this.updateSet === void 0 ? InsertOnConflict.on(conflictRefs).doNothing() : InsertOnConflict.on(conflictRefs).doUpdateSet(buildSetMap(this.schema, this.updateSet));\n\t\treturn InsertAst.into(this.src).withRows([row]).withOnConflict(onConflict);\n\t}\n};\nvar CfUpdateQuery = class CfUpdateQuery {\n\tsrc;\n\tschema;\n\tsetValues;\n\twhereExpr;\n\treturningItems;\n\tconstructor(src, schema, setValues = void 0, whereExpr = void 0, returningItems = void 0) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.setValues = setValues;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.returningItems = returningItems;\n\t}\n\tset(values) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, values, this.whereExpr, this.returningItems);\n\t}\n\twhere(expr) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, this.setValues, expr, this.returningItems);\n\t}\n\treturning(...columns) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, this.setValues, this.whereExpr, columns.map((col) => col.toProjectionItem()));\n\t}\n\tbuild() {\n\t\tconst set = buildSetMap(this.schema, this.setValues);\n\t\tconst base = UpdateAst.table(this.src).withSet(set);\n\t\tconst withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n\t\treturn this.returningItems ? withWhere.withReturning(this.returningItems) : withWhere;\n\t}\n};\nvar CfSelectQuery = class CfSelectQuery {\n\tsrc;\n\tprojectionItems;\n\twhereExpr;\n\torderByItems;\n\tconstructor(src, projectionItems, whereExpr = void 0, orderByItems = []) {\n\t\tthis.src = src;\n\t\tthis.projectionItems = projectionItems;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.orderByItems = orderByItems;\n\t}\n\twhere(expr) {\n\t\treturn new CfSelectQuery(this.src, this.projectionItems, expr, this.orderByItems);\n\t}\n\torderBy(column, dir = \"asc\") {\n\t\tconst item = dir === \"asc\" ? OrderByItem.asc(column.toRef()) : OrderByItem.desc(column.toRef());\n\t\treturn new CfSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.orderByItems, item]);\n\t}\n\tbuild() {\n\t\tconst base = SelectAst.from(this.src).withProjection(this.projectionItems);\n\t\tconst withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n\t\treturn this.orderByItems.length > 0 ? withWhere.withOrderBy(this.orderByItems) : withWhere;\n\t}\n};\n/**\n* Declare a control-plane table once, binding column codecs at declaration time.\n* Returns a `TableHandle` whose column properties compose expressions directly\n* without per-call-site codec or column-name threading.\n*\n* ```ts\n* const marker = pgTable({ name: 'marker', schema: 'prisma_contract' }, {\n* space: text(),\n* core_hash: text(),\n* updated_at: timestamptz(),\n* });\n*\n* const query = marker.update()\n* .set({ core_hash: newHash, updated_at: NOW })\n* .where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom)))\n* .returning(marker.space)\n* .build();\n* ```\n*/\nfunction table(source, schema) {\n\tconst proxies = {};\n\tfor (const [col, desc] of Object.entries(schema)) proxies[col] = makeColumnProxy(source.alias ?? source.name, col, desc);\n\treturn blindCast({\n\t\t...proxies,\n\t\tsource,\n\t\tinsert: (row) => new CfInsertQuery(source, schema, row),\n\t\tupsert: (row) => new CfUpsertBuilder(source, schema, row),\n\t\tupdate: () => new CfUpdateQuery(source, schema),\n\t\tselect: (...cols) => new CfSelectQuery(source, cols.map((col) => col.toProjectionItem()))\n\t});\n}\nfunction makeColumnProxy(tableName, columnName, desc) {\n\tconst ref = ColumnRef.of(tableName, columnName);\n\treturn {\n\t\tcodecId: desc.codecId,\n\t\tnullable: desc.nullable,\n\t\tcolumnName,\n\t\ttableName,\n\t\teq: (value) => value === null ? new CfExpr(NullCheckExpr.isNull(ref)) : new CfExpr(BinaryExpr.eq(ref, toSetExpression(value, desc))),\n\t\tneq: (value) => value === null ? new CfExpr(NullCheckExpr.isNotNull(ref)) : new CfExpr(BinaryExpr.neq(ref, toSetExpression(value, desc))),\n\t\tisNull: () => new CfExpr(NullCheckExpr.isNull(ref)),\n\t\tisNotNull: () => new CfExpr(NullCheckExpr.isNotNull(ref)),\n\t\ttoRef: () => ref,\n\t\ttoProjectionItem: (alias = columnName) => ProjectionItem.of(alias, ref, { codecId: desc.codecId })\n\t};\n}\nfunction buildExcludedProxy(schema) {\n\treturn blindCast(Object.fromEntries(Object.keys(schema).map((col) => [col, ColumnRef.of(\"excluded\", col)])));\n}\nfunction isExpressionSource(value) {\n\treturn typeof value === \"object\" && value !== null && \"toExpr\" in value && typeof value.toExpr === \"function\";\n}\nfunction toInsertValue(value, desc) {\n\tif (isExpressionSource(value)) {\n\t\tconst expr = value.toExpr();\n\t\tif (expr.kind === \"column-ref\" || expr.kind === \"param-ref\" || expr.kind === \"prepared-param-ref\" || expr.kind === \"raw-expr\") return expr;\n\t}\n\treturn ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\nfunction toSetExpression(value, desc) {\n\tif (isExpressionSource(value)) return value.toExpr();\n\treturn ParamRef.of(value, { codec: { codecId: desc.codecId } });\n}\nfunction buildInsertRow(schema, values) {\n\tconst row = {};\n\tconst rawValues = blindCast(values);\n\tfor (const [col, desc] of Object.entries(schema)) row[col] = toInsertValue(rawValues[col], desc);\n\treturn row;\n}\nfunction buildSetMap(schema, values) {\n\tif (values === void 0) return {};\n\tconst set = {};\n\tconst rawSchema = blindCast(schema);\n\tconst rawValues = blindCast(values);\n\tfor (const [col, value] of Object.entries(rawValues)) {\n\t\tconst desc = rawSchema[col];\n\t\tif (desc !== void 0) set[col] = toSetExpression(value, desc);\n\t}\n\treturn set;\n}\n//#endregion\nexport { CfConflictClause, CfExpr, CfExprSelectQuery, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, cfExpr, cfTable, checkExpression, col, exprSelect, fn, foreignKey, lit, primaryKey, table, unique };\n\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AC/B,MAAM,MAAM,CAAC;CACb,MAAM,YAAY,UAAU,MAAM;CAClC,MAAM,YAAY,UAAU,MAAM;CAClC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,GAAG;EACrD,MAAM,OAAO,UAAU;EACvB,IAAI,SAAS,KAAK,GAAG,IAAI,OAAO,gBAAgB,OAAO,IAAI;CAC5D;CACA,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"relational-core__contract-free.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/contract-free.mjs"],"sourcesContent":["import { C as LiteralExpr, D as OrExpr, E as OperationExpr, I as TableSource, L as UpdateAst, M as RawExpr, O as OrderByItem, P as SelectAst, T as NullCheckExpr, _ as InsertAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, v as InsertOnConflict, y as JoinAst } from \"../types-BLnsGaJf.mjs\";\nimport { a as DdlColumn, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as CheckExpressionConstraint, l as FunctionColumnDefault, n as opaqueSql, u as LiteralColumnDefault } from \"../opaque-sql-CwvHZSr8.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/contract-free/column.ts\nfunction lit(value) {\n\treturn new LiteralColumnDefault(value);\n}\nfunction fn(expression) {\n\treturn new FunctionColumnDefault(opaqueSql(expression));\n}\nfunction col(name, type, options) {\n\treturn new DdlColumn({\n\t\tname,\n\t\ttype,\n\t\t...options\n\t});\n}\nfunction primaryKey(columns, options) {\n\treturn new PrimaryKeyConstraint({\n\t\tcolumns,\n\t\t...options\n\t});\n}\nfunction foreignKey(columns, refTable, refColumns, options) {\n\treturn new ForeignKeyConstraint({\n\t\tcolumns,\n\t\trefTable,\n\t\trefColumns,\n\t\t...options\n\t});\n}\nfunction unique(columns, options) {\n\treturn new UniqueConstraint({\n\t\tcolumns,\n\t\t...options\n\t});\n}\nfunction checkExpression(name, expression) {\n\treturn new CheckExpressionConstraint({\n\t\tname,\n\t\texpression: opaqueSql(expression)\n\t});\n}\n//#endregion\n//#region src/contract-free/table.ts\nfunction codecRefOf(desc) {\n\treturn desc.many === true ? {\n\t\tcodecId: desc.codecId,\n\t\tmany: true\n\t} : { codecId: desc.codecId };\n}\n/**\n* A composable WHERE / ON expression. Wraps an `AnyExpression` and exposes\n* fluent boolean combinators, mirroring the spirit of `sql-builder`'s\n* `Expression` interface without the contract-bound type machinery.\n*/\nvar CfExpr = class CfExpr {\n\tast;\n\tconstructor(ast) {\n\t\tthis.ast = ast;\n\t}\n\tand(other) {\n\t\treturn new CfExpr(AndExpr.of([this.ast, other.ast]));\n\t}\n\tor(other) {\n\t\treturn new CfExpr(OrExpr.of([this.ast, other.ast]));\n\t}\n\tnot() {\n\t\treturn new CfExpr(this.ast.not());\n\t}\n\tisNull() {\n\t\treturn new CfExpr(NullCheckExpr.isNull(this.ast));\n\t}\n\tisNotNull() {\n\t\treturn new CfExpr(NullCheckExpr.isNotNull(this.ast));\n\t}\n\teqLit(value) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, LiteralExpr.of(value)));\n\t}\n\tgtLit(value) {\n\t\treturn new CfExpr(BinaryExpr.gt(this.ast, LiteralExpr.of(value)));\n\t}\n\teqParam(value, codecId) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, ParamRef.of(value, { codec: { codecId } })));\n\t}\n\teqExpr(other) {\n\t\treturn new CfExpr(BinaryExpr.eq(this.ast, other.ast));\n\t}\n};\nconst cfExpr = {\n\tcountStar() {\n\t\treturn new CfExpr(AggregateExpr.count());\n\t},\n\tlit(value) {\n\t\treturn new CfExpr(LiteralExpr.of(value));\n\t},\n\tidentifierRef(name) {\n\t\treturn new CfExpr(IdentifierRef.of(name));\n\t},\n\tparam(value, codecId) {\n\t\treturn new CfExpr(ParamRef.of(value, { codec: { codecId } }));\n\t},\n\t/**\n\t* Catalog function call lowered via a `'function'`-strategy template\n\t* (e.g. `to_regclass({{self}})`). Owns the `OperationExpr` assembly so\n\t* target packages only supply vocabulary: template, codec'd operands,\n\t* and return spec.\n\t*/\n\tfn(options) {\n\t\treturn new CfExpr(new OperationExpr({\n\t\t\tmethod: options.method,\n\t\t\tself: options.self.ast,\n\t\t\targs: options.args?.map((arg) => arg.ast),\n\t\t\treturns: options.returns,\n\t\t\tlowering: {\n\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\ttemplate: options.template\n\t\t\t}\n\t\t}));\n\t},\n\tcolumnRef(qualifier, name) {\n\t\treturn new CfExpr(ColumnRef.of(qualifier, name));\n\t},\n\tallOf(exprs) {\n\t\treturn new CfExpr(AndExpr.of(exprs.map((expr) => expr.ast)));\n\t},\n\t/**\n\t* Opaque DB-side SQL expression (e.g. `current_schema()`) carried as a\n\t* `RawExpr`. For zero-operand catalog functions where a `'function'`\n\t* lowering template has nothing to substitute.\n\t*/\n\traw(sql, returns) {\n\t\treturn new CfExpr(new RawExpr({\n\t\t\tparts: [sql],\n\t\t\treturns\n\t\t}));\n\t},\n\texists(query) {\n\t\treturn new CfExpr(ExistsExpr.exists(query.build()));\n\t},\n\tnotExists(query) {\n\t\treturn new CfExpr(ExistsExpr.notExists(query.build()));\n\t}\n};\n/** Aliased table source for catalog queries (no namespace coordinate). */\nfunction cfTable(name, alias) {\n\treturn TableSource.named(name, alias);\n}\nvar CfExprSelectQuery = class CfExprSelectQuery {\n\tsrc;\n\tprojectionItems;\n\twhereExpr;\n\tjoinItems;\n\tlimitValue;\n\tconstructor(src, projectionItems, whereExpr, joinItems = [], limitValue = void 0) {\n\t\tthis.src = src;\n\t\tthis.projectionItems = projectionItems;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.joinItems = joinItems;\n\t\tthis.limitValue = limitValue;\n\t}\n\tfrom(source) {\n\t\treturn new CfExprSelectQuery(source, this.projectionItems, this.whereExpr, this.joinItems, this.limitValue);\n\t}\n\tjoin(source, on) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.inner(source, on.ast)], this.limitValue);\n\t}\n\tleftJoin(source, on) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.joinItems, JoinAst.left(source, on.ast)], this.limitValue);\n\t}\n\tproject(alias, expr) {\n\t\treturn new CfExprSelectQuery(this.src, [...this.projectionItems, ProjectionItem.of(alias, expr.ast)], this.whereExpr, this.joinItems, this.limitValue);\n\t}\n\twhere(expr) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, expr, this.joinItems, this.limitValue);\n\t}\n\tlimit(value) {\n\t\treturn new CfExprSelectQuery(this.src, this.projectionItems, this.whereExpr, this.joinItems, value);\n\t}\n\tbuild() {\n\t\tif (this.joinItems.length > 0 && this.src === void 0) throw structuredError(\"ORM.ARGUMENT_INVALID\", \"CfExprSelectQuery: cannot add a JOIN without a FROM clause\");\n\t\tconst base = this.src !== void 0 ? SelectAst.from(this.src).withProjection(this.projectionItems) : SelectAst.noFrom().withProjection(this.projectionItems);\n\t\tconst withJoins = this.joinItems.length > 0 ? base.withJoins(this.joinItems) : base;\n\t\tconst withWhere = this.whereExpr !== void 0 ? withJoins.withWhere(this.whereExpr.ast) : withJoins;\n\t\treturn this.limitValue !== void 0 ? withWhere.withLimit(this.limitValue) : withWhere;\n\t}\n};\nfunction exprSelect() {\n\treturn new CfExprSelectQuery(void 0, [], void 0);\n}\nvar CfInsertQuery = class CfInsertQuery {\n\tsrc;\n\tschema;\n\trowValues;\n\treturningItems;\n\tconstructor(src, schema, rowValues, returningItems = void 0) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.returningItems = returningItems;\n\t}\n\treturning(...columns) {\n\t\treturn new CfInsertQuery(this.src, this.schema, this.rowValues, columns.map((col) => col.toProjectionItem()));\n\t}\n\tbuild() {\n\t\tconst row = buildInsertRow(this.schema, this.rowValues);\n\t\tconst ast = InsertAst.into(this.src).withRows([row]);\n\t\treturn this.returningItems ? ast.withReturning(this.returningItems) : ast;\n\t}\n};\nvar CfUpsertBuilder = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconstructor(src, schema, rowValues) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t}\n\tonConflict(...columns) {\n\t\treturn new CfConflictClause(this.src, this.schema, this.rowValues, [...columns]);\n\t}\n};\nvar CfConflictClause = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconflictCols;\n\tconstructor(src, schema, rowValues, conflictCols) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.conflictCols = conflictCols;\n\t}\n\tdoUpdate(setOrCallback) {\n\t\tconst set = typeof setOrCallback === \"function\" ? setOrCallback(buildExcludedProxy(this.schema)) : setOrCallback;\n\t\treturn new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, set);\n\t}\n\tdoNothing() {\n\t\treturn new CfUpsertQuery(this.src, this.schema, this.rowValues, this.conflictCols, void 0);\n\t}\n};\nvar CfUpsertQuery = class {\n\tsrc;\n\tschema;\n\trowValues;\n\tconflictCols;\n\tupdateSet;\n\tconstructor(src, schema, rowValues, conflictCols, updateSet) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.rowValues = rowValues;\n\t\tthis.conflictCols = conflictCols;\n\t\tthis.updateSet = updateSet;\n\t}\n\tbuild() {\n\t\tconst row = buildInsertRow(this.schema, this.rowValues);\n\t\tconst conflictRefs = this.conflictCols.map((col) => col.toRef());\n\t\tconst onConflict = this.updateSet === void 0 ? InsertOnConflict.on(conflictRefs).doNothing() : InsertOnConflict.on(conflictRefs).doUpdateSet(buildSetMap(this.schema, this.updateSet));\n\t\treturn InsertAst.into(this.src).withRows([row]).withOnConflict(onConflict);\n\t}\n};\nvar CfUpdateQuery = class CfUpdateQuery {\n\tsrc;\n\tschema;\n\tsetValues;\n\twhereExpr;\n\treturningItems;\n\tconstructor(src, schema, setValues = void 0, whereExpr = void 0, returningItems = void 0) {\n\t\tthis.src = src;\n\t\tthis.schema = schema;\n\t\tthis.setValues = setValues;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.returningItems = returningItems;\n\t}\n\tset(values) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, values, this.whereExpr, this.returningItems);\n\t}\n\twhere(expr) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, this.setValues, expr, this.returningItems);\n\t}\n\treturning(...columns) {\n\t\treturn new CfUpdateQuery(this.src, this.schema, this.setValues, this.whereExpr, columns.map((col) => col.toProjectionItem()));\n\t}\n\tbuild() {\n\t\tconst set = buildSetMap(this.schema, this.setValues);\n\t\tconst base = UpdateAst.table(this.src).withSet(set);\n\t\tconst withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n\t\treturn this.returningItems ? withWhere.withReturning(this.returningItems) : withWhere;\n\t}\n};\nvar CfSelectQuery = class CfSelectQuery {\n\tsrc;\n\tprojectionItems;\n\twhereExpr;\n\torderByItems;\n\tconstructor(src, projectionItems, whereExpr = void 0, orderByItems = []) {\n\t\tthis.src = src;\n\t\tthis.projectionItems = projectionItems;\n\t\tthis.whereExpr = whereExpr;\n\t\tthis.orderByItems = orderByItems;\n\t}\n\twhere(expr) {\n\t\treturn new CfSelectQuery(this.src, this.projectionItems, expr, this.orderByItems);\n\t}\n\torderBy(column, dir = \"asc\") {\n\t\tconst item = dir === \"asc\" ? OrderByItem.asc(column.toRef()) : OrderByItem.desc(column.toRef());\n\t\treturn new CfSelectQuery(this.src, this.projectionItems, this.whereExpr, [...this.orderByItems, item]);\n\t}\n\tbuild() {\n\t\tconst base = SelectAst.from(this.src).withProjection(this.projectionItems);\n\t\tconst withWhere = this.whereExpr ? base.withWhere(this.whereExpr.ast) : base;\n\t\treturn this.orderByItems.length > 0 ? withWhere.withOrderBy(this.orderByItems) : withWhere;\n\t}\n};\n/**\n* Declare a control-plane table once, binding column codecs at declaration time.\n* Returns a `TableHandle` whose column properties compose expressions directly\n* without per-call-site codec or column-name threading.\n*\n* ```ts\n* const marker = pgTable({ name: 'marker', schema: 'prisma_contract' }, {\n* space: text(),\n* core_hash: text(),\n* updated_at: timestamptz(),\n* });\n*\n* const query = marker.update()\n* .set({ core_hash: newHash, updated_at: NOW })\n* .where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom)))\n* .returning(marker.space)\n* .build();\n* ```\n*/\nfunction table(source, schema) {\n\tconst proxies = {};\n\tfor (const [col, desc] of Object.entries(schema)) proxies[col] = makeColumnProxy(source.alias ?? source.name, col, desc);\n\treturn blindCast({\n\t\t...proxies,\n\t\tsource,\n\t\tinsert: (row) => new CfInsertQuery(source, schema, row),\n\t\tupsert: (row) => new CfUpsertBuilder(source, schema, row),\n\t\tupdate: () => new CfUpdateQuery(source, schema),\n\t\tselect: (...cols) => new CfSelectQuery(source, cols.map((col) => col.toProjectionItem()))\n\t});\n}\nfunction makeColumnProxy(tableName, columnName, desc) {\n\tconst ref = ColumnRef.of(tableName, columnName);\n\treturn {\n\t\tcodecId: desc.codecId,\n\t\tnullable: desc.nullable,\n\t\tcolumnName,\n\t\ttableName,\n\t\teq: (value) => value === null ? new CfExpr(NullCheckExpr.isNull(ref)) : new CfExpr(BinaryExpr.eq(ref, toSetExpression(value, desc))),\n\t\tneq: (value) => value === null ? new CfExpr(NullCheckExpr.isNotNull(ref)) : new CfExpr(BinaryExpr.neq(ref, toSetExpression(value, desc))),\n\t\tisNull: () => new CfExpr(NullCheckExpr.isNull(ref)),\n\t\tisNotNull: () => new CfExpr(NullCheckExpr.isNotNull(ref)),\n\t\ttoRef: () => ref,\n\t\ttoProjectionItem: (alias = columnName) => ProjectionItem.of(alias, ref, codecRefOf(desc))\n\t};\n}\nfunction buildExcludedProxy(schema) {\n\treturn blindCast(Object.fromEntries(Object.keys(schema).map((col) => [col, ColumnRef.of(\"excluded\", col)])));\n}\nfunction isExpressionSource(value) {\n\treturn typeof value === \"object\" && value !== null && \"toExpr\" in value && typeof value.toExpr === \"function\";\n}\nfunction toInsertValue(value, desc) {\n\tif (isExpressionSource(value)) {\n\t\tconst expr = value.toExpr();\n\t\tif (expr.kind === \"column-ref\" || expr.kind === \"param-ref\" || expr.kind === \"prepared-param-ref\" || expr.kind === \"raw-expr\") return expr;\n\t}\n\treturn ParamRef.of(value, { codec: codecRefOf(desc) });\n}\nfunction toSetExpression(value, desc) {\n\tif (isExpressionSource(value)) return value.toExpr();\n\treturn ParamRef.of(value, { codec: codecRefOf(desc) });\n}\nfunction buildInsertRow(schema, values) {\n\tconst row = {};\n\tconst rawValues = blindCast(values);\n\tfor (const [col, desc] of Object.entries(schema)) row[col] = toInsertValue(rawValues[col], desc);\n\treturn row;\n}\nfunction buildSetMap(schema, values) {\n\tif (values === void 0) return {};\n\tconst set = {};\n\tconst rawSchema = blindCast(schema);\n\tconst rawValues = blindCast(values);\n\tfor (const [col, value] of Object.entries(rawValues)) {\n\t\tconst desc = rawSchema[col];\n\t\tif (desc !== void 0) set[col] = toSetExpression(value, desc);\n\t}\n\treturn set;\n}\n//#endregion\nexport { CfConflictClause, CfExpr, CfExprSelectQuery, CfInsertQuery, CfSelectQuery, CfUpdateQuery, CfUpsertBuilder, CfUpsertQuery, cfExpr, cfTable, checkExpression, col, exprSelect, fn, foreignKey, lit, primaryKey, table, unique };\n\n//# sourceMappingURL=contract-free.mjs.map"],"mappings":";;;;;AAKA,SAAS,IAAI,OAAO;CACnB,OAAO,IAAI,qBAAqB,KAAK;AACtC;AACA,SAAS,GAAG,YAAY;CACvB,OAAO,IAAI,sBAAsB,UAAU,UAAU,CAAC;AACvD;AACA,SAAS,IAAI,MAAM,MAAM,SAAS;CACjC,OAAO,IAAI,UAAU;EACpB;EACA;EACA,GAAG;CACJ,CAAC;AACF;AACA,SAAS,WAAW,SAAS,SAAS;CACrC,OAAO,IAAI,qBAAqB;EAC/B;EACA,GAAG;CACJ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,2 +1,2 @@
|
|
|
1
|
-
import { C as buildOperation, D as param, E as isExpression, O as toExpr, S as TraitExpression, T as createRawSql, _ as RawSqlStatementBuilder, a as CodecValue, b as ScalarListExpression, c as RawAffectedCountQuery, d as RawRow, f as RawRowQuery, g as RawSqlInterpolation, h as RawSqlBuilder, i as CodecTypesBase, l as RawCodecInferer, m as RawRowSpecEntry, n as BuildOperationSpec, o as Expression, p as RawRowSpec, r as CodecExpression, s as NoReservedRowColumn, t as AffectedCount, u as RawPlanContext, v as RawSqlStatementTag, w as codecOf, x as ScopeField, y as RawSqlTag } from "./expression-
|
|
1
|
+
import { C as buildOperation, D as param, E as isExpression, O as toExpr, S as TraitExpression, T as createRawSql, _ as RawSqlStatementBuilder, a as CodecValue, b as ScalarListExpression, c as RawAffectedCountQuery, d as RawRow, f as RawRowQuery, g as RawSqlInterpolation, h as RawSqlBuilder, i as CodecTypesBase, l as RawCodecInferer, m as RawRowSpecEntry, n as BuildOperationSpec, o as Expression, p as RawRowSpec, r as CodecExpression, s as NoReservedRowColumn, t as AffectedCount, u as RawPlanContext, v as RawSqlStatementTag, w as codecOf, x as ScopeField, y as RawSqlTag } from "./expression-Bf_MkeQS.mjs";
|
|
2
2
|
export { AffectedCount, BuildOperationSpec, CodecExpression, CodecTypesBase, CodecValue, Expression, NoReservedRowColumn, RawAffectedCountQuery, RawCodecInferer, RawPlanContext, RawRow, RawRowQuery, RawRowSpec, RawRowSpecEntry, RawSqlBuilder, RawSqlInterpolation, RawSqlStatementBuilder, RawSqlStatementTag, RawSqlTag, ScalarListExpression, ScopeField, TraitExpression, buildOperation, codecOf, createRawSql, isExpression, param, toExpr };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as param, i as isExpression, n as codecOf, o as toExpr, r as createRawSql, t as buildOperation } from "./expression-
|
|
1
|
+
import { a as param, i as isExpression, n as codecOf, o as toExpr, r as createRawSql, t as buildOperation } from "./expression-Bv8X6-Qg.mjs";
|
|
2
2
|
export { buildOperation, codecOf, createRawSql, isExpression, param, toExpr };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-
|
|
2
|
-
import "./middleware-
|
|
1
|
+
import { a as SqlParamRefMutatorInternal, i as SqlParamRefMutator, n as ParamRefEntryUnion, o as createSqlParamRefMutator, r as ParamRefHandle, t as ParamRefEntry } from "./middleware-BtMX6nSF-DUnzMyGl.mjs";
|
|
2
|
+
import "./middleware-pBMsszaq.mjs";
|
|
3
3
|
export { type ParamRefEntry, type ParamRefEntryUnion, type ParamRefHandle, type SqlParamRefMutator, type SqlParamRefMutatorInternal, createSqlParamRefMutator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as SqlQueryPlan, r as planFromAst, t as Preparable } from "./plan-
|
|
2
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-
|
|
3
|
-
import "./plan-
|
|
1
|
+
import { n as SqlQueryPlan, r as planFromAst, t as Preparable } from "./plan-BlQITcbP-DvbDlHXA.mjs";
|
|
2
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-CV6K4o9N-DAIvJbkb.mjs";
|
|
3
|
+
import "./plan-BbkBYyGR.mjs";
|
|
4
4
|
export { Preparable, type SqlExecutionPlan, SqlQueryPlan, planFromAst };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-
|
|
2
|
-
import "./query-lane-context-
|
|
1
|
+
import { a as SqlAggregateDescriptorRegistry, c as TypeHelperRegistry, n as ExecutionContext, r as ResolvedSqlAggregate, t as CodecDescriptorRegistry } from "./query-lane-context-OSV9X636-CcPv1TZj.mjs";
|
|
2
|
+
import "./query-lane-context-CLtywrTY.mjs";
|
|
3
3
|
export { CodecDescriptorRegistry, ExecutionContext, ResolvedSqlAggregate, SqlAggregateDescriptorRegistry, TypeHelperRegistry };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { S as TablesOf, _ as SqlOrmPlan, a as ColumnsOf, b as TableKey, c as META, d as ModelMetadata, f as OperationTypeSignature, g as SqlBuilderOptions, h as RuntimeScope, i as ColumnResolutionContract, l as Meta, m as OperationsForTypeId, n as BuildParamsMap, o as ComputeColumnJsType, p as OperationTypes, r as CodecTypes, s as Expr, t as BuildOptions, u as ModelDef, v as SqlPlan, x as TableMetadata, y as TableDef } from "./types-DpwLgzPO-Cb9nQ-Wt.mjs";
|
|
2
|
+
import "./types-QvcS13Qc.mjs";
|
|
3
3
|
export { BuildOptions, BuildParamsMap, CodecTypes, ColumnResolutionContract, ColumnsOf, ComputeColumnJsType, Expr, META, Meta, ModelDef, ModelMetadata, OperationTypeSignature, OperationTypes, OperationsForTypeId, type RuntimeScope, SqlBuilderOptions, type SqlOrmPlan, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf };
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as TypeHelperRegistry, n as ExecutionContext } from "./query-lane-context-
|
|
3
|
-
import { A as SqlMiddlewareContext, B as TransactionContext, C as RuntimeParameterizedCodecDescriptor, D as SqlExecutionStack, E as RuntimeTransaction, F as SqlRuntimeExtensionDescriptor, G as encodeParamsWithMetadata, H as createExecutionContext, I as SqlRuntimeExtensionInstance, J as withTransaction, L as SqlRuntimeTargetDescriptor, M as SqlRuntimeAdapterInstance, N as SqlRuntimeBase, O as SqlExecutionStackWithDriver, P as SqlRuntimeDriverInstance, R as SqlStaticContributions, S as RuntimeOptions, T as RuntimeTelemetryEvent, U as createSqlExecutionStack, V as VerifyMarkerOption, W as deriveParamMetadata, _ as PreparedStatementInternals, a as DeclaredCodecId, b as RuntimeConnection, c as ParamSpec, d as PreparedExecution, f as PreparedExecutionImpl, g as PreparedStatementImpl, i as Declaration, j as SqlRuntimeAdapterDescriptor, k as SqlMiddleware, l as ParamsFromDeclaration, m as PreparedStatement, n as CloseRefusal, o as DeclaredNullable, p as PreparedFor, r as ConnectionProvider, s as MarkerReader, t as BindSiteParams, u as PrepareCallback, w as RuntimeQueryable, x as RuntimeFamilyAdapter, y as Runtime, z as TelemetryOutcome } from "./prepared-statement-Cv54gpY_-
|
|
4
|
-
import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-
|
|
1
|
+
import { c as MarkerReadResult } from "./ast-BUbHXpzG.mjs";
|
|
2
|
+
import { c as TypeHelperRegistry, n as ExecutionContext } from "./query-lane-context-OSV9X636-CcPv1TZj.mjs";
|
|
3
|
+
import { A as SqlMiddlewareContext, B as TransactionContext, C as RuntimeParameterizedCodecDescriptor, D as SqlExecutionStack, E as RuntimeTransaction, F as SqlRuntimeExtensionDescriptor, G as encodeParamsWithMetadata, H as createExecutionContext, I as SqlRuntimeExtensionInstance, J as withTransaction, L as SqlRuntimeTargetDescriptor, M as SqlRuntimeAdapterInstance, N as SqlRuntimeBase, O as SqlExecutionStackWithDriver, P as SqlRuntimeDriverInstance, R as SqlStaticContributions, S as RuntimeOptions, T as RuntimeTelemetryEvent, U as createSqlExecutionStack, V as VerifyMarkerOption, W as deriveParamMetadata, _ as PreparedStatementInternals, a as DeclaredCodecId, b as RuntimeConnection, c as ParamSpec, d as PreparedExecution, f as PreparedExecutionImpl, g as PreparedStatementImpl, i as Declaration, j as SqlRuntimeAdapterDescriptor, k as SqlMiddleware, l as ParamsFromDeclaration, m as PreparedStatement, n as CloseRefusal, o as DeclaredNullable, p as PreparedFor, r as ConnectionProvider, s as MarkerReader, t as BindSiteParams, u as PrepareCallback, w as RuntimeQueryable, x as RuntimeFamilyAdapter, y as Runtime, z as TelemetryOutcome } from "./prepared-statement-Cv54gpY_-dg9Qr8sK.mjs";
|
|
4
|
+
import { a as LintsOptions, c as budgets, d as lints, f as lowerSqlPlan, i as ExecuteInterceptResult, l as createAstCodecRegistry, m as validateContractCodecMappings, n as AfterQueryResult, o as Log, p as validateCodecRegistryCompleteness, r as BudgetsOptions, s as QueryInterceptResult, t as AfterExecuteResult, u as extractCodecIds } from "./index-D2ho4por.mjs";
|
|
5
5
|
export { type AfterExecuteResult, type AfterQueryResult, type BindSiteParams, type BudgetsOptions, type CloseRefusal, type ConnectionProvider, type Declaration, type DeclaredCodecId, type DeclaredNullable, type ExecuteInterceptResult, type ExecutionContext, type LintsOptions, type Log, type MarkerReadResult, type MarkerReader, type ParamSpec, type ParamsFromDeclaration, type PrepareCallback, type PreparedExecution, PreparedExecutionImpl, type PreparedFor, type PreparedStatement, PreparedStatementImpl, type PreparedStatementInternals, type QueryInterceptResult, type Runtime, type RuntimeConnection, type RuntimeFamilyAdapter, type RuntimeOptions, type RuntimeParameterizedCodecDescriptor, type RuntimeQueryable, type RuntimeTelemetryEvent, type RuntimeTransaction, type SqlExecutionStack, type SqlExecutionStackWithDriver, type SqlMiddleware, type SqlMiddlewareContext, type SqlRuntimeAdapterDescriptor, type SqlRuntimeAdapterInstance, SqlRuntimeBase, type SqlRuntimeDriverInstance, type SqlRuntimeExtensionDescriptor, type SqlRuntimeExtensionInstance, type SqlRuntimeTargetDescriptor, type SqlStaticContributions, type TelemetryOutcome, type TransactionContext, type TypeHelperRegistry, type VerifyMarkerOption, budgets, createAstCodecRegistry, createExecutionContext, createSqlExecutionStack, deriveParamMetadata, encodeParamsWithMetadata, extractCodecIds, lints, lowerSqlPlan, validateCodecRegistryCompleteness, validateContractCodecMappings, withTransaction };
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as createSqlOperationRegistry } from "./dist-C_q1_QR9.mjs";
|
|
2
|
-
import { A as PreparedParamRef, W as isQueryAst } from "./types-
|
|
2
|
+
import { A as PreparedParamRef, W as isQueryAst } from "./types-BLnsGaJf-m-qTW3ox.mjs";
|
|
3
3
|
import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
|
|
4
4
|
import { t as createSqlParamRefMutator } from "./middleware-CMr4CHNz-DHIUdxlm.mjs";
|
|
5
|
-
import { t as buildSqlAggregateDescriptorRegistry } from "./aggregate-descriptor-registry-
|
|
6
|
-
import { t as buildCodecDescriptorRegistry } from "./codec-descriptor-registry-
|
|
5
|
+
import { t as buildSqlAggregateDescriptorRegistry } from "./aggregate-descriptor-registry-B3RG0Zom.mjs";
|
|
6
|
+
import { t as buildCodecDescriptorRegistry } from "./codec-descriptor-registry-BW0REwkz.mjs";
|
|
7
7
|
import { i as runPreparedQuery, n as preparedStatementQuery, r as runPreparedExecute, t as preparedStatementExecute } from "./prepared-query-BJr50wPm-ChoqfJbX.mjs";
|
|
8
8
|
import { isStructuredError, structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
|
-
import { assertNever, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
11
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
12
10
|
import { materializeCodec, resolveCodecDescriptorOrThrow } from "@prisma/orm-framework/components/codec";
|
|
11
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
12
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
13
|
+
import { assertNever, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
13
14
|
import { checkContractComponentRequirements, mergeCapabilityMatrices } from "@prisma/orm-framework/components/components";
|
|
14
15
|
import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError as runtimeError$1 } from "@prisma/orm-framework/components/runtime";
|
|
15
|
-
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
16
16
|
import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
|
|
17
17
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
18
18
|
import { createExecutionStack } from "@prisma/orm-framework/components/execution";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { K as preparedStatementExecute, h as PreparedStatementExecuteTarget, q as preparedStatementQuery, v as PreparedStatementQueryTarget } from "./prepared-statement-Cv54gpY_-
|
|
1
|
+
import { K as preparedStatementExecute, h as PreparedStatementExecuteTarget, q as preparedStatementQuery, v as PreparedStatementQueryTarget } from "./prepared-statement-Cv54gpY_-dg9Qr8sK.mjs";
|
|
2
2
|
export { type PreparedStatementExecuteTarget, type PreparedStatementQueryTarget, preparedStatementExecute, preparedStatementQuery };
|
package/dist/{schema-differ-DpG_gnur-CUh9eZM-.d.mts → schema-differ-DpG_gnur-if2KDxZC.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as SqlStorage } from "./sql-storage-jJySr7bL-C_xAiyzH.mjs";
|
|
2
2
|
import "./types-B11MGgKr.mjs";
|
|
3
|
-
import { y as SqlSchemaIRNode } from "./types-
|
|
4
|
-
import "./types-
|
|
3
|
+
import { y as SqlSchemaIRNode } from "./types-Da1Y_OI7-BPyFwdFU.mjs";
|
|
4
|
+
import "./types-DZA5xxDT.mjs";
|
|
5
5
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
7
7
|
import { SchemaDiffIssue } from "@prisma/orm-framework/components/control";
|
|
@@ -44,4 +44,4 @@ interface SqlSchemaDiffInput {
|
|
|
44
44
|
type SqlSchemaDiffFn = (input: SqlSchemaDiffInput) => SqlSchemaDiffResult;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { SqlSchemaDiffInput as n, SqlSchemaDiffResult as r, SqlSchemaDiffFn as t };
|
|
47
|
-
//# sourceMappingURL=schema-differ-DpG_gnur-
|
|
47
|
+
//# sourceMappingURL=schema-differ-DpG_gnur-if2KDxZC.d.mts.map
|
package/dist/{schema-differ-DpG_gnur-CUh9eZM-.d.mts.map → schema-differ-DpG_gnur-if2KDxZC.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-differ-DpG_gnur-
|
|
1
|
+
{"version":3,"file":"schema-differ-DpG_gnur-if2KDxZC.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/schema-differ-DpG_gnur.d.mts"],"mappings":";;;;;;;;;;;;;;;;;UAcU;;WAEC,iBAAiB;;;;;;;;;WASjB,uBAAuB,OAAO,oBAAoB;;;;;;WAMlD,gBAAgB;aACd,QAAQ;;;UAGX;WACC,UAAU,SAAS;WACnB,QAAQ;WACR,qBAAqB,cAAc;;KAEzC,mBAAmB,OAAO,uBAAuB"}
|
package/dist/schema-ir.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { type DefaultInCanonicalForm, PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput,
|
|
1
|
+
import { C as SqlUniqueIRInput, D as defineNonEnumerable, E as defaultInCanonicalForm, O as relationalNodeEntityKind, S as SqlUniqueIR, T as contractDefaultRefusal, _ as SqlSchemaIR, a as SqlAnnotations, b as SqlTableIR, c as SqlColumnDefaultIR, d as SqlColumnIRInput, f as SqlForeignKeyIR, g as SqlReferentialAction, h as SqlIndexIRInput, i as RelationalSchemaNodeKind, k as relationalNodeGranularity, l as SqlColumnDefaultIRInput, m as SqlIndexIR, n as PrimaryKey, o as SqlCheckConstraintIR, p as SqlForeignKeyIRInput, r as PrimaryKeyInput, s as SqlCheckConstraintIRInput, t as DefaultInCanonicalForm, u as SqlColumnIR, v as SqlSchemaIRInput, w as assertNode, x as SqlTableIRInput, y as SqlSchemaIRNode } from "./types-Da1Y_OI7-BPyFwdFU.mjs";
|
|
2
|
+
export { type DefaultInCanonicalForm, PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput, SqlUniqueIR, type SqlUniqueIRInput, assertNode, contractDefaultRefusal, defaultInCanonicalForm, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
|
package/dist/schema-ir.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as relationalNodeGranularity, a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, g as relationalNodeEntityKind, h as defineNonEnumerable, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as defaultInCanonicalForm, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as contractDefaultRefusal, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-
|
|
1
|
+
import { _ as relationalNodeGranularity, a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, g as relationalNodeEntityKind, h as defineNonEnumerable, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as defaultInCanonicalForm, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as contractDefaultRefusal, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-CyPuXMTn-pumFirZ6.mjs";
|
|
2
2
|
export { PrimaryKey, RelationalSchemaNodeKind, SqlCheckConstraintIR, SqlColumnDefaultIR, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlSchemaIRNode, SqlTableIR, SqlUniqueIR, assertNode, contractDefaultRefusal, defaultInCanonicalForm, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./types-
|
|
3
|
-
export { type DefaultInCanonicalForm, PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput,
|
|
1
|
+
import { C as SqlUniqueIRInput, D as defineNonEnumerable, E as defaultInCanonicalForm, O as relationalNodeEntityKind, S as SqlUniqueIR, T as contractDefaultRefusal, _ as SqlSchemaIR, a as SqlAnnotations, b as SqlTableIR, c as SqlColumnDefaultIR, d as SqlColumnIRInput, f as SqlForeignKeyIR, g as SqlReferentialAction, h as SqlIndexIRInput, i as RelationalSchemaNodeKind, k as relationalNodeGranularity, l as SqlColumnDefaultIRInput, m as SqlIndexIR, n as PrimaryKey, o as SqlCheckConstraintIR, p as SqlForeignKeyIRInput, r as PrimaryKeyInput, s as SqlCheckConstraintIRInput, t as DefaultInCanonicalForm, u as SqlColumnIR, v as SqlSchemaIRInput, w as assertNode, x as SqlTableIRInput, y as SqlSchemaIRNode } from "./types-Da1Y_OI7-BPyFwdFU.mjs";
|
|
2
|
+
import "./types-DZA5xxDT.mjs";
|
|
3
|
+
export { type DefaultInCanonicalForm, PrimaryKey, type PrimaryKeyInput, RelationalSchemaNodeKind, type SqlAnnotations, SqlCheckConstraintIR, type SqlCheckConstraintIRInput, SqlColumnDefaultIR, type SqlColumnDefaultIRInput, SqlColumnIR, type SqlColumnIRInput, SqlForeignKeyIR, type SqlForeignKeyIRInput, SqlIndexIR, type SqlIndexIRInput, type SqlReferentialAction, SqlSchemaIR, type SqlSchemaIRInput, SqlSchemaIRNode, SqlTableIR, type SqlTableIRInput, SqlUniqueIR, type SqlUniqueIRInput, assertNode, contractDefaultRefusal, defaultInCanonicalForm, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as relationalNodeGranularity, a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, g as relationalNodeEntityKind, h as defineNonEnumerable, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as defaultInCanonicalForm, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as contractDefaultRefusal, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-
|
|
1
|
+
import { _ as relationalNodeGranularity, a as SqlColumnIR, c as SqlSchemaIR, d as SqlUniqueIR, f as assertNode, g as relationalNodeEntityKind, h as defineNonEnumerable, i as SqlColumnDefaultIR, l as SqlSchemaIRNode, m as defaultInCanonicalForm, n as RelationalSchemaNodeKind, o as SqlForeignKeyIR, p as contractDefaultRefusal, r as SqlCheckConstraintIR, s as SqlIndexIR, t as PrimaryKey, u as SqlTableIR } from "./types-CyPuXMTn-pumFirZ6.mjs";
|
|
2
2
|
export { PrimaryKey, RelationalSchemaNodeKind, SqlCheckConstraintIR, SqlColumnDefaultIR, SqlColumnIR, SqlForeignKeyIR, SqlIndexIR, SqlSchemaIR, SqlSchemaIRNode, SqlTableIR, SqlUniqueIR, assertNode, contractDefaultRefusal, defaultInCanonicalForm, defineNonEnumerable, relationalNodeEntityKind, relationalNodeGranularity };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { n as findSqlDataTypeCollision, r as isSqlDataType } from "./data-type-CAPmGXg9.mjs";
|
|
2
|
+
import { r as assertNothingCastsFromSqlExpression } from "./sql-expression-D7GsLgDM.mjs";
|
|
3
|
+
import { u as isStorageTypeInstance } from "./types-Cn4JEguu.mjs";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
|
+
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
7
|
+
import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
5
8
|
import { VERIFY_CODE_SCHEMA_FAILURE, assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from "@prisma/orm-framework/components/control";
|
|
6
|
-
//#region ../../../2-sql/9-family/dist/schema-verify-
|
|
9
|
+
//#region ../../../2-sql/9-family/dist/schema-verify-lPfqY_aE.mjs
|
|
7
10
|
function hasCodecControlHooks(descriptor) {
|
|
8
11
|
if (typeof descriptor !== "object" || descriptor === null) return false;
|
|
9
12
|
const hooks = blindCast(descriptor).types?.codecTypes?.controlPlaneHooks;
|
|
@@ -31,6 +34,29 @@ function extractCodecControlHooks(descriptors) {
|
|
|
31
34
|
return hooks;
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
37
|
+
* The SQL family's checks of the stack's data types and codecs, each naming the contributor:
|
|
38
|
+
* no two SQL data types would both recognise one reported type, by colliding claiming texts or by
|
|
39
|
+
* claiming the same kind; no data type casts from `sql/expression`; and every codec represents a
|
|
40
|
+
* SQL data type, because a codec represents a column's type and `sql/expression` is the one data
|
|
41
|
+
* type no column has.
|
|
42
|
+
*/
|
|
43
|
+
function enforceSqlDataTypeInvariants(declaredDataTypes, codecDescriptors) {
|
|
44
|
+
const declaredById = new Map(declaredDataTypes.map((declared) => [declared.type.id, declared]));
|
|
45
|
+
const describe = (type) => `data type "${type.id}" contributed by "${declaredById.get(type.id)?.contributedBy ?? "<unknown>"}"`;
|
|
46
|
+
const collision = findSqlDataTypeCollision(declaredDataTypes.map(({ type }) => type));
|
|
47
|
+
if (collision !== void 0) {
|
|
48
|
+
const { first, second, claims } = collision;
|
|
49
|
+
if (claims.by === "kind") throw new InternalError(`The ${describe(first)} and the ${describe(second)} both claim the kind "${claims.kind}".`);
|
|
50
|
+
throw new InternalError(`The ${describe(first)} claims the text "${claims.first}", which collides with the text "${claims.second}" claimed by the ${describe(second)}.`);
|
|
51
|
+
}
|
|
52
|
+
assertNothingCastsFromSqlExpression(declaredDataTypes);
|
|
53
|
+
for (const codec of codecDescriptors) {
|
|
54
|
+
const represented = declaredById.get(codec.dataType)?.type;
|
|
55
|
+
if (represented === void 0 || isSqlDataType(represented)) continue;
|
|
56
|
+
throw new InternalError(`Codec "${codec.codecId}" represents ${describe(represented)}, which is not a SQL data type. In a SQL stack a codec represents a column's type, so its data type is declared with sqlDataType.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
34
60
|
* Classifies a codec `verifyType` hook finding into the target-neutral
|
|
35
61
|
* categories the framework grades. A storage type is a named type instance
|
|
36
62
|
* (e.g. a native enum); the only shape divergence it can carry is a change
|
|
@@ -215,6 +241,6 @@ function verifySqlSchemaByDiff(input) {
|
|
|
215
241
|
};
|
|
216
242
|
}
|
|
217
243
|
//#endregion
|
|
218
|
-
export { computeStorageTypeVerdict as a, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n,
|
|
244
|
+
export { computeStorageTypeVerdict as a, verifySqlSchemaByDiff as c, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, enforceSqlDataTypeInvariants as o, classifySqlDiffIssue as r, extractCodecControlHooks as s, classifyDiffEntityKind as t };
|
|
219
245
|
|
|
220
|
-
//# sourceMappingURL=schema-verify-
|
|
246
|
+
//# sourceMappingURL=schema-verify-lPfqY_aE-CZCO8my1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-verify-lPfqY_aE-CZCO8my1.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/schema-verify-lPfqY_aE.mjs"],"sourcesContent":["import { assertNothingCastsFromSqlExpression } from \"@internal/sql-contract/sql-expression\";\nimport { VERIFY_CODE_SCHEMA_FAILURE, assertUniqueCodecOwner, dispositionForCategory, issueOutcome } from \"@internal/framework-components/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { findSqlDataTypeCollision, isSqlDataType } from \"@internal/sql-contract/data-type\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { isStorageTypeInstance } from \"@internal/sql-contract/types\";\n//#region src/core/assembly.ts\nfunction hasCodecControlHooks(descriptor) {\n\tif (typeof descriptor !== \"object\" || descriptor === null) return false;\n\tconst hooks = blindCast(descriptor).types?.codecTypes?.controlPlaneHooks;\n\treturn hooks !== null && hooks !== void 0 && typeof hooks === \"object\";\n}\nfunction extractCodecControlHooks(descriptors) {\n\tconst hooks = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (typeof descriptor !== \"object\" || descriptor === null) continue;\n\t\tif (!hasCodecControlHooks(descriptor)) continue;\n\t\tconst controlPlaneHooks = descriptor.types.codecTypes.controlPlaneHooks;\n\t\tfor (const [codecId, hook] of Object.entries(controlPlaneHooks)) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId: descriptor.id,\n\t\t\t\tentityLabel: \"control hooks\",\n\t\t\t\tentityOwnershipLabel: \"owner\"\n\t\t\t});\n\t\t\thooks.set(codecId, hook);\n\t\t\towners.set(codecId, descriptor.id);\n\t\t}\n\t}\n\treturn hooks;\n}\n/**\n* The SQL family's checks of the stack's data types and codecs, each naming the contributor:\n* no two SQL data types would both recognise one reported type, by colliding claiming texts or by\n* claiming the same kind; no data type casts from `sql/expression`; and every codec represents a\n* SQL data type, because a codec represents a column's type and `sql/expression` is the one data\n* type no column has.\n*/\nfunction enforceSqlDataTypeInvariants(declaredDataTypes, codecDescriptors) {\n\tconst declaredById = new Map(declaredDataTypes.map((declared) => [declared.type.id, declared]));\n\tconst describe = (type) => `data type \"${type.id}\" contributed by \"${declaredById.get(type.id)?.contributedBy ?? \"<unknown>\"}\"`;\n\tconst collision = findSqlDataTypeCollision(declaredDataTypes.map(({ type }) => type));\n\tif (collision !== void 0) {\n\t\tconst { first, second, claims } = collision;\n\t\tif (claims.by === \"kind\") throw new InternalError(`The ${describe(first)} and the ${describe(second)} both claim the kind \"${claims.kind}\".`);\n\t\tthrow new InternalError(`The ${describe(first)} claims the text \"${claims.first}\", which collides with the text \"${claims.second}\" claimed by the ${describe(second)}.`);\n\t}\n\tassertNothingCastsFromSqlExpression(declaredDataTypes);\n\tfor (const codec of codecDescriptors) {\n\t\tconst represented = declaredById.get(codec.dataType)?.type;\n\t\tif (represented === void 0 || isSqlDataType(represented)) continue;\n\t\tthrow new InternalError(`Codec \"${codec.codecId}\" represents ${describe(represented)}, which is not a SQL data type. In a SQL stack a codec represents a column's type, so its data type is declared with sqlDataType.`);\n\t}\n}\n//#endregion\n//#region src/core/diff/verifier-disposition.ts\n/**\n* Classifies a codec `verifyType` hook finding into the target-neutral\n* categories the framework grades. A storage type is a named type instance\n* (e.g. a native enum); the only shape divergence it can carry is a change\n* to its value set, so a paired mismatch always classifies as `valueDrift`.\n*/\nfunction classifyStorageTypeDiffIssue(issue) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") return \"extraAuxiliary\";\n\treturn \"valueDrift\";\n}\nfunction verifierDisposition(controlPolicy, issue) {\n\treturn dispositionForCategory(controlPolicy, classifyStorageTypeDiffIssue(issue));\n}\n//#endregion\n//#region src/core/diff/schema-verify.ts\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/**\n* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on\n* demand, from the issue's node's `nodeKind` via the target-provided\n* `granularityOf` map. The node carries only its `nodeKind` identity, never a\n* classification, and nothing is stamped onto the issue — every consumer\n* (the family verdict below, the framework aggregate's unclaimed-elements\n* sweep via {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable})\n* calls this the same way, resolved by the family/target that owns the node\n* vocabulary. `undefined` for an issue with no node.\n*/\nfunction classifyDiffSubjectGranularity(issue, granularityOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : granularityOf(node.nodeKind);\n}\n/**\n* Resolves an issue's storage `entityKind` on demand, from the issue's\n* node's `nodeKind` via the target-provided `entityKindOf` map — the sibling\n* of {@link classifyDiffSubjectGranularity}, called the same way by the same\n* consumers (via\n* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}).\n* `undefined` for an issue with no node, or for a node kind with no storage\n* entity of its own.\n*/\nfunction classifyDiffEntityKind(issue, entityKindOf) {\n\tconst node = issueNode(issue);\n\treturn node === void 0 ? void 0 : entityKindOf(node.nodeKind);\n}\n/**\n* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the\n* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the\n* issue reason. The vocabulary maps one-to-one: an undeclared live entity or\n* namespace is `extraTopLevelObject`, an undeclared live field\n* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,\n* defaults) and structural leaves (policies) `extraAuxiliary`; every paired\n* divergence is `declaredIncompatible`; anything the database lacks is\n* `declaredMissing`.\n* `granularityOf` is the target's classifier, so target and extension node\n* kinds classify without the family importing them.\n*/\nfunction classifySqlDiffIssue(issue, granularityOf) {\n\tif (issueOutcome(issue) === \"not-found\") return \"declaredMissing\";\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\t\tif (granularity === \"entity\" || granularity === \"namespace\") return \"extraTopLevelObject\";\n\t\tif (granularity === \"field\") return \"extraNestedElement\";\n\t\treturn \"extraAuxiliary\";\n\t}\n\treturn \"declaredIncompatible\";\n}\n/**\n* Whether a `not-expected` issue is a strict-mode-only finding. The legacy\n* walk detected every relational extra (namespaces, entities, fields, and\n* their auxiliaries) only under `--strict`; the structural diff (roots, RLS\n* policies, roles) was never strict-gated — its extras fail in both modes.\n* Keyed on the issue's granularity, resolved via `granularityOf`.\n*/\nfunction isStrictOnlyExtra(issue, granularityOf) {\n\tconst granularity = classifyDiffSubjectGranularity(issue, granularityOf);\n\treturn granularity === \"namespace\" || granularity === \"entity\" || granularity === \"field\" || granularity === \"auxiliary\";\n}\n/**\n* Applies the two consumer filters to a diff issue list: strict gating\n* (relational `not-expected` findings drop in lenient mode) and\n* control-policy disposition (each surviving issue grades against its\n* subject table's effective policy; suppressed issues drop, `observed`\n* subjects warn). The verify verdict is `failures.length === 0`.\n*/\nfunction computeSqlDiffVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tfor (const issue of input.issues) {\n\t\tif (!input.strict && issueOutcome(issue) === \"not-expected\" && isStrictOnlyExtra(issue, input.granularityOf)) continue;\n\t\tconst disposition = dispositionForCategory(effectiveControlPolicy(input.resolveControlPolicy(issue), input.defaultControlPolicy), classifySqlDiffIssue(issue, input.granularityOf));\n\t\tif (disposition === \"suppress\") continue;\n\t\tif (disposition === \"warn\") {\n\t\t\twarnings.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tfailures.push(issue);\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\nfunction computeStorageTypeVerdict(input) {\n\tconst failures = [];\n\tconst warnings = [];\n\tconst policy = effectiveControlPolicy(void 0, input.contract.defaultControlPolicy);\n\tfor (const pair of input.namespacePairs) {\n\t\tif (pair.actual === void 0) continue;\n\t\tfor (const [typeName, typeInstance] of Object.entries(input.contract.storage.types ?? {})) {\n\t\t\tif (!isStorageTypeInstance(typeInstance)) continue;\n\t\t\tconst hook = input.codecHooks.get(typeInstance.codecId);\n\t\t\tif (!hook?.verifyType) continue;\n\t\t\tconst typeIssues = hook.verifyType({\n\t\t\t\ttypeName,\n\t\t\t\ttypeInstance,\n\t\t\t\tschema: pair.actual\n\t\t\t});\n\t\t\tfor (const issue of typeIssues) {\n\t\t\t\tconst disposition = verifierDisposition(policy, issue);\n\t\t\t\tif (disposition === \"suppress\") continue;\n\t\t\t\tif (disposition === \"warn\") {\n\t\t\t\t\twarnings.push(issue);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfailures.push(issue);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tfailures,\n\t\twarnings\n\t};\n}\n/**\n* THE SQL schema verify: runs the target's full-tree node diff, grades it\n* through the family's post-diff filters (strict gating + control-policy\n* disposition) plus the codec `verifyType` hook findings, and wraps the\n* verdict in the issue-based result envelope. `ok` holds exactly when both\n* issue lists are empty — the lists carry the verdict's failures.\n*/\nfunction verifySqlSchemaByDiff(input) {\n\tconst startTime = Date.now();\n\tconst verdictDiff = input.diffSchema({\n\t\tcontract: input.contract,\n\t\tschema: input.schema,\n\t\tframeworkComponents: input.frameworkComponents\n\t});\n\tconst diffVerdict = computeSqlDiffVerdict({\n\t\tissues: verdictDiff.issues,\n\t\tresolveControlPolicy: verdictDiff.resolveControlPolicy,\n\t\tstrict: input.strict,\n\t\tdefaultControlPolicy: input.contract.defaultControlPolicy,\n\t\tgranularityOf: input.granularityOf\n\t});\n\tconst storageTypeVerdict = computeStorageTypeVerdict({\n\t\tcontract: input.contract,\n\t\tnamespacePairs: verdictDiff.namespacePairs,\n\t\tcodecHooks: extractCodecControlHooks(input.frameworkComponents)\n\t});\n\tconst failCount = diffVerdict.failures.length + storageTypeVerdict.failures.length;\n\tconst ok = failCount === 0;\n\tconst profileHash = \"profileHash\" in input.contract && typeof input.contract.profileHash === \"string\" ? input.contract.profileHash : void 0;\n\treturn {\n\t\tok,\n\t\t...ok ? {} : { code: VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : `Database schema does not satisfy contract (${failCount} failure${failCount === 1 ? \"\" : \"s\"})`,\n\t\tcontract: {\n\t\t\tstorageHash: input.contract.storage.storageHash,\n\t\t\t...ifDefined(\"profileHash\", profileHash)\n\t\t},\n\t\ttarget: {\n\t\t\texpected: input.contract.target,\n\t\t\tactual: input.contract.target\n\t\t},\n\t\tschema: {\n\t\t\tissues: [...diffVerdict.failures, ...storageTypeVerdict.failures],\n\t\t\twarnings: { issues: [...diffVerdict.warnings, ...storageTypeVerdict.warnings] }\n\t\t},\n\t\tmeta: { strict: input.strict },\n\t\ttimings: { total: Date.now() - startTime }\n\t};\n}\n//#endregion\nexport { computeStorageTypeVerdict as a, extractCodecControlHooks as c, computeSqlDiffVerdict as i, classifyDiffSubjectGranularity as n, verifySqlSchemaByDiff as o, classifySqlDiffIssue as r, enforceSqlDataTypeInvariants as s, classifyDiffEntityKind as t };\n\n//# sourceMappingURL=schema-verify-lPfqY_aE.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,YAAY;CACzC,IAAI,OAAO,eAAe,YAAY,eAAe,MAAM,OAAO;CAClE,MAAM,QAAQ,UAAU,UAAU,CAAC,CAAC,OAAO,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|
|
1
1
|
import { m as parseNaming } from "./naming-BLraiRfc-DKPaCL0a.mjs";
|
|
2
|
-
import { o as SqlNode } from "./storage-table-
|
|
2
|
+
import { o as SqlNode } from "./storage-table-BwwDKQkD-BN9cZrGX.mjs";
|
|
3
3
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
4
4
|
import { freezeNode } from "@prisma/orm-framework/components/ir";
|
|
5
|
-
//#region ../../../2-sql/1-core/contract/dist/serialized-index-
|
|
5
|
+
//#region ../../../2-sql/1-core/contract/dist/serialized-index-BeGqqsrC.mjs
|
|
6
6
|
/**
|
|
7
7
|
* SQL Contract IR node for a value-set entry in a namespace's `valueSet`
|
|
8
8
|
* map (`SqlNamespace.entries.valueSet`).
|
|
@@ -71,4 +71,4 @@ function indexInputFromSerialized(flat) {
|
|
|
71
71
|
//#endregion
|
|
72
72
|
export { isStorageValueSet as i, checkConstraintInputFromSerialized as n, indexInputFromSerialized as r, StorageValueSet as t };
|
|
73
73
|
|
|
74
|
-
//# sourceMappingURL=serialized-index-
|
|
74
|
+
//# sourceMappingURL=serialized-index-BeGqqsrC-PymnV1h-.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialized-index-
|
|
1
|
+
{"version":3,"file":"serialized-index-BeGqqsrC-PymnV1h-.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/serialized-index-BeGqqsrC.mjs"],"sourcesContent":["import { l as SqlNode } from \"./storage-table-BwwDKQkD.mjs\";\nimport { parseNaming } from \"@internal/sql-schema-ir/naming\";\nimport { freezeNode } from \"@internal/framework-components/ir\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\n//#region src/ir/storage-value-set.ts\n/**\n* SQL Contract IR node for a value-set entry in a namespace's `valueSet`\n* map (`SqlNamespace.entries.valueSet`).\n*\n* A value-set records the ordered set of permitted codec-encoded values for\n* an enum-like column restriction. It does not carry a `codecId` — the\n* column that references it already holds the codec; the value-set holds\n* only the permitted values.\n*\n* The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope\n* carries the discriminator and the serializer hydration walker can\n* dispatch on it. This follows the per-leaf enumerable-kind convention\n* established in the SQL-node comment (future polymorphic dispatch on\n* namespace entries needs the discriminator in JSON).\n*\n* The entry's name is not on the class — value-sets are keyed by name in\n* the parent namespace's `valueSet: Record<string, StorageValueSet>` map.\n*/\nvar StorageValueSet = class extends SqlNode {\n\tkind = \"valueSet\";\n\tvalues;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.values = Object.freeze([...input.values]);\n\t\tfreezeNode(this);\n\t}\n};\nfunction isStorageValueSet(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\treturn \"kind\" in value && value.kind === \"valueSet\" && \"values\" in value;\n}\n//#endregion\n//#region src/serialized-check-constraint.ts\n/**\n* Hydrates one stored check constraint into constructor input. `parseNaming`\n* is what rejects a hand-edited file whose `prefix` and `name` disagree.\n*/\nfunction checkConstraintInputFromSerialized(flat) {\n\treturn {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\texpression: flat.expression\n\t};\n}\n//#endregion\n//#region src/serialized-index.ts\n/**\n* Hydrates one stored index into constructor input. The parameter is typed\n* but the values are whatever the file held, so each field the union depends\n* on is checked here rather than downstream — by the time `Index` sees the\n* data it is already a valid union.\n*/\nfunction indexInputFromSerialized(flat) {\n\tif (flat.name === void 0 || flat.name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\tif (flat.columns === void 0 === (flat.expression === void 0)) throw new ContractValidationError(`Index \"${flat.name}\": exactly one of columns or expression must be set.`, \"storage\");\n\tconst carried = {\n\t\tnaming: parseNaming(flat.name, flat.prefix),\n\t\twhere: flat.where,\n\t\tunique: flat.unique,\n\t\ttype: flat.type,\n\t\toptions: flat.options\n\t};\n\treturn flat.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: flat.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: flat.columns ?? []\n\t};\n}\n//#endregion\nexport { isStorageValueSet as i, checkConstraintInputFromSerialized as n, StorageValueSet as r, indexInputFromSerialized as t };\n\n//# sourceMappingURL=serialized-index-BeGqqsrC.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAI,kBAAkB,cAAc,QAAQ;CAC3C,OAAO;CACP;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,CAAC,GAAG,MAAM,MAAM,CAAC;EAC7C,WAAW,IAAI;CAChB;AACD;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,OAAO,UAAU,SAAS,MAAM,SAAS,cAAc,YAAY;AACpE;;;;;AAOA,SAAS,mCAAmC,MAAM;CACjD,OAAO;EACN,QAAQ,YAAY,KAAK,MAAM,KAAK,MAAM;EAC1C,YAAY,KAAK;CAClB;AACD;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,KAAK,WAAW,GAAG,MAAM,IAAI,wBAAwB,wJAAwJ,SAAS;CACvP,IAAI,KAAK,YAAY,KAAK,OAAO,KAAK,eAAe,KAAK,IAAI,MAAM,IAAI,wBAAwB,UAAU,KAAK,KAAK,uDAAuD,SAAS;CACpL,MAAM,UAAU;EACf,QAAQ,YAAY,KAAK,MAAM,KAAK,MAAM;EAC1C,OAAO,KAAK;EACZ,QAAQ,KAAK;EACb,MAAM,KAAK;EACX,SAAS,KAAK;CACf;CACA,OAAO,KAAK,eAAe,KAAK,IAAI;EACnC,GAAG;EACH,YAAY,KAAK;CAClB,IAAI;EACH,GAAG;EACH,SAAS,KAAK,WAAW,CAAC;CAC3B;AACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as sqlContractCanonicalizationHooks } from "./canonicalization-hooks-dmXkOR4a.mjs";
|
|
2
|
-
import { f as composeSqlEntityKinds } from "./entity-kinds-
|
|
3
|
-
import { c as isMaterializedSqlNamespace, o as SqlStorage } from "./types-
|
|
4
|
-
import { i as createSqlContractSchema, s as resolveSqlToOneRelationStorage, u as validateSqlContractFully } from "./validators-
|
|
2
|
+
import { f as composeSqlEntityKinds } from "./entity-kinds-BNQFeECV-BOJmOArY.mjs";
|
|
3
|
+
import { c as isMaterializedSqlNamespace, o as SqlStorage } from "./types-Cn4JEguu.mjs";
|
|
4
|
+
import { i as createSqlContractSchema, s as resolveSqlToOneRelationStorage, u as validateSqlContractFully } from "./validators-IGdAEEIM.mjs";
|
|
5
5
|
import { t as sqlFamilyError } from "./errors-B5g0xWro-mWH2C07F.mjs";
|
|
6
6
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
7
7
|
import { hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
|
|
8
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
9
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
9
10
|
import { type } from "arktype";
|
|
10
|
-
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
11
11
|
import { withDerivedToOneRelationNullability } from "@prisma/orm-framework/contract-authoring";
|
|
12
12
|
import { isPlainRecord as isPlainRecord$1 } from "@prisma/orm-framework/contract/is-plain-record";
|
|
13
13
|
//#region ../../../2-sql/9-family/dist/sql-contract-serializer-C90xg7_q.mjs
|
|
@@ -188,4 +188,4 @@ var SqlContractSerializer = class extends SqlContractSerializerBase {
|
|
|
188
188
|
//#endregion
|
|
189
189
|
export { SqlContractSerializerBase as n, SqlContractSerializer as t };
|
|
190
190
|
|
|
191
|
-
//# sourceMappingURL=sql-contract-serializer-C90xg7_q-
|
|
191
|
+
//# sourceMappingURL=sql-contract-serializer-C90xg7_q-4UVEMTWO.mjs.map
|