@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,948 @@
|
|
|
1
|
+
import { r as StorageColumn } from "./storage-table-BBaAmanc-BwR37LMA.mjs";
|
|
2
|
+
import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
|
|
3
|
+
import { C as SqlControlDriverInstance } from "./types-CuDrWc5v-ISVXBmBs.mjs";
|
|
4
|
+
import "./types-BchwQpmO.mjs";
|
|
5
|
+
import { r as SqlOperationDescriptors } from "./index-BgaTJRxj.mjs";
|
|
6
|
+
import { p as AnyQueryAst } from "./types-DIBA80mc-wf5wLmON.mjs";
|
|
7
|
+
import { s as DdlNode } from "./ddl-types-rrMsf77U-DGctYf-T.mjs";
|
|
8
|
+
import { a as LowererContext, y as SqlExecuteRequest } from "./ast-DSuzmsWn.mjs";
|
|
9
|
+
import { g as SqlSchemaIR, v as SqlSchemaIRNode } from "./types-CvbBw1Jo-3KQdErJY.mjs";
|
|
10
|
+
import "./types-TvBZ2Ne9.mjs";
|
|
11
|
+
import { i as SqlControlAdapter } from "./control-adapter-C99J7aEF-C-17lFY8.mjs";
|
|
12
|
+
import { A as SqlPlannerSuccessResult, C as SqlMigrationRunnerSuccessValue, O as SqlPlannerFailureResult, T as SqlPlannerConflict, _ as SqlMigrationRunner, h as SqlMigrationPlanner, n as CodecControlHooks, r as CreateSqlMigrationPlanOptions, t as AnyRecord, u as SqlMigrationPlan, v as SqlMigrationRunnerErrorCode, x as SqlMigrationRunnerFailure } from "./types-IqZMLrFC-DtdJNICr.mjs";
|
|
13
|
+
import { t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-g5_iks8G.mjs";
|
|
14
|
+
import { ColumnDefault, Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
15
|
+
import { NotOk, Ok } from "@prisma/orm-framework/utils/result";
|
|
16
|
+
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
17
|
+
import { ContractSerializer, ControlFamilyDescriptor, ControlFamilyInstance, ControlStack, DiffSubjectGranularity, MigratableTargetDescriptor, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan as MigrationPlan$1, MigrationPlanOperation, MigrationPlanOperation as MigrationPlanOperation$1, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, OperationPreview, OperationPreviewCapable, PslContractInferCapable, SchemaDiffIssue, SchemaVerifier, SchemaViewCapable, SignDatabaseResult, TargetMigrationsCapability, VerifyDatabaseResult, VerifyDatabaseSchemaResult, assembleAuthoringContributions } from "@prisma/orm-framework/components/control";
|
|
18
|
+
import { EmissionSpi, TypesImportSpec } from "@prisma/orm-framework/components/emission";
|
|
19
|
+
import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
|
|
20
|
+
//#region ../../../2-sql/9-family/dist/control.d.mts
|
|
21
|
+
//#region src/core/control-instance.d.ts
|
|
22
|
+
interface SqlTypeMetadata {
|
|
23
|
+
readonly typeId: string;
|
|
24
|
+
readonly familyId: 'sql';
|
|
25
|
+
readonly targetId: string;
|
|
26
|
+
readonly nativeType?: string;
|
|
27
|
+
}
|
|
28
|
+
type SqlTypeMetadataRegistry = Map<string, SqlTypeMetadata>;
|
|
29
|
+
interface SqlFamilyInstanceState {
|
|
30
|
+
readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;
|
|
31
|
+
readonly extensionIds: ReadonlyArray<string>;
|
|
32
|
+
readonly typeMetadataRegistry: SqlTypeMetadataRegistry;
|
|
33
|
+
}
|
|
34
|
+
interface SqlControlFamilyInstance extends ControlFamilyInstance<'sql', SqlSchemaIRNode>, SchemaViewCapable<SqlSchemaIRNode>, PslContractInferCapable<SqlSchemaIRNode>, OperationPreviewCapable, SqlFamilyInstanceState {
|
|
35
|
+
/**
|
|
36
|
+
* The family seam-of-record for on-disk contract reads. Structurally
|
|
37
|
+
* validates the JSON envelope, then hydrates IR-class instances via
|
|
38
|
+
* the per-target ContractSerializer. The single named entry point
|
|
39
|
+
* every CLI on-disk read crosses (TML-2536) — `as Contract` casts
|
|
40
|
+
* in production package sources are a serializer-bypass smell guarded
|
|
41
|
+
* by `pnpm lint:no-contract-cast`.
|
|
42
|
+
*/
|
|
43
|
+
deserializeContract(contractJson: unknown): Contract;
|
|
44
|
+
verify(options: {
|
|
45
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
46
|
+
readonly contract: unknown;
|
|
47
|
+
readonly expectedTargetId: string;
|
|
48
|
+
readonly contractPath: string;
|
|
49
|
+
readonly configPath?: string;
|
|
50
|
+
}): Promise<VerifyDatabaseResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Verify a contract against an already-introspected schema.
|
|
53
|
+
*
|
|
54
|
+
* Callers that need to verify against the live database compose
|
|
55
|
+
* `introspect({ driver })` + `verifySchema({ contract, schema, ... })`.
|
|
56
|
+
* The aggregate verifier hands in the full introspected schema and scopes
|
|
57
|
+
* the returned result to each member's contract space afterwards — so
|
|
58
|
+
* sibling-space tables never survive as `extras`.
|
|
59
|
+
*/
|
|
60
|
+
verifySchema(options: {
|
|
61
|
+
readonly contract: unknown;
|
|
62
|
+
readonly schema: SqlSchemaIRNode;
|
|
63
|
+
readonly strict: boolean;
|
|
64
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
65
|
+
}): VerifyDatabaseSchemaResult;
|
|
66
|
+
/**
|
|
67
|
+
* Classifies a diff issue's subject granularity on demand, resolved from
|
|
68
|
+
* its node's `nodeKind` via the target's classifier. Satisfies the
|
|
69
|
+
* {@link import('@prisma/orm-framework/components/control').SchemaSubjectClassifierCapable}
|
|
70
|
+
* capability that framework consumers spanning contract spaces (the
|
|
71
|
+
* migration aggregate's unclaimed-elements sweep) detect via
|
|
72
|
+
* `hasSchemaSubjectClassifier` and call instead of reading family/target
|
|
73
|
+
* node vocabulary. Nothing is stamped on the issue or the node.
|
|
74
|
+
*/
|
|
75
|
+
classifySubjectGranularity(issue: SchemaDiffIssue): DiffSubjectGranularity | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Classifies a diff issue's subject storage `entityKind` on demand,
|
|
78
|
+
* resolved from its node's `nodeKind` via the target's classifier —
|
|
79
|
+
* sibling of `classifySubjectGranularity` above, part of the same
|
|
80
|
+
* {@link import('@prisma/orm-framework/components/control').SchemaSubjectClassifierCapable}
|
|
81
|
+
* capability. Nothing is stamped on the issue or the node.
|
|
82
|
+
*/
|
|
83
|
+
classifyEntityKind(issue: SchemaDiffIssue): string | undefined;
|
|
84
|
+
sign(options: {
|
|
85
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
86
|
+
readonly contract: unknown;
|
|
87
|
+
readonly contractPath: string;
|
|
88
|
+
readonly configPath?: string;
|
|
89
|
+
}): Promise<SignDatabaseResult>;
|
|
90
|
+
introspect(options: {
|
|
91
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
92
|
+
readonly contract?: unknown;
|
|
93
|
+
}): Promise<SqlSchemaIRNode>;
|
|
94
|
+
inferPslContract(schemaIR: SqlSchemaIRNode): PslDocumentAst;
|
|
95
|
+
lowerAst(ast: AnyQueryAst | DdlNode, context: LowererContext<unknown>): Promise<SqlExecuteRequest>;
|
|
96
|
+
/**
|
|
97
|
+
* Inserts the initial marker row for `space` (upsert on `space`).
|
|
98
|
+
* Delegates to the target control adapter's write SPI; see
|
|
99
|
+
* `SqlControlAdapter.initMarker`.
|
|
100
|
+
*/
|
|
101
|
+
initMarker(options: {
|
|
102
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
103
|
+
readonly space: string;
|
|
104
|
+
readonly destination: {
|
|
105
|
+
readonly storageHash: string;
|
|
106
|
+
readonly profileHash: string;
|
|
107
|
+
readonly invariants?: readonly string[];
|
|
108
|
+
};
|
|
109
|
+
}): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Compare-and-swap advance of the marker row for `space`. Returns `true`
|
|
112
|
+
* when the swap matched a row; see `SqlControlAdapter.updateMarker`.
|
|
113
|
+
*/
|
|
114
|
+
updateMarker(options: {
|
|
115
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
116
|
+
readonly space: string;
|
|
117
|
+
readonly expectedFrom: string;
|
|
118
|
+
readonly destination: {
|
|
119
|
+
readonly storageHash: string;
|
|
120
|
+
readonly profileHash: string;
|
|
121
|
+
readonly invariants?: readonly string[];
|
|
122
|
+
};
|
|
123
|
+
}): Promise<boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* Appends a ledger entry for `space`; see
|
|
126
|
+
* `SqlControlAdapter.writeLedgerEntry`.
|
|
127
|
+
*/
|
|
128
|
+
writeLedgerEntry(options: {
|
|
129
|
+
readonly driver: SqlControlDriverInstance<string>;
|
|
130
|
+
readonly space: string;
|
|
131
|
+
readonly entry: {
|
|
132
|
+
readonly edgeId: string;
|
|
133
|
+
readonly from: string;
|
|
134
|
+
readonly to: string;
|
|
135
|
+
readonly migrationName: string;
|
|
136
|
+
readonly migrationHash: string;
|
|
137
|
+
readonly operations: readonly unknown[];
|
|
138
|
+
readonly destinationContractJson?: unknown;
|
|
139
|
+
};
|
|
140
|
+
}): Promise<void>;
|
|
141
|
+
bootstrapControlTableQueries(): readonly DdlNode[];
|
|
142
|
+
toOperationPreview(operations: readonly MigrationPlanOperation[]): OperationPreview;
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/core/control-descriptor.d.ts
|
|
146
|
+
declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
|
|
147
|
+
readonly kind: "family";
|
|
148
|
+
readonly id = "sql";
|
|
149
|
+
readonly familyId: "sql";
|
|
150
|
+
readonly version = "0.0.1";
|
|
151
|
+
readonly emission: EmissionSpi;
|
|
152
|
+
readonly authoring: {
|
|
153
|
+
readonly field: {
|
|
154
|
+
readonly uuidString: {
|
|
155
|
+
readonly kind: "fieldPreset";
|
|
156
|
+
readonly output: {
|
|
157
|
+
readonly codecId: "sql/char@1";
|
|
158
|
+
readonly nativeType: "character";
|
|
159
|
+
readonly typeParams: {
|
|
160
|
+
readonly length: 36;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly ulid: {
|
|
165
|
+
readonly kind: "fieldPreset";
|
|
166
|
+
readonly output: {
|
|
167
|
+
readonly codecId: "sql/char@1";
|
|
168
|
+
readonly nativeType: "character";
|
|
169
|
+
readonly typeParams: {
|
|
170
|
+
readonly length: 26;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly nanoid: {
|
|
175
|
+
readonly kind: "fieldPreset";
|
|
176
|
+
readonly args: readonly [{
|
|
177
|
+
readonly kind: "object";
|
|
178
|
+
readonly optional: true;
|
|
179
|
+
readonly properties: {
|
|
180
|
+
readonly size: {
|
|
181
|
+
readonly kind: "number";
|
|
182
|
+
readonly optional: true;
|
|
183
|
+
readonly integer: true;
|
|
184
|
+
readonly minimum: 2;
|
|
185
|
+
readonly maximum: 255;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
}];
|
|
189
|
+
readonly output: {
|
|
190
|
+
readonly codecId: "sql/char@1";
|
|
191
|
+
readonly nativeType: "character";
|
|
192
|
+
readonly typeParams: {
|
|
193
|
+
readonly length: {
|
|
194
|
+
readonly kind: "arg";
|
|
195
|
+
readonly index: 0;
|
|
196
|
+
readonly path: readonly ["size"];
|
|
197
|
+
readonly default: 21;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
readonly cuid2: {
|
|
203
|
+
readonly kind: "fieldPreset";
|
|
204
|
+
readonly output: {
|
|
205
|
+
readonly codecId: "sql/char@1";
|
|
206
|
+
readonly nativeType: "character";
|
|
207
|
+
readonly typeParams: {
|
|
208
|
+
readonly length: 24;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
readonly ksuid: {
|
|
213
|
+
readonly kind: "fieldPreset";
|
|
214
|
+
readonly output: {
|
|
215
|
+
readonly codecId: "sql/char@1";
|
|
216
|
+
readonly nativeType: "character";
|
|
217
|
+
readonly typeParams: {
|
|
218
|
+
readonly length: 27;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
readonly id: {
|
|
223
|
+
readonly uuidv4String: {
|
|
224
|
+
readonly kind: "fieldPreset";
|
|
225
|
+
readonly output: {
|
|
226
|
+
readonly codecId: "sql/char@1";
|
|
227
|
+
readonly nativeType: "character";
|
|
228
|
+
readonly typeParams: {
|
|
229
|
+
readonly length: 36;
|
|
230
|
+
};
|
|
231
|
+
readonly executionDefaults: {
|
|
232
|
+
readonly onCreate: {
|
|
233
|
+
readonly kind: "generator";
|
|
234
|
+
readonly id: "uuidv4";
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
readonly id: true;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
readonly uuidv7String: {
|
|
241
|
+
readonly kind: "fieldPreset";
|
|
242
|
+
readonly output: {
|
|
243
|
+
readonly codecId: "sql/char@1";
|
|
244
|
+
readonly nativeType: "character";
|
|
245
|
+
readonly typeParams: {
|
|
246
|
+
readonly length: 36;
|
|
247
|
+
};
|
|
248
|
+
readonly executionDefaults: {
|
|
249
|
+
readonly onCreate: {
|
|
250
|
+
readonly kind: "generator";
|
|
251
|
+
readonly id: "uuidv7";
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
readonly id: true;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly ulid: {
|
|
258
|
+
readonly kind: "fieldPreset";
|
|
259
|
+
readonly output: {
|
|
260
|
+
readonly codecId: "sql/char@1";
|
|
261
|
+
readonly nativeType: "character";
|
|
262
|
+
readonly typeParams: {
|
|
263
|
+
readonly length: 26;
|
|
264
|
+
};
|
|
265
|
+
readonly executionDefaults: {
|
|
266
|
+
readonly onCreate: {
|
|
267
|
+
readonly kind: "generator";
|
|
268
|
+
readonly id: "ulid";
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
readonly id: true;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
readonly nanoid: {
|
|
275
|
+
readonly kind: "fieldPreset";
|
|
276
|
+
readonly args: readonly [{
|
|
277
|
+
readonly kind: "object";
|
|
278
|
+
readonly optional: true;
|
|
279
|
+
readonly properties: {
|
|
280
|
+
readonly size: {
|
|
281
|
+
readonly kind: "number";
|
|
282
|
+
readonly optional: true;
|
|
283
|
+
readonly integer: true;
|
|
284
|
+
readonly minimum: 2;
|
|
285
|
+
readonly maximum: 255;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
}];
|
|
289
|
+
readonly output: {
|
|
290
|
+
readonly codecId: "sql/char@1";
|
|
291
|
+
readonly nativeType: "character";
|
|
292
|
+
readonly typeParams: {
|
|
293
|
+
readonly length: {
|
|
294
|
+
readonly kind: "arg";
|
|
295
|
+
readonly index: 0;
|
|
296
|
+
readonly path: readonly ["size"];
|
|
297
|
+
readonly default: 21;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
readonly executionDefaults: {
|
|
301
|
+
readonly onCreate: {
|
|
302
|
+
readonly kind: "generator";
|
|
303
|
+
readonly id: "nanoid";
|
|
304
|
+
readonly params: {
|
|
305
|
+
readonly size: {
|
|
306
|
+
readonly kind: "arg";
|
|
307
|
+
readonly index: 0;
|
|
308
|
+
readonly path: readonly ["size"];
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly id: true;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
readonly cuid2: {
|
|
317
|
+
readonly kind: "fieldPreset";
|
|
318
|
+
readonly output: {
|
|
319
|
+
readonly codecId: "sql/char@1";
|
|
320
|
+
readonly nativeType: "character";
|
|
321
|
+
readonly typeParams: {
|
|
322
|
+
readonly length: 24;
|
|
323
|
+
};
|
|
324
|
+
readonly executionDefaults: {
|
|
325
|
+
readonly onCreate: {
|
|
326
|
+
readonly kind: "generator";
|
|
327
|
+
readonly id: "cuid2";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
readonly id: true;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
readonly ksuid: {
|
|
334
|
+
readonly kind: "fieldPreset";
|
|
335
|
+
readonly output: {
|
|
336
|
+
readonly codecId: "sql/char@1";
|
|
337
|
+
readonly nativeType: "character";
|
|
338
|
+
readonly typeParams: {
|
|
339
|
+
readonly length: 27;
|
|
340
|
+
};
|
|
341
|
+
readonly executionDefaults: {
|
|
342
|
+
readonly onCreate: {
|
|
343
|
+
readonly kind: "generator";
|
|
344
|
+
readonly id: "ksuid";
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
readonly id: true;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
readonly type: {
|
|
353
|
+
readonly sql: {
|
|
354
|
+
readonly String: {
|
|
355
|
+
readonly kind: "typeConstructor";
|
|
356
|
+
readonly args: readonly [{
|
|
357
|
+
readonly kind: "number";
|
|
358
|
+
readonly name: "length";
|
|
359
|
+
readonly integer: true;
|
|
360
|
+
readonly minimum: 1;
|
|
361
|
+
readonly maximum: 10485760;
|
|
362
|
+
}];
|
|
363
|
+
readonly output: {
|
|
364
|
+
readonly codecId: "sql/varchar@1";
|
|
365
|
+
readonly nativeType: "character varying";
|
|
366
|
+
readonly typeParams: {
|
|
367
|
+
readonly length: {
|
|
368
|
+
readonly kind: "arg";
|
|
369
|
+
readonly index: 0;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
readonly entityTypes: import("@prisma/orm-framework/components/authoring").AuthoringEntityTypeNamespace;
|
|
377
|
+
readonly pslBlockDescriptors: {
|
|
378
|
+
readonly enum: {
|
|
379
|
+
readonly kind: "pslBlock";
|
|
380
|
+
readonly keyword: "enum";
|
|
381
|
+
readonly discriminator: "enum";
|
|
382
|
+
readonly name: {
|
|
383
|
+
readonly required: true;
|
|
384
|
+
};
|
|
385
|
+
readonly parameters: {};
|
|
386
|
+
readonly variadicParameters: true;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
create<TTargetId extends string>(stack: ControlStack<'sql', TTargetId>): SqlControlFamilyInstance;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/core/assembly.d.ts
|
|
394
|
+
declare function extractCodecControlHooks(descriptors: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): Map<string, CodecControlHooks>;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/core/control-target-descriptor.d.ts
|
|
397
|
+
/**
|
|
398
|
+
* One stack extension pack's already-assembled contract, paired with the
|
|
399
|
+
* `spaceId` its extension descriptor was registered under. `contract infer`
|
|
400
|
+
* needs both: the contract to know which elements the pack describes and to
|
|
401
|
+
* resolve the domain model a cross-space foreign key targets, the `spaceId`
|
|
402
|
+
* to qualify the emitted relation type (`<spaceId>:<namespace>.<Model>`).
|
|
403
|
+
* Neither the contract JSON nor the framework's `ContractSpace` wrapper
|
|
404
|
+
* self-declares its owning space id — it is only known from the extension
|
|
405
|
+
* descriptor that carries the `ContractSpace`.
|
|
406
|
+
*/
|
|
407
|
+
interface SqlDescribedContractSpace {
|
|
408
|
+
readonly spaceId: string;
|
|
409
|
+
readonly contract: Contract<SqlStorage>;
|
|
410
|
+
}
|
|
411
|
+
interface SqlControlTargetDescriptor<TTargetId extends string, TTargetDetails, TContract extends Contract<SqlStorage> = Contract<SqlStorage>> extends MigratableTargetDescriptor<'sql', TTargetId, SqlControlFamilyInstance> {
|
|
412
|
+
readonly queryOperations?: () => SqlOperationDescriptors;
|
|
413
|
+
/**
|
|
414
|
+
* JSON ⇄ class boundary for the SQL target's contract. The descriptor
|
|
415
|
+
* composes a concrete `SqlContractSerializerBase` subclass; the rest
|
|
416
|
+
* of the control stack reaches `descriptor.contractSerializer` rather
|
|
417
|
+
* than importing a per-target deserialization function.
|
|
418
|
+
*/
|
|
419
|
+
readonly contractSerializer: ContractSerializer<TContract>;
|
|
420
|
+
/**
|
|
421
|
+
* Per-target schema verifier walking the contract against
|
|
422
|
+
* `SqlSchemaIR`. The descriptor composes a concrete
|
|
423
|
+
* `SqlSchemaVerifierBase` subclass; the family-shared walk lives on
|
|
424
|
+
* the base, the target-specific dispatch on the subclass.
|
|
425
|
+
*/
|
|
426
|
+
readonly schemaVerifier: SchemaVerifier<TContract, SqlSchemaIR>;
|
|
427
|
+
/**
|
|
428
|
+
* Database→PSL inference for `contract infer`. Target logic (owns the dialect
|
|
429
|
+
* maps), so it lives on the descriptor. Optional: targets without `contract
|
|
430
|
+
* infer` (Mongo) omit it, and the family instance throws when it is absent.
|
|
431
|
+
* `describedContracts` carries the stack's extension packs' already-assembled
|
|
432
|
+
* contracts (each paired with its `spaceId`) so the inferrer can omit elements
|
|
433
|
+
* they already describe, and can qualify a cross-space relation with the
|
|
434
|
+
* owning pack's space id.
|
|
435
|
+
*/
|
|
436
|
+
readonly inferPslContract?: (schema: SqlSchemaIRNode, describedContracts?: readonly SqlDescribedContractSpace[]) => PslDocumentAst;
|
|
437
|
+
/**
|
|
438
|
+
* The full-tree node diff the family verify verdict derives from —
|
|
439
|
+
* expected-tree derivation, pre-diff normalization, the generic differ,
|
|
440
|
+
* and ownership scoping, all target-side. The family applies strict
|
|
441
|
+
* gating + control-policy disposition over the returned issues; verify
|
|
442
|
+
* rejects when a surviving issue is a failure.
|
|
443
|
+
*/
|
|
444
|
+
readonly diffSchema: SqlSchemaDiffFn;
|
|
445
|
+
/**
|
|
446
|
+
* Classifies a diff-tree node's `nodeKind` into its framework-neutral
|
|
447
|
+
* {@link DiffSubjectGranularity} — the target owns the full node vocabulary
|
|
448
|
+
* that appears in its diff tree (its own kinds plus the relational kinds it
|
|
449
|
+
* delegates to), so it is the one place that can resolve this. The family
|
|
450
|
+
* verdict calls it inline per issue (never stamping the result); the
|
|
451
|
+
* framework aggregate's unclaimed-elements sweep reaches the same
|
|
452
|
+
* classifier via the family instance's `classifySubjectGranularity`
|
|
453
|
+
* capability.
|
|
454
|
+
*/
|
|
455
|
+
readonly classifySubjectGranularity: (nodeKind: string) => DiffSubjectGranularity;
|
|
456
|
+
/**
|
|
457
|
+
* Classifies a diff-tree node's `nodeKind` into its storage `entityKind` —
|
|
458
|
+
* the same vocabulary the contract storage's `entries` dictionary keys use
|
|
459
|
+
* (e.g. `'table'`). Sibling of `classifySubjectGranularity`, resolved the
|
|
460
|
+
* same way: the target owns the full node vocabulary, so it is the one
|
|
461
|
+
* place that can resolve this. `undefined` for a node kind with no
|
|
462
|
+
* storage entity of its own (a column, an index, …). The framework
|
|
463
|
+
* aggregate's unclaimed-elements sweep reaches this via the family
|
|
464
|
+
* instance's `classifyEntityKind` capability, so it never hardcodes a
|
|
465
|
+
* family entity kind.
|
|
466
|
+
*/
|
|
467
|
+
readonly classifyEntityKind: (nodeKind: string) => string | undefined;
|
|
468
|
+
createPlanner(adapter: SqlControlAdapter<TTargetId>): SqlMigrationPlanner<TTargetDetails>;
|
|
469
|
+
createRunner(family: SqlControlFamilyInstance): SqlMigrationRunner<TTargetDetails>;
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/core/migrations/contract-to-schema-ir.d.ts
|
|
473
|
+
/**
|
|
474
|
+
* Target-specific callback that expands a column's base `nativeType` and optional
|
|
475
|
+
* `typeParams` into the fully-qualified type string used by the database
|
|
476
|
+
* (e.g. `character` + `{ length: 36 }` → `character(36)`).
|
|
477
|
+
*
|
|
478
|
+
* This lives in the family layer as a callback rather than importing a concrete
|
|
479
|
+
* implementation because each target (Postgres, MySQL, SQLite, …) has its own
|
|
480
|
+
* parameterization syntax. The target wires its expander when calling
|
|
481
|
+
* `contractToSchemaIR`, keeping the family layer target-agnostic.
|
|
482
|
+
*/
|
|
483
|
+
type NativeTypeExpander = (input: {
|
|
484
|
+
readonly nativeType: string;
|
|
485
|
+
readonly codecId?: string;
|
|
486
|
+
readonly typeParams?: Record<string, unknown>;
|
|
487
|
+
}) => string;
|
|
488
|
+
/**
|
|
489
|
+
* Target-specific callback that renders a `ColumnDefault` into the raw SQL literal
|
|
490
|
+
* string stored in `SqlColumnIR.default`.
|
|
491
|
+
*
|
|
492
|
+
* Default value serialization is target-specific (quoting, casting, type syntax vary
|
|
493
|
+
* between Postgres, MySQL, SQLite, …). This callback follows the same IoC pattern as
|
|
494
|
+
* `NativeTypeExpander`: the target provides its renderer when calling
|
|
495
|
+
* `contractToSchemaIR`, keeping the family layer target-agnostic.
|
|
496
|
+
*/
|
|
497
|
+
type DefaultRenderer = (def: ColumnDefault, column: StorageColumn) => string;
|
|
498
|
+
/**
|
|
499
|
+
* Target-supplied hook (same IoC seam as `NativeTypeExpander`/`DefaultRenderer`)
|
|
500
|
+
* that normalizes a contract-declared `ColumnDefault` into the resolved shape
|
|
501
|
+
* the target's introspection parses from the live database — e.g. a
|
|
502
|
+
* `dbgenerated("'{}'::jsonb")` function call and the literal Postgres reports
|
|
503
|
+
* are the same value in different shapes, and `resolvedDefaultsEqual`
|
|
504
|
+
* compares `kind` before content. When omitted, the contract's raw default
|
|
505
|
+
* is the resolved default unchanged.
|
|
506
|
+
*/
|
|
507
|
+
type DefaultResolver = (def: ColumnDefault, resolvedNativeType: string) => ColumnDefault;
|
|
508
|
+
/**
|
|
509
|
+
* Target-supplied callback that resolves a contract namespace to the live
|
|
510
|
+
* database schema its enums are stored under.
|
|
511
|
+
*
|
|
512
|
+
* The projected enum annotations are nested by schema
|
|
513
|
+
* (`storageTypes[schema][nativeType]`) so two namespaces holding an enum with
|
|
514
|
+
* the same native type resolve to distinct live-database types. Mapping a
|
|
515
|
+
* namespace to its DDL schema is target-specific (Postgres schemas;
|
|
516
|
+
* SQLite/MySQL differ), so the target injects it here rather than the family
|
|
517
|
+
* importing a concrete `ddlSchemaName`. This keeps the family layer
|
|
518
|
+
* target-agnostic while the projection nests under the same schema the
|
|
519
|
+
* target's read side (`readExistingEnumValues`) looks up.
|
|
520
|
+
*/
|
|
521
|
+
type EnumNamespaceSchemaResolver = (storage: SqlStorage, namespaceId: string) => string;
|
|
522
|
+
declare function resolveValueSetValues(ref: {
|
|
523
|
+
readonly namespaceId: string;
|
|
524
|
+
readonly entityName: string;
|
|
525
|
+
}, storage: SqlStorage, contextLabel: string): readonly string[];
|
|
526
|
+
/**
|
|
527
|
+
* Detects destructive changes between two contract storages.
|
|
528
|
+
*
|
|
529
|
+
* The additive-only planner silently ignores removals (tables, columns).
|
|
530
|
+
* This function detects those removals so callers can report them as conflicts
|
|
531
|
+
* rather than silently producing an empty plan.
|
|
532
|
+
*
|
|
533
|
+
* Returns an empty array if no destructive changes are found.
|
|
534
|
+
*/
|
|
535
|
+
declare function detectDestructiveChanges(from: SqlStorage | null, to: SqlStorage): readonly MigrationPlannerConflict[];
|
|
536
|
+
interface ContractToSchemaIROptions {
|
|
537
|
+
readonly annotationNamespace: string;
|
|
538
|
+
readonly expandNativeType?: NativeTypeExpander;
|
|
539
|
+
readonly renderDefault?: DefaultRenderer;
|
|
540
|
+
readonly resolveDefault?: DefaultResolver;
|
|
541
|
+
/**
|
|
542
|
+
* Target-supplied resolver mapping a namespace to the live database schema
|
|
543
|
+
* its enums are stored under. When provided (Postgres), namespace-scoped
|
|
544
|
+
* enums are nested by that schema in `enumTypes` so the projection matches
|
|
545
|
+
* the target's `readExistingEnumValues` lookup. Targets without
|
|
546
|
+
* schema-scoped enum storage (SQLite) omit it; enums are absent there.
|
|
547
|
+
*/
|
|
548
|
+
readonly resolveEnumNamespaceSchema?: EnumNamespaceSchemaResolver;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Converts a `Contract` to `SqlSchemaIR`.
|
|
552
|
+
*
|
|
553
|
+
* Reads `contract.storage` for tables and `contract.storage.types` for type
|
|
554
|
+
* annotations. Storage-type annotations are written under
|
|
555
|
+
* `options.annotationNamespace`.
|
|
556
|
+
*
|
|
557
|
+
* Drops codec metadata (`codecId`, `typeRef`) since the schema IR only represents
|
|
558
|
+
* structural information. When `expandNativeType` is provided, parameterized types
|
|
559
|
+
* are expanded (e.g. `character` + `{ length: 36 }` → `character(36)`) so the
|
|
560
|
+
* resulting IR compares correctly against the "to" contract during planning.
|
|
561
|
+
*
|
|
562
|
+
* Returns an empty schema IR when `contract` is `null` (new project).
|
|
563
|
+
*/
|
|
564
|
+
/**
|
|
565
|
+
* Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by
|
|
566
|
+
* table name within that namespace. Unlike {@link contractToSchemaIR}, which
|
|
567
|
+
* flattens every namespace's tables into one bare-keyed record (and throws on a
|
|
568
|
+
* cross-namespace name collision), this scopes the table iteration to one
|
|
569
|
+
* namespace so the same table name can exist in two schemas.
|
|
570
|
+
*
|
|
571
|
+
* The full `storage` is still passed to `convertTable`, so value-set / enum /
|
|
572
|
+
* type resolution that legitimately spans namespaces is unaffected. Foreign
|
|
573
|
+
* keys are built purely from the FK descriptor (`fk.target`), so cross-namespace
|
|
574
|
+
* FKs survive per-namespace conversion. The `annotations` block (storage-type
|
|
575
|
+
* derived) is omitted here — the per-namespace tree consumer reads only the
|
|
576
|
+
* per-table fields.
|
|
577
|
+
*/
|
|
578
|
+
declare function contractNamespaceToSchemaIR(storage: SqlStorage, namespaceId: string, options: ContractToSchemaIROptions): SqlSchemaIR;
|
|
579
|
+
declare function contractToSchemaIR(contract: Contract<SqlStorage> | null, options: ContractToSchemaIROptions): SqlSchemaIR;
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region src/core/migrations/control-policy.d.ts
|
|
582
|
+
/**
|
|
583
|
+
* The target object a control policy governs for a single planner call,
|
|
584
|
+
* resolved from the target's own IR. `undefined` means the call's target
|
|
585
|
+
* object could not be positively established — a fail-closed signal: any
|
|
586
|
+
* policy stricter than `managed` drops such a call rather than emitting it.
|
|
587
|
+
*
|
|
588
|
+
* The object identity is a generic storage coordinate — `(entityKind,
|
|
589
|
+
* entityName)`, absent for a whole-namespace subject — never a target-specific
|
|
590
|
+
* `table`/`typeName` field. The family reasons about the coordinate for policy
|
|
591
|
+
* and deduplication; the target owns any vocabulary (table vs enum) when it
|
|
592
|
+
* renders a suppression.
|
|
593
|
+
*/
|
|
594
|
+
interface ControlPolicySubject {
|
|
595
|
+
readonly namespaceId: string;
|
|
596
|
+
readonly entityKind?: string;
|
|
597
|
+
readonly entityName?: string;
|
|
598
|
+
readonly column?: string;
|
|
599
|
+
/**
|
|
600
|
+
* Names the RLS policy when the suppressed thing is a policy-level unit
|
|
601
|
+
* on the subject's table (mirrors `column`) — the report must say which
|
|
602
|
+
* policy, not just which table.
|
|
603
|
+
*/
|
|
604
|
+
readonly rlsPolicy?: string;
|
|
605
|
+
readonly explicitNodeControlPolicy?: ControlPolicy;
|
|
606
|
+
/**
|
|
607
|
+
* Whether the call creates a whole, previously-absent top-level storage
|
|
608
|
+
* object (e.g. a table or an enum/type), as opposed to modifying an
|
|
609
|
+
* existing object. This is the only thing `tolerated` permits: it is a
|
|
610
|
+
* create-if-absent policy, so an op that touches an existing object — add
|
|
611
|
+
* column, add index/constraint, alter, drop — is never allowed under it.
|
|
612
|
+
*/
|
|
613
|
+
readonly createsNewObject: boolean;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* The structured record a control-policy partition emits for one suppressed
|
|
617
|
+
* subject or call. It carries only raw data — no strings, no vocabulary — so
|
|
618
|
+
* the consumer (the target) renders the user-facing message itself:
|
|
619
|
+
*
|
|
620
|
+
* - `subject` — the suppressed subject (its coordinate + namespace), or
|
|
621
|
+
* `undefined` when the subject could not be resolved (fail-closed).
|
|
622
|
+
* - `policy` — the effective control policy that caused the suppression.
|
|
623
|
+
* - `factoryName` — the resolved creation factory name if the suppressed thing
|
|
624
|
+
* was a whole-object creation (e.g. `createTable`), else `undefined`. The
|
|
625
|
+
* family never invents a verb for a modification that produced no call.
|
|
626
|
+
* - `createsNewObject` — whether the suppressed thing was object creation.
|
|
627
|
+
*/
|
|
628
|
+
interface SuppressionRecord {
|
|
629
|
+
readonly subject: ControlPolicySubject | undefined;
|
|
630
|
+
readonly policy: ControlPolicy;
|
|
631
|
+
readonly factoryName: string | undefined;
|
|
632
|
+
readonly createsNewObject: boolean;
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* The control policy that governs a single call. The `external` default is an
|
|
636
|
+
* un-overridable namespace floor: when the contract default is `external`, no
|
|
637
|
+
* per-object `managed` override can escalate DDL above the floor, so the
|
|
638
|
+
* policy is forced to `external` regardless of the node's own declaration.
|
|
639
|
+
* Every other default defers to the node's effective control policy.
|
|
640
|
+
*/
|
|
641
|
+
declare function controlPolicyForCall(subject: ControlPolicySubject | undefined, defaultControlPolicy: ControlPolicy | undefined): ControlPolicy;
|
|
642
|
+
/**
|
|
643
|
+
* Partition the calls produced for a single set of subjects into those the
|
|
644
|
+
* effective control policy permits (`kept`) and a list of
|
|
645
|
+
* {@link SuppressionRecord}s describing the suppressed calls.
|
|
646
|
+
*
|
|
647
|
+
* **Prefer {@link partitionIssuesByControlPolicy}** for the schema-issue
|
|
648
|
+
* pipeline: it filters subjects out of the planner's *input* so the planner
|
|
649
|
+
* never has to reason about un-modeled state on `external`/`observed`
|
|
650
|
+
* subjects. This call-level helper remains for paths that bypass the issue
|
|
651
|
+
* pipeline — currently the codec-emitted field-event ops, which originate
|
|
652
|
+
* from declared contract fields rather than from introspected schema state
|
|
653
|
+
* and therefore cannot trip the diff engine.
|
|
654
|
+
*/
|
|
655
|
+
declare function partitionCallsByControlPolicy<TCall>(options: {
|
|
656
|
+
readonly calls: readonly TCall[];
|
|
657
|
+
readonly contract: Contract<SqlStorage>;
|
|
658
|
+
readonly resolveControlPolicySubject: (call: TCall) => ControlPolicySubject | undefined;
|
|
659
|
+
readonly resolveFactoryName: (call: TCall) => string;
|
|
660
|
+
}): {
|
|
661
|
+
readonly kept: readonly TCall[];
|
|
662
|
+
readonly suppressions: readonly SuppressionRecord[];
|
|
663
|
+
};
|
|
664
|
+
/**
|
|
665
|
+
* Partition a list of schema-issue-shaped inputs by the effective control
|
|
666
|
+
* policy of each issue's subject *before* the planner is invoked.
|
|
667
|
+
*
|
|
668
|
+
* `plannable` is the list of issues whose subject's effective policy permits
|
|
669
|
+
* the planner to act on them (`managed`, or `tolerated` for whole-object
|
|
670
|
+
* creation issues only). Issues for `external`/`observed` subjects, and
|
|
671
|
+
* non-creation issues for `tolerated` subjects, are dropped from the planner's
|
|
672
|
+
* input entirely — they never enter introspection-driven planning, never feed
|
|
673
|
+
* the diff engine, and never produce DDL calls that would have to be
|
|
674
|
+
* post-filtered. This sidesteps a class of failure where the diff engine
|
|
675
|
+
* cannot reason about the live shape of a subject the user marked as
|
|
676
|
+
* out-of-scope (`external`).
|
|
677
|
+
*
|
|
678
|
+
* `suppressions` is one {@link SuppressionRecord} per suppressed subject (not
|
|
679
|
+
* per suppressed issue). Its `factoryName` is the creation factory name when any
|
|
680
|
+
* of the subject's issues is whole-object creation (e.g. `createTable`), else
|
|
681
|
+
* `undefined` — the family never invents a modification verb for an op that
|
|
682
|
+
* produced no call; the target renders the message.
|
|
683
|
+
*
|
|
684
|
+
* Unresolved-subject issues (`resolveControlPolicySubject` returns
|
|
685
|
+
* `undefined`) emit one record each; they cannot be deduplicated because they
|
|
686
|
+
* carry no subject coordinate.
|
|
687
|
+
*/
|
|
688
|
+
declare function partitionIssuesByControlPolicy<TIssue>(options: {
|
|
689
|
+
readonly issues: readonly TIssue[];
|
|
690
|
+
readonly contract: Contract<SqlStorage>;
|
|
691
|
+
/**
|
|
692
|
+
* Resolve the subject targeted by this issue (or `undefined` to fail-closed:
|
|
693
|
+
* any policy stricter than `managed` drops the issue).
|
|
694
|
+
*/
|
|
695
|
+
readonly resolveControlPolicySubject: (issue: TIssue) => ControlPolicySubject | undefined;
|
|
696
|
+
/**
|
|
697
|
+
* Resolve a creation factoryName for this issue if it represents the
|
|
698
|
+
* absence of the whole top-level object (e.g. `'createTable'` for a
|
|
699
|
+
* missing-table issue). When the issue describes a modification to an
|
|
700
|
+
* existing object, return `undefined`. Both decisions feed off this signal:
|
|
701
|
+
*
|
|
702
|
+
* 1. Under `tolerated`, only issues whose `resolveCreationFactoryName`
|
|
703
|
+
* returns a value flow into the planner (create-if-absent).
|
|
704
|
+
* 2. A suppressed subject's record carries the resolved creation factoryName
|
|
705
|
+
* when it has at least one creation-flavoured issue, else `undefined`.
|
|
706
|
+
*/
|
|
707
|
+
readonly resolveCreationFactoryName: (issue: TIssue) => string | undefined;
|
|
708
|
+
}): {
|
|
709
|
+
readonly plannable: readonly TIssue[];
|
|
710
|
+
readonly suppressions: readonly SuppressionRecord[];
|
|
711
|
+
};
|
|
712
|
+
//#endregion
|
|
713
|
+
//#region src/core/migrations/field-event-planner.d.ts
|
|
714
|
+
interface PlanFieldEventOperationsOptions {
|
|
715
|
+
/**
|
|
716
|
+
* Prior contract the planner is diffing against. `null` for first emits
|
|
717
|
+
* (every field is treated as added).
|
|
718
|
+
*/
|
|
719
|
+
readonly priorContract: Contract<SqlStorage> | null;
|
|
720
|
+
/**
|
|
721
|
+
* New contract the user just authored.
|
|
722
|
+
*/
|
|
723
|
+
readonly newContract: Contract<SqlStorage>;
|
|
724
|
+
/**
|
|
725
|
+
* Codec-id keyed map of control hooks, as produced by
|
|
726
|
+
* {@link import('./assembly').extractCodecControlHooks}. Hooks carry
|
|
727
|
+
* `unknown` target details after extraction; the caller casts the
|
|
728
|
+
* helper's returned ops to its target's `SqlMigrationPlanOperation`
|
|
729
|
+
* specialisation at the integration boundary, mirroring how
|
|
730
|
+
* `storageTypePlanCallStrategy` lifts `planTypeOperations` results into
|
|
731
|
+
* `RawSqlCall`.
|
|
732
|
+
*/
|
|
733
|
+
readonly codecHooks: ReadonlyMap<string, CodecControlHooks>;
|
|
734
|
+
}
|
|
735
|
+
declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/core/migrations/native-type-expander.d.ts
|
|
738
|
+
/**
|
|
739
|
+
* Builds the codec-hook-composed `expandNativeType` callback the contract→IR
|
|
740
|
+
* derivation uses to expand parameterized native types (e.g. `character` +
|
|
741
|
+
* `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework
|
|
742
|
+
* components are supplied, so callers can omit the option entirely.
|
|
743
|
+
*/
|
|
744
|
+
declare function buildNativeTypeExpander(frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>): ((input: {
|
|
745
|
+
readonly nativeType: string;
|
|
746
|
+
readonly codecId?: string;
|
|
747
|
+
readonly typeParams?: Record<string, unknown>;
|
|
748
|
+
}) => string) | undefined;
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/core/migrations/plan-helpers.d.ts
|
|
751
|
+
declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
|
|
752
|
+
declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>, warnings?: readonly SqlPlannerConflict[]): SqlPlannerSuccessResult<TTargetDetails>;
|
|
753
|
+
declare function plannerFailure(conflicts: readonly SqlPlannerConflict[]): SqlPlannerFailureResult;
|
|
754
|
+
/**
|
|
755
|
+
* Creates a successful migration runner result.
|
|
756
|
+
*/
|
|
757
|
+
declare function runnerSuccess(value: {
|
|
758
|
+
operationsPlanned: number;
|
|
759
|
+
operationsExecuted: number;
|
|
760
|
+
}): Ok<SqlMigrationRunnerSuccessValue>;
|
|
761
|
+
/**
|
|
762
|
+
* Creates a failed migration runner result.
|
|
763
|
+
*/
|
|
764
|
+
declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: string, options?: {
|
|
765
|
+
why?: string;
|
|
766
|
+
meta?: AnyRecord;
|
|
767
|
+
}): NotOk<SqlMigrationRunnerFailure>;
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/core/migrations/policies.d.ts
|
|
770
|
+
/**
|
|
771
|
+
* Policy used by `db init`: additive-only operations, no widening/destructive steps.
|
|
772
|
+
*/
|
|
773
|
+
declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy;
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region src/core/timestamp-now-generator.d.ts
|
|
776
|
+
/**
|
|
777
|
+
* Builds the canonical control-plane descriptor for the wall-clock-now
|
|
778
|
+
* mutation default generator. The descriptor's `id` and `buildPhases`
|
|
779
|
+
* are target-agnostic so PSL `temporal.updatedAt()` and TS
|
|
780
|
+
* `field.temporal.updatedAt()` lower to byte-identical contracts.
|
|
781
|
+
*
|
|
782
|
+
* `applicableCodecIds` is omitted: `timestampNow` is preset-only (not
|
|
783
|
+
* reachable via `@default(timestampNow())` lowering), and the codec is
|
|
784
|
+
* co-registered by the preset descriptor itself, so the
|
|
785
|
+
* `@default(...)` compatibility check has no role to play here.
|
|
786
|
+
*/
|
|
787
|
+
declare function timestampNowControlDescriptor(): MutationDefaultGeneratorDescriptor;
|
|
788
|
+
/**
|
|
789
|
+
* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair
|
|
790
|
+
* for a SQL target. `createdAt` lowers to a `now()` storage default;
|
|
791
|
+
* `updatedAt` lowers to the `timestampNow` execution generator on both
|
|
792
|
+
* `onCreate` and `onUpdate` (RD: "last modified time", non-null). Targets
|
|
793
|
+
* supply the codec/native-type pair that matches their timestamp column;
|
|
794
|
+
* everything else is shared so PSL `temporal.updatedAt()` and TS
|
|
795
|
+
* `field.temporal.updatedAt()` lower to byte-identical contracts across
|
|
796
|
+
* targets by construction.
|
|
797
|
+
*/
|
|
798
|
+
declare function temporalAuthoringPresets<const CodecId extends string, const NativeType extends string>(input: {
|
|
799
|
+
readonly codecId: CodecId;
|
|
800
|
+
readonly nativeType: NativeType;
|
|
801
|
+
}): {
|
|
802
|
+
readonly createdAt: {
|
|
803
|
+
readonly kind: "fieldPreset";
|
|
804
|
+
readonly output: {
|
|
805
|
+
readonly codecId: CodecId;
|
|
806
|
+
readonly nativeType: NativeType;
|
|
807
|
+
readonly default: {
|
|
808
|
+
readonly kind: "function";
|
|
809
|
+
readonly expression: "now()";
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
readonly updatedAt: {
|
|
814
|
+
readonly kind: "fieldPreset";
|
|
815
|
+
readonly output: {
|
|
816
|
+
readonly codecId: CodecId;
|
|
817
|
+
readonly nativeType: NativeType;
|
|
818
|
+
readonly executionDefaults: {
|
|
819
|
+
readonly onCreate: {
|
|
820
|
+
readonly kind: "generator";
|
|
821
|
+
readonly id: "timestampNow";
|
|
822
|
+
};
|
|
823
|
+
readonly onUpdate: {
|
|
824
|
+
readonly kind: "generator";
|
|
825
|
+
readonly id: "timestampNow";
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Builds a `temporal.<codec>` field preset for a codec that takes a precision
|
|
833
|
+
* parameter (`pg/timestamp@1`, `pg/timestamptz@1`). Arguments change field
|
|
834
|
+
* properties only — never the codec, which the caller fixes here.
|
|
835
|
+
*
|
|
836
|
+
* All three arguments are optional: omitting `precision` omits `typeParams`
|
|
837
|
+
* entirely, and omitting a phase omits that phase (both omitted omits
|
|
838
|
+
* `executionDefaults`).
|
|
839
|
+
*/
|
|
840
|
+
declare function temporalCodecPresetWithPrecision<const CodecId extends string, const NativeType extends string>(input: {
|
|
841
|
+
readonly codecId: CodecId;
|
|
842
|
+
readonly nativeType: NativeType;
|
|
843
|
+
}): {
|
|
844
|
+
readonly kind: "fieldPreset";
|
|
845
|
+
readonly args: readonly [{
|
|
846
|
+
readonly name: "precision";
|
|
847
|
+
readonly kind: "number";
|
|
848
|
+
readonly optional: true;
|
|
849
|
+
readonly integer: true;
|
|
850
|
+
readonly minimum: 0;
|
|
851
|
+
}, {
|
|
852
|
+
readonly name: "onCreate";
|
|
853
|
+
readonly kind: "option";
|
|
854
|
+
readonly values: readonly ["now"];
|
|
855
|
+
readonly optional: true;
|
|
856
|
+
}, {
|
|
857
|
+
readonly name: "onUpdate";
|
|
858
|
+
readonly kind: "option";
|
|
859
|
+
readonly values: readonly ["now"];
|
|
860
|
+
readonly optional: true;
|
|
861
|
+
}];
|
|
862
|
+
readonly output: {
|
|
863
|
+
readonly codecId: CodecId;
|
|
864
|
+
readonly nativeType: NativeType;
|
|
865
|
+
readonly typeParams: {
|
|
866
|
+
readonly precision: {
|
|
867
|
+
readonly kind: "arg";
|
|
868
|
+
readonly index: 0;
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
readonly executionDefaults: {
|
|
872
|
+
readonly onCreate: {
|
|
873
|
+
readonly kind: "select";
|
|
874
|
+
readonly index: 1;
|
|
875
|
+
readonly cases: {
|
|
876
|
+
readonly now: {
|
|
877
|
+
readonly kind: "generator";
|
|
878
|
+
readonly id: "timestampNow";
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
readonly onUpdate: {
|
|
883
|
+
readonly kind: "select";
|
|
884
|
+
readonly index: 2;
|
|
885
|
+
readonly cases: {
|
|
886
|
+
readonly now: {
|
|
887
|
+
readonly kind: "generator";
|
|
888
|
+
readonly id: "timestampNow";
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* Builds a `temporal.<codec>` field preset for a codec with no type
|
|
897
|
+
* parameters (`sqlite/datetime@1`). As with the precision-bearing variant,
|
|
898
|
+
* both phase arguments are optional and omitting one omits that phase.
|
|
899
|
+
*/
|
|
900
|
+
declare function temporalCodecPreset<const CodecId extends string, const NativeType extends string>(input: {
|
|
901
|
+
readonly codecId: CodecId;
|
|
902
|
+
readonly nativeType: NativeType;
|
|
903
|
+
}): {
|
|
904
|
+
readonly kind: "fieldPreset";
|
|
905
|
+
readonly args: readonly [{
|
|
906
|
+
readonly name: "onCreate";
|
|
907
|
+
readonly kind: "option";
|
|
908
|
+
readonly values: readonly ["now"];
|
|
909
|
+
readonly optional: true;
|
|
910
|
+
}, {
|
|
911
|
+
readonly name: "onUpdate";
|
|
912
|
+
readonly kind: "option";
|
|
913
|
+
readonly values: readonly ["now"];
|
|
914
|
+
readonly optional: true;
|
|
915
|
+
}];
|
|
916
|
+
readonly output: {
|
|
917
|
+
readonly codecId: CodecId;
|
|
918
|
+
readonly nativeType: NativeType;
|
|
919
|
+
readonly executionDefaults: {
|
|
920
|
+
readonly onCreate: {
|
|
921
|
+
readonly kind: "select";
|
|
922
|
+
readonly index: 0;
|
|
923
|
+
readonly cases: {
|
|
924
|
+
readonly now: {
|
|
925
|
+
readonly kind: "generator";
|
|
926
|
+
readonly id: "timestampNow";
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
readonly onUpdate: {
|
|
931
|
+
readonly kind: "select";
|
|
932
|
+
readonly index: 1;
|
|
933
|
+
readonly cases: {
|
|
934
|
+
readonly now: {
|
|
935
|
+
readonly kind: "generator";
|
|
936
|
+
readonly id: "timestampNow";
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/exports/control.d.ts
|
|
945
|
+
declare const _default: SqlFamilyDescriptor;
|
|
946
|
+
//#endregion
|
|
947
|
+
export { partitionCallsByControlPolicy as A, temporalCodecPresetWithPrecision as B, buildNativeTypeExpander as C, createMigrationPlan as D, controlPolicyForCall as E, resolveValueSetValues as F, runnerFailure as I, runnerSuccess as L, planFieldEventOperations as M, plannerFailure as N, detectDestructiveChanges as O, plannerSuccess as P, temporalAuthoringPresets as R, assembleAuthoringContributions as S, contractToSchemaIR as T, timestampNowControlDescriptor as V, SqlControlTargetDescriptor as _, EnumNamespaceSchemaResolver as a, TargetMigrationsCapability as b, MigrationOperationPolicy$1 as c, MigrationPlanner as d, MigrationPlannerConflict$1 as f, SqlControlFamilyInstance as g, PlanFieldEventOperationsOptions as h, DefaultResolver as i, partitionIssuesByControlPolicy as j, extractCodecControlHooks as k, MigrationPlan$1 as l, NativeTypeExpander as m, ControlPolicySubject as n, INIT_ADDITIVE_POLICY as o, MigrationPlannerResult as p, DefaultRenderer as r, MigrationOperationClass as s, ContractToSchemaIROptions as t, MigrationPlanOperation$1 as u, SqlDescribedContractSpace as v, contractNamespaceToSchemaIR as w, _default as x, SuppressionRecord as y, temporalCodecPreset as z };
|
|
948
|
+
//# sourceMappingURL=control-BHmsZudH.d.mts.map
|