@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,153 @@
|
|
|
1
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
|
+
import { isColumnDefaultLiteralInputValue } from "@prisma/orm-framework/contract/types";
|
|
3
|
+
//#region ../../../2-sql/4-lanes/relational-core/dist/ddl-types-BMp2bWVS.mjs
|
|
4
|
+
var DdlColumnDefault = class {
|
|
5
|
+
freeze() {
|
|
6
|
+
Object.freeze(this);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
var LiteralColumnDefault = class extends DdlColumnDefault {
|
|
10
|
+
kind = "literal";
|
|
11
|
+
value;
|
|
12
|
+
constructor(value) {
|
|
13
|
+
super();
|
|
14
|
+
if (!isColumnDefaultLiteralInputValue(value)) throw structuredError("CONTRACT.DEFAULT_INVALID", "Invalid column default literal value");
|
|
15
|
+
this.value = value;
|
|
16
|
+
this.freeze();
|
|
17
|
+
}
|
|
18
|
+
accept(visitor, ctx) {
|
|
19
|
+
return visitor.literal(this, ctx);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var FunctionColumnDefault = class extends DdlColumnDefault {
|
|
23
|
+
kind = "function";
|
|
24
|
+
expression;
|
|
25
|
+
constructor(expression) {
|
|
26
|
+
super();
|
|
27
|
+
this.expression = expression;
|
|
28
|
+
this.freeze();
|
|
29
|
+
}
|
|
30
|
+
accept(visitor, ctx) {
|
|
31
|
+
return visitor.function(this, ctx);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var DdlColumn = class {
|
|
35
|
+
name;
|
|
36
|
+
type;
|
|
37
|
+
notNull;
|
|
38
|
+
primaryKey;
|
|
39
|
+
default;
|
|
40
|
+
/** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */
|
|
41
|
+
codecRef;
|
|
42
|
+
constructor(options) {
|
|
43
|
+
this.name = options.name;
|
|
44
|
+
this.type = options.type;
|
|
45
|
+
this.notNull = options.notNull;
|
|
46
|
+
this.primaryKey = options.primaryKey;
|
|
47
|
+
this.default = options.default;
|
|
48
|
+
this.codecRef = options.codecRef;
|
|
49
|
+
Object.freeze(this);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var DdlNode = class {
|
|
53
|
+
/**
|
|
54
|
+
* Structural brand: every DDL node answers `true`. Lets {@link isDdlNode}
|
|
55
|
+
* recognise any `DdlNode` subclass — including target-contributed kinds —
|
|
56
|
+
* without a central kind registry that subclasses would have to register
|
|
57
|
+
* into.
|
|
58
|
+
*/
|
|
59
|
+
isDdlNode() {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
freeze() {
|
|
63
|
+
Object.freeze(this);
|
|
64
|
+
}
|
|
65
|
+
collectParamRefs() {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
function isDdlNode(value) {
|
|
70
|
+
return typeof value === "object" && value !== null && "isDdlNode" in value && typeof value.isDdlNode === "function";
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A composite (or single-column) PRIMARY KEY constraint on a `CreateTable`
|
|
74
|
+
* node. When `name` is set, the adapter renders `CONSTRAINT <name> PRIMARY KEY
|
|
75
|
+
* (…)`; otherwise it renders an anonymous `PRIMARY KEY (…)`.
|
|
76
|
+
*
|
|
77
|
+
* Frozen on construction — immutable after creation.
|
|
78
|
+
*/
|
|
79
|
+
var PrimaryKeyConstraint = class {
|
|
80
|
+
kind = "primary-key";
|
|
81
|
+
columns;
|
|
82
|
+
name;
|
|
83
|
+
constructor(options) {
|
|
84
|
+
this.columns = Object.freeze([...options.columns]);
|
|
85
|
+
this.name = options.name;
|
|
86
|
+
Object.freeze(this);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* A FOREIGN KEY constraint on a `CreateTable` node. `onDelete` and `onUpdate`
|
|
91
|
+
* use the same `ReferentialAction` vocabulary already used by the migration
|
|
92
|
+
* planner and the contract IR — no parallel string enum.
|
|
93
|
+
*
|
|
94
|
+
* Frozen on construction — immutable after creation.
|
|
95
|
+
*/
|
|
96
|
+
var ForeignKeyConstraint = class {
|
|
97
|
+
kind = "foreign-key";
|
|
98
|
+
columns;
|
|
99
|
+
refTable;
|
|
100
|
+
refColumns;
|
|
101
|
+
onDelete;
|
|
102
|
+
onUpdate;
|
|
103
|
+
name;
|
|
104
|
+
constructor(options) {
|
|
105
|
+
this.columns = Object.freeze([...options.columns]);
|
|
106
|
+
this.refTable = options.refTable;
|
|
107
|
+
this.refColumns = Object.freeze([...options.refColumns]);
|
|
108
|
+
this.onDelete = options.onDelete;
|
|
109
|
+
this.onUpdate = options.onUpdate;
|
|
110
|
+
this.name = options.name;
|
|
111
|
+
Object.freeze(this);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* A table-level UNIQUE constraint on a `CreateTable` node. When `name` is
|
|
116
|
+
* set, the adapter renders `CONSTRAINT <name> UNIQUE (…)`; otherwise it
|
|
117
|
+
* renders an anonymous `UNIQUE (…)`.
|
|
118
|
+
*
|
|
119
|
+
* Frozen on construction — immutable after creation.
|
|
120
|
+
*/
|
|
121
|
+
var UniqueConstraint = class {
|
|
122
|
+
kind = "unique";
|
|
123
|
+
columns;
|
|
124
|
+
name;
|
|
125
|
+
constructor(options) {
|
|
126
|
+
this.columns = Object.freeze([...options.columns]);
|
|
127
|
+
this.name = options.name;
|
|
128
|
+
Object.freeze(this);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* A table-level CHECK constraint carrying a raw SQL predicate expression. Used
|
|
133
|
+
* for checks that are not enum value-set restrictions — e.g. the element-non-null
|
|
134
|
+
* constraint on a scalar-array column (`array_position(col, NULL) IS NULL`).
|
|
135
|
+
* The `expression` is emitted verbatim, so callers must supply safe,
|
|
136
|
+
* pre-validated SQL.
|
|
137
|
+
*
|
|
138
|
+
* Frozen on construction — immutable after creation.
|
|
139
|
+
*/
|
|
140
|
+
var CheckExpressionConstraint = class {
|
|
141
|
+
kind = "check-expression";
|
|
142
|
+
name;
|
|
143
|
+
expression;
|
|
144
|
+
constructor(options) {
|
|
145
|
+
this.name = options.name;
|
|
146
|
+
this.expression = options.expression;
|
|
147
|
+
Object.freeze(this);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
export { ForeignKeyConstraint as a, PrimaryKeyConstraint as c, DdlNode as i, UniqueConstraint as l, DdlColumn as n, FunctionColumnDefault as o, DdlColumnDefault as r, LiteralColumnDefault as s, CheckExpressionConstraint as t, isDdlNode as u };
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=ddl-types-BMp2bWVS-D1waZJ4n.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddl-types-BMp2bWVS-D1waZJ4n.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/ddl-types-BMp2bWVS.mjs"],"sourcesContent":["import { isColumnDefaultLiteralInputValue } from \"@internal/contract/types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/ast/ddl-types.ts\nvar DdlColumnDefault = class {\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar LiteralColumnDefault = class extends DdlColumnDefault {\n\tkind = \"literal\";\n\tvalue;\n\tconstructor(value) {\n\t\tsuper();\n\t\tif (!isColumnDefaultLiteralInputValue(value)) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", \"Invalid column default literal value\");\n\t\tthis.value = value;\n\t\tthis.freeze();\n\t}\n\taccept(visitor, ctx) {\n\t\treturn visitor.literal(this, ctx);\n\t}\n};\nvar FunctionColumnDefault = class extends DdlColumnDefault {\n\tkind = \"function\";\n\texpression;\n\tconstructor(expression) {\n\t\tsuper();\n\t\tthis.expression = expression;\n\t\tthis.freeze();\n\t}\n\taccept(visitor, ctx) {\n\t\treturn visitor.function(this, ctx);\n\t}\n};\nvar DdlColumn = class {\n\tname;\n\ttype;\n\tnotNull;\n\tprimaryKey;\n\tdefault;\n\t/** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */\n\tcodecRef;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.type = options.type;\n\t\tthis.notNull = options.notNull;\n\t\tthis.primaryKey = options.primaryKey;\n\t\tthis.default = options.default;\n\t\tthis.codecRef = options.codecRef;\n\t\tObject.freeze(this);\n\t}\n};\nvar DdlNode = class {\n\t/**\n\t* Structural brand: every DDL node answers `true`. Lets {@link isDdlNode}\n\t* recognise any `DdlNode` subclass — including target-contributed kinds —\n\t* without a central kind registry that subclasses would have to register\n\t* into.\n\t*/\n\tisDdlNode() {\n\t\treturn true;\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n\tcollectParamRefs() {\n\t\treturn [];\n\t}\n};\nfunction isDdlNode(value) {\n\treturn typeof value === \"object\" && value !== null && \"isDdlNode\" in value && typeof value.isDdlNode === \"function\";\n}\n/**\n* A composite (or single-column) PRIMARY KEY constraint on a `CreateTable`\n* node. When `name` is set, the adapter renders `CONSTRAINT <name> PRIMARY KEY\n* (…)`; otherwise it renders an anonymous `PRIMARY KEY (…)`.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar PrimaryKeyConstraint = class {\n\tkind = \"primary-key\";\n\tcolumns;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A FOREIGN KEY constraint on a `CreateTable` node. `onDelete` and `onUpdate`\n* use the same `ReferentialAction` vocabulary already used by the migration\n* planner and the contract IR — no parallel string enum.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar ForeignKeyConstraint = class {\n\tkind = \"foreign-key\";\n\tcolumns;\n\trefTable;\n\trefColumns;\n\tonDelete;\n\tonUpdate;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.refTable = options.refTable;\n\t\tthis.refColumns = Object.freeze([...options.refColumns]);\n\t\tthis.onDelete = options.onDelete;\n\t\tthis.onUpdate = options.onUpdate;\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A table-level UNIQUE constraint on a `CreateTable` node. When `name` is\n* set, the adapter renders `CONSTRAINT <name> UNIQUE (…)`; otherwise it\n* renders an anonymous `UNIQUE (…)`.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar UniqueConstraint = class {\n\tkind = \"unique\";\n\tcolumns;\n\tname;\n\tconstructor(options) {\n\t\tthis.columns = Object.freeze([...options.columns]);\n\t\tthis.name = options.name;\n\t\tObject.freeze(this);\n\t}\n};\n/**\n* A table-level CHECK constraint carrying a raw SQL predicate expression. Used\n* for checks that are not enum value-set restrictions — e.g. the element-non-null\n* constraint on a scalar-array column (`array_position(col, NULL) IS NULL`).\n* The `expression` is emitted verbatim, so callers must supply safe,\n* pre-validated SQL.\n*\n* Frozen on construction — immutable after creation.\n*/\nvar CheckExpressionConstraint = class {\n\tkind = \"check-expression\";\n\tname;\n\texpression;\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.expression = options.expression;\n\t\tObject.freeze(this);\n\t}\n};\n//#endregion\nexport { ForeignKeyConstraint as a, PrimaryKeyConstraint as c, DdlNode as i, UniqueConstraint as l, DdlColumn as n, FunctionColumnDefault as o, DdlColumnDefault as r, LiteralColumnDefault as s, CheckExpressionConstraint as t, isDdlNode as u };\n\n//# sourceMappingURL=ddl-types-BMp2bWVS.mjs.map"],"mappings":";;;AAGA,IAAI,mBAAmB,MAAM;CAC5B,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,uBAAuB,cAAc,iBAAiB;CACzD,OAAO;CACP;CACA,YAAY,OAAO;EAClB,MAAM;EACN,IAAI,CAAC,iCAAiC,KAAK,GAAG,MAAM,gBAAgB,4BAA4B,sCAAsC;EACtI,KAAK,QAAQ;EACb,KAAK,OAAO;CACb;CACA,OAAO,SAAS,KAAK;EACpB,OAAO,QAAQ,QAAQ,MAAM,GAAG;CACjC;AACD;AACA,IAAI,wBAAwB,cAAc,iBAAiB;CAC1D,OAAO;CACP;CACA,YAAY,YAAY;EACvB,MAAM;EACN,KAAK,aAAa;EAClB,KAAK,OAAO;CACb;CACA,OAAO,SAAS,KAAK;EACpB,OAAO,QAAQ,SAAS,MAAM,GAAG;CAClC;AACD;AACA,IAAI,YAAY,MAAM;CACrB;CACA;CACA;CACA;CACA;;CAEA;CACA,YAAY,SAAS;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,UAAU,QAAQ;EACvB,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,QAAQ;EACvB,KAAK,WAAW,QAAQ;EACxB,OAAO,OAAO,IAAI;CACnB;AACD;AACA,IAAI,UAAU,MAAM;;;;;;;CAOnB,YAAY;EACX,OAAO;CACR;CACA,SAAS;EACR,OAAO,OAAO,IAAI;CACnB;CACA,mBAAmB;EAClB,OAAO,CAAC;CACT;AACD;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,SAAS,OAAO,MAAM,cAAc;AAC1G;;;;;;;;AAQA,IAAI,uBAAuB,MAAM;CAChC,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;AAQA,IAAI,uBAAuB,MAAM;CAChC,OAAO;CACP;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,WAAW,QAAQ;EACxB,KAAK,aAAa,OAAO,OAAO,CAAC,GAAG,QAAQ,UAAU,CAAC;EACvD,KAAK,WAAW,QAAQ;EACxB,KAAK,WAAW,QAAQ;EACxB,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;AAQA,IAAI,mBAAmB,MAAM;CAC5B,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU,OAAO,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC;EACjD,KAAK,OAAO,QAAQ;EACpB,OAAO,OAAO,IAAI;CACnB;AACD;;;;;;;;;;AAUA,IAAI,4BAA4B,MAAM;CACrC,OAAO;CACP;CACA;CACA,YAAY,SAAS;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,aAAa,QAAQ;EAC1B,OAAO,OAAO,IAAI;CACnB;AACD"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { a as CodecRef$1 } from "./codec-types-MOaceoPi-C5eL2sao.mjs";
|
|
2
|
+
import { a as ReferentialAction } from "./foreign-key-BSy9u4O4-BnsOe5Nf.mjs";
|
|
3
|
+
import "./types-BchwQpmO.mjs";
|
|
4
|
+
import { f as AnyParamRef } from "./types-DIBA80mc-wf5wLmON.mjs";
|
|
5
|
+
import { ColumnDefaultLiteralInputValue } from "@prisma/orm-framework/contract/types";
|
|
6
|
+
//#region ../../../2-sql/4-lanes/relational-core/dist/ddl-types-rrMsf77U.d.mts
|
|
7
|
+
//#region src/ast/ddl-types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Render-time context the column-default visitor needs to make dialect
|
|
10
|
+
* decisions that depend on the parent column. Today only the parent
|
|
11
|
+
* column's native type (`"jsonb"`, `"text"`, …) — the Postgres renderer
|
|
12
|
+
* uses it to decide whether to emit a `::jsonb` / `::json` cast on JSON
|
|
13
|
+
* literal defaults so the emitted DDL matches the column type without
|
|
14
|
+
* relying on Postgres's implicit text → jsonb cast at default-evaluation
|
|
15
|
+
* time. Additional fields can join without re-shaping the interface.
|
|
16
|
+
*/
|
|
17
|
+
interface DdlColumnRenderContext {
|
|
18
|
+
readonly nativeType: string;
|
|
19
|
+
}
|
|
20
|
+
interface DdlColumnDefaultVisitor<R> {
|
|
21
|
+
literal(node: LiteralColumnDefault, ctx: DdlColumnRenderContext): R;
|
|
22
|
+
function(node: FunctionColumnDefault, ctx: DdlColumnRenderContext): R;
|
|
23
|
+
}
|
|
24
|
+
declare abstract class DdlColumnDefault {
|
|
25
|
+
abstract readonly kind: string;
|
|
26
|
+
abstract accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R;
|
|
27
|
+
protected freeze(): void;
|
|
28
|
+
}
|
|
29
|
+
declare class LiteralColumnDefault extends DdlColumnDefault {
|
|
30
|
+
readonly kind: "literal";
|
|
31
|
+
readonly value: ColumnDefaultLiteralInputValue;
|
|
32
|
+
constructor(value: ColumnDefaultLiteralInputValue);
|
|
33
|
+
accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R;
|
|
34
|
+
}
|
|
35
|
+
declare class FunctionColumnDefault extends DdlColumnDefault {
|
|
36
|
+
readonly kind: "function";
|
|
37
|
+
readonly expression: string;
|
|
38
|
+
constructor(expression: string);
|
|
39
|
+
accept<R>(visitor: DdlColumnDefaultVisitor<R>, ctx: DdlColumnRenderContext): R;
|
|
40
|
+
}
|
|
41
|
+
type AnyDdlColumnDefault = LiteralColumnDefault | FunctionColumnDefault;
|
|
42
|
+
declare class DdlColumn {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly type: string;
|
|
45
|
+
readonly notNull?: boolean | undefined;
|
|
46
|
+
readonly primaryKey?: boolean | undefined;
|
|
47
|
+
readonly default?: AnyDdlColumnDefault | undefined;
|
|
48
|
+
/** Codec identity for this column. When present, the DDL walker resolves the codec via `codecLookup.get(codecRef.codecId)` and calls `codec.encode(default.value, {})` to obtain the wire value before inlining the literal default into the DDL string. When absent, literal defaults follow RawSqlLiteral wire-scalar semantics (string / number / boolean / bigint / null / Uint8Array / Date inlined directly). */
|
|
49
|
+
readonly codecRef?: CodecRef$1 | undefined;
|
|
50
|
+
constructor(options: {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
readonly type: string;
|
|
53
|
+
readonly notNull?: boolean;
|
|
54
|
+
readonly primaryKey?: boolean;
|
|
55
|
+
readonly default?: AnyDdlColumnDefault;
|
|
56
|
+
readonly codecRef?: CodecRef$1;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
declare abstract class DdlNode {
|
|
60
|
+
abstract readonly kind: string;
|
|
61
|
+
/**
|
|
62
|
+
* Structural brand: every DDL node answers `true`. Lets {@link isDdlNode}
|
|
63
|
+
* recognise any `DdlNode` subclass — including target-contributed kinds —
|
|
64
|
+
* without a central kind registry that subclasses would have to register
|
|
65
|
+
* into.
|
|
66
|
+
*/
|
|
67
|
+
isDdlNode(): true;
|
|
68
|
+
protected freeze(): void;
|
|
69
|
+
collectParamRefs(): AnyParamRef[];
|
|
70
|
+
}
|
|
71
|
+
declare function isDdlNode(value: unknown): value is DdlNode;
|
|
72
|
+
/**
|
|
73
|
+
* A composite (or single-column) PRIMARY KEY constraint on a `CreateTable`
|
|
74
|
+
* node. When `name` is set, the adapter renders `CONSTRAINT <name> PRIMARY KEY
|
|
75
|
+
* (…)`; otherwise it renders an anonymous `PRIMARY KEY (…)`.
|
|
76
|
+
*
|
|
77
|
+
* Frozen on construction — immutable after creation.
|
|
78
|
+
*/
|
|
79
|
+
declare class PrimaryKeyConstraint {
|
|
80
|
+
readonly kind: "primary-key";
|
|
81
|
+
readonly columns: ReadonlyArray<string>;
|
|
82
|
+
readonly name: string | undefined;
|
|
83
|
+
constructor(options: {
|
|
84
|
+
readonly columns: readonly string[];
|
|
85
|
+
readonly name?: string;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A FOREIGN KEY constraint on a `CreateTable` node. `onDelete` and `onUpdate`
|
|
90
|
+
* use the same `ReferentialAction` vocabulary already used by the migration
|
|
91
|
+
* planner and the contract IR — no parallel string enum.
|
|
92
|
+
*
|
|
93
|
+
* Frozen on construction — immutable after creation.
|
|
94
|
+
*/
|
|
95
|
+
declare class ForeignKeyConstraint {
|
|
96
|
+
readonly kind: "foreign-key";
|
|
97
|
+
readonly columns: ReadonlyArray<string>;
|
|
98
|
+
readonly refTable: string;
|
|
99
|
+
readonly refColumns: ReadonlyArray<string>;
|
|
100
|
+
readonly onDelete: ReferentialAction | undefined;
|
|
101
|
+
readonly onUpdate: ReferentialAction | undefined;
|
|
102
|
+
readonly name: string | undefined;
|
|
103
|
+
constructor(options: {
|
|
104
|
+
readonly columns: readonly string[];
|
|
105
|
+
readonly refTable: string;
|
|
106
|
+
readonly refColumns: readonly string[];
|
|
107
|
+
readonly onDelete?: ReferentialAction;
|
|
108
|
+
readonly onUpdate?: ReferentialAction;
|
|
109
|
+
readonly name?: string;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A table-level UNIQUE constraint on a `CreateTable` node. When `name` is
|
|
114
|
+
* set, the adapter renders `CONSTRAINT <name> UNIQUE (…)`; otherwise it
|
|
115
|
+
* renders an anonymous `UNIQUE (…)`.
|
|
116
|
+
*
|
|
117
|
+
* Frozen on construction — immutable after creation.
|
|
118
|
+
*/
|
|
119
|
+
declare class UniqueConstraint {
|
|
120
|
+
readonly kind: "unique";
|
|
121
|
+
readonly columns: ReadonlyArray<string>;
|
|
122
|
+
readonly name: string | undefined;
|
|
123
|
+
constructor(options: {
|
|
124
|
+
readonly columns: readonly string[];
|
|
125
|
+
readonly name?: string;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A table-level CHECK constraint carrying a raw SQL predicate expression. Used
|
|
130
|
+
* for checks that are not enum value-set restrictions — e.g. the element-non-null
|
|
131
|
+
* constraint on a scalar-array column (`array_position(col, NULL) IS NULL`).
|
|
132
|
+
* The `expression` is emitted verbatim, so callers must supply safe,
|
|
133
|
+
* pre-validated SQL.
|
|
134
|
+
*
|
|
135
|
+
* Frozen on construction — immutable after creation.
|
|
136
|
+
*/
|
|
137
|
+
declare class CheckExpressionConstraint {
|
|
138
|
+
readonly kind: "check-expression";
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly expression: string;
|
|
141
|
+
constructor(options: {
|
|
142
|
+
readonly name: string;
|
|
143
|
+
readonly expression: string;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
type DdlTableConstraint = PrimaryKeyConstraint | ForeignKeyConstraint | UniqueConstraint | CheckExpressionConstraint;
|
|
147
|
+
//#endregion
|
|
148
|
+
export { DdlColumnDefaultVisitor as a, DdlTableConstraint as c, LiteralColumnDefault as d, PrimaryKeyConstraint as f, DdlColumnDefault as i, ForeignKeyConstraint as l, isDdlNode as m, CheckExpressionConstraint as n, DdlColumnRenderContext as o, UniqueConstraint as p, DdlColumn as r, DdlNode as s, AnyDdlColumnDefault as t, FunctionColumnDefault as u };
|
|
149
|
+
//# sourceMappingURL=ddl-types-rrMsf77U-DGctYf-T.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddl-types-rrMsf77U-DGctYf-T.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/ddl-types-rrMsf77U.d.mts"],"mappings":";;;;;;;;;;;;;;;;UAcU;WACC;;UAED,wBAAwB;EAChC,QAAQ,MAAM,sBAAsB,KAAK,yBAAyB;EAClE,SAAS,MAAM,uBAAuB,KAAK,yBAAyB;;uBAE/C;oBACH;WACT,OAAO,GAAG,SAAS,wBAAwB,IAAI,KAAK,yBAAyB;YAC5E;;cAEE,6BAA6B;WAChC;WACA,OAAO;EAChB,YAAY,OAAO;EACnB,OAAO,GAAG,SAAS,wBAAwB,IAAI,KAAK,yBAAyB;;cAEjE,8BAA8B;WACjC;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,wBAAwB,IAAI,KAAK,yBAAyB;;KAE1E,sBAAsB,uBAAuB;cACpC;WACH;WACA;WACA;WACA;WACA,UAAU;;WAEV,WAAW;EACpB,YAAY;aACD;aACA;aACA;aACA;aACA,UAAU;aACV,WAAW;;;uBAGD;oBACH;;;;;;;EAOlB;YACU;EACV,oBAAoB;;iBAEL,UAAU,iBAAiB,SAAS;;;;;;;;cAQvC;WACH;WACA,SAAS;WACT;EACT,YAAY;aACD;aACA;;;;;;;;;;cAUC;WACH;WACA,SAAS;WACT;WACA,YAAY;WACZ,UAAU;WACV,UAAU;WACV;EACT,YAAY;aACD;aACA;aACA;aACA,WAAW;aACX,WAAW;aACX;;;;;;;;;;cAUC;WACH;WACA,SAAS;WACT;EACT,YAAY;aACD;aACA;;;;;;;;;;;;cAYC;WACH;WACA;WACA;EACT,YAAY;aACD;aACA;;;KAGR,qBAAqB,uBAAuB,uBAAuB,mBAAmB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region ../../../2-sql/9-family/dist/diff.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Compares two arrays of strings for equality (order-sensitive).
|
|
4
|
+
*/
|
|
5
|
+
function arraysEqual(a, b) {
|
|
6
|
+
if (a.length !== b.length) return false;
|
|
7
|
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { arraysEqual as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=diff-B16bL_IR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-B16bL_IR.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/diff.mjs"],"sourcesContent":["import { a as computeStorageTypeVerdict, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, r as classifySqlDiffIssue } from \"./schema-verify-vtFZbmGq.mjs\";\n//#region src/core/diff/sql-schema-diff.ts\n/**\n* Compares two arrays of strings for equality (order-sensitive).\n*/\nfunction arraysEqual(a, b) {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\treturn true;\n}\n//#endregion\nexport { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };\n\n//# sourceMappingURL=diff.mjs.map"],"mappings":";;;;AAKA,SAAS,YAAY,GAAG,GAAG;CAC1B,IAAI,EAAE,WAAW,EAAE,QAAQ,OAAO;CAClC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK,IAAI,EAAE,OAAO,EAAE,IAAI,OAAO;CAC7D,OAAO;AACR"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
|
|
2
|
+
import "./types-BchwQpmO.mjs";
|
|
3
|
+
import { v as SqlSchemaIRNode } from "./types-CvbBw1Jo-3KQdErJY.mjs";
|
|
4
|
+
import "./types-TvBZ2Ne9.mjs";
|
|
5
|
+
import "./control-adapter-C99J7aEF-C-17lFY8.mjs";
|
|
6
|
+
import { n as CodecControlHooks } from "./types-IqZMLrFC-DtdJNICr.mjs";
|
|
7
|
+
import { t as SqlSchemaDiffFn } from "./schema-differ-DpG_gnur-g5_iks8G.mjs";
|
|
8
|
+
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
9
|
+
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
10
|
+
import { DiffSubjectGranularity, SchemaDiffIssue, VerifierIssueCategory, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
11
|
+
//#region ../../../2-sql/9-family/dist/diff.d.mts
|
|
12
|
+
//#region src/core/diff/schema-verify.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* Resolves an issue's framework-neutral {@link DiffSubjectGranularity} on
|
|
15
|
+
* demand, from the issue's node's `nodeKind` via the target-provided
|
|
16
|
+
* `granularityOf` map. The node carries only its `nodeKind` identity, never a
|
|
17
|
+
* classification, and nothing is stamped onto the issue — every consumer
|
|
18
|
+
* (the family verdict below, the framework aggregate's unclaimed-elements
|
|
19
|
+
* sweep via {@link import('@prisma/orm-framework/components/control').SchemaSubjectClassifierCapable})
|
|
20
|
+
* calls this the same way, resolved by the family/target that owns the node
|
|
21
|
+
* vocabulary. `undefined` for an issue with no node.
|
|
22
|
+
*/
|
|
23
|
+
declare function classifyDiffSubjectGranularity(issue: SchemaDiffIssue, granularityOf: (nodeKind: string) => DiffSubjectGranularity): DiffSubjectGranularity | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Re-keys the legacy `classifySqlVerifierIssueKind` category mapping on the
|
|
26
|
+
* issue's {@link DiffSubjectGranularity} (resolved via `granularityOf`) + the
|
|
27
|
+
* issue reason. The vocabulary maps one-to-one: an undeclared live entity or
|
|
28
|
+
* namespace is `extraTopLevelObject`, an undeclared live field
|
|
29
|
+
* `extraNestedElement`, undeclared auxiliaries (constraints, indexes,
|
|
30
|
+
* defaults) and structural leaves (policies) `extraAuxiliary`; a value-set
|
|
31
|
+
* drift on a check node is `valueDrift`; every other paired divergence is
|
|
32
|
+
* `declaredIncompatible`; anything the database lacks is `declaredMissing`.
|
|
33
|
+
* `granularityOf` is the target's classifier, so target and extension node
|
|
34
|
+
* kinds classify without the family importing them.
|
|
35
|
+
*/
|
|
36
|
+
declare function classifySqlDiffIssue(issue: SchemaDiffIssue, granularityOf: (nodeKind: string) => DiffSubjectGranularity): VerifierIssueCategory;
|
|
37
|
+
interface SqlDiffVerdictInput {
|
|
38
|
+
/** The full, ownership-scoped diff issue list from the target's differ. */
|
|
39
|
+
readonly issues: readonly SchemaDiffIssue[];
|
|
40
|
+
/** Resolves a diff issue's subject table's declared control policy directly from the contract. */
|
|
41
|
+
readonly resolveControlPolicy: (issue: SchemaDiffIssue) => ControlPolicy | undefined;
|
|
42
|
+
readonly strict: boolean;
|
|
43
|
+
readonly defaultControlPolicy: ControlPolicy | undefined;
|
|
44
|
+
/** The target's classifier: a diff issue node's `nodeKind` → its subject granularity. */
|
|
45
|
+
readonly granularityOf: (nodeKind: string) => DiffSubjectGranularity;
|
|
46
|
+
}
|
|
47
|
+
interface SqlDiffVerdict {
|
|
48
|
+
readonly failures: readonly SchemaDiffIssue[];
|
|
49
|
+
readonly warnings: readonly SchemaDiffIssue[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Applies the two consumer filters to a diff issue list: strict gating
|
|
53
|
+
* (relational `not-expected` findings drop in lenient mode) and
|
|
54
|
+
* control-policy disposition (each surviving issue grades against its
|
|
55
|
+
* subject table's effective policy; suppressed issues drop, `observed`
|
|
56
|
+
* subjects warn). The verify verdict is `failures.length === 0`.
|
|
57
|
+
*/
|
|
58
|
+
declare function computeSqlDiffVerdict(input: SqlDiffVerdictInput): SqlDiffVerdict;
|
|
59
|
+
interface StorageTypeVerdictInput {
|
|
60
|
+
readonly contract: Contract<SqlStorage>;
|
|
61
|
+
/**
|
|
62
|
+
* Expected/actual namespace-node pairs the target's differ input produced:
|
|
63
|
+
* for a namespaced tree, one entry per expected namespace with a
|
|
64
|
+
* non-empty table set, paired by DDL schema name (absent actual side for
|
|
65
|
+
* a schema the database lacks); a flat tree is the sole pair.
|
|
66
|
+
*/
|
|
67
|
+
readonly namespacePairs: ReadonlyArray<{
|
|
68
|
+
readonly actual: SqlSchemaIRNode | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
readonly codecHooks: ReadonlyMap<string, CodecControlHooks>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Runs the codec `verifyType` hooks the way the legacy walk did: once per
|
|
74
|
+
* contract namespace with tables, against that namespace's paired actual
|
|
75
|
+
* node (the hook reads namespace-scoped state such as `enums` off it).
|
|
76
|
+
* Issue dispositions grade against the contract default policy, matching
|
|
77
|
+
* the legacy `pushTypeNode` semantics.
|
|
78
|
+
*/
|
|
79
|
+
interface StorageTypeVerdict {
|
|
80
|
+
readonly failures: readonly SchemaDiffIssue[];
|
|
81
|
+
readonly warnings: readonly SchemaDiffIssue[];
|
|
82
|
+
}
|
|
83
|
+
declare function computeStorageTypeVerdict(input: StorageTypeVerdictInput): StorageTypeVerdict;
|
|
84
|
+
interface VerifySqlSchemaByDiffInput {
|
|
85
|
+
readonly contract: Contract<SqlStorage>;
|
|
86
|
+
readonly schema: SqlSchemaIRNode;
|
|
87
|
+
readonly strict: boolean;
|
|
88
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
|
|
89
|
+
/** The target's full-tree node diff (`diffSchema` descriptor hook). */
|
|
90
|
+
readonly diffSchema: SqlSchemaDiffFn;
|
|
91
|
+
/** The target's classifier: a diff issue node's `nodeKind` → its subject granularity. */
|
|
92
|
+
readonly granularityOf: (nodeKind: string) => DiffSubjectGranularity;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* THE SQL schema verify: runs the target's full-tree node diff, grades it
|
|
96
|
+
* through the family's post-diff filters (strict gating + control-policy
|
|
97
|
+
* disposition) plus the codec `verifyType` hook findings, and wraps the
|
|
98
|
+
* verdict in the issue-based result envelope. `ok` holds exactly when both
|
|
99
|
+
* issue lists are empty — the lists carry the verdict's failures.
|
|
100
|
+
*/
|
|
101
|
+
declare function verifySqlSchemaByDiff(input: VerifySqlSchemaByDiffInput): VerifyDatabaseSchemaResult;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { VerifySqlSchemaByDiffInput as a, computeSqlDiffVerdict as c, StorageTypeVerdictInput as i, computeStorageTypeVerdict as l, SqlDiffVerdictInput as n, classifyDiffSubjectGranularity as o, StorageTypeVerdict as r, classifySqlDiffIssue as s, SqlDiffVerdict as t, verifySqlSchemaByDiff as u };
|
|
104
|
+
//# sourceMappingURL=diff-DhlzHOMD.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-DhlzHOMD.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAmBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;;;;;;;;;;;iBAarH,qBAAqB,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;UAClH;;WAEC,iBAAiB;;WAEjB,uBAAuB,OAAO,oBAAoB;WAClD;WACA,sBAAsB;;WAEtB,gBAAgB,qBAAqB;;UAEtC;WACC,mBAAmB;WACnB,mBAAmB;;;;;;;;;iBASb,sBAAsB,OAAO,sBAAsB;UAC1D;WACC,UAAU,SAAS;;;;;;;WAOnB,gBAAgB;aACd,QAAQ;;WAEV,YAAY,oBAAoB;;;;;;;;;UASjC;WACC,mBAAmB;WACnB,mBAAmB;;iBAEb,0BAA0B,OAAO,0BAA0B;UAClE;WACC,UAAU,SAAS;WACnB,QAAQ;WACR;WACA,qBAAqB,cAAc;;WAEnC,YAAY;;WAEZ,gBAAgB,qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createOperationRegistry } from "@prisma/orm-framework/operations";
|
|
2
|
+
//#region ../../../2-sql/1-core/operations/dist/index.mjs
|
|
3
|
+
function createSqlOperationRegistry() {
|
|
4
|
+
return createOperationRegistry();
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createSqlOperationRegistry as t };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=dist-C_q1_QR9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-C_q1_QR9.mjs","names":[],"sources":["../../../../2-sql/1-core/operations/dist/index.mjs"],"sourcesContent":["import { createOperationRegistry } from \"@internal/operations\";\n//#region src/index.ts\nfunction createSqlOperationRegistry() {\n\treturn createOperationRegistry();\n}\n//#endregion\nexport { createSqlOperationRegistry };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;AAEA,SAAS,6BAA6B;CACrC,OAAO,wBAAwB;AAChC"}
|