@prisma/orm-family-sql 0.16.0-dev.36
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/LICENSE +201 -0
- package/README.md +28 -0
- package/dist/ast-BstHjAoG.mjs +325 -0
- package/dist/ast-BstHjAoG.mjs.map +1 -0
- package/dist/ast-DSuzmsWn.d.mts +287 -0
- package/dist/ast-DSuzmsWn.d.mts.map +1 -0
- package/dist/authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs +316 -0
- package/dist/authoring-type-constructors-Blqoa2Ua-DyCmD6mp.mjs.map +1 -0
- package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs +778 -0
- package/dist/build-contract-DBCz_YSs-DO0wMHai.mjs.map +1 -0
- package/dist/builder.d.mts +3 -0
- package/dist/builder.mjs +1 -0
- package/dist/builder__runtime.d.mts +42 -0
- package/dist/builder__runtime.d.mts.map +1 -0
- package/dist/builder__runtime.mjs +955 -0
- package/dist/builder__runtime.mjs.map +1 -0
- package/dist/builder__types.d.mts +3 -0
- package/dist/builder__types.mjs +1 -0
- package/dist/canonicalization-hooks-CYnW_sGn.d.mts +10 -0
- package/dist/canonicalization-hooks-CYnW_sGn.d.mts.map +1 -0
- package/dist/canonicalization-hooks-DfIc_lOO.mjs +87 -0
- package/dist/canonicalization-hooks-DfIc_lOO.mjs.map +1 -0
- package/dist/codec-descriptor-registry-BJVJRftS.mjs +96 -0
- package/dist/codec-descriptor-registry-BJVJRftS.mjs.map +1 -0
- package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts +116 -0
- package/dist/codec-types-MOaceoPi-C5eL2sao.d.mts.map +1 -0
- package/dist/config-types-47qB33rW.d.mts +21 -0
- package/dist/config-types-47qB33rW.d.mts.map +1 -0
- package/dist/config-types-N7PJc6VN.mjs +65 -0
- package/dist/config-types-N7PJc6VN.mjs.map +1 -0
- package/dist/contract-builder-MvJJrQ-5.d.mts +1306 -0
- package/dist/contract-builder-MvJJrQ-5.d.mts.map +1 -0
- package/dist/contract-builder-YjMQcvZ1.mjs +1615 -0
- package/dist/contract-builder-YjMQcvZ1.mjs.map +1 -0
- package/dist/contract-emitter.d.mts +25 -0
- package/dist/contract-emitter.d.mts.map +1 -0
- package/dist/contract-emitter.mjs +2 -0
- package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs +9 -0
- package/dist/contract-errors-BCN6RVI5-5IHBF_lg.mjs.map +1 -0
- package/dist/contract-psl.d.mts +65 -0
- package/dist/contract-psl.d.mts.map +1 -0
- package/dist/contract-psl.mjs +2 -0
- package/dist/contract-psl__provider.d.mts +23 -0
- package/dist/contract-psl__provider.d.mts.map +1 -0
- package/dist/contract-psl__provider.mjs +105 -0
- package/dist/contract-psl__provider.mjs.map +1 -0
- package/dist/contract-ts.d.mts +3 -0
- package/dist/contract-ts.mjs +4 -0
- package/dist/contract-ts__config-types.d.mts +2 -0
- package/dist/contract-ts__config-types.mjs +2 -0
- package/dist/contract-ts__contract-builder.d.mts +2 -0
- package/dist/contract-ts__contract-builder.mjs +3 -0
- package/dist/contract-view-BMR5IWk4.mjs +39 -0
- package/dist/contract-view-BMR5IWk4.mjs.map +1 -0
- package/dist/contract-view-BbWQp6r4.d.mts +61 -0
- package/dist/contract-view-BbWQp6r4.d.mts.map +1 -0
- package/dist/contract.d.mts +26 -0
- package/dist/contract.mjs +17 -0
- package/dist/contract__canonicalization-hooks.d.mts +2 -0
- package/dist/contract__canonicalization-hooks.mjs +2 -0
- package/dist/contract__contract-view.d.mts +2 -0
- package/dist/contract__contract-view.mjs +2 -0
- package/dist/contract__entity-handle-lowering-hook.d.mts +2 -0
- package/dist/contract__entity-handle-lowering-hook.mjs +2 -0
- package/dist/contract__entity-kinds.d.mts +2 -0
- package/dist/contract__entity-kinds.mjs +2 -0
- package/dist/contract__factories.d.mts +2 -0
- package/dist/contract__factories.mjs +2 -0
- package/dist/contract__foreign-key-materialization.d.mts +2 -0
- package/dist/contract__foreign-key-materialization.mjs +2 -0
- package/dist/contract__index-naming.d.mts +2 -0
- package/dist/contract__index-naming.mjs +2 -0
- package/dist/contract__index-type-validation.d.mts +2 -0
- package/dist/contract__index-type-validation.mjs +2 -0
- package/dist/contract__index-types.d.mts +3 -0
- package/dist/contract__index-types.mjs +2 -0
- package/dist/contract__pack-types.d.mts +2 -0
- package/dist/contract__pack-types.mjs +1 -0
- package/dist/contract__referential-action-sql.d.mts +2 -0
- package/dist/contract__referential-action-sql.mjs +2 -0
- package/dist/contract__resolve-storage-table.d.mts +2 -0
- package/dist/contract__resolve-storage-table.mjs +2 -0
- package/dist/contract__types.d.mts +11 -0
- package/dist/contract__types.mjs +4 -0
- package/dist/contract__validators.d.mts +2 -0
- package/dist/contract__validators.mjs +3 -0
- package/dist/contract__value-set-derivation-hook.d.mts +2 -0
- package/dist/contract__value-set-derivation-hook.mjs +2 -0
- package/dist/control-B7iS4jv4.mjs +1326 -0
- package/dist/control-B7iS4jv4.mjs.map +1 -0
- package/dist/control-BHmsZudH.d.mts +948 -0
- package/dist/control-BHmsZudH.d.mts.map +1 -0
- package/dist/control-adapter-4y1O8Ps3.d.mts +1 -0
- package/dist/control-adapter-C99J7aEF-C-17lFY8.d.mts +191 -0
- package/dist/control-adapter-C99J7aEF-C-17lFY8.d.mts.map +1 -0
- package/dist/db-DhMsmBS--DKENDi3l.d.mts +365 -0
- package/dist/db-DhMsmBS--DKENDi3l.d.mts.map +1 -0
- package/dist/ddl-types-BMp2bWVS-D1waZJ4n.mjs +153 -0
- package/dist/ddl-types-BMp2bWVS-D1waZJ4n.mjs.map +1 -0
- package/dist/ddl-types-rrMsf77U-DGctYf-T.d.mts +149 -0
- package/dist/ddl-types-rrMsf77U-DGctYf-T.d.mts.map +1 -0
- package/dist/diff-B16bL_IR.mjs +13 -0
- package/dist/diff-B16bL_IR.mjs.map +1 -0
- package/dist/diff-DhlzHOMD.d.mts +104 -0
- package/dist/diff-DhlzHOMD.d.mts.map +1 -0
- package/dist/dist-C_q1_QR9.mjs +9 -0
- package/dist/dist-C_q1_QR9.mjs.map +1 -0
- package/dist/dist-DrScXbhq.mjs +414 -0
- package/dist/dist-DrScXbhq.mjs.map +1 -0
- package/dist/dist-x6jvtkKM.mjs +68 -0
- package/dist/dist-x6jvtkKM.mjs.map +1 -0
- package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts +92 -0
- package/dist/entity-handle-lowering-hook-CIvRKBfa.d.mts.map +1 -0
- package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs +11 -0
- package/dist/entity-handle-lowering-hook-DwLIKNiS.mjs.map +1 -0
- package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs +136 -0
- package/dist/entity-kinds-DKxwKolf-CcsY-iYV.mjs.map +1 -0
- package/dist/entity-kinds-Dh6VH4uK.d.mts +29 -0
- package/dist/entity-kinds-Dh6VH4uK.d.mts.map +1 -0
- package/dist/errors-B5g0xWro-mWH2C07F.mjs +9 -0
- package/dist/errors-B5g0xWro-mWH2C07F.mjs.map +1 -0
- package/dist/errors.d.mts +63 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +2 -0
- package/dist/expression-DIf8F4Mc.d.mts +167 -0
- package/dist/expression-DIf8F4Mc.d.mts.map +1 -0
- package/dist/expression-RUO52bJB.mjs +109 -0
- package/dist/expression-RUO52bJB.mjs.map +1 -0
- package/dist/factories-B7tA4y9D.d.mts +39 -0
- package/dist/factories-B7tA4y9D.d.mts.map +1 -0
- package/dist/factories-CDG9zBxC.mjs +77 -0
- package/dist/factories-CDG9zBxC.mjs.map +1 -0
- package/dist/family.d.mts +13 -0
- package/dist/family.mjs +12 -0
- package/dist/family__control-adapter.d.mts +3 -0
- package/dist/family__control-adapter.mjs +1 -0
- package/dist/family__control.d.mts +4 -0
- package/dist/family__control.mjs +4 -0
- package/dist/family__diff.d.mts +3 -0
- package/dist/family__diff.mjs +3 -0
- package/dist/family__ir.d.mts +2 -0
- package/dist/family__ir.mjs +3 -0
- package/dist/family__migration.d.mts +2 -0
- package/dist/family__migration.mjs +2 -0
- package/dist/family__pack.d.mts +249 -0
- package/dist/family__pack.d.mts.map +1 -0
- package/dist/family__pack.mjs +18 -0
- package/dist/family__pack.mjs.map +1 -0
- package/dist/family__psl-infer.d.mts +2 -0
- package/dist/family__psl-infer.mjs +2 -0
- package/dist/family__runtime.d.mts +3 -0
- package/dist/family__runtime.mjs +3 -0
- package/dist/family__verify.d.mts +2 -0
- package/dist/family__verify.mjs +2 -0
- package/dist/foreign-key-BSy9u4O4-BnsOe5Nf.d.mts +85 -0
- package/dist/foreign-key-BSy9u4O4-BnsOe5Nf.d.mts.map +1 -0
- package/dist/foreign-key-materialization-Ca-wRbmj.d.mts +65 -0
- package/dist/foreign-key-materialization-Ca-wRbmj.d.mts.map +1 -0
- package/dist/foreign-key-materialization-HI7BIQrG.mjs +72 -0
- package/dist/foreign-key-materialization-HI7BIQrG.mjs.map +1 -0
- package/dist/index-Bb9U36N4.d.mts +511 -0
- package/dist/index-Bb9U36N4.d.mts.map +1 -0
- package/dist/index-BgaTJRxj.d.mts +25 -0
- package/dist/index-BgaTJRxj.d.mts.map +1 -0
- package/dist/index-naming-BZWoh45T.d.mts +62 -0
- package/dist/index-naming-BZWoh45T.d.mts.map +1 -0
- package/dist/index-naming-BoGBcMmI-DiJAr66H.mjs +108 -0
- package/dist/index-naming-BoGBcMmI-DiJAr66H.mjs.map +1 -0
- package/dist/index-type-validation-COH4d78M.mjs +17 -0
- package/dist/index-type-validation-COH4d78M.mjs.map +1 -0
- package/dist/index-type-validation-DN0L2mqm.d.mts +10 -0
- package/dist/index-type-validation-DN0L2mqm.d.mts.map +1 -0
- package/dist/index-types-CNhHgKHi.d.mts +1 -0
- package/dist/index-types-DJQ_xwaE.mjs +40 -0
- package/dist/index-types-DJQ_xwaE.mjs.map +1 -0
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +31 -0
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +1 -0
- package/dist/interpreter-5WgpL-ax-_nqHLUTr.mjs +3526 -0
- package/dist/interpreter-5WgpL-ax-_nqHLUTr.mjs.map +1 -0
- package/dist/ir-B3bKMnGQ.d.mts +123 -0
- package/dist/ir-B3bKMnGQ.d.mts.map +1 -0
- package/dist/ir-I-xciGUH.mjs +36 -0
- package/dist/ir-I-xciGUH.mjs.map +1 -0
- package/dist/lane-query-builder.d.mts +236 -0
- package/dist/lane-query-builder.d.mts.map +1 -0
- package/dist/lane-query-builder.mjs +67 -0
- package/dist/lane-query-builder.mjs.map +1 -0
- package/dist/middleware-B4XbF4d4-tfwBl6mX.d.mts +119 -0
- package/dist/middleware-B4XbF4d4-tfwBl6mX.d.mts.map +1 -0
- package/dist/middleware-ByRsXxxq.d.mts +1 -0
- package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs +80 -0
- package/dist/middleware-CMr4CHNz-DHIUdxlm.mjs.map +1 -0
- package/dist/migration-CK4oePIo.mjs +44 -0
- package/dist/migration-CK4oePIo.mjs.map +1 -0
- package/dist/migration-CW0ZJLxP.d.mts +44 -0
- package/dist/migration-CW0ZJLxP.d.mts.map +1 -0
- package/dist/naming-BwqqVcZy-BgTObIQw.mjs +177 -0
- package/dist/naming-BwqqVcZy-BgTObIQw.mjs.map +1 -0
- package/dist/naming-jLgdauLi-C84G_UHi.d.mts +133 -0
- package/dist/naming-jLgdauLi-C84G_UHi.d.mts.map +1 -0
- package/dist/operations.d.mts +2 -0
- package/dist/operations.mjs +2 -0
- package/dist/orm-client.d.mts +1316 -0
- package/dist/orm-client.d.mts.map +1 -0
- package/dist/orm-client.mjs +4544 -0
- package/dist/orm-client.mjs.map +1 -0
- package/dist/pack-types-BcLTpwbv.d.mts +14 -0
- package/dist/pack-types-BcLTpwbv.d.mts.map +1 -0
- package/dist/plan-BTD8xFfa-Dd_K-A1R.d.mts +45 -0
- package/dist/plan-BTD8xFfa-Dd_K-A1R.d.mts.map +1 -0
- package/dist/plan-CkpcgUaM.mjs +34 -0
- package/dist/plan-CkpcgUaM.mjs.map +1 -0
- package/dist/plan-Cm4jaoNM.d.mts +2 -0
- package/dist/psl-infer-6je61Z6J.d.mts +119 -0
- package/dist/psl-infer-6je61Z6J.d.mts.map +1 -0
- package/dist/psl-infer-DGftl-HW.mjs +362 -0
- package/dist/psl-infer-DGftl-HW.mjs.map +1 -0
- package/dist/query-lane-context-Bz8XJZ45.d.mts +1 -0
- package/dist/query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts +94 -0
- package/dist/query-lane-context-DtdVMqoz-C2Tj5QHA.d.mts.map +1 -0
- package/dist/referential-action-sql-Csd6dA8G.d.mts +12 -0
- package/dist/referential-action-sql-Csd6dA8G.d.mts.map +1 -0
- package/dist/referential-action-sql-DSqkrySN.mjs +17 -0
- package/dist/referential-action-sql-DSqkrySN.mjs.map +1 -0
- package/dist/relational-core.d.mts +13 -0
- package/dist/relational-core.mjs +8 -0
- package/dist/relational-core__ast.d.mts +5 -0
- package/dist/relational-core__ast.mjs +5 -0
- package/dist/relational-core__codec-descriptor-registry.d.mts +39 -0
- package/dist/relational-core__codec-descriptor-registry.d.mts.map +1 -0
- package/dist/relational-core__codec-descriptor-registry.mjs +2 -0
- package/dist/relational-core__contract-free.d.mts +220 -0
- package/dist/relational-core__contract-free.d.mts.map +1 -0
- package/dist/relational-core__contract-free.mjs +393 -0
- package/dist/relational-core__contract-free.mjs.map +1 -0
- package/dist/relational-core__expression.d.mts +2 -0
- package/dist/relational-core__expression.mjs +2 -0
- package/dist/relational-core__middleware.d.mts +3 -0
- package/dist/relational-core__middleware.mjs +2 -0
- package/dist/relational-core__plan.d.mts +4 -0
- package/dist/relational-core__plan.mjs +2 -0
- package/dist/relational-core__query-lane-context.d.mts +3 -0
- package/dist/relational-core__query-lane-context.mjs +1 -0
- package/dist/relational-core__types.d.mts +3 -0
- package/dist/relational-core__types.mjs +1 -0
- package/dist/resolve-storage-table-DUwyRJmP.d.mts +21 -0
- package/dist/resolve-storage-table-DUwyRJmP.d.mts.map +1 -0
- package/dist/resolve-storage-table-DZsfnzeW.mjs +46 -0
- package/dist/resolve-storage-table-DZsfnzeW.mjs.map +1 -0
- package/dist/runtime-DNewRuec.d.mts +46 -0
- package/dist/runtime-DNewRuec.d.mts.map +1 -0
- package/dist/runtime-tIHpGCcG.mjs +55 -0
- package/dist/runtime-tIHpGCcG.mjs.map +1 -0
- package/dist/runtime.d.mts +4 -0
- package/dist/runtime.mjs +1606 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/schema-differ-DpG_gnur-g5_iks8G.d.mts +47 -0
- package/dist/schema-differ-DpG_gnur-g5_iks8G.d.mts.map +1 -0
- package/dist/schema-ir.d.mts +2 -0
- package/dist/schema-ir.mjs +2 -0
- package/dist/schema-ir__naming.d.mts +2 -0
- package/dist/schema-ir__naming.mjs +2 -0
- package/dist/schema-ir__types.d.mts +3 -0
- package/dist/schema-ir__types.mjs +2 -0
- package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs +222 -0
- package/dist/schema-verify-vtFZbmGq-BNfTr6fU.mjs.map +1 -0
- package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts +26 -0
- package/dist/serialized-index-B96AwqtU-DcqcB4q_.d.mts.map +1 -0
- package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs +64 -0
- package/dist/serialized-index-Dp5_EjXD-DMsw8jf3.mjs.map +1 -0
- package/dist/sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs +171 -0
- package/dist/sql-contract-serializer-2oBWuxTe-B9hzBBv1.mjs.map +1 -0
- package/dist/sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts +32 -0
- package/dist/sql-execution-plan-CJmsCP7n-DoEpNn7r.d.mts.map +1 -0
- package/dist/sql-index-DsI8HAeK-BJsn-jvD.d.mts +72 -0
- package/dist/sql-index-DsI8HAeK-BJsn-jvD.d.mts.map +1 -0
- package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts +42 -0
- package/dist/sql-node-kEz6YFZo-v2F7delx.d.mts.map +1 -0
- package/dist/sql-storage-B0QwiTg6-B8DVctJm.d.mts +171 -0
- package/dist/sql-storage-B0QwiTg6-B8DVctJm.d.mts.map +1 -0
- package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts +130 -0
- package/dist/storage-table-BBaAmanc-BwR37LMA.d.mts.map +1 -0
- package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs +277 -0
- package/dist/storage-table-_LWDmPfv-DFhU2dML.mjs.map +1 -0
- package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts +41 -0
- package/dist/storage-value-set-BGlj5Uus-CvZD--GG.d.mts.map +1 -0
- package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs +173 -0
- package/dist/timestamp-now-generator-DRXygu32-DN9Qb1uI.mjs.map +1 -0
- package/dist/types-BchwQpmO.d.mts +16 -0
- package/dist/types-BchwQpmO.d.mts.map +1 -0
- package/dist/types-BgkZru_1-H7yfikSQ.mjs +1444 -0
- package/dist/types-BgkZru_1-H7yfikSQ.mjs.map +1 -0
- package/dist/types-CMMQS6aG.mjs +111 -0
- package/dist/types-CMMQS6aG.mjs.map +1 -0
- package/dist/types-CuDrWc5v-ISVXBmBs.d.mts +134 -0
- package/dist/types-CuDrWc5v-ISVXBmBs.d.mts.map +1 -0
- package/dist/types-CvbBw1Jo-3KQdErJY.d.mts +688 -0
- package/dist/types-CvbBw1Jo-3KQdErJY.d.mts.map +1 -0
- package/dist/types-DIBA80mc-wf5wLmON.d.mts +723 -0
- package/dist/types-DIBA80mc-wf5wLmON.d.mts.map +1 -0
- package/dist/types-DMxc5KZa.d.mts +1 -0
- package/dist/types-Dl20lxky-DC_jdA0T.d.mts +247 -0
- package/dist/types-Dl20lxky-DC_jdA0T.d.mts.map +1 -0
- package/dist/types-DmhUVq4u-BpqqjPJx.mjs +719 -0
- package/dist/types-DmhUVq4u-BpqqjPJx.mjs.map +1 -0
- package/dist/types-IqZMLrFC-DtdJNICr.d.mts +426 -0
- package/dist/types-IqZMLrFC-DtdJNICr.d.mts.map +1 -0
- package/dist/types-TvBZ2Ne9.d.mts +1 -0
- package/dist/unique-constraint-jQWfH7dg-zLWtFp99.d.mts +32 -0
- package/dist/unique-constraint-jQWfH7dg-zLWtFp99.d.mts.map +1 -0
- package/dist/util-DQQgv2j1-D6INZaRG.mjs +34 -0
- package/dist/util-DQQgv2j1-D6INZaRG.mjs.map +1 -0
- package/dist/validators-C4PItWnf.mjs +0 -0
- package/dist/validators-C4PItWnf.mjs.map +1 -0
- package/dist/validators-CxeHhHrf.d.mts +206 -0
- package/dist/validators-CxeHhHrf.d.mts.map +1 -0
- package/dist/value-set-derivation-hook-BhgGVtw0.d.mts +35 -0
- package/dist/value-set-derivation-hook-BhgGVtw0.d.mts.map +1 -0
- package/dist/value-set-derivation-hook-Di9JZ0X7.mjs +22 -0
- package/dist/value-set-derivation-hook-Di9JZ0X7.mjs.map +1 -0
- package/dist/verify-E6Dd2vYp-gYwnlhLm.mjs +86 -0
- package/dist/verify-E6Dd2vYp-gYwnlhLm.mjs.map +1 -0
- package/dist/verify-zDRnw0Rn.d.mts +26 -0
- package/dist/verify-zDRnw0Rn.d.mts.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { a as CodecRef$1, n as Codec$1, p as SqlCodecCallContext, s as ContractCodecRegistry } from "./codec-types-MOaceoPi-C5eL2sao.mjs";
|
|
2
|
+
import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
|
|
3
|
+
import "./types-BchwQpmO.mjs";
|
|
4
|
+
import { r as SqlOperationDescriptors } from "./index-BgaTJRxj.mjs";
|
|
5
|
+
import { Q as LoweredStatement, Z as LoweredParam, p as AnyQueryAst } from "./types-DIBA80mc-wf5wLmON.mjs";
|
|
6
|
+
import { E as SqlQueryable, _ as SqlDriver, g as SqlConnection, o as MarkerReadResult, t as Adapter } from "./ast-DSuzmsWn.mjs";
|
|
7
|
+
import { a as Expression, i as CodecValue, o as RawCodecInferer, r as CodecTypesBase } from "./expression-DIf8F4Mc.mjs";
|
|
8
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-CJmsCP7n-DoEpNn7r.mjs";
|
|
9
|
+
import { t as SqlQueryPlan } from "./plan-BTD8xFfa-Dd_K-A1R.mjs";
|
|
10
|
+
import "./plan-Cm4jaoNM.mjs";
|
|
11
|
+
import { n as CodecDescriptorRegistry, r as ExecutionContext } from "./query-lane-context-DtdVMqoz-C2Tj5QHA.mjs";
|
|
12
|
+
import "./query-lane-context-Bz8XJZ45.mjs";
|
|
13
|
+
import { i as SqlParamRefMutator } from "./middleware-B4XbF4d4-tfwBl6mX.mjs";
|
|
14
|
+
import "./middleware-ByRsXxxq.mjs";
|
|
15
|
+
import { y as RuntimeScope } from "./types-Dl20lxky-DC_jdA0T.mjs";
|
|
16
|
+
import "./types-DMxc5KZa.mjs";
|
|
17
|
+
import { Contract, JsonValue, PlanMeta } from "@prisma/orm-framework/contract/types";
|
|
18
|
+
import { AnyCodecDescriptor, CodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
19
|
+
import { AfterExecuteResult, AfterExecuteResult as AfterExecuteResult$1, AsyncIterableResult, ExecutionPlan, RuntimeCore, RuntimeExecuteOptions, RuntimeLog, RuntimeLog as Log, RuntimeMiddleware, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
|
|
20
|
+
import { ExecutionStack, RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeTargetDescriptor, RuntimeTargetInstance } from "@prisma/orm-framework/components/execution";
|
|
21
|
+
//#region ../../../2-sql/5-runtime/dist/prepared-statement-D4zOlprk.d.mts
|
|
22
|
+
//#region src/codecs/encoding.d.ts
|
|
23
|
+
interface ParamMetadata {
|
|
24
|
+
readonly codec: CodecRef$1 | undefined;
|
|
25
|
+
readonly name: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
declare function deriveParamMetadata(ast: AnyQueryAst): readonly ParamMetadata[];
|
|
28
|
+
declare function encodeParamsWithMetadata(values: readonly unknown[], metadata: readonly ParamMetadata[], ctx: SqlCodecCallContext, contractCodecs?: ContractCodecRegistry): Promise<readonly unknown[]>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/middleware/sql-middleware.d.ts
|
|
31
|
+
interface SqlMiddlewareContext extends RuntimeMiddlewareContext {
|
|
32
|
+
readonly contract: Contract<SqlStorage>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Pre-lowering query view passed to `beforeCompile`. Carries the typed SQL
|
|
36
|
+
* AST and plan metadata; `sql`/`params` are produced later by the adapter.
|
|
37
|
+
*/
|
|
38
|
+
interface DraftPlan {
|
|
39
|
+
readonly ast: AnyQueryAst;
|
|
40
|
+
readonly meta: PlanMeta;
|
|
41
|
+
}
|
|
42
|
+
interface SqlMiddleware<TCodecMap extends Record<string, unknown> = Record<string, unknown>> extends RuntimeMiddleware<SqlExecutionPlan, SqlParamRefMutator<TCodecMap>> {
|
|
43
|
+
readonly familyId?: 'sql';
|
|
44
|
+
/**
|
|
45
|
+
* Rewrite the query AST before it is lowered to SQL. Middlewares run in
|
|
46
|
+
* registration order; each sees the predecessor's output, so rewrites
|
|
47
|
+
* compose (e.g. soft-delete + tenant isolation).
|
|
48
|
+
*
|
|
49
|
+
* Return `undefined` (or a draft whose `ast` reference equals the input's)
|
|
50
|
+
* to pass through. Return a draft with a new `ast` reference to replace it;
|
|
51
|
+
* the runtime emits a `middleware.rewrite` debug log event and continues
|
|
52
|
+
* with the new draft. `adapter.lower()` runs once after the chain.
|
|
53
|
+
*
|
|
54
|
+
* Use `AstRewriter` / `SelectAst.withWhere` / `AndExpr.of` etc. to build
|
|
55
|
+
* the rewritten AST. Predicates and literals go through parameterized
|
|
56
|
+
* constructors by default — no SQL-injection surface is added. **Warning:**
|
|
57
|
+
* constructing `LiteralExpr.of(userInput)` from untrusted input bypasses
|
|
58
|
+
* that guarantee; use `ParamRef.of(userInput, ...)` instead.
|
|
59
|
+
*
|
|
60
|
+
* See `docs/architecture docs/subsystems/4. Runtime & Middleware Framework.md`.
|
|
61
|
+
*/
|
|
62
|
+
beforeCompile?(draft: DraftPlan, ctx: SqlMiddlewareContext): Promise<DraftPlan | undefined>;
|
|
63
|
+
/**
|
|
64
|
+
* Mutate `ParamRef.value` slots before encode runs. The third
|
|
65
|
+
* `params` argument is a {@link SqlParamRefMutator} scoped to value
|
|
66
|
+
* slots only — SQL strings, projections, and `ParamRef` membership
|
|
67
|
+
* are not mutable. Existing `(plan)` and `(plan, ctx)` middleware
|
|
68
|
+
* bodies that ignore the additional argument continue to compile
|
|
69
|
+
* and run unchanged.
|
|
70
|
+
*
|
|
71
|
+
* Lifecycle position:
|
|
72
|
+
* `beforeCompile → lowerSqlPlan → beforeExecute → encodeParams → intercept → driver`.
|
|
73
|
+
*
|
|
74
|
+
* The plan handed in is the SQL execution plan after lowering but
|
|
75
|
+
* *before* parameter encoding: `plan.params[i]` is the user-domain
|
|
76
|
+
* value the mutator's `entries()` iterator surfaces (e.g. an
|
|
77
|
+
* `EncryptedEnvelopeBase` for a cipherstash-codec'd column, or a
|
|
78
|
+
* plain JS value for non-codec'd ParamRefs). Mutations applied via
|
|
79
|
+
* `params.replaceValue` / `replaceValues` are visible to encode,
|
|
80
|
+
* which then renders the mutated value through the column's codec.
|
|
81
|
+
*
|
|
82
|
+
* `ctx.signal` carries the per-query `AbortSignal` (ADR 207);
|
|
83
|
+
* middleware that wraps a network SDK forwards `ctx.signal` to
|
|
84
|
+
* that SDK. Cooperative cancellation: a body that ignores the
|
|
85
|
+
* signal still surfaces `RUNTIME.ABORTED { phase: 'beforeExecute' }`
|
|
86
|
+
* promptly via the runtime's race against the signal.
|
|
87
|
+
*/
|
|
88
|
+
beforeExecute?(plan: SqlExecutionPlan, ctx: SqlMiddlewareContext, params?: SqlParamRefMutator<TCodecMap>): void | Promise<void>;
|
|
89
|
+
onRow?(row: Record<string, unknown>, plan: SqlExecutionPlan, ctx: SqlMiddlewareContext): Promise<void>;
|
|
90
|
+
afterExecute?(plan: SqlExecutionPlan, result: AfterExecuteResult, ctx: SqlMiddlewareContext): Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/codecs/decoding.d.ts
|
|
94
|
+
type ColumnRef = {
|
|
95
|
+
table: string;
|
|
96
|
+
column: string;
|
|
97
|
+
};
|
|
98
|
+
interface DecodeContext {
|
|
99
|
+
readonly aliases: ReadonlyArray<string> | undefined;
|
|
100
|
+
readonly codecs: ReadonlyMap<string, Codec$1>;
|
|
101
|
+
readonly columnRefs: ReadonlyMap<string, ColumnRef>;
|
|
102
|
+
readonly includeAliases: ReadonlySet<string>;
|
|
103
|
+
readonly manyAliases: ReadonlySet<string>;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/prepared/types.d.ts
|
|
107
|
+
type ParamSpec<CT extends CodecTypesBase = CodecTypesBase> = (keyof CT & string) | {
|
|
108
|
+
readonly codecId: keyof CT & string;
|
|
109
|
+
readonly typeParams?: JsonValue;
|
|
110
|
+
readonly nullable?: boolean;
|
|
111
|
+
};
|
|
112
|
+
type Declaration<CT extends CodecTypesBase = CodecTypesBase> = Readonly<Record<string, ParamSpec<CT>>>;
|
|
113
|
+
type DeclaredCodecId<S> = S extends string ? S : S extends {
|
|
114
|
+
readonly codecId: infer C extends string;
|
|
115
|
+
} ? C : never;
|
|
116
|
+
type DeclaredNullable<S> = S extends {
|
|
117
|
+
readonly nullable: true;
|
|
118
|
+
} ? true : false;
|
|
119
|
+
type BindSiteParams<D> = { readonly [K in keyof D]: Expression<{
|
|
120
|
+
codecId: DeclaredCodecId<D[K]>;
|
|
121
|
+
nullable: DeclaredNullable<D[K]>;
|
|
122
|
+
}>; };
|
|
123
|
+
type ParamsFromDeclaration<D, CT extends CodecTypesBase> = { readonly [K in keyof D]: CodecValue<DeclaredCodecId<D[K]>, DeclaredNullable<D[K]>, CT>; };
|
|
124
|
+
type PrepareCallback<D, Row> = (params: BindSiteParams<D>) => SqlQueryPlan<Row>;
|
|
125
|
+
interface PreparedStatement<Params, Row> {
|
|
126
|
+
readonly sql: string;
|
|
127
|
+
readonly ast: AnyQueryAst;
|
|
128
|
+
readonly meta: PlanMeta;
|
|
129
|
+
readonly slots: readonly LoweredParam[];
|
|
130
|
+
/**
|
|
131
|
+
* Run this prepared statement against the given target. The target carries
|
|
132
|
+
* the execution scope (top-level runtime, an explicit connection, an active
|
|
133
|
+
* transaction). It is required and explicit — there is no implicit binding
|
|
134
|
+
* back to the runtime that produced this statement.
|
|
135
|
+
*/
|
|
136
|
+
execute(target: RuntimeQueryable, params: Params, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/runtime-spi.d.ts
|
|
140
|
+
/**
|
|
141
|
+
* Reader of the SQL contract marker. SQL runtimes call `readMarker` before executing user queries (unless `verifyMarker` is false). The adapter owns the full marker-read flow — probing for storage, issuing the read, decoding the row — and returns a tagged result so callers can distinguish "marker storage missing", "no row for this space", and "present".
|
|
142
|
+
*/
|
|
143
|
+
interface MarkerReader {
|
|
144
|
+
readMarker(queryable: SqlQueryable): Promise<MarkerReadResult>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* SQL family adapter SPI consumed by `SqlRuntimeBase`. Encapsulates the
|
|
148
|
+
* runtime contract, marker reader, and plan validation logic so the
|
|
149
|
+
* runtime can be unit-tested without a concrete SQL adapter profile.
|
|
150
|
+
*
|
|
151
|
+
* Implemented by `SqlFamilyAdapter` for production and by mock classes
|
|
152
|
+
* in tests.
|
|
153
|
+
*/
|
|
154
|
+
interface RuntimeFamilyAdapter<TContract = unknown> {
|
|
155
|
+
readonly contract: TContract;
|
|
156
|
+
readonly markerReader: MarkerReader;
|
|
157
|
+
validatePlan(plan: ExecutionPlan, contract: TContract): void;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Controls whether the runtime reads and checks the contract marker row on first execute.
|
|
161
|
+
*
|
|
162
|
+
* - `'onFirstUse'` (default when omitted): the marker is read once per runtime lifetime, on the
|
|
163
|
+
* first `execute()` call. Any hash mismatch or absent marker emits a structured `warn`-level log
|
|
164
|
+
* through the runtime's {@link RuntimeLog} and the query proceeds. Subsequent queries skip the
|
|
165
|
+
* marker reader entirely.
|
|
166
|
+
* - `false`: the marker reader is never invoked. No log line is emitted. Use this to opt out of
|
|
167
|
+
* the diagnostic entirely (e.g. during a known deploy-skew window).
|
|
168
|
+
*
|
|
169
|
+
* The string-or-false shape is forward-compatible: future modes such as `'startup'` (eager check
|
|
170
|
+
* inside the wrapper `connect()` step) can be added as additive union members without an API break.
|
|
171
|
+
* `true` is intentionally not permitted — modes are always named.
|
|
172
|
+
*
|
|
173
|
+
* Default-on so contract drift surfaces by default — teams who never thought to enable the diagnostic
|
|
174
|
+
* still see the warning when something goes wrong.
|
|
175
|
+
*/
|
|
176
|
+
type VerifyMarkerOption = 'onFirstUse' | false;
|
|
177
|
+
type TelemetryOutcome = 'success' | 'runtime-error';
|
|
178
|
+
interface RuntimeTelemetryEvent {
|
|
179
|
+
readonly lane: string;
|
|
180
|
+
readonly target: string;
|
|
181
|
+
readonly fingerprint: string;
|
|
182
|
+
readonly outcome: TelemetryOutcome;
|
|
183
|
+
readonly durationMs?: number;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/sql-context.d.ts
|
|
187
|
+
/**
|
|
188
|
+
* Runtime parameterized codec descriptor.
|
|
189
|
+
*
|
|
190
|
+
* The unified `CodecDescriptor<P>` shape applied to parameterized codecs — `paramsSchema: StandardSchemaV1<P>` for JSON-boundary validation, `factory: (P) => (CodecInstanceContext) => Codec` for the curried higher-order codec. The factory is called once per `storage.types` instance (or once per inline-`typeParams` column); per-instance state lives in the closure.
|
|
191
|
+
*
|
|
192
|
+
* Codec-registry-unification spec § Decision.
|
|
193
|
+
*/
|
|
194
|
+
type RuntimeParameterizedCodecDescriptor<P = Record<string, unknown>> = CodecDescriptor<P>;
|
|
195
|
+
/**
|
|
196
|
+
* Contributor protocol for SQL components (target, adapter, extension pack). The unified `codecs:` slot returns the full {@link CodecDescriptor} list — non-parameterized and parameterized descriptors live side-by-side in the same array. The framework dispatches every codec id through the unified descriptor map without branching on parameterization.
|
|
197
|
+
*/
|
|
198
|
+
interface SqlStaticContributions {
|
|
199
|
+
readonly codecs: () => ReadonlyArray<AnyCodecDescriptor>;
|
|
200
|
+
readonly queryOperations?: () => SqlOperationDescriptors;
|
|
201
|
+
readonly mutationDefaultGenerators?: () => ReadonlyArray<RuntimeMutationDefaultGenerator>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Scope across which a generator's value is constant.
|
|
205
|
+
*
|
|
206
|
+
* - `'field'` — one value per defaulting site (one column, one row). Cache strategy: no cache; call per defaulting site. Right for per-row identifiers (UUIDs, CUIDs, ULIDs, nanoid, ksuid).
|
|
207
|
+
* - `'row'` — one value across all defaulting sites of one row of one operation. Cache strategy: per-call cache keyed by `generatorId`. Right for correlation ids stamped into multiple columns of one row.
|
|
208
|
+
* - `'query'` — one value across all rows and columns of one ORM operation. Cache strategy: caller-provided cache keyed by `generatorId`. Right for `timestampNow` (a single timestamp per bulk insert/update).
|
|
209
|
+
*/
|
|
210
|
+
type GeneratorStability = 'field' | 'row' | 'query';
|
|
211
|
+
interface RuntimeMutationDefaultGenerator {
|
|
212
|
+
readonly id: string;
|
|
213
|
+
readonly generate: (params?: Record<string, unknown>) => unknown;
|
|
214
|
+
/**
|
|
215
|
+
* Scope across which the generator's value is constant. The framework derives the cache strategy from this declaration; generator authors never need to know about cache keys. See `GeneratorStability` for the per-value semantics.
|
|
216
|
+
*/
|
|
217
|
+
readonly stability: GeneratorStability;
|
|
218
|
+
}
|
|
219
|
+
interface SqlRuntimeTargetDescriptor<TTargetId extends string = string, TTargetInstance extends RuntimeTargetInstance<'sql', TTargetId> = RuntimeTargetInstance<'sql', TTargetId>> extends RuntimeTargetDescriptor<'sql', TTargetId, TTargetInstance>, SqlStaticContributions {}
|
|
220
|
+
interface SqlRuntimeAdapterDescriptor<TTargetId extends string = string, TAdapterInstance extends RuntimeAdapterInstance<'sql', TTargetId> = SqlRuntimeAdapterInstance<TTargetId>> extends RuntimeAdapterDescriptor<'sql', TTargetId, TAdapterInstance>, SqlStaticContributions {
|
|
221
|
+
/**
|
|
222
|
+
* Codec inferer used by `fns.raw` to look up the codec id for a bare-literal interpolation. Required on every SQL adapter descriptor — the facade reads it off the descriptor at client-construction time without instantiating the runtime adapter.
|
|
223
|
+
*/
|
|
224
|
+
readonly rawCodecInferer: RawCodecInferer;
|
|
225
|
+
}
|
|
226
|
+
interface SqlRuntimeExtensionDescriptor<TTargetId extends string = string> extends RuntimeExtensionDescriptor<'sql', TTargetId, SqlRuntimeExtensionInstance<TTargetId>>, SqlStaticContributions {
|
|
227
|
+
create(): SqlRuntimeExtensionInstance<TTargetId>;
|
|
228
|
+
}
|
|
229
|
+
interface SqlExecutionStack<TTargetId extends string = string> {
|
|
230
|
+
readonly target: SqlRuntimeTargetDescriptor<TTargetId>;
|
|
231
|
+
readonly adapter: SqlRuntimeAdapterDescriptor<TTargetId>;
|
|
232
|
+
readonly extensions: readonly SqlRuntimeExtensionDescriptor<TTargetId>[];
|
|
233
|
+
}
|
|
234
|
+
type SqlExecutionStackWithDriver<TTargetId extends string = string> = Omit<ExecutionStack<'sql', TTargetId, SqlRuntimeAdapterInstance<TTargetId>, SqlRuntimeDriverInstance<TTargetId>, SqlRuntimeExtensionInstance<TTargetId>>, 'target' | 'adapter' | 'driver' | 'extensions'> & {
|
|
235
|
+
readonly target: SqlRuntimeTargetDescriptor<TTargetId>;
|
|
236
|
+
readonly adapter: SqlRuntimeAdapterDescriptor<TTargetId, SqlRuntimeAdapterInstance<TTargetId>>;
|
|
237
|
+
readonly driver: RuntimeDriverDescriptor<'sql', TTargetId, unknown, SqlRuntimeDriverInstance<TTargetId>> | undefined;
|
|
238
|
+
readonly extensions: readonly SqlRuntimeExtensionDescriptor<TTargetId>[];
|
|
239
|
+
};
|
|
240
|
+
interface SqlRuntimeExtensionInstance<TTargetId extends string> extends RuntimeExtensionInstance<'sql', TTargetId> {}
|
|
241
|
+
type SqlRuntimeAdapterInstance<TTargetId extends string = string> = RuntimeAdapterInstance<'sql', TTargetId> & Adapter<AnyQueryAst, Contract<SqlStorage>, LoweredStatement>;
|
|
242
|
+
/**
|
|
243
|
+
* NOTE: Binding type is intentionally erased to unknown at this shared runtime layer. Target clients (for example `postgres()`) validate and construct the concrete binding before calling `driver.connect(binding)`, which keeps runtime behavior safe today. A future follow-up can preserve TBinding through stack/context generics end-to-end.
|
|
244
|
+
*/
|
|
245
|
+
type SqlRuntimeDriverInstance<TTargetId extends string = string> = RuntimeDriverInstance<'sql', TTargetId> & SqlDriver<unknown>;
|
|
246
|
+
declare function createSqlExecutionStack<TTargetId extends string>(options: {
|
|
247
|
+
readonly target: SqlRuntimeTargetDescriptor<TTargetId>;
|
|
248
|
+
readonly adapter: SqlRuntimeAdapterDescriptor<TTargetId>;
|
|
249
|
+
readonly driver?: RuntimeDriverDescriptor<'sql', TTargetId, unknown, SqlRuntimeDriverInstance<TTargetId>> | undefined;
|
|
250
|
+
readonly extensions?: readonly SqlRuntimeExtensionDescriptor<TTargetId>[] | undefined;
|
|
251
|
+
}): SqlExecutionStackWithDriver<TTargetId>;
|
|
252
|
+
declare function createExecutionContext<TContract extends Contract<SqlStorage> = Contract<SqlStorage>, TTargetId extends string = string>(options: {
|
|
253
|
+
readonly contract: TContract;
|
|
254
|
+
readonly stack: SqlExecutionStack<TTargetId>;
|
|
255
|
+
/**
|
|
256
|
+
* Optional driver descriptor. When provided, its `capabilities` are folded into the contract's capability matrix alongside the target, adapter, and extension packs — matching the merge `enrichContract` performs at CLI emit time. The driver is *only* consulted as a capability source here; runtime driver lifecycle is wired separately via {@link instantiateExecutionStack} + `runtime.connect`.
|
|
257
|
+
*/
|
|
258
|
+
readonly driver?: RuntimeDriverDescriptor<'sql', TTargetId, unknown, SqlRuntimeDriverInstance<TTargetId>>;
|
|
259
|
+
}): ExecutionContext<TContract>;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/sql-runtime.d.ts
|
|
262
|
+
type Log$1 = RuntimeLog;
|
|
263
|
+
interface RuntimeOptions<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> {
|
|
264
|
+
readonly context: ExecutionContext<TContract>;
|
|
265
|
+
readonly adapter: Adapter<AnyQueryAst, Contract<SqlStorage>, LoweredStatement>;
|
|
266
|
+
readonly driver: SqlDriver<unknown>;
|
|
267
|
+
readonly verifyMarker?: VerifyMarkerOption;
|
|
268
|
+
readonly middleware?: readonly SqlMiddleware[];
|
|
269
|
+
readonly mode?: 'strict' | 'permissive';
|
|
270
|
+
readonly log?: Log$1;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* SQL-family runtime interface. Named `Runtime` (not `SqlRuntime`) by deliberate exception
|
|
274
|
+
* to avoid a repo-wide rename; see ADR 230 (runtime target layer) for the recorded decision.
|
|
275
|
+
*/
|
|
276
|
+
interface Runtime extends RuntimeQueryable {
|
|
277
|
+
connection(): Promise<RuntimeConnection>;
|
|
278
|
+
telemetry(): RuntimeTelemetryEvent | null;
|
|
279
|
+
close(): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Build a reusable {@link PreparedStatement}. Throws
|
|
282
|
+
* `RUNTIME.PREPARE_UNUSED_PARAM` if any declared name is unreferenced
|
|
283
|
+
* by the callback's plan.
|
|
284
|
+
*/
|
|
285
|
+
prepare<D extends Declaration<CT>, Row, CT extends CodecTypesBase = CodecTypesBase>(declaration: D, callback: PrepareCallback<D, Row>): Promise<PreparedStatement<ParamsFromDeclaration<D, CT>, Row>>;
|
|
286
|
+
}
|
|
287
|
+
interface RuntimeConnection extends RuntimeQueryable {
|
|
288
|
+
transaction(): Promise<RuntimeTransaction>;
|
|
289
|
+
/**
|
|
290
|
+
* Returns the connection to the pool for reuse. Only call this when the connection is known to be in a clean state. If a transaction commit/rollback failed or the connection is otherwise suspect, call `destroy(reason)` instead.
|
|
291
|
+
*/
|
|
292
|
+
release(): Promise<void>;
|
|
293
|
+
/**
|
|
294
|
+
* Evicts the connection so it is never reused. Call this when the connection may be in an indeterminate state (e.g. a failed rollback leaving an open transaction, or a broken socket).
|
|
295
|
+
*
|
|
296
|
+
* If teardown fails the error is propagated and the connection remains retryable, so the caller can decide whether to swallow the failure or retry cleanup. Calling destroy() or release() more than once after a successful teardown is caller error.
|
|
297
|
+
*
|
|
298
|
+
* `reason` is advisory context only. It may be surfaced to driver-level observability hooks (e.g. pg-pool's `'release'` event) but does not influence eviction behavior and is not rethrown.
|
|
299
|
+
*/
|
|
300
|
+
destroy(reason?: unknown): Promise<void>;
|
|
301
|
+
}
|
|
302
|
+
interface RuntimeTransaction extends RuntimeQueryable {
|
|
303
|
+
commit(): Promise<void>;
|
|
304
|
+
rollback(): Promise<void>;
|
|
305
|
+
}
|
|
306
|
+
interface RuntimeQueryable extends RuntimeScope {
|
|
307
|
+
/**
|
|
308
|
+
* Run a prepared statement against this scope. Required for the explicit
|
|
309
|
+
* `PreparedStatement.execute(target, params)` API — every scope (top-level
|
|
310
|
+
* runtime, connection, transaction) routes prepared executions through the
|
|
311
|
+
* `SqlQueryable` it is backed by.
|
|
312
|
+
*/
|
|
313
|
+
executePrepared<Params, Row>(ps: PreparedStatement<Params, Row>, params: Params, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
314
|
+
}
|
|
315
|
+
interface TransactionContext extends RuntimeQueryable {
|
|
316
|
+
readonly invalidated: boolean;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Abstract family-layer base for SQL runtimes. Subclass to build a target runtime
|
|
320
|
+
* (e.g. `PostgresRuntimeImpl`); app code should consume the `Runtime` interface returned
|
|
321
|
+
* by the target factories, never this class directly.
|
|
322
|
+
*/
|
|
323
|
+
declare abstract class SqlRuntimeBase<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends RuntimeCore<SqlQueryPlan, SqlExecutionPlan, SqlMiddleware> implements Runtime {
|
|
324
|
+
#private;
|
|
325
|
+
private readonly contract;
|
|
326
|
+
private readonly adapter;
|
|
327
|
+
private readonly driver;
|
|
328
|
+
private readonly familyAdapter;
|
|
329
|
+
private readonly contractCodecs;
|
|
330
|
+
private readonly codecDescriptors;
|
|
331
|
+
private readonly sqlCtx;
|
|
332
|
+
private readonly verifyMarkerOption;
|
|
333
|
+
private verifyMarkerPromise;
|
|
334
|
+
private codecRegistryValidated;
|
|
335
|
+
private _telemetry;
|
|
336
|
+
constructor(options: RuntimeOptions<TContract>);
|
|
337
|
+
/**
|
|
338
|
+
* Lower a `SqlQueryPlan` (AST + meta) into a `SqlExecutionPlan`
|
|
339
|
+
* with encoded parameters ready for the driver.
|
|
340
|
+
*
|
|
341
|
+
* Implementation note: SQL splits lower-then-encode across
|
|
342
|
+
* {@link lowerToDraft} + {@link encodeDraftParams} so the runtime
|
|
343
|
+
* can fire the `beforeExecute` middleware chain between them
|
|
344
|
+
* (cipherstash bulk-encrypt, for example, mutates pre-encode
|
|
345
|
+
* `ParamRef.value` slots). This protected hook composes the two
|
|
346
|
+
* back into the cross-family `lower()` shape `RuntimeCore.execute`
|
|
347
|
+
* expects, and is called from the no-middleware fast paths /
|
|
348
|
+
* fixtures that hit `RuntimeCore`'s default template directly.
|
|
349
|
+
* `execute()` overrides the template and uses the split form so
|
|
350
|
+
* `beforeExecute` lands between the two halves.
|
|
351
|
+
*
|
|
352
|
+
* `ctx: SqlCodecCallContext` is forwarded to `encodeParams` so
|
|
353
|
+
* per-query cancellation reaches every codec body during parameter
|
|
354
|
+
* encoding. SQL params do not populate `ctx.column` — encode-side
|
|
355
|
+
* column metadata is the middleware's domain.
|
|
356
|
+
*/
|
|
357
|
+
protected lower(plan: SqlQueryPlan, ctx: SqlCodecCallContext): Promise<SqlExecutionPlan>;
|
|
358
|
+
/**
|
|
359
|
+
* AST → pre-encode draft. The returned plan has `sql` rendered and
|
|
360
|
+
* `params` populated with the user-domain values the lowering site
|
|
361
|
+
* collected from `ParamRef` nodes. No codec encode has happened
|
|
362
|
+
* yet; consumers can mutate `params` via the `SqlParamRefMutator`
|
|
363
|
+
* before {@link encodeDraftParams} runs.
|
|
364
|
+
*/
|
|
365
|
+
private lowerToDraft;
|
|
366
|
+
/**
|
|
367
|
+
* Encode a draft plan's params through the per-column codecs and
|
|
368
|
+
* freeze the result into the final `SqlExecutionPlan` the driver
|
|
369
|
+
* sees. Errors surface as `RUNTIME.ENCODE_FAILED` envelopes from
|
|
370
|
+
* {@link encodeParams}.
|
|
371
|
+
*/
|
|
372
|
+
private encodeDraftParams;
|
|
373
|
+
/**
|
|
374
|
+
* Default driver invocation required by the abstract `RuntimeCore` contract. Every production path overrides `execute()` and routes through `executeAgainstQueryable`, so this hook is defensive only — subclasses that delegate back to `super.execute()` would land here.
|
|
375
|
+
*/
|
|
376
|
+
protected runDriver(exec: SqlExecutionPlan): AsyncIterable<Record<string, unknown>>;
|
|
377
|
+
/**
|
|
378
|
+
* SQL pre-compile hook. Runs the registered middleware `beforeCompile` chain over the plan's draft (AST + meta). Returns the original plan unchanged when no middleware rewrote the AST; otherwise returns a new plan carrying the rewritten AST and meta. The AST is the authoritative source of execution metadata, so a rewrite needs no sidecar reconciliation here — the lowering adapter and the encoder both walk the rewritten
|
|
379
|
+
* AST directly.
|
|
380
|
+
*/
|
|
381
|
+
protected runBeforeCompile(plan: SqlQueryPlan): Promise<SqlQueryPlan>;
|
|
382
|
+
execute<Row>(plan: (SqlExecutionPlan<unknown> | SqlQueryPlan<unknown>) & {
|
|
383
|
+
readonly _row?: Row;
|
|
384
|
+
}, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
385
|
+
executePrepared<Params, Row>(ps: PreparedStatement<Params, Row>, params: Params, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
386
|
+
/**
|
|
387
|
+
* Returns the raw driver connection. The connection is a `SqlQueryable` — SQL
|
|
388
|
+
* issued on it runs below the middleware/codec/telemetry pipeline. It carries
|
|
389
|
+
* its own lifecycle (`release`/`destroy`/`beginTransaction`); the caller owns
|
|
390
|
+
* disposal.
|
|
391
|
+
*/
|
|
392
|
+
protected acquireRawConnection(): Promise<SqlConnection>;
|
|
393
|
+
private streamRows;
|
|
394
|
+
/**
|
|
395
|
+
* Execute a plan against a caller-supplied queryable, running the full
|
|
396
|
+
* middleware/codec/telemetry pipeline. Use `acquireRawConnection` to obtain a
|
|
397
|
+
* queryable that subclasses can bind typed plans to.
|
|
398
|
+
*/
|
|
399
|
+
protected executeAgainstQueryable<Row>(plan: SqlExecutionPlan<unknown> | SqlQueryPlan<unknown>, queryable: SqlQueryable, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
400
|
+
prepare<D extends Declaration<CT>, Row, CT extends CodecTypesBase = CodecTypesBase>(declaration: D, callback: PrepareCallback<D, Row>): Promise<PreparedStatement<ParamsFromDeclaration<D, CT>, Row>>;
|
|
401
|
+
/**
|
|
402
|
+
* Execute a prepared statement against a caller-supplied queryable, running
|
|
403
|
+
* the full middleware/codec/telemetry pipeline.
|
|
404
|
+
*/
|
|
405
|
+
protected executePreparedAgainstQueryable<P, Row>(ps: PreparedStatementImpl<P, Row>, userParams: Record<string, unknown>, queryable: SqlQueryable, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
406
|
+
connection(): Promise<RuntimeConnection>;
|
|
407
|
+
private wrapTransaction;
|
|
408
|
+
telemetry(): RuntimeTelemetryEvent | null;
|
|
409
|
+
close(): Promise<void>;
|
|
410
|
+
private ensureCodecRegistryValidated;
|
|
411
|
+
private verifyMarker;
|
|
412
|
+
private recordTelemetry;
|
|
413
|
+
}
|
|
414
|
+
/** Minimal structural type `withTransaction` depends on — anything that can open a connection. */
|
|
415
|
+
interface ConnectionProvider {
|
|
416
|
+
connection(): Promise<RuntimeConnection>;
|
|
417
|
+
}
|
|
418
|
+
declare function withTransaction<R>(runtime: ConnectionProvider, fn: (tx: TransactionContext) => PromiseLike<R>): Promise<R>;
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/prepared/prepared-statement.d.ts
|
|
421
|
+
interface PreparedStatementInternals {
|
|
422
|
+
readonly sql: string;
|
|
423
|
+
readonly ast: AnyQueryAst;
|
|
424
|
+
readonly meta: PlanMeta;
|
|
425
|
+
readonly slots: readonly LoweredParam[];
|
|
426
|
+
readonly decodeContext: DecodeContext;
|
|
427
|
+
readonly paramMetadata: readonly ParamMetadata[];
|
|
428
|
+
}
|
|
429
|
+
declare class PreparedStatementImpl<Params, Row> implements PreparedStatement<Params, Row>, PreparedStatementInternals {
|
|
430
|
+
readonly sql: string;
|
|
431
|
+
readonly ast: AnyQueryAst;
|
|
432
|
+
readonly meta: PlanMeta;
|
|
433
|
+
readonly slots: readonly LoweredParam[];
|
|
434
|
+
readonly decodeContext: DecodeContext;
|
|
435
|
+
readonly paramMetadata: readonly ParamMetadata[];
|
|
436
|
+
constructor(internals: PreparedStatementInternals);
|
|
437
|
+
execute(target: RuntimeQueryable, params: Params, options?: RuntimeExecuteOptions): AsyncIterableResult<Row>;
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region ../../../2-sql/5-runtime/dist/index.d.mts
|
|
441
|
+
//#region src/codecs/ast-codec-registry.d.ts
|
|
442
|
+
/**
|
|
443
|
+
* Build a contract-free {@link ContractCodecRegistry} that resolves codecs
|
|
444
|
+
* purely from AST-supplied {@link import('@prisma/orm-framework/components/codec').CodecRef}s
|
|
445
|
+
* against a target's descriptor registry.
|
|
446
|
+
*
|
|
447
|
+
* Dispatch is driven entirely by `CodecRef`s embedded in AST nodes; no
|
|
448
|
+
* contract walk is needed. `forColumn` always returns `undefined` — this
|
|
449
|
+
* registry carries no column-to-codec mappings.
|
|
450
|
+
*/
|
|
451
|
+
declare function createAstCodecRegistry(descriptors: CodecDescriptorRegistry): ContractCodecRegistry;
|
|
452
|
+
//#endregion
|
|
453
|
+
//#region src/codecs/validation.d.ts
|
|
454
|
+
declare function extractCodecIds(contract: Contract<SqlStorage>): Set<string>;
|
|
455
|
+
declare function validateContractCodecMappings(registry: CodecDescriptorRegistry, contract: Contract<SqlStorage>): void;
|
|
456
|
+
declare function validateCodecRegistryCompleteness(registry: CodecDescriptorRegistry, contract: Contract<SqlStorage>): void;
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/lower-sql-plan.d.ts
|
|
459
|
+
/**
|
|
460
|
+
* Lowers a SQL query plan to an executable Plan by calling the adapter's lower method.
|
|
461
|
+
*
|
|
462
|
+
* Ad-hoc lowerings produce only `{kind: 'literal'}` slots; this helper
|
|
463
|
+
* unwraps them into the bare-value array `SqlExecutionPlan` exposes.
|
|
464
|
+
* Encountering a `{kind: 'bind'}` slot here means the caller passed an
|
|
465
|
+
* AST containing `PreparedParamRef` to the ad-hoc execute path — that's a
|
|
466
|
+
* caller error, surfaced as `RUNTIME.PREPARE_BIND_ON_ADHOC`.
|
|
467
|
+
*/
|
|
468
|
+
declare function lowerSqlPlan<Row>(adapter: Adapter<AnyQueryAst, Contract<SqlStorage>, LoweredStatement>, contract: Contract<SqlStorage>, queryPlan: SqlQueryPlan<Row>): SqlExecutionPlan<Row>;
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/middleware/budgets.d.ts
|
|
471
|
+
interface BudgetsOptions {
|
|
472
|
+
readonly maxRows?: number;
|
|
473
|
+
readonly defaultTableRows?: number;
|
|
474
|
+
readonly tableRows?: Record<string, number>;
|
|
475
|
+
readonly maxLatencyMs?: number;
|
|
476
|
+
readonly severities?: {
|
|
477
|
+
readonly rowCount?: 'warn' | 'error';
|
|
478
|
+
readonly latency?: 'warn' | 'error';
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
declare function budgets(options?: BudgetsOptions): SqlMiddleware;
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/middleware/lints.d.ts
|
|
484
|
+
interface LintsOptions {
|
|
485
|
+
readonly severities?: {
|
|
486
|
+
readonly selectStar?: 'warn' | 'error';
|
|
487
|
+
readonly noLimit?: 'warn' | 'error';
|
|
488
|
+
readonly deleteWithoutWhere?: 'warn' | 'error';
|
|
489
|
+
readonly updateWithoutWhere?: 'warn' | 'error';
|
|
490
|
+
readonly readOnlyMutation?: 'warn' | 'error';
|
|
491
|
+
};
|
|
492
|
+
readonly fallbackWhenAstMissing?: 'raw' | 'skip';
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* AST-first lint middleware for SQL plans. When `plan.ast` is a SQL QueryAst, inspects
|
|
496
|
+
* the AST structurally. When `plan.ast` is missing, falls back to raw heuristic
|
|
497
|
+
* guardrails or skips linting depending on `fallbackWhenAstMissing`.
|
|
498
|
+
*
|
|
499
|
+
* Rules (AST-based):
|
|
500
|
+
* - DELETE without WHERE: blocks execution (configurable severity, default error)
|
|
501
|
+
* - UPDATE without WHERE: blocks execution (configurable severity, default error)
|
|
502
|
+
* - Unbounded SELECT: warn/error (severity from noLimit)
|
|
503
|
+
* - SELECT * intent: warn/error (severity from selectStar)
|
|
504
|
+
*
|
|
505
|
+
* Fallback: When ast is missing, `fallbackWhenAstMissing: 'raw'` uses heuristic
|
|
506
|
+
* SQL parsing; `'skip'` skips all lints. Default is `'raw'`.
|
|
507
|
+
*/
|
|
508
|
+
declare function lints(options?: LintsOptions): SqlMiddleware;
|
|
509
|
+
//#endregion
|
|
510
|
+
export { RuntimeQueryable as A, SqlRuntimeDriverInstance as B, PreparedStatementImpl as C, RuntimeFamilyAdapter as D, RuntimeConnection as E, SqlMiddleware as F, TelemetryOutcome as G, SqlRuntimeExtensionInstance as H, SqlMiddlewareContext as I, createExecutionContext as J, TransactionContext as K, SqlRuntimeAdapterDescriptor as L, RuntimeTransaction as M, SqlExecutionStack as N, RuntimeMutationDefaultGenerator as O, SqlExecutionStackWithDriver as P, withTransaction as Q, SqlRuntimeAdapterInstance as R, PreparedStatement as S, Runtime as T, SqlRuntimeTargetDescriptor as U, SqlRuntimeExtensionDescriptor as V, SqlStaticContributions as W, deriveParamMetadata as X, createSqlExecutionStack as Y, encodeParamsWithMetadata as Z, GeneratorStability as _, budgets as a, ParamsFromDeclaration as b, lints as c, validateContractCodecMappings as d, BindSiteParams as f, DeclaredNullable as g, DeclaredCodecId as h, Log as i, RuntimeTelemetryEvent as j, RuntimeParameterizedCodecDescriptor as k, lowerSqlPlan as l, Declaration as m, BudgetsOptions as n, createAstCodecRegistry as o, ConnectionProvider as p, VerifyMarkerOption as q, LintsOptions as r, extractCodecIds as s, AfterExecuteResult$1 as t, validateCodecRegistryCompleteness as u, MarkerReader as v, PreparedStatementInternals as w, PrepareCallback as x, ParamSpec as y, SqlRuntimeBase as z };
|
|
511
|
+
//# sourceMappingURL=index-Bb9U36N4.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Bb9U36N4.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/prepared-statement-D4zOlprk.d.mts","../../../../2-sql/5-runtime/dist/index.d.mts"],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { y as QueryOperationTypeEntry } from "./types-CuDrWc5v-ISVXBmBs.mjs";
|
|
2
|
+
import "./types-BchwQpmO.mjs";
|
|
3
|
+
import { OperationDescriptor, OperationDescriptors, OperationRegistry } from "@prisma/orm-framework/operations";
|
|
4
|
+
//#region ../../../2-sql/1-core/operations/dist/index.d.mts
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
interface SqlLoweringSpec {
|
|
7
|
+
readonly targetFamily: 'sql';
|
|
8
|
+
readonly strategy: 'infix' | 'function';
|
|
9
|
+
readonly template: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Runtime shape of a SQL operation entry — tightened beyond the framework's
|
|
13
|
+
* target-agnostic `OperationEntry` so `impl` returns a codec-exact
|
|
14
|
+
* `QueryOperationReturn` instead of `unknown`. Consumers (ORM column helper,
|
|
15
|
+
* sql-builder `fns` dispatch) can read `result.returnType.codecId` without a
|
|
16
|
+
* cast.
|
|
17
|
+
*/
|
|
18
|
+
type SqlOperationEntry = QueryOperationTypeEntry;
|
|
19
|
+
type SqlOperationDescriptor = OperationDescriptor<SqlOperationEntry>;
|
|
20
|
+
type SqlOperationDescriptors = OperationDescriptors<SqlOperationEntry>;
|
|
21
|
+
type SqlOperationRegistry = OperationRegistry<SqlOperationEntry>;
|
|
22
|
+
declare function createSqlOperationRegistry(): SqlOperationRegistry;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { SqlOperationRegistry as a, SqlOperationEntry as i, SqlOperationDescriptor as n, createSqlOperationRegistry as o, SqlOperationDescriptors as r, SqlLoweringSpec as t };
|
|
25
|
+
//# sourceMappingURL=index-BgaTJRxj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BgaTJRxj.d.mts","names":[],"sources":["../../../../2-sql/1-core/operations/dist/index.d.mts"],"mappings":";;;;;UAGU;WACC;WACA;WACA;;;;;;;;;KASN,oBAAoB;KACpB,yBAAyB,oBAAoB;KAC7C,0BAA0B,qBAAqB;KAC/C,uBAAuB,kBAAkB;iBAC7B,8BAA8B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { r as IndexInput } from "./sql-index-DsI8HAeK-BJsn-jvD.mjs";
|
|
2
|
+
import { AuthoringWarning, AuthoringWarningSink } from "@prisma/orm-framework/components/authoring";
|
|
3
|
+
//#region ../../../2-sql/1-core/contract/dist/index-naming.d.mts
|
|
4
|
+
//#region src/index-naming.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The authored element structure: a fields index carries `columns`, an
|
|
7
|
+
* expression index carries `expression` — exactly one, never both.
|
|
8
|
+
*/
|
|
9
|
+
type AuthoredIndexElements = {
|
|
10
|
+
readonly columns: readonly string[];
|
|
11
|
+
readonly expression?: never;
|
|
12
|
+
} | {
|
|
13
|
+
readonly columns?: never;
|
|
14
|
+
readonly expression: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The authored access method: options only exist as options *of a type*, so
|
|
18
|
+
* the pair is one two-arm union rather than two independent fields. An
|
|
19
|
+
* options bag without a type is therefore unrepresentable, the same way
|
|
20
|
+
* {@link AuthoredIndexElements} makes columns-with-expression
|
|
21
|
+
* unrepresentable.
|
|
22
|
+
*/
|
|
23
|
+
type AuthoredIndexMethod = {
|
|
24
|
+
readonly type: undefined;
|
|
25
|
+
readonly options: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
readonly type: string;
|
|
28
|
+
readonly options: Record<string, unknown> | undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* An index as authored, before naming: `map` is an exact physical name
|
|
32
|
+
* (adopted verbatim); `name` is a wire-name prefix. With neither,
|
|
33
|
+
* the wire prefix defaults to `defaultIndexName(table, columns)`.
|
|
34
|
+
* `where`, `unique`, `type`, and `options` participate in the content hash
|
|
35
|
+
* alongside the elements.
|
|
36
|
+
*/
|
|
37
|
+
type AuthoredIndexInput = AuthoredIndexElements & AuthoredIndexMethod & {
|
|
38
|
+
readonly where: string | undefined;
|
|
39
|
+
readonly unique: boolean | undefined;
|
|
40
|
+
readonly map: string | undefined;
|
|
41
|
+
readonly name: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Mints the exact-name body-comparison warning for a `map:`-named object
|
|
45
|
+
* carrying a hand-authorable SQL body — fully formed, so the transport and
|
|
46
|
+
* the flush stay generic. `subject` is `index` here and `policy` where
|
|
47
|
+
* policies mint the same warning; the feature name and the remediation are
|
|
48
|
+
* subject-specific end to end, so a batched summary (grouped on
|
|
49
|
+
* code + summary) is true of every object it covers.
|
|
50
|
+
*/
|
|
51
|
+
declare function exactNameBodyWarning(subject: 'index' | 'policy', exactName: string): AuthoringWarning;
|
|
52
|
+
/**
|
|
53
|
+
* Lowers an authored index into the name-identified entity `contract.json`
|
|
54
|
+
* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire
|
|
55
|
+
* mode appends the content-hash suffix to the authored or default prefix.
|
|
56
|
+
* The cross-field guards are the shared enforcement backstop for both
|
|
57
|
+
* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).
|
|
58
|
+
*/
|
|
59
|
+
declare function lowerAuthoredIndex(tableName: string, authored: AuthoredIndexInput, warnings?: AuthoringWarningSink): IndexInput;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { lowerAuthoredIndex as i, AuthoredIndexMethod as n, exactNameBodyWarning as r, AuthoredIndexInput as t };
|
|
62
|
+
//# sourceMappingURL=index-naming-BZWoh45T.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-naming-BZWoh45T.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming.d.mts"],"mappings":";;;;;;;;KAOK;WACM;WACA;;WAEA;WACA;;;;;;;;;KASN;WACM;WACA;;WAEA;WACA,SAAS;;;;;;;;;KASf,qBAAqB,wBAAwB;WACvC;WACA;WACA;WACA;;;;;;;;;;iBAUM,qBAAqB,6BAA6B,oBAAoB;;;;;;;;iBAQtE,mBAAmB,mBAAmB,UAAU,oBAAoB,WAAW,uBAAuB"}
|