@prisma/orm-family-sql 8.0.0-rc.2-dev.3 → 8.0.0-rc.20-dev.1
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/README.md +2 -6
- package/dist/{aggregate-descriptor-registry-C7hel5O7.mjs → aggregate-descriptor-registry-ZrKjxwQe.mjs} +5 -5
- package/dist/aggregate-descriptor-registry-ZrKjxwQe.mjs.map +1 -0
- package/dist/ast-D0miQ1B6.mjs +372 -0
- package/dist/ast-D0miQ1B6.mjs.map +1 -0
- package/dist/ast-YEMe_B8z.d.mts +292 -0
- package/dist/ast-YEMe_B8z.d.mts.map +1 -0
- package/dist/attribute-specs-DA_RwQFB.d.mts +114 -0
- package/dist/attribute-specs-DA_RwQFB.d.mts.map +1 -0
- package/dist/{authored-check-naming-Hf9990DV.mjs → authored-check-naming-BHGJhjqn.mjs} +5 -5
- package/dist/authored-check-naming-BHGJhjqn.mjs.map +1 -0
- package/dist/{authored-check-naming-BWBe-PVE.d.mts → authored-check-naming-D-o196ry.d.mts} +3 -3
- package/dist/authored-check-naming-D-o196ry.d.mts.map +1 -0
- package/dist/authoring-entity-types-CgKIgWq5-pEdfjam5.d.mts +9 -0
- package/dist/authoring-entity-types-CgKIgWq5-pEdfjam5.d.mts.map +1 -0
- package/dist/builder.d.mts +4 -3
- package/dist/builder__runtime.d.mts +29 -31
- package/dist/builder__runtime.d.mts.map +1 -1
- package/dist/builder__runtime.mjs +261 -191
- package/dist/builder__runtime.mjs.map +1 -1
- package/dist/builder__types.d.mts +6 -3
- package/dist/{canonicalization-hooks-dmXkOR4a.mjs → canonicalization-hooks-Ce1v_TDl.mjs} +2 -2
- package/dist/canonicalization-hooks-Ce1v_TDl.mjs.map +1 -0
- package/dist/{canonicalization-hooks-CYnW_sGn.d.mts → canonicalization-hooks-DyapQ0my.d.mts} +2 -2
- package/dist/canonicalization-hooks-DyapQ0my.d.mts.map +1 -0
- package/dist/{check-constraint-B7qGu6rc-HvQjjX82.d.mts → check-constraint-B7qGu6rc-Bk2ezWXu.d.mts} +4 -4
- package/dist/check-constraint-B7qGu6rc-Bk2ezWXu.d.mts.map +1 -0
- package/dist/{codec-descriptor-registry-N0dhtKaH.mjs → codec-descriptor-registry-CiiFzMtb.mjs} +13 -40
- package/dist/codec-descriptor-registry-CiiFzMtb.mjs.map +1 -0
- package/dist/collection-methods-BB8YH69u.d.mts +1 -0
- package/dist/collection-methods-D2UnCS0S-DOy2qHYS.d.mts +77 -0
- package/dist/collection-methods-D2UnCS0S-DOy2qHYS.d.mts.map +1 -0
- package/dist/{config-types-D9fdKG3g.d.mts → config-types-C-1mIiJO.d.mts} +5 -5
- package/dist/config-types-C-1mIiJO.d.mts.map +1 -0
- package/dist/{config-types-gAm54C_v.mjs → config-types-DkEeq_qq.mjs} +10 -6
- package/dist/config-types-DkEeq_qq.mjs.map +1 -0
- package/dist/{contract-builder-D4a5dT7j.mjs → contract-builder-50lF0kz1.mjs} +431 -226
- package/dist/contract-builder-50lF0kz1.mjs.map +1 -0
- package/dist/contract-builder-C_Zi57iD.d.mts +1967 -0
- package/dist/contract-builder-C_Zi57iD.d.mts.map +1 -0
- package/dist/contract-emitter.d.mts +4 -7
- package/dist/contract-emitter.d.mts.map +1 -1
- package/dist/contract-emitter.mjs +1 -1
- package/dist/{contract-errors-BCN6RVI5-5IHBF_lg.mjs → contract-errors-BCN6RVI5-DoH6b_KZ.mjs} +2 -2
- package/dist/contract-errors-BCN6RVI5-DoH6b_KZ.mjs.map +1 -0
- package/dist/contract-prisma7__provider.d.mts +97 -0
- package/dist/contract-prisma7__provider.d.mts.map +1 -0
- package/dist/contract-prisma7__provider.mjs +2011 -0
- package/dist/contract-prisma7__provider.mjs.map +1 -0
- package/dist/contract-psl.d.mts +18 -29
- 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 -0
- package/dist/contract-psl__attribute-specs.mjs +2 -0
- package/dist/contract-psl__default-table-name.d.mts +7 -0
- package/dist/contract-psl__default-table-name.d.mts.map +1 -0
- package/dist/contract-psl__default-table-name.mjs +2 -0
- package/dist/contract-psl__diagnostics.d.mts +12 -0
- package/dist/contract-psl__diagnostics.d.mts.map +1 -0
- package/dist/contract-psl__diagnostics.mjs +2 -0
- package/dist/contract-psl__map-names.d.mts +16 -0
- package/dist/contract-psl__map-names.d.mts.map +1 -0
- package/dist/contract-psl__map-names.mjs +21 -0
- package/dist/contract-psl__map-names.mjs.map +1 -0
- package/dist/contract-psl__provider.d.mts +3 -3
- package/dist/contract-psl__provider.d.mts.map +1 -1
- package/dist/contract-psl__provider.mjs +95 -46
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +5 -5
- package/dist/contract-ts.mjs +5 -4
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +4 -4
- package/dist/contract-ts__contract-builder.mjs +4 -3
- package/dist/{contract-view-BMR5IWk4.mjs → contract-view-DqpzeYeE.mjs} +2 -2
- package/dist/contract-view-DqpzeYeE.mjs.map +1 -0
- package/dist/{contract-view-CPHxoAEX.d.mts → contract-view-DuB35or0.d.mts} +3 -3
- package/dist/contract-view-DuB35or0.d.mts.map +1 -0
- package/dist/contract.d.mts +30 -28
- package/dist/contract.mjs +23 -18
- package/dist/contract__authored-check-naming.d.mts +1 -1
- package/dist/contract__authored-check-naming.mjs +1 -1
- package/dist/contract__canonicalization-hooks.d.mts +1 -1
- package/dist/contract__canonicalization-hooks.mjs +1 -1
- package/dist/contract__contract-view.d.mts +1 -1
- package/dist/contract__contract-view.mjs +1 -1
- 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-handle-lowering-hook.d.mts +2 -2
- package/dist/contract__entity-handle-lowering-hook.mjs +2 -2
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +2 -2
- package/dist/contract__foreign-key-materialization.mjs +3 -2
- package/dist/contract__index-naming.d.mts +2 -2
- package/dist/contract__index-naming.mjs +2 -2
- package/dist/contract__index-type-validation.d.mts +2 -2
- package/dist/contract__index-type-validation.mjs +1 -1
- package/dist/contract__index-types.d.mts +3 -3
- package/dist/contract__index-types.mjs +2 -2
- package/dist/contract__referential-action-sql.d.mts +1 -1
- package/dist/contract__referential-action-sql.mjs +1 -1
- package/dist/contract__resolve-storage-table.d.mts +1 -1
- package/dist/contract__resolve-storage-table.mjs +1 -1
- package/dist/contract__sql-expression.d.mts +2 -0
- package/dist/contract__sql-expression.mjs +2 -0
- package/dist/contract__types.d.mts +12 -12
- package/dist/contract__types.mjs +4 -4
- package/dist/contract__validators.d.mts +2 -2
- package/dist/contract__validators.mjs +3 -3
- package/dist/contract__value-set-derivation-hook.d.mts +1 -1
- package/dist/contract__value-set-derivation-hook.mjs +1 -1
- package/dist/control-BK50zF6c.mjs +2721 -0
- package/dist/control-BK50zF6c.mjs.map +1 -0
- package/dist/control-ChAUdOOu.d.mts +1416 -0
- package/dist/control-ChAUdOOu.d.mts.map +1 -0
- package/dist/{control-adapter-C99J7aEF-B7eQd7vD.d.mts → control-adapter-Bn0uhplA-BzP2uPqJ.d.mts} +27 -44
- package/dist/control-adapter-Bn0uhplA-BzP2uPqJ.d.mts.map +1 -0
- package/dist/control-adapter-NZ2kKc4x.d.mts +13 -0
- package/dist/control-adapter-NZ2kKc4x.d.mts.map +1 -0
- package/dist/control-adapter-SlQkTEwT.mjs +16 -0
- package/dist/control-adapter-SlQkTEwT.mjs.map +1 -0
- package/dist/data-type-BFSpaotu.mjs +52 -0
- package/dist/data-type-BFSpaotu.mjs.map +1 -0
- package/dist/data-type-DJIvKQHf.d.mts +158 -0
- package/dist/data-type-DJIvKQHf.d.mts.map +1 -0
- package/dist/data-type-support-BhSoPUFj.mjs +9 -0
- package/dist/data-type-support-BhSoPUFj.mjs.map +1 -0
- package/dist/data-type-support-CXpA0ex-.d.mts +7 -0
- package/dist/data-type-support-CXpA0ex-.d.mts.map +1 -0
- package/dist/{db-D18PrXKW-DvTv4JFn.d.mts → db-D1d75IvM-D4mRDC6w.d.mts} +123 -128
- package/dist/db-D1d75IvM-D4mRDC6w.d.mts.map +1 -0
- package/dist/{ddl-types-CXx4vPz6-BsgrnSUY.d.mts → ddl-types-By5mT2_S-CdaaFvsX.d.mts} +24 -29
- package/dist/ddl-types-By5mT2_S-CdaaFvsX.d.mts.map +1 -0
- package/dist/default-mapping-CAOONlKQ-4m07nb-O.d.mts +39 -0
- package/dist/default-mapping-CAOONlKQ-4m07nb-O.d.mts.map +1 -0
- package/dist/default-table-name-BfFY8qYR-CWZFDX6v.mjs +9 -0
- package/dist/default-table-name-BfFY8qYR-CWZFDX6v.mjs.map +1 -0
- package/dist/derived-checks-D5HVRvqN-BJx1gwPA.mjs +1508 -0
- package/dist/derived-checks-D5HVRvqN-BJx1gwPA.mjs.map +1 -0
- package/dist/{derived-checks-DPdD01O0-DGqOFjs6.d.mts → derived-checks-DpPkO6Dt-9U9UJZOo.d.mts} +4 -4
- package/dist/derived-checks-DpPkO6Dt-9U9UJZOo.d.mts.map +1 -0
- package/dist/diagnostics-RHJxoiIk.mjs +23 -0
- package/dist/diagnostics-RHJxoiIk.mjs.map +1 -0
- package/dist/{diff-DbTNVm2f.d.mts → diff-1qHOLoUB.d.mts} +23 -10
- package/dist/diff-1qHOLoUB.d.mts.map +1 -0
- package/dist/diff-C1rFOhek.mjs +21 -0
- package/dist/diff-C1rFOhek.mjs.map +1 -0
- package/dist/{dist-ZK6oeI5e.mjs → dist-C8Y-PPuE.mjs} +36 -212
- package/dist/dist-C8Y-PPuE.mjs.map +1 -0
- package/dist/{dist-C_q1_QR9.mjs → dist-CHz1hF8M.mjs} +2 -2
- package/dist/dist-CHz1hF8M.mjs.map +1 -0
- package/dist/{dist-x6jvtkKM.mjs → dist-CMDXybwm.mjs} +2 -2
- package/dist/dist-CMDXybwm.mjs.map +1 -0
- package/dist/{driver-types-BQtRkOJ0-Bv2RPSfr.d.mts → driver-types-DRsYeq3j-BimeCnUk.d.mts} +11 -2
- package/dist/driver-types-DRsYeq3j-BimeCnUk.d.mts.map +1 -0
- package/dist/entity-handle-lowering-hook-BJZSlVVF.mjs +16 -0
- package/dist/entity-handle-lowering-hook-BJZSlVVF.mjs.map +1 -0
- package/dist/{entity-handle-lowering-hook-CIvRKBfa.d.mts → entity-handle-lowering-hook-BuvLtgFi.d.mts} +8 -11
- package/dist/entity-handle-lowering-hook-BuvLtgFi.d.mts.map +1 -0
- package/dist/{entity-kinds-B5cUFU22.d.mts → entity-kinds-BPG2xCZV.d.mts} +7 -7
- package/dist/entity-kinds-BPG2xCZV.d.mts.map +1 -0
- package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs → entity-kinds-JR5SAm5h-DOH6VUtL.mjs} +31 -28
- package/dist/entity-kinds-JR5SAm5h-DOH6VUtL.mjs.map +1 -0
- package/dist/{errors-B5g0xWro-mWH2C07F.mjs → errors-B5g0xWro-C8plbqga.mjs} +2 -2
- package/dist/errors-B5g0xWro-C8plbqga.mjs.map +1 -0
- package/dist/errors.d.mts +1 -1
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/exports-C3wGYtID-D65DEUTC.mjs +2389 -0
- package/dist/exports-C3wGYtID-D65DEUTC.mjs.map +1 -0
- package/dist/{expression-FJK6Ar-d.d.mts → expression-6ld_ZQL6-fOuazzzm.d.mts} +37 -16
- package/dist/expression-6ld_ZQL6-fOuazzzm.d.mts.map +1 -0
- package/dist/expression-CieaNuRM-B1uVqxwd.d.mts +22 -0
- package/dist/expression-CieaNuRM-B1uVqxwd.d.mts.map +1 -0
- package/dist/expression-D8HstQiB.d.mts +2 -0
- package/dist/{expression-CX5mTA-z.mjs → expression-impl-B-XNINxr-BhN2sysZ.mjs} +41 -18
- package/dist/expression-impl-B-XNINxr-BhN2sysZ.mjs.map +1 -0
- package/dist/{factories-SVor5xIT.mjs → factories-Crobuxwn.mjs} +27 -20
- package/dist/factories-Crobuxwn.mjs.map +1 -0
- package/dist/{factories-P3qBQhO-.d.mts → factories-DbNP9qfs.d.mts} +16 -10
- package/dist/factories-DbNP9qfs.d.mts.map +1 -0
- package/dist/family.d.mts +17 -13
- package/dist/family.mjs +17 -12
- package/dist/family__control-adapter.d.mts +3 -3
- package/dist/family__control-adapter.mjs +2 -1
- package/dist/family__control.d.mts +5 -4
- package/dist/family__control.mjs +4 -4
- package/dist/family__diff.d.mts +2 -3
- package/dist/family__diff.mjs +2 -2
- package/dist/family__ir.d.mts +1 -1
- package/dist/family__ir.mjs +2 -2
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__migration.mjs +1 -1
- package/dist/family__pack.d.mts +2 -249
- package/dist/family__pack.mjs +3 -18
- package/dist/family__psl-build.d.mts +3 -0
- package/dist/family__psl-build.mjs +3 -0
- package/dist/family__psl-infer.d.mts +2 -2
- package/dist/family__psl-infer.mjs +2 -2
- package/dist/family__runtime.d.mts +2 -2
- package/dist/family__runtime.mjs +2 -2
- package/dist/family__verify.d.mts +1 -1
- package/dist/family__verify.mjs +1 -1
- package/dist/foreign-key-materialization-48P2V8on.d.mts +98 -0
- package/dist/foreign-key-materialization-48P2V8on.d.mts.map +1 -0
- package/dist/foreign-key-materialization-BM59w_Xg.mjs +287 -0
- package/dist/foreign-key-materialization-BM59w_Xg.mjs.map +1 -0
- package/dist/{foreign-key-C-iTPuRT-C9ip8zFx.d.mts → foreign-key-qkDFfG8t-TaK_GYWR.d.mts} +21 -5
- package/dist/foreign-key-qkDFfG8t-TaK_GYWR.d.mts.map +1 -0
- package/dist/functions-CsOoN7I3.mjs +88 -0
- package/dist/functions-CsOoN7I3.mjs.map +1 -0
- package/dist/functions-EW-RrRn3.d.mts +73 -0
- package/dist/functions-EW-RrRn3.d.mts.map +1 -0
- package/dist/generator-functions-D_qdqBV--Bq296cED.mjs +544 -0
- package/dist/generator-functions-D_qdqBV--Bq296cED.mjs.map +1 -0
- package/dist/index-7nHHQsAj.d.mts +606 -0
- package/dist/index-7nHHQsAj.d.mts.map +1 -0
- package/dist/{index-C5I8D-MB.d.mts → index-Nqc3OHR_.d.mts} +4 -5
- package/dist/index-Nqc3OHR_.d.mts.map +1 -0
- package/dist/index-equivalence-DswCiq5l-CGsyPP9B.mjs +109 -0
- package/dist/index-equivalence-DswCiq5l-CGsyPP9B.mjs.map +1 -0
- package/dist/{index-naming-DREt6js7-CRH27yUv.mjs → index-naming-BOcJT1B3-mG8Fd6KN.mjs} +35 -9
- package/dist/index-naming-BOcJT1B3-mG8Fd6KN.mjs.map +1 -0
- package/dist/{index-naming-Ct65z5Xk.d.mts → index-naming-Cs6wwia3.d.mts} +15 -5
- package/dist/index-naming-Cs6wwia3.d.mts.map +1 -0
- package/dist/index-reference-4wsdeB7v-DCwswK-q.d.mts +67 -0
- package/dist/index-reference-4wsdeB7v-DCwswK-q.d.mts.map +1 -0
- package/dist/index-reference-BQSrkRfT.mjs +55 -0
- package/dist/index-reference-BQSrkRfT.mjs.map +1 -0
- package/dist/index-reference-D8ewQRJr.d.mts +1 -0
- package/dist/index-type-validation-DJEMmmw0.mjs +42 -0
- package/dist/index-type-validation-DJEMmmw0.mjs.map +1 -0
- package/dist/index-type-validation-fGGwAHWc.d.mts +16 -0
- package/dist/index-type-validation-fGGwAHWc.d.mts.map +1 -0
- package/dist/index-types-H1O43iYT-BD0VwPqV.d.mts +66 -0
- package/dist/index-types-H1O43iYT-BD0VwPqV.d.mts.map +1 -0
- package/dist/index-types-pC_5vADQ-BOOBi14R.mjs +95 -0
- package/dist/index-types-pC_5vADQ-BOOBi14R.mjs.map +1 -0
- package/dist/index-types-snhtt_Fo.d.mts +1 -0
- package/dist/interpreter-D5qk4B---CG0C7kdx.mjs +2280 -0
- package/dist/interpreter-D5qk4B---CG0C7kdx.mjs.map +1 -0
- package/dist/{ir-Bghjt-FG.d.mts → ir-BvptQsFW.d.mts} +11 -5
- package/dist/ir-BvptQsFW.d.mts.map +1 -0
- package/dist/{ir-I-xciGUH.mjs → ir-DzsUDO8e.mjs} +2 -2
- package/dist/ir-DzsUDO8e.mjs.map +1 -0
- package/dist/{middleware-AhTz1BOW-th-Suxuf.d.mts → middleware-DHkW6pRr-DM6hd9iZ.d.mts} +5 -5
- package/dist/middleware-DHkW6pRr-DM6hd9iZ.d.mts.map +1 -0
- package/dist/middleware-gqy3l13N.d.mts +1 -0
- package/dist/{middleware-CMr4CHNz-DHIUdxlm.mjs → middleware-yBAfiVWn-DZO0vCRQ.mjs} +3 -3
- package/dist/middleware-yBAfiVWn-DZO0vCRQ.mjs.map +1 -0
- package/dist/{migration-CK4oePIo.mjs → migration-BJQjkqFz.mjs} +4 -4
- package/dist/migration-BJQjkqFz.mjs.map +1 -0
- package/dist/{migration-CjDRZNep.d.mts → migration-Cxmpzaz0.d.mts} +6 -6
- package/dist/migration-Cxmpzaz0.d.mts.map +1 -0
- package/dist/{naming-CV9j2pXl-KARaDReS.d.mts → naming-BcD36g9T-Mfe_xGGL.d.mts} +9 -14
- package/dist/naming-BcD36g9T-Mfe_xGGL.d.mts.map +1 -0
- package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs → naming-bM5qm5PY-jOg3JFMb.mjs} +20 -31
- package/dist/naming-bM5qm5PY-jOg3JFMb.mjs.map +1 -0
- package/dist/{ddl-types-BGdnAbXo-DKPHPUGx.mjs → opaque-sql-Dset3kln-CtsPDTXn.mjs} +24 -11
- package/dist/opaque-sql-Dset3kln-CtsPDTXn.mjs.map +1 -0
- package/dist/operations.d.mts +1 -1
- package/dist/operations.mjs +1 -1
- package/dist/orm-client.d.mts +817 -267
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +4719 -2942
- package/dist/orm-client.mjs.map +1 -1
- package/dist/pack-DA8HZ2mo.d.mts +535 -0
- package/dist/pack-DA8HZ2mo.d.mts.map +1 -0
- package/dist/pack-gSvGQWqs.mjs +80 -0
- package/dist/pack-gSvGQWqs.mjs.map +1 -0
- package/dist/{plan-CDxduYaN-pLIyyJaB.d.mts → plan-Cr4azjnG-CuL8FqXC.d.mts} +12 -8
- package/dist/plan-Cr4azjnG-CuL8FqXC.d.mts.map +1 -0
- package/dist/{plan-Dh0LbYIv-Crx5-ThG.mjs → plan-Dh0LbYIv-ubBSdUgl.mjs} +2 -2
- package/dist/plan-Dh0LbYIv-ubBSdUgl.mjs.map +1 -0
- package/dist/plan-Di6Gs2JD.d.mts +2 -0
- package/dist/psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs +42 -0
- package/dist/psl-attribute-parsing-BCsFWsSp-BJ-wGlY6.mjs.map +1 -0
- package/dist/psl-build-DFBG6vhz.mjs +426 -0
- package/dist/psl-build-DFBG6vhz.mjs.map +1 -0
- package/dist/psl-build-RelubU2E.d.mts +112 -0
- package/dist/psl-build-RelubU2E.d.mts.map +1 -0
- package/dist/psl-column-resolution-ChZqioOc-BREg4J7d.d.mts +24 -0
- package/dist/psl-column-resolution-ChZqioOc-BREg4J7d.d.mts.map +1 -0
- package/dist/psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs +1960 -0
- package/dist/psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs.map +1 -0
- package/dist/psl-infer--g4i84Go.mjs +201 -0
- package/dist/psl-infer--g4i84Go.mjs.map +1 -0
- package/dist/psl-infer-DzoxPZGd.d.mts +80 -0
- package/dist/psl-infer-DzoxPZGd.d.mts.map +1 -0
- package/dist/psl-names-C3cwe0rg-D1CTmC3a.mjs +66 -0
- package/dist/psl-names-C3cwe0rg-D1CTmC3a.mjs.map +1 -0
- package/dist/{query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts → query-lane-context-BCEoKy0_-CzmyavC9.d.mts} +20 -49
- package/dist/query-lane-context-BCEoKy0_-CzmyavC9.d.mts.map +1 -0
- package/dist/query-lane-context-VqH0mS9B.d.mts +1 -0
- package/dist/{referential-action-sql-DJ9ps6-S.d.mts → referential-action-sql-B2vKoUK6.d.mts} +3 -3
- package/dist/referential-action-sql-B2vKoUK6.d.mts.map +1 -0
- package/dist/{referential-action-sql-DSqkrySN.mjs → referential-action-sql-BLzCtTi8.mjs} +2 -2
- package/dist/referential-action-sql-BLzCtTi8.mjs.map +1 -0
- package/dist/relational-core.d.mts +14 -13
- package/dist/relational-core.mjs +8 -8
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +2 -2
- package/dist/relational-core__aggregate-descriptor-registry.d.mts.map +1 -1
- package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
- package/dist/relational-core__ast.d.mts +5 -5
- package/dist/relational-core__ast.mjs +5 -5
- package/dist/relational-core__codec-descriptor-registry.d.mts +7 -8
- package/dist/relational-core__codec-descriptor-registry.d.mts.map +1 -1
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__collection-methods.d.mts +3 -0
- package/dist/relational-core__contract-free.d.mts +18 -8
- package/dist/relational-core__contract-free.d.mts.map +1 -1
- package/dist/relational-core__contract-free.mjs +26 -10
- package/dist/relational-core__contract-free.mjs.map +1 -1
- package/dist/relational-core__expression.d.mts +4 -2
- package/dist/relational-core__expression.mjs +2 -2
- package/dist/relational-core__functions.d.mts +2 -0
- package/dist/relational-core__functions.mjs +2 -0
- package/dist/relational-core__index-reference.d.mts +3 -0
- package/dist/relational-core__index-reference.mjs +2 -0
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__middleware.mjs +1 -1
- package/dist/relational-core__plan.d.mts +4 -4
- package/dist/relational-core__plan.mjs +1 -1
- package/dist/relational-core__query-lane-context.d.mts +3 -3
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{resolve-storage-table-DZsfnzeW.mjs → resolve-storage-table-BHLQsOza.mjs} +3 -3
- package/dist/resolve-storage-table-BHLQsOza.mjs.map +1 -0
- package/dist/{resolve-storage-table-Nyrgk4h8.d.mts → resolve-storage-table-DCqtmnSU.d.mts} +4 -4
- package/dist/resolve-storage-table-DCqtmnSU.d.mts.map +1 -0
- package/dist/{runtime-tIHpGCcG.mjs → runtime-6tH1yOxK.mjs} +6 -6
- package/dist/runtime-6tH1yOxK.mjs.map +1 -0
- package/dist/{runtime-DpKF2Yu2.d.mts → runtime-CF6rAlE5.d.mts} +7 -8
- package/dist/runtime-CF6rAlE5.d.mts.map +1 -0
- package/dist/runtime.d.mts +5 -5
- package/dist/runtime.mjs +2 -1799
- package/dist/runtime__internal__prepared-query.d.mts +2 -2
- package/dist/runtime__internal__prepared-query.mjs +2 -2
- package/dist/{schema-differ-DpG_gnur-DFAtGezx.d.mts → schema-differ-DmP74bB8-tqHKiJ88.d.mts} +6 -6
- package/dist/schema-differ-DmP74bB8-tqHKiJ88.d.mts.map +1 -0
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/schema-ir__naming.d.mts +1 -1
- package/dist/schema-ir__naming.mjs +1 -1
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +2 -2
- package/dist/{schema-verify-C_PEdlAr-Dxxjm6EM.mjs → schema-verify-C3wbdviw-DMjIubOr.mjs} +50 -8
- package/dist/schema-verify-C3wbdviw-DMjIubOr.mjs.map +1 -0
- package/dist/{serialized-index-CrgG8ct1-DG3JpHc7.d.mts → serialized-index-CrgG8ct1-DKVJ7TDX.d.mts} +4 -4
- package/dist/serialized-index-CrgG8ct1-DKVJ7TDX.d.mts.map +1 -0
- package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs → serialized-index-DjCCnXB1-DMA7BtO2.mjs} +4 -4
- package/dist/serialized-index-DjCCnXB1-DMA7BtO2.mjs.map +1 -0
- package/dist/{sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs → sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs} +41 -16
- package/dist/sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs.map +1 -0
- package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs +400 -0
- package/dist/sql-data-type-D7M-YTTY-D2vRqDxn.mjs.map +1 -0
- package/dist/{sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts → sql-execution-plan-3uxYjHyu-DLknM-Pj.d.mts} +3 -3
- package/dist/sql-execution-plan-3uxYjHyu-DLknM-Pj.d.mts.map +1 -0
- package/dist/sql-expression-B4BrhGPi.d.mts +62 -0
- package/dist/sql-expression-B4BrhGPi.d.mts.map +1 -0
- package/dist/sql-expression-CKgKznXS.mjs +137 -0
- package/dist/sql-expression-CKgKznXS.mjs.map +1 -0
- package/dist/{sql-index-ByAAE7K8-DKj2V86p.d.mts → sql-index-ByAAE7K8-Dqtn_vUL.d.mts} +4 -4
- package/dist/sql-index-ByAAE7K8-Dqtn_vUL.d.mts.map +1 -0
- package/dist/{sql-node-kEz6YFZo-v2F7delx.d.mts → sql-node-kEz6YFZo-1ogT6Cxt.d.mts} +2 -2
- package/dist/sql-node-kEz6YFZo-1ogT6Cxt.d.mts.map +1 -0
- package/dist/{sql-storage-8LqxeLAY-DH4DdUXx.d.mts → sql-storage-DeCAh5Hi-CEM-m8cs.d.mts} +19 -22
- package/dist/sql-storage-DeCAh5Hi-CEM-m8cs.d.mts.map +1 -0
- package/dist/{storage-table-DSeWszOL-CI-cItEK.d.mts → storage-table-Bf1ZjnxO-pUj6pyP0.d.mts} +17 -24
- package/dist/storage-table-Bf1ZjnxO-pUj6pyP0.d.mts.map +1 -0
- package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs → storage-table-DDvN83mw-DkbBFmK9.mjs} +12 -9
- package/dist/storage-table-DDvN83mw-DkbBFmK9.mjs.map +1 -0
- package/dist/{storage-value-set-BGlj5Uus-CvZD--GG.d.mts → storage-value-set-BGlj5Uus-ny2k-0PA.d.mts} +3 -3
- package/dist/storage-value-set-BGlj5Uus-ny2k-0PA.d.mts.map +1 -0
- package/dist/transaction-state-BfXhs7D7-DhmbySW9.mjs +45 -0
- package/dist/transaction-state-BfXhs7D7-DhmbySW9.mjs.map +1 -0
- package/dist/transaction-state-DR3nKTmH-D29jmVE-.d.mts +115 -0
- package/dist/transaction-state-DR3nKTmH-D29jmVE-.d.mts.map +1 -0
- package/dist/types-B9wSEUsV.d.mts +1 -0
- package/dist/{types-CUsJrvEl.mjs → types-CTdSkl0s.mjs} +13 -6
- package/dist/types-CTdSkl0s.mjs.map +1 -0
- package/dist/types-CkAd8SWm.d.mts +57 -0
- package/dist/types-CkAd8SWm.d.mts.map +1 -0
- package/dist/{types-IqZMLrFC-DcH8v_u3.d.mts → types-Cq6ImLAB-RlU4jJAX.d.mts} +27 -41
- package/dist/types-Cq6ImLAB-RlU4jJAX.d.mts.map +1 -0
- package/dist/{types-YStFFkKs-D9UAmnON.d.mts → types-CuCxAQat-Dz8P4xyt.d.mts} +141 -86
- package/dist/types-CuCxAQat-Dz8P4xyt.d.mts.map +1 -0
- package/dist/types-DfKvtJwS-CrpWTGBJ.d.mts +273 -0
- package/dist/types-DfKvtJwS-CrpWTGBJ.d.mts.map +1 -0
- package/dist/{types-4YenawkP-CwaaZSid.mjs → types-DoyiTsjg-2YMhMJDA.mjs} +181 -80
- package/dist/types-DoyiTsjg-2YMhMJDA.mjs.map +1 -0
- package/dist/{types-v3qxLLxo-DCeKv7yY.d.mts → types-DriMIMNQ-BkbsW7w3.d.mts} +68 -34
- package/dist/types-DriMIMNQ-BkbsW7w3.d.mts.map +1 -0
- package/dist/{types-Dt4e_jC--COeP8xzN.mjs → types-NTQsD2MS-xcLtvKO9.mjs} +83 -17
- package/dist/types-NTQsD2MS-xcLtvKO9.mjs.map +1 -0
- package/dist/{types-CyxGtOOh-BggSa6Fe.d.mts → types-TXO7x1BA-CYYIY8NI.d.mts} +14 -14
- package/dist/types-TXO7x1BA-CYYIY8NI.d.mts.map +1 -0
- package/dist/types-ljUNyiWe.d.mts +1 -0
- package/dist/{unique-constraint-M5TlQnJQ-BiIHJ85k.d.mts → unique-constraint-M5TlQnJQ-qX-maNUV.d.mts} +3 -3
- package/dist/unique-constraint-M5TlQnJQ-qX-maNUV.d.mts.map +1 -0
- package/dist/{util-DQQgv2j1-D6INZaRG.mjs → util-BBgcP3gI-CpL-0VuC.mjs} +12 -3
- package/dist/util-BBgcP3gI-CpL-0VuC.mjs.map +1 -0
- package/dist/{validators-CrWD6bSP.mjs → validators-BwA7ttZM.mjs} +0 -0
- package/dist/validators-BwA7ttZM.mjs.map +1 -0
- package/dist/{validators-Belo8QqM.d.mts → validators-FJs8HvFr.d.mts} +54 -16
- package/dist/validators-FJs8HvFr.d.mts.map +1 -0
- package/dist/{value-set-derivation-hook-BhgGVtw0.d.mts → value-set-derivation-hook-3E437jPU.d.mts} +3 -3
- package/dist/value-set-derivation-hook-3E437jPU.d.mts.map +1 -0
- package/dist/{value-set-derivation-hook-Di9JZ0X7.mjs → value-set-derivation-hook-HVaxhALD.mjs} +2 -2
- package/dist/value-set-derivation-hook-HVaxhALD.mjs.map +1 -0
- package/dist/{verify-u0UTdZgD-DSAaz9rW.mjs → verify-BVk5bjdH-DhKm6hB3.mjs} +8 -7
- package/dist/verify-BVk5bjdH-DhKm6hB3.mjs.map +1 -0
- package/dist/{verify-zDRnw0Rn.d.mts → verify-DHXbuZPB.d.mts} +2 -2
- package/dist/verify-DHXbuZPB.d.mts.map +1 -0
- package/package.json +33 -22
- package/dist/aggregate-descriptor-registry-C7hel5O7.mjs.map +0 -1
- package/dist/ast-HFcfQZr-.d.mts +0 -206
- package/dist/ast-HFcfQZr-.d.mts.map +0 -1
- package/dist/ast-Lbl4VwqP.mjs +0 -325
- package/dist/ast-Lbl4VwqP.mjs.map +0 -1
- package/dist/authored-check-naming-BWBe-PVE.d.mts.map +0 -1
- package/dist/authored-check-naming-Hf9990DV.mjs.map +0 -1
- package/dist/authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs +0 -316
- package/dist/authoring-type-constructors-Blqoa2Ua-DqvNCOb2.mjs.map +0 -1
- package/dist/canonicalization-hooks-CYnW_sGn.d.mts.map +0 -1
- package/dist/canonicalization-hooks-dmXkOR4a.mjs.map +0 -1
- package/dist/check-constraint-B7qGu6rc-HvQjjX82.d.mts.map +0 -1
- package/dist/codec-descriptor-registry-N0dhtKaH.mjs.map +0 -1
- package/dist/config-types-D9fdKG3g.d.mts.map +0 -1
- package/dist/config-types-gAm54C_v.mjs.map +0 -1
- package/dist/contract-builder-CG_tGDbB.d.mts +0 -1360
- package/dist/contract-builder-CG_tGDbB.d.mts.map +0 -1
- package/dist/contract-builder-D4a5dT7j.mjs.map +0 -1
- package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs.map +0 -1
- package/dist/contract-view-BMR5IWk4.mjs.map +0 -1
- package/dist/contract-view-CPHxoAEX.d.mts.map +0 -1
- package/dist/contract__pack-types.d.mts +0 -2
- package/dist/control-D3cB5YQp.mjs +0 -1267
- package/dist/control-D3cB5YQp.mjs.map +0 -1
- package/dist/control-DTLJ1WtZ.d.mts +0 -945
- package/dist/control-DTLJ1WtZ.d.mts.map +0 -1
- package/dist/control-adapter-C99J7aEF-B7eQd7vD.d.mts.map +0 -1
- package/dist/control-adapter-MZJQiwcE.d.mts +0 -1
- package/dist/db-D18PrXKW-DvTv4JFn.d.mts.map +0 -1
- package/dist/ddl-types-BGdnAbXo-DKPHPUGx.mjs.map +0 -1
- package/dist/ddl-types-CXx4vPz6-BsgrnSUY.d.mts.map +0 -1
- package/dist/derived-checks-DFMRmiAu-DGfB8aS4.mjs +0 -1057
- package/dist/derived-checks-DFMRmiAu-DGfB8aS4.mjs.map +0 -1
- package/dist/derived-checks-DPdD01O0-DGqOFjs6.d.mts.map +0 -1
- package/dist/diff-B16bL_IR.mjs +0 -13
- package/dist/diff-B16bL_IR.mjs.map +0 -1
- package/dist/diff-DbTNVm2f.d.mts.map +0 -1
- package/dist/dist-C_q1_QR9.mjs.map +0 -1
- package/dist/dist-ZK6oeI5e.mjs.map +0 -1
- package/dist/dist-x6jvtkKM.mjs.map +0 -1
- package/dist/driver-types-BQtRkOJ0-Bv2RPSfr.d.mts.map +0 -1
- package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts.map +0 -1
- package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs +0 -11
- package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs.map +0 -1
- package/dist/entity-kinds-B5cUFU22.d.mts.map +0 -1
- package/dist/entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map +0 -1
- package/dist/errors-B5g0xWro-mWH2C07F.mjs.map +0 -1
- package/dist/expression-CX5mTA-z.mjs.map +0 -1
- package/dist/expression-FJK6Ar-d.d.mts.map +0 -1
- package/dist/factories-P3qBQhO-.d.mts.map +0 -1
- package/dist/factories-SVor5xIT.mjs.map +0 -1
- package/dist/family__pack.d.mts.map +0 -1
- package/dist/family__pack.mjs.map +0 -1
- package/dist/foreign-key-C-iTPuRT-C9ip8zFx.d.mts.map +0 -1
- package/dist/foreign-key-materialization-CkvOzJWy.d.mts +0 -65
- package/dist/foreign-key-materialization-CkvOzJWy.d.mts.map +0 -1
- package/dist/foreign-key-materialization-Cu7-7LHl.mjs +0 -73
- package/dist/foreign-key-materialization-Cu7-7LHl.mjs.map +0 -1
- package/dist/index-C-vQOMY_.d.mts +0 -84
- package/dist/index-C-vQOMY_.d.mts.map +0 -1
- package/dist/index-C5I8D-MB.d.mts.map +0 -1
- package/dist/index-naming-Ct65z5Xk.d.mts.map +0 -1
- package/dist/index-naming-DREt6js7-CRH27yUv.mjs.map +0 -1
- package/dist/index-type-validation-COH4d78M.mjs +0 -17
- package/dist/index-type-validation-COH4d78M.mjs.map +0 -1
- package/dist/index-type-validation-CZ5L2lli.d.mts +0 -10
- package/dist/index-type-validation-CZ5L2lli.d.mts.map +0 -1
- package/dist/index-types-CNhHgKHi.d.mts +0 -1
- package/dist/index-types-DJQ_xwaE.mjs +0 -40
- package/dist/index-types-DJQ_xwaE.mjs.map +0 -1
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +0 -31
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +0 -1
- package/dist/interpreter-DyiUUAWh-DYdjIpiE.mjs +0 -3680
- package/dist/interpreter-DyiUUAWh-DYdjIpiE.mjs.map +0 -1
- package/dist/ir-Bghjt-FG.d.mts.map +0 -1
- package/dist/ir-I-xciGUH.mjs.map +0 -1
- package/dist/lane-query-builder.d.mts +0 -236
- package/dist/lane-query-builder.d.mts.map +0 -1
- package/dist/lane-query-builder.mjs +0 -67
- package/dist/lane-query-builder.mjs.map +0 -1
- package/dist/middleware--TtoxUiW.d.mts +0 -1
- package/dist/middleware-AhTz1BOW-th-Suxuf.d.mts.map +0 -1
- package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs.map +0 -1
- package/dist/migration-CK4oePIo.mjs.map +0 -1
- package/dist/migration-CjDRZNep.d.mts.map +0 -1
- package/dist/naming-CV9j2pXl-KARaDReS.d.mts.map +0 -1
- package/dist/naming-DKr4TJd7-Cszhq9RV.mjs.map +0 -1
- package/dist/pack-types-BcLTpwbv.d.mts +0 -14
- package/dist/pack-types-BcLTpwbv.d.mts.map +0 -1
- package/dist/plan-BHLdb0Z7.d.mts +0 -2
- package/dist/plan-CDxduYaN-pLIyyJaB.d.mts.map +0 -1
- package/dist/plan-Dh0LbYIv-Crx5-ThG.mjs.map +0 -1
- package/dist/prepared-query-BJr50wPm-ChoqfJbX.mjs +0 -22
- package/dist/prepared-query-BJr50wPm-ChoqfJbX.mjs.map +0 -1
- package/dist/prepared-statement-9QpkE6JG-C430V3MO.d.mts +0 -529
- package/dist/prepared-statement-9QpkE6JG-C430V3MO.d.mts.map +0 -1
- package/dist/psl-infer-CCAD6FWA.d.mts +0 -119
- package/dist/psl-infer-CCAD6FWA.d.mts.map +0 -1
- package/dist/psl-infer-Dk5kgKre.mjs +0 -362
- package/dist/psl-infer-Dk5kgKre.mjs.map +0 -1
- package/dist/query-lane-context-Qa-eddrE-kuZ8Z86-.d.mts.map +0 -1
- package/dist/query-lane-context-XMvk7fmY.d.mts +0 -1
- package/dist/referential-action-sql-DJ9ps6-S.d.mts.map +0 -1
- package/dist/referential-action-sql-DSqkrySN.mjs.map +0 -1
- package/dist/resolve-storage-table-DZsfnzeW.mjs.map +0 -1
- package/dist/resolve-storage-table-Nyrgk4h8.d.mts.map +0 -1
- package/dist/runtime-DpKF2Yu2.d.mts.map +0 -1
- package/dist/runtime-tIHpGCcG.mjs.map +0 -1
- package/dist/runtime.mjs.map +0 -1
- package/dist/schema-differ-DpG_gnur-DFAtGezx.d.mts.map +0 -1
- package/dist/schema-verify-C_PEdlAr-Dxxjm6EM.mjs.map +0 -1
- package/dist/serialized-index-CrgG8ct1-DG3JpHc7.d.mts.map +0 -1
- package/dist/serialized-index-nBTwanKy-_ddEK4tk.mjs.map +0 -1
- package/dist/sql-contract-serializer-2oBWuxTe-DKZTf2n8.mjs.map +0 -1
- package/dist/sql-execution-plan--jKyLpe5-CMGhgO0M.d.mts.map +0 -1
- package/dist/sql-index-ByAAE7K8-DKj2V86p.d.mts.map +0 -1
- package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts.map +0 -1
- package/dist/sql-storage-8LqxeLAY-DH4DdUXx.d.mts.map +0 -1
- package/dist/storage-table-DSeWszOL-CI-cItEK.d.mts.map +0 -1
- package/dist/storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map +0 -1
- package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts.map +0 -1
- package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs +0 -173
- package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs.map +0 -1
- package/dist/types-4YenawkP-CwaaZSid.mjs.map +0 -1
- package/dist/types-B0msOnBM.d.mts +0 -1
- package/dist/types-BDUG29Df-LE85dIXP.d.mts +0 -161
- package/dist/types-BDUG29Df-LE85dIXP.d.mts.map +0 -1
- package/dist/types-CUsJrvEl.mjs.map +0 -1
- package/dist/types-CyxGtOOh-BggSa6Fe.d.mts.map +0 -1
- package/dist/types-Dt4e_jC--COeP8xzN.mjs.map +0 -1
- package/dist/types-Dwcw0F8X.d.mts +0 -1
- package/dist/types-IqZMLrFC-DcH8v_u3.d.mts.map +0 -1
- package/dist/types-UcHa2cTe.d.mts +0 -17
- package/dist/types-UcHa2cTe.d.mts.map +0 -1
- package/dist/types-YStFFkKs-D9UAmnON.d.mts.map +0 -1
- package/dist/types-v3qxLLxo-DCeKv7yY.d.mts.map +0 -1
- package/dist/unique-constraint-M5TlQnJQ-BiIHJ85k.d.mts.map +0 -1
- package/dist/util-DQQgv2j1-D6INZaRG.mjs.map +0 -1
- package/dist/validators-Belo8QqM.d.mts.map +0 -1
- package/dist/validators-CrWD6bSP.mjs.map +0 -1
- package/dist/value-set-derivation-hook-BhgGVtw0.d.mts.map +0 -1
- package/dist/value-set-derivation-hook-Di9JZ0X7.mjs.map +0 -1
- package/dist/verify-u0UTdZgD-DSAaz9rW.mjs.map +0 -1
- package/dist/verify-zDRnw0Rn.d.mts.map +0 -1
- /package/dist/{contract__pack-types.mjs → relational-core__collection-methods.mjs} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as collectOrderedParamRefs } from "./util-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { A as ParamRef, F as SelectAst, G as isOrderByNulls, L as TableSource, M as ProjectionItem, R as UpdateAst, U as isAggregateFn, W as isOrderByDirection, _ as InsertAst, c as DeleteAst, g as IdentifierRef, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, t as AggregateExpr, w as LockingClause, y as JoinAst } from "./types-NTQsD2MS-xcLtvKO9.mjs";
|
|
2
|
+
import { r as isAggregateProjection, t as collectOrderedParamRefs } from "./util-BBgcP3gI-CpL-0VuC.mjs";
|
|
3
|
+
import { D as lockWaitPolicyOf, E as lockStrengthCapabilities, T as lockOptionCapabilities, w as lockIncompatible } from "./ast-D0miQ1B6.mjs";
|
|
4
|
+
import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-B-XNINxr-BhN2sysZ.mjs";
|
|
5
|
+
import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-CiiFzMtb.mjs";
|
|
6
|
+
import { t as createFunctions } from "./functions-CsOoN7I3.mjs";
|
|
7
|
+
import { t as createIndexReferences } from "./index-reference-BQSrkRfT.mjs";
|
|
5
8
|
import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
|
|
6
|
-
//#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
|
|
9
|
+
//#region ../../../2-sql-family/4-lanes/sql-builder/dist/runtime/index.mjs
|
|
7
10
|
/**
|
|
8
11
|
* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**
|
|
9
12
|
*
|
|
@@ -42,6 +45,55 @@ import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/ru
|
|
|
42
45
|
function blindCast(input) {
|
|
43
46
|
return input;
|
|
44
47
|
}
|
|
48
|
+
function createFieldProxy(scope) {
|
|
49
|
+
return new Proxy(blindCast({}), { get(_target, prop) {
|
|
50
|
+
if (Object.hasOwn(scope.topLevel, prop)) {
|
|
51
|
+
const topField = scope.topLevel[prop];
|
|
52
|
+
if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField);
|
|
53
|
+
}
|
|
54
|
+
if (Object.hasOwn(scope.namespaces, prop)) {
|
|
55
|
+
const nsFields = scope.namespaces[prop];
|
|
56
|
+
if (nsFields) return createNamespaceProxy(prop, nsFields);
|
|
57
|
+
}
|
|
58
|
+
} });
|
|
59
|
+
}
|
|
60
|
+
function createNamespaceProxy(namespaceName, fields) {
|
|
61
|
+
return new Proxy({}, { get(_target, prop) {
|
|
62
|
+
if (Object.hasOwn(fields, prop)) {
|
|
63
|
+
const field = fields[prop];
|
|
64
|
+
if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field);
|
|
65
|
+
}
|
|
66
|
+
} });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A bug in Prisma 8, not a user error. Never catch this except at the
|
|
70
|
+
* outermost boundary for crash reporting — an InternalError means an invariant
|
|
71
|
+
* broke and the process cannot reliably continue. User-facing failures use
|
|
72
|
+
* `structuredError` with a dotted code instead.
|
|
73
|
+
*/
|
|
74
|
+
var InternalError = class extends Error {
|
|
75
|
+
isPrismaInternalError = true;
|
|
76
|
+
constructor(message, options) {
|
|
77
|
+
super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
78
|
+
this.name = "InternalError";
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Asserts that a value is defined (not null or undefined).
|
|
83
|
+
* Use for invariants where the value should always exist at runtime.
|
|
84
|
+
*
|
|
85
|
+
* @throws Error if value is null or undefined
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const table = storage.namespaces[namespaceId].entries.table[tableName];
|
|
90
|
+
* assertDefined(table, `Table "${tableName}" not found`);
|
|
91
|
+
* // table is now narrowed to non-nullable
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
function assertDefined(value, message) {
|
|
95
|
+
if (value === null || value === void 0) throw new InternalError(message);
|
|
96
|
+
}
|
|
45
97
|
/**
|
|
46
98
|
* Returns an object with the key/value if value is defined, otherwise an empty object.
|
|
47
99
|
*
|
|
@@ -85,31 +137,6 @@ function structuredError(code, message, options) {
|
|
|
85
137
|
});
|
|
86
138
|
}
|
|
87
139
|
/**
|
|
88
|
-
* Runtime wrapper around a relational-core AST expression node. Carries ScopeField metadata (codecId, nullable) so aggregate-like combinators can propagate the input codec onto their result.
|
|
89
|
-
*
|
|
90
|
-
* `codec` records the column-bound {@link CodecRef} when the field-proxy knows the binding — both the namespaced form (`f.user.email` → `ColumnRef`) and the top-level shortcut (`f.email` → `IdentifierRef`) stamp the ref derived from contract storage. `codecOf(expression)` exposes it for operation implementations forwarding the ref to `toExpr`.
|
|
91
|
-
*
|
|
92
|
-
* `projectionAst` carries the descriptor-lowered rendering of the expression, where a target declares one (e.g. SQLite's `CAST(count(*) AS TEXT)`). Lowering exists to carry the value across the driver boundary, so only the projection site consumes it — predicate and ordering positions (`buildAst()`) keep the plain form, where the rendering would change SQL semantics.
|
|
93
|
-
*/
|
|
94
|
-
var ExpressionImpl = class {
|
|
95
|
-
ast;
|
|
96
|
-
projectionAst;
|
|
97
|
-
returnType;
|
|
98
|
-
codec;
|
|
99
|
-
constructor(ast, returnType, codec, projectionAst) {
|
|
100
|
-
this.ast = ast;
|
|
101
|
-
this.returnType = returnType;
|
|
102
|
-
this.codec = codec;
|
|
103
|
-
this.projectionAst = projectionAst;
|
|
104
|
-
}
|
|
105
|
-
buildAst() {
|
|
106
|
-
return this.ast;
|
|
107
|
-
}
|
|
108
|
-
buildProjectionAst() {
|
|
109
|
-
return this.projectionAst ?? this.ast;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
140
|
* An aggregate whose operation lies outside the SQL aggregate alphabet: the expression exists only in its descriptor-lowered form, so only the projection may consume it.
|
|
114
141
|
*
|
|
115
142
|
* Predicate and ordering positions build the plain form through `buildAst()` and are refused at authoring time — the lowered rendering exists to carry the value across the driver boundary, and comparing or sorting by it inside the database would change SQL semantics (a textual rendering compares lexicographically).
|
|
@@ -117,7 +144,7 @@ var ExpressionImpl = class {
|
|
|
117
144
|
var ProjectionOnlyExpressionImpl = class extends ExpressionImpl {
|
|
118
145
|
operation;
|
|
119
146
|
constructor(operation, lowered, returnType) {
|
|
120
|
-
super(lowered, returnType,
|
|
147
|
+
super(lowered, returnType, lowered);
|
|
121
148
|
this.operation = operation;
|
|
122
149
|
}
|
|
123
150
|
buildAst() {
|
|
@@ -134,111 +161,6 @@ var ProjectionOnlyExpressionImpl = class extends ExpressionImpl {
|
|
|
134
161
|
function projectionAstOf(expr) {
|
|
135
162
|
return expr instanceof ExpressionImpl ? expr.buildProjectionAst() : expr.buildAst();
|
|
136
163
|
}
|
|
137
|
-
function createFieldProxy(scope) {
|
|
138
|
-
return new Proxy({}, { get(_target, prop) {
|
|
139
|
-
if (Object.hasOwn(scope.topLevel, prop)) {
|
|
140
|
-
const topField = scope.topLevel[prop];
|
|
141
|
-
if (topField) return new ExpressionImpl(IdentifierRef.of(prop), topField, topField.codec);
|
|
142
|
-
}
|
|
143
|
-
if (Object.hasOwn(scope.namespaces, prop)) {
|
|
144
|
-
const nsFields = scope.namespaces[prop];
|
|
145
|
-
if (nsFields) return createNamespaceProxy(prop, nsFields);
|
|
146
|
-
}
|
|
147
|
-
} });
|
|
148
|
-
}
|
|
149
|
-
function createNamespaceProxy(namespaceName, fields) {
|
|
150
|
-
return new Proxy({}, { get(_target, prop) {
|
|
151
|
-
if (Object.hasOwn(fields, prop)) {
|
|
152
|
-
const field = fields[prop];
|
|
153
|
-
if (field) return new ExpressionImpl(ColumnRef.of(namespaceName, prop), field, field.codec);
|
|
154
|
-
}
|
|
155
|
-
} });
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* A bug in Prisma Next, not a user error. Never catch this except at the
|
|
159
|
-
* outermost boundary for crash reporting — an InternalError means an invariant
|
|
160
|
-
* broke and the process cannot reliably continue. User-facing failures use
|
|
161
|
-
* `structuredError` with a dotted code instead.
|
|
162
|
-
*/
|
|
163
|
-
var InternalError = class extends Error {
|
|
164
|
-
isPrismaInternalError = true;
|
|
165
|
-
constructor(message, options) {
|
|
166
|
-
super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
167
|
-
this.name = "InternalError";
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Asserts that a value is defined (not null or undefined).
|
|
172
|
-
* Use for invariants where the value should always exist at runtime.
|
|
173
|
-
*
|
|
174
|
-
* @throws Error if value is null or undefined
|
|
175
|
-
*
|
|
176
|
-
* @example
|
|
177
|
-
* ```typescript
|
|
178
|
-
* const table = storage.namespaces[namespaceId].entries.table[tableName];
|
|
179
|
-
* assertDefined(table, `Table "${tableName}" not found`);
|
|
180
|
-
* // table is now narrowed to non-nullable
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
function assertDefined(value, message) {
|
|
184
|
-
if (value === null || value === void 0) throw new InternalError(message);
|
|
185
|
-
}
|
|
186
|
-
const BOOL_FIELD = {
|
|
187
|
-
codecId: "pg/bool@1",
|
|
188
|
-
nullable: false
|
|
189
|
-
};
|
|
190
|
-
const resolve = toExpr;
|
|
191
|
-
/**
|
|
192
|
-
* Resolve a binary-comparison operand into an AST expression, threading the column-bound side's {@link CodecRef} to the raw-value side.
|
|
193
|
-
*
|
|
194
|
-
* For `fns.eq(f.email, 'alice@example.com')`, `f.email` is the column-bound expression carrying a `ColumnRef` AST and a `CodecRef` derived from contract storage; the raw string operand has no codec context. By deriving the codec context from the column-bound side and forwarding it via `toExpr(value, codec)`, the resulting `ParamRef` carries the `CodecRef` that encode-side dispatch needs to materialise the per-instance codec for parameterized codec ids (`vector(1024)` vs. `vector(1536)`).
|
|
195
|
-
*/
|
|
196
|
-
function resolveOperand(operand, otherCodec) {
|
|
197
|
-
if (isExpressionLike(operand)) return operand.buildAst();
|
|
198
|
-
return toExpr(operand, otherCodec);
|
|
199
|
-
}
|
|
200
|
-
function isExpressionLike(value) {
|
|
201
|
-
return typeof value === "object" && value !== null && "buildAst" in value && typeof value.buildAst === "function";
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Resolves an Expression via `buildAst()`, or wraps a raw value as a `LiteralExpr` — an SQL literal inlined into the query text, not a bound parameter.
|
|
205
|
-
*
|
|
206
|
-
* Used for `and` / `or` operands. The usual operand is an `Expression<bool>` (e.g. the result of `fns.eq`), which this function passes through by calling `buildAst()`. The only time the raw-value branch fires is when the caller writes `fns.and(true, x)` or similar — inlining `TRUE`/`FALSE` literals lets the SQL planner statically simplify `TRUE AND x` to `x`, which it cannot do for an opaque `ParamRef`.
|
|
207
|
-
*/
|
|
208
|
-
function toLiteralExpr(value) {
|
|
209
|
-
if (typeof value === "object" && value !== null && "buildAst" in value && typeof value.buildAst === "function") return value.buildAst();
|
|
210
|
-
return new LiteralExpr(value);
|
|
211
|
-
}
|
|
212
|
-
function boolExpr(astNode) {
|
|
213
|
-
return new ExpressionImpl(astNode, BOOL_FIELD);
|
|
214
|
-
}
|
|
215
|
-
function binaryWithSharedCodec(a, b, build) {
|
|
216
|
-
const aCodec = codecOf(a);
|
|
217
|
-
return build(resolveOperand(a, codecOf(b)), resolveOperand(b, aCodec));
|
|
218
|
-
}
|
|
219
|
-
function eq(a, b) {
|
|
220
|
-
if (b === null) return boolExpr(NullCheckExpr.isNull(resolve(a)));
|
|
221
|
-
if (a === null) return boolExpr(NullCheckExpr.isNull(resolve(b)));
|
|
222
|
-
return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr("eq", l, r)));
|
|
223
|
-
}
|
|
224
|
-
function ne(a, b) {
|
|
225
|
-
if (b === null) return boolExpr(NullCheckExpr.isNotNull(resolve(a)));
|
|
226
|
-
if (a === null) return boolExpr(NullCheckExpr.isNotNull(resolve(b)));
|
|
227
|
-
return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr("neq", l, r)));
|
|
228
|
-
}
|
|
229
|
-
function comparison(a, b, op) {
|
|
230
|
-
return boolExpr(binaryWithSharedCodec(a, b, (l, r) => new BinaryExpr(op, l, r)));
|
|
231
|
-
}
|
|
232
|
-
function inOrNotIn(expr, valuesOrSubquery, op) {
|
|
233
|
-
const left = expr.buildAst();
|
|
234
|
-
const leftCodec = codecOf(expr);
|
|
235
|
-
const binaryFn = op === "in" ? BinaryExpr.in : BinaryExpr.notIn;
|
|
236
|
-
if (Array.isArray(valuesOrSubquery)) {
|
|
237
|
-
const refs = valuesOrSubquery.map((v) => resolveOperand(v, leftCodec));
|
|
238
|
-
return boolExpr(binaryFn(left, ListExpression.of(refs)));
|
|
239
|
-
}
|
|
240
|
-
return boolExpr(binaryFn(left, SubqueryExpr.of(valuesOrSubquery.buildAst())));
|
|
241
|
-
}
|
|
242
164
|
/**
|
|
243
165
|
* Build an aggregate through the target's own answer for it.
|
|
244
166
|
*
|
|
@@ -294,24 +216,7 @@ function aggregate(aggregates, operation, expr) {
|
|
|
294
216
|
expr: inputAst,
|
|
295
217
|
inputCodec
|
|
296
218
|
});
|
|
297
|
-
return new ExpressionImpl(ast, returnType,
|
|
298
|
-
}
|
|
299
|
-
function createBuiltinFunctions(rawCodecInferer) {
|
|
300
|
-
return {
|
|
301
|
-
eq: (a, b) => eq(a, b),
|
|
302
|
-
ne: (a, b) => ne(a, b),
|
|
303
|
-
gt: (a, b) => comparison(a, b, "gt"),
|
|
304
|
-
gte: (a, b) => comparison(a, b, "gte"),
|
|
305
|
-
lt: (a, b) => comparison(a, b, "lt"),
|
|
306
|
-
lte: (a, b) => comparison(a, b, "lte"),
|
|
307
|
-
and: (...exprs) => boolExpr(AndExpr.of(exprs.map(toLiteralExpr))),
|
|
308
|
-
or: (...exprs) => boolExpr(OrExpr.of(exprs.map(toLiteralExpr))),
|
|
309
|
-
exists: (subquery) => boolExpr(ExistsExpr.exists(subquery.buildAst())),
|
|
310
|
-
notExists: (subquery) => boolExpr(ExistsExpr.notExists(subquery.buildAst())),
|
|
311
|
-
in: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, "in"),
|
|
312
|
-
notIn: (expr, valuesOrSubquery) => inOrNotIn(expr, valuesOrSubquery, "notIn"),
|
|
313
|
-
raw: createRawSql(rawCodecInferer)
|
|
314
|
-
};
|
|
219
|
+
return new ExpressionImpl(ast, returnType, projectionAst);
|
|
315
220
|
}
|
|
316
221
|
/**
|
|
317
222
|
* The aggregate implementations, one per operation the registry contributes,
|
|
@@ -332,22 +237,28 @@ function createAggregateOnlyFunctions(aggregates) {
|
|
|
332
237
|
}
|
|
333
238
|
return Object.fromEntries(methods);
|
|
334
239
|
}
|
|
335
|
-
function createFunctions(operations, rawCodecInferer) {
|
|
336
|
-
const builtins = createBuiltinFunctions(rawCodecInferer);
|
|
337
|
-
return new Proxy({}, { get(_target, prop) {
|
|
338
|
-
if (Object.hasOwn(builtins, prop)) return builtins[prop];
|
|
339
|
-
const op = operations[prop];
|
|
340
|
-
if (op) return op.impl;
|
|
341
|
-
} });
|
|
342
|
-
}
|
|
343
240
|
function createAggregateFunctions(operations, rawCodecInferer, aggregateRegistry) {
|
|
344
241
|
const baseFns = createFunctions(operations, rawCodecInferer);
|
|
345
242
|
const aggregates = createAggregateOnlyFunctions(aggregateRegistry);
|
|
346
|
-
return new Proxy({}, { get(_target, prop) {
|
|
243
|
+
return new Proxy(blindCast({}), { get(_target, prop) {
|
|
347
244
|
if (Object.hasOwn(aggregates, prop)) return aggregates[prop];
|
|
348
|
-
return baseFns[prop];
|
|
245
|
+
return blindCast(baseFns)[prop];
|
|
349
246
|
} });
|
|
350
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Builds the raw lane a client exposes as `db.raw`.
|
|
250
|
+
*
|
|
251
|
+
* The tag binds the adapter's codec inferer and the contract here, once. An
|
|
252
|
+
* authoring site then carries only its template, its row spec, and a
|
|
253
|
+
* terminator.
|
|
254
|
+
*
|
|
255
|
+
* The row type is phantom: no value holds it. The target-agnostic tag types it
|
|
256
|
+
* as `unknown`, and the contract says what each declared column decodes to.
|
|
257
|
+
*/
|
|
258
|
+
function createRawLane(options) {
|
|
259
|
+
const tag = blindCast(createRawSql(options.rawCodecInferer, { contract: options.context.contract }));
|
|
260
|
+
return Object.freeze({ sql: tag });
|
|
261
|
+
}
|
|
351
262
|
function resolveTableInNamespace(storage, namespaceId, tableName) {
|
|
352
263
|
const namespace = storage.namespaces[namespaceId];
|
|
353
264
|
if (namespace === void 0) return void 0;
|
|
@@ -355,6 +266,83 @@ function resolveTableInNamespace(storage, namespaceId, tableName) {
|
|
|
355
266
|
if (tables === void 0 || !Object.hasOwn(tables, tableName)) return void 0;
|
|
356
267
|
return tables[tableName];
|
|
357
268
|
}
|
|
269
|
+
const NOTHING = {
|
|
270
|
+
columns: [],
|
|
271
|
+
subqueries: []
|
|
272
|
+
};
|
|
273
|
+
/** The columns an expression reads itself, and the subqueries inside it, which read their own sources. */
|
|
274
|
+
function readsOf(expression) {
|
|
275
|
+
return expression.fold({
|
|
276
|
+
empty: NOTHING,
|
|
277
|
+
combine: (a, b) => ({
|
|
278
|
+
columns: [...a.columns, ...b.columns],
|
|
279
|
+
subqueries: [...a.subqueries, ...b.subqueries]
|
|
280
|
+
}),
|
|
281
|
+
columnRef: (columnRef) => ({
|
|
282
|
+
columns: [columnRef],
|
|
283
|
+
subqueries: []
|
|
284
|
+
}),
|
|
285
|
+
select: (subquery) => ({
|
|
286
|
+
columns: [],
|
|
287
|
+
subqueries: [subquery]
|
|
288
|
+
})
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function aliasOf(source) {
|
|
292
|
+
return source.kind === "table-source" ? source.alias ?? source.name : source.alias;
|
|
293
|
+
}
|
|
294
|
+
function assertReadsIn(expressions, visible) {
|
|
295
|
+
for (const expression of expressions) {
|
|
296
|
+
const { columns, subqueries } = readsOf(expression);
|
|
297
|
+
for (const column of columns) if (!visible.has(column.table)) throw columnOutsideQuery(column, visible);
|
|
298
|
+
for (const subquery of subqueries) assertSelectReads(subquery, visible);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function assertSelectReads(select, outer) {
|
|
302
|
+
const sources = [select.from, ...(select.joins ?? []).map((join) => join.source)].filter((source) => source !== void 0);
|
|
303
|
+
const visible = /* @__PURE__ */ new Set([...outer, ...sources.map(aliasOf).filter((alias) => alias !== void 0)]);
|
|
304
|
+
for (const source of sources) {
|
|
305
|
+
if (source.kind === "derived-table-source") assertSelectReads(source.query, visible);
|
|
306
|
+
if (source.kind === "function-source") assertReadsIn(source.args, visible);
|
|
307
|
+
}
|
|
308
|
+
assertReadsIn([
|
|
309
|
+
...select.projection.map((item) => item.expr),
|
|
310
|
+
...select.where === void 0 ? [] : [select.where],
|
|
311
|
+
...(select.orderBy ?? []).map((item) => item.expr),
|
|
312
|
+
...select.groupBy ?? [],
|
|
313
|
+
...select.having === void 0 ? [] : [select.having],
|
|
314
|
+
...select.distinctOn ?? [],
|
|
315
|
+
...(select.joins ?? []).flatMap((join) => join.on.kind === "eq-col-join-on" ? [join.on.left, join.on.right] : [join.on])
|
|
316
|
+
], visible);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Refuses a statement that reads a column of an alias none of its sources, or of the queries around it, has. An expression built outside the query's callbacks, such as an index read from `table.as('other').indexes`, can name any alias.
|
|
320
|
+
*/
|
|
321
|
+
function assertColumnsInScope(ast) {
|
|
322
|
+
switch (ast.kind) {
|
|
323
|
+
case "select":
|
|
324
|
+
assertSelectReads(ast, /* @__PURE__ */ new Set());
|
|
325
|
+
return;
|
|
326
|
+
case "update":
|
|
327
|
+
assertReadsIn([...Object.values(ast.set), ...ast.where === void 0 ? [] : [ast.where]], /* @__PURE__ */ new Set([aliasOf(ast.table) ?? ast.table.name]));
|
|
328
|
+
return;
|
|
329
|
+
case "delete":
|
|
330
|
+
assertReadsIn(ast.where === void 0 ? [] : [ast.where], /* @__PURE__ */ new Set([aliasOf(ast.table) ?? ast.table.name]));
|
|
331
|
+
return;
|
|
332
|
+
default: return;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function columnOutsideQuery(column, visible) {
|
|
336
|
+
const sources = [...visible];
|
|
337
|
+
return structuredError("ORM.ARGUMENT_INVALID", `The query reads column "${column.column}" of "${column.table}", which is not one of its sources (${sources.map((source) => `"${source}"`).join(", ")}).`, {
|
|
338
|
+
fix: "Read the column, or the index, from a table the query selects from or joins, under the alias it has in the query.",
|
|
339
|
+
meta: {
|
|
340
|
+
alias: column.table,
|
|
341
|
+
column: column.column,
|
|
342
|
+
sources
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
358
346
|
var BuilderBase = class {
|
|
359
347
|
ctx;
|
|
360
348
|
constructor(ctx) {
|
|
@@ -387,6 +375,7 @@ function emptyState(from, scope) {
|
|
|
387
375
|
offset: void 0,
|
|
388
376
|
distinct: void 0,
|
|
389
377
|
distinctOn: void 0,
|
|
378
|
+
locking: void 0,
|
|
390
379
|
scope,
|
|
391
380
|
rowFields: {},
|
|
392
381
|
annotations: /* @__PURE__ */ new Map()
|
|
@@ -403,7 +392,33 @@ function combineWhereExprs(exprs) {
|
|
|
403
392
|
if (exprs.length === 1) return exprs[0];
|
|
404
393
|
return AndExpr.of(exprs);
|
|
405
394
|
}
|
|
395
|
+
const lockConflictKinds = [
|
|
396
|
+
"distinct",
|
|
397
|
+
"distinctOn",
|
|
398
|
+
"groupBy",
|
|
399
|
+
"having"
|
|
400
|
+
];
|
|
401
|
+
function lockConflictOf(state) {
|
|
402
|
+
const conflicts = {
|
|
403
|
+
distinct: state.distinct !== void 0,
|
|
404
|
+
distinctOn: state.distinctOn !== void 0 && state.distinctOn.length > 0,
|
|
405
|
+
groupBy: state.groupBy.length > 0,
|
|
406
|
+
having: state.having !== void 0
|
|
407
|
+
};
|
|
408
|
+
return lockConflictKinds.find((conflict) => conflicts[conflict]);
|
|
409
|
+
}
|
|
410
|
+
function assertLockable(state) {
|
|
411
|
+
if (state.locking === void 0) return;
|
|
412
|
+
const conflict = lockConflictOf(state);
|
|
413
|
+
if (conflict !== void 0) throw lockIncompatible(conflict, `A locking clause cannot be combined with ${conflict}`);
|
|
414
|
+
const item = state.projections.find(isAggregateProjection);
|
|
415
|
+
if (item !== void 0) throw lockIncompatible("aggregate", `A locking clause cannot be combined with an aggregate or window function in the projection (column "${item.alias}")`);
|
|
416
|
+
}
|
|
417
|
+
function assertNotLocked(state) {
|
|
418
|
+
if (state.locking !== void 0) throw lockIncompatible("subquery", "A locked select cannot be used as a subquery");
|
|
419
|
+
}
|
|
406
420
|
function buildSelectAst(state) {
|
|
421
|
+
assertLockable(state);
|
|
407
422
|
const where = combineWhereExprs(state.where);
|
|
408
423
|
return new SelectAst({
|
|
409
424
|
from: state.from,
|
|
@@ -417,10 +432,12 @@ function buildSelectAst(state) {
|
|
|
417
432
|
having: state.having,
|
|
418
433
|
limit: state.limit,
|
|
419
434
|
offset: state.offset,
|
|
435
|
+
locking: state.locking,
|
|
420
436
|
selectAllIntent: void 0
|
|
421
437
|
});
|
|
422
438
|
}
|
|
423
439
|
function buildQueryPlan(ast, ctx, annotations) {
|
|
440
|
+
assertColumnsInScope(ast);
|
|
424
441
|
const paramValues = collectOrderedParamRefs(ast).map((r) => r.kind === "param-ref" ? r.value : void 0);
|
|
425
442
|
const annotationsRecord = annotations !== void 0 && annotations.size > 0 ? Object.freeze(Object.fromEntries(annotations)) : void 0;
|
|
426
443
|
const meta = Object.freeze({
|
|
@@ -501,6 +518,10 @@ function assertCapability(ctx, required, methodName) {
|
|
|
501
518
|
capability: `${ns}.${key}`
|
|
502
519
|
} });
|
|
503
520
|
}
|
|
521
|
+
function codecRefOf(field, ctx) {
|
|
522
|
+
if (field.codec !== void 0) return field.codec;
|
|
523
|
+
return ctx.materializesWithoutTypeParams(field.codecId) ? { codecId: field.codecId } : void 0;
|
|
524
|
+
}
|
|
504
525
|
function resolveSelectArgs(args, scope, ctx) {
|
|
505
526
|
const projections = [];
|
|
506
527
|
const newRowFields = {};
|
|
@@ -512,7 +533,7 @@ function resolveSelectArgs(args, scope, ctx) {
|
|
|
512
533
|
for (const colName of args) {
|
|
513
534
|
const field = scope.topLevel[colName];
|
|
514
535
|
if (!field) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${colName}" not found in scope`, { meta: { column: colName } });
|
|
515
|
-
projections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), field
|
|
536
|
+
projections.push(ProjectionItem.of(colName, IdentifierRef.of(colName), codecRefOf(field, ctx)));
|
|
516
537
|
newRowFields[colName] = field;
|
|
517
538
|
}
|
|
518
539
|
return {
|
|
@@ -526,7 +547,7 @@ function resolveSelectArgs(args, scope, ctx) {
|
|
|
526
547
|
const fns = createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates);
|
|
527
548
|
const result = exprFn(createFieldProxy(scope), fns);
|
|
528
549
|
const field = result.returnType;
|
|
529
|
-
projections.push(ProjectionItem.of(alias, projectionAstOf(result), field
|
|
550
|
+
projections.push(ProjectionItem.of(alias, projectionAstOf(result), codecRefOf(field, ctx)));
|
|
530
551
|
newRowFields[alias] = field;
|
|
531
552
|
return {
|
|
532
553
|
projections,
|
|
@@ -539,7 +560,7 @@ function resolveSelectArgs(args, scope, ctx) {
|
|
|
539
560
|
const record = callbackFn(createFieldProxy(scope), fns);
|
|
540
561
|
for (const [key, expr] of Object.entries(record)) {
|
|
541
562
|
const field = expr.returnType;
|
|
542
|
-
projections.push(ProjectionItem.of(key, projectionAstOf(expr), field
|
|
563
|
+
projections.push(ProjectionItem.of(key, projectionAstOf(expr), codecRefOf(field, ctx)));
|
|
543
564
|
newRowFields[key] = field;
|
|
544
565
|
}
|
|
545
566
|
return {
|
|
@@ -550,17 +571,19 @@ function resolveSelectArgs(args, scope, ctx) {
|
|
|
550
571
|
throw structuredError("ORM.ARGUMENT_INVALID", "Invalid .select() arguments");
|
|
551
572
|
}
|
|
552
573
|
function resolveOrderBy(arg, options, scope, rowFields, ctx, useAggregateFns) {
|
|
553
|
-
const
|
|
574
|
+
const direction = options?.direction ?? "asc";
|
|
575
|
+
const nulls = options?.nulls;
|
|
576
|
+
if (!isOrderByDirection(direction)) throw structuredError("ORM.ARGUMENT_INVALID", "orderBy direction must be \"asc\" or \"desc\"", { meta: { direction: String(direction) } });
|
|
577
|
+
if (nulls !== void 0 && !isOrderByNulls(nulls)) throw structuredError("ORM.ARGUMENT_INVALID", "orderBy nulls must be \"first\" or \"last\"", { meta: { nulls: String(nulls) } });
|
|
578
|
+
const toOrderByItem = (expr) => new OrderByItem(expr, direction, nulls);
|
|
554
579
|
if (typeof arg === "string") {
|
|
555
580
|
if (!(arg in orderByScopeOf(scope, rowFields).topLevel)) throw structuredError("ORM.COLUMN_UNKNOWN", `Column "${arg}" not found in scope for orderBy`, { meta: { column: arg } });
|
|
556
|
-
|
|
557
|
-
return dir === "asc" ? OrderByItem.asc(expr) : OrderByItem.desc(expr);
|
|
581
|
+
return toOrderByItem(IdentifierRef.of(arg));
|
|
558
582
|
}
|
|
559
583
|
if (typeof arg === "function") {
|
|
560
584
|
const combined = orderByScopeOf(scope, rowFields);
|
|
561
585
|
const fns = useAggregateFns ? createAggregateFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer, ctx.aggregates) : createFunctions(ctx.queryOperationTypes, ctx.rawCodecInferer);
|
|
562
|
-
|
|
563
|
-
return dir === "asc" ? OrderByItem.asc(result.buildAst()) : OrderByItem.desc(result.buildAst());
|
|
586
|
+
return toOrderByItem(arg(createFieldProxy(combined), fns).buildAst());
|
|
564
587
|
}
|
|
565
588
|
throw structuredError("ORM.ARGUMENT_INVALID", "Invalid orderBy argument");
|
|
566
589
|
}
|
|
@@ -640,6 +663,7 @@ var QueryBase = class extends BuilderBase {
|
|
|
640
663
|
return new GroupedQueryImpl(cloneState(this.state, { groupBy: [...this.state.groupBy, ...exprs] }), this.ctx);
|
|
641
664
|
}
|
|
642
665
|
as(alias) {
|
|
666
|
+
assertNotLocked(this.state);
|
|
643
667
|
const ast = buildSelectAst(this.state);
|
|
644
668
|
const derivedSource = DerivedTableSource.as(alias, ast);
|
|
645
669
|
const scope = {
|
|
@@ -655,6 +679,7 @@ var QueryBase = class extends BuilderBase {
|
|
|
655
679
|
return this.state.rowFields;
|
|
656
680
|
}
|
|
657
681
|
buildAst() {
|
|
682
|
+
assertNotLocked(this.state);
|
|
658
683
|
return buildSelectAst(this.state);
|
|
659
684
|
}
|
|
660
685
|
build() {
|
|
@@ -683,6 +708,21 @@ var SelectQueryImpl = class SelectQueryImpl extends QueryBase {
|
|
|
683
708
|
const item = resolveOrderBy(arg, options, this.state.scope, this.state.rowFields, this.ctx, false);
|
|
684
709
|
return this.clone(cloneState(this.state, { orderBy: [...this.state.orderBy, item] }));
|
|
685
710
|
}
|
|
711
|
+
forUpdate = this._gate(lockStrengthCapabilities.forUpdate, "forUpdate", (options) => this.lock("forUpdate", options));
|
|
712
|
+
forNoKeyUpdate = this._gate(lockStrengthCapabilities.forNoKeyUpdate, "forNoKeyUpdate", (options) => this.lock("forNoKeyUpdate", options));
|
|
713
|
+
forShare = this._gate(lockStrengthCapabilities.forShare, "forShare", (options) => this.lock("forShare", options));
|
|
714
|
+
forKeyShare = this._gate(lockStrengthCapabilities.forKeyShare, "forKeyShare", (options) => this.lock("forKeyShare", options));
|
|
715
|
+
lock(strength, options) {
|
|
716
|
+
const of = options?.of !== void 0 && options.of.length > 0 ? options.of : void 0;
|
|
717
|
+
if (of !== void 0) assertCapability(this.ctx, lockOptionCapabilities.of, strength);
|
|
718
|
+
const waitPolicy = lockWaitPolicyOf(strength, options);
|
|
719
|
+
if (waitPolicy !== void 0) assertCapability(this.ctx, lockOptionCapabilities[waitPolicy], strength);
|
|
720
|
+
const clause = LockingClause.of(strength, {
|
|
721
|
+
...ifDefined("of", of),
|
|
722
|
+
...ifDefined("waitPolicy", waitPolicy)
|
|
723
|
+
});
|
|
724
|
+
return this.clone(cloneState(this.state, { locking: [...this.state.locking ?? [], clause] }));
|
|
725
|
+
}
|
|
686
726
|
};
|
|
687
727
|
var GroupedQueryImpl = class GroupedQueryImpl extends QueryBase {
|
|
688
728
|
clone(state) {
|
|
@@ -800,16 +840,19 @@ function buildParamValues(values, namespaceId, table, tableName, op, ctx) {
|
|
|
800
840
|
for (const def of ctx.applyMutationDefaults({
|
|
801
841
|
op,
|
|
802
842
|
namespace: namespaceId,
|
|
803
|
-
|
|
843
|
+
entry: tableName,
|
|
804
844
|
values
|
|
805
845
|
})) {
|
|
806
|
-
const codec = table.columns[def.
|
|
807
|
-
params[def.
|
|
846
|
+
const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
|
|
847
|
+
params[def.field] = ParamRef.of(def.value, codec ? { codec } : void 0);
|
|
808
848
|
}
|
|
809
849
|
return params;
|
|
810
850
|
}
|
|
811
|
-
function buildReturningProjections(tableName, columns, rowFields) {
|
|
812
|
-
return columns.map((col) =>
|
|
851
|
+
function buildReturningProjections(tableName, columns, rowFields, ctx) {
|
|
852
|
+
return columns.map((col) => {
|
|
853
|
+
const field = rowFields[col];
|
|
854
|
+
return ProjectionItem.of(col, ColumnRef.of(tableName, col), field === void 0 ? void 0 : codecRefOf(field, ctx));
|
|
855
|
+
});
|
|
813
856
|
}
|
|
814
857
|
function evaluateWhere(whereCallback, scope, queryOperationTypes, rawCodecInferer) {
|
|
815
858
|
return whereCallback(createFieldProxy(scope), createFunctions(queryOperationTypes, rawCodecInferer)).buildAst();
|
|
@@ -825,11 +868,11 @@ function buildSetExpressions(exprs, namespaceId, table, tableName, op, ctx) {
|
|
|
825
868
|
for (const def of ctx.applyMutationDefaults({
|
|
826
869
|
op,
|
|
827
870
|
namespace: namespaceId,
|
|
828
|
-
|
|
871
|
+
entry: tableName,
|
|
829
872
|
values: exprs
|
|
830
|
-
})) if (!(def.
|
|
831
|
-
const codec = table.columns[def.
|
|
832
|
-
set[def.
|
|
873
|
+
})) if (!(def.field in set)) {
|
|
874
|
+
const codec = table.columns[def.field] ? codecRefFor(ctx, namespaceId, tableName, def.field) : void 0;
|
|
875
|
+
set[def.field] = ParamRef.of(def.value, ifDefined("codec", codec));
|
|
833
876
|
}
|
|
834
877
|
return set;
|
|
835
878
|
}
|
|
@@ -878,7 +921,7 @@ var InsertQueryImpl = class InsertQueryImpl extends BuilderBase {
|
|
|
878
921
|
if (this.#rows.length === 0) throw structuredError("ORM.MUTATION_DATA_MISSING", "insert() called with an empty row array — at least one row is required");
|
|
879
922
|
const paramRows = this.#rows.map((rowValues) => buildParamValues(rowValues, this.#namespaceId, this.#table, this.#tableName, "create", this.ctx));
|
|
880
923
|
let ast = InsertAst.into(this.#tableSource).withRows(paramRows);
|
|
881
|
-
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
|
|
924
|
+
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
|
|
882
925
|
return buildQueryPlan(ast, this.ctx, this.#annotations);
|
|
883
926
|
}
|
|
884
927
|
};
|
|
@@ -925,7 +968,7 @@ var UpdateQueryImpl = class UpdateQueryImpl extends BuilderBase {
|
|
|
925
968
|
}
|
|
926
969
|
build() {
|
|
927
970
|
let ast = UpdateAst.table(this.#tableSource).withSet(this.#setExpressions).withWhere(combineWhereExprs(this.#whereExprs));
|
|
928
|
-
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
|
|
971
|
+
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
|
|
929
972
|
return buildQueryPlan(ast, this.ctx, this.#annotations);
|
|
930
973
|
}
|
|
931
974
|
};
|
|
@@ -969,7 +1012,7 @@ var DeleteQueryImpl = class DeleteQueryImpl extends BuilderBase {
|
|
|
969
1012
|
build() {
|
|
970
1013
|
const whereExpr = combineWhereExprs(this.#whereCallbacks.map((cb) => evaluateWhere(cb, this.#scope, this.ctx.queryOperationTypes, this.ctx.rawCodecInferer)));
|
|
971
1014
|
let ast = DeleteAst.from(this.#tableSource).withWhere(whereExpr);
|
|
972
|
-
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields));
|
|
1015
|
+
if (this.#returningColumns.length > 0) ast = ast.withReturning(buildReturningProjections(this.#tableName, this.#returningColumns, this.#rowFields, this.ctx));
|
|
973
1016
|
return buildQueryPlan(ast, this.ctx, this.#annotations);
|
|
974
1017
|
}
|
|
975
1018
|
};
|
|
@@ -978,13 +1021,16 @@ function tableSourceForProxy(tableName, alias, namespaceId) {
|
|
|
978
1021
|
}
|
|
979
1022
|
var TableProxyImpl = class TableProxyImpl extends BuilderBase {
|
|
980
1023
|
#tableName;
|
|
1024
|
+
#alias;
|
|
981
1025
|
#table;
|
|
982
1026
|
#namespaceId;
|
|
983
1027
|
#fromSource;
|
|
984
1028
|
#scope;
|
|
1029
|
+
#indexes;
|
|
985
1030
|
constructor(tableName, table, alias, ctx, namespaceId) {
|
|
986
1031
|
super(ctx);
|
|
987
1032
|
this.#tableName = tableName;
|
|
1033
|
+
this.#alias = alias;
|
|
988
1034
|
this.#table = table;
|
|
989
1035
|
this.#namespaceId = namespaceId;
|
|
990
1036
|
this.#scope = tableToScope(alias, table, {
|
|
@@ -1006,6 +1052,27 @@ var TableProxyImpl = class TableProxyImpl extends BuilderBase {
|
|
|
1006
1052
|
}]));
|
|
1007
1053
|
return blindCast(Object.freeze(refs));
|
|
1008
1054
|
}
|
|
1055
|
+
/**
|
|
1056
|
+
* The table's indexes, keyed by the name the contract source gave each. An index's columns are this table's columns under its alias, so `post.as('p').indexes.post_search` reads `p`'s columns. A name more than one index shares is refused when it is read.
|
|
1057
|
+
*/
|
|
1058
|
+
get indexes() {
|
|
1059
|
+
this.#indexes ??= this.#indexReferences();
|
|
1060
|
+
return this.#indexes;
|
|
1061
|
+
}
|
|
1062
|
+
#indexReferences() {
|
|
1063
|
+
const fields = this.#scope.namespaces[this.#alias];
|
|
1064
|
+
assertDefined(fields, "a table proxy scopes its own alias");
|
|
1065
|
+
return blindCast(createIndexReferences({
|
|
1066
|
+
namespaceId: this.#namespaceId,
|
|
1067
|
+
tableName: this.#tableName,
|
|
1068
|
+
table: this.#table,
|
|
1069
|
+
column: (column) => {
|
|
1070
|
+
const field = fields[column];
|
|
1071
|
+
assertDefined(field, `an index covers a column of table "${this.#tableName}"`);
|
|
1072
|
+
return new ExpressionImpl(ColumnRef.of(this.#alias, column), field);
|
|
1073
|
+
}
|
|
1074
|
+
}));
|
|
1075
|
+
}
|
|
1009
1076
|
lateralJoin = this._gate({ sql: { lateral: true } }, "lateralJoin", (alias, builder) => {
|
|
1010
1077
|
return this.#toJoined().lateralJoin(alias, builder);
|
|
1011
1078
|
});
|
|
@@ -1054,8 +1121,13 @@ var TableProxyImpl = class TableProxyImpl extends BuilderBase {
|
|
|
1054
1121
|
return new JoinedTablesImpl(emptyState(this.#fromSource, this.#scope), this.ctx);
|
|
1055
1122
|
}
|
|
1056
1123
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1124
|
+
function descriptorMaterializesWithoutTypeParams(descriptor) {
|
|
1125
|
+
if (descriptor === void 0) return false;
|
|
1126
|
+
const schema = descriptor.paramsSchema;
|
|
1127
|
+
if (schema === void 0) return true;
|
|
1128
|
+
const result = schema["~standard"].validate({});
|
|
1129
|
+
return !(result instanceof Promise) && result.issues === void 0;
|
|
1130
|
+
}
|
|
1059
1131
|
function sql(options) {
|
|
1060
1132
|
const { context, rawCodecInferer } = options;
|
|
1061
1133
|
const ctx = {
|
|
@@ -1066,14 +1138,12 @@ function sql(options) {
|
|
|
1066
1138
|
storage: context.contract.storage,
|
|
1067
1139
|
applyMutationDefaults: (options) => context.applyMutationDefaults(options),
|
|
1068
1140
|
rawCodecInferer,
|
|
1069
|
-
aggregates: context.aggregateDescriptors
|
|
1141
|
+
aggregates: context.aggregateDescriptors,
|
|
1142
|
+
materializesWithoutTypeParams: (codecId) => descriptorMaterializesWithoutTypeParams(context.codecDescriptors.descriptorFor(codecId))
|
|
1070
1143
|
};
|
|
1071
1144
|
const { storage } = context.contract;
|
|
1072
|
-
if (Object.hasOwn(storage.namespaces, RAW_TAG_KEY)) throw structuredError("ORM.NAMESPACE_RESERVED", `The SQL surface exposes the raw statement tag as "db.${RAW_TAG_KEY}", so a storage namespace named "${RAW_TAG_KEY}" cannot be reached through it. Rename the namespace in the schema.`, { meta: { namespaceId: RAW_TAG_KEY } });
|
|
1073
|
-
const raw = blindCast(createRawSql(rawCodecInferer, { contract: context.contract }));
|
|
1074
1145
|
return new Proxy(blindCast({}), { get(_target, prop) {
|
|
1075
1146
|
if (typeof prop !== "string") return;
|
|
1076
|
-
if (prop === RAW_TAG_KEY) return raw;
|
|
1077
1147
|
if (!Object.hasOwn(storage.namespaces, prop)) return;
|
|
1078
1148
|
const namespaceId = prop;
|
|
1079
1149
|
return new Proxy({}, { get(_facetTarget, tableName) {
|
|
@@ -1084,6 +1154,6 @@ function sql(options) {
|
|
|
1084
1154
|
} });
|
|
1085
1155
|
}
|
|
1086
1156
|
//#endregion
|
|
1087
|
-
export { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, sql };
|
|
1157
|
+
export { ExpressionImpl, createAggregateFunctions, createFieldProxy, createFunctions, createRawLane, sql };
|
|
1088
1158
|
|
|
1089
1159
|
//# sourceMappingURL=builder__runtime.mjs.map
|