@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,108 @@
|
|
|
1
|
+
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
+
import { i as defaultIndexName, n as assertWireNamePrefixLength, r as computeIndexContentHash } from "./naming-BwqqVcZy-BgTObIQw.mjs";
|
|
3
|
+
import { flushAuthoringWarnings } from "@prisma/orm-framework/components/authoring";
|
|
4
|
+
//#region ../../../2-sql/1-core/contract/dist/index-naming-BoGBcMmI.mjs
|
|
5
|
+
const EXACT_NAME_BODY_PREAMBLE = "Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.";
|
|
6
|
+
/**
|
|
7
|
+
* Per-subject remediation: an index moves to wire naming via `name:`;
|
|
8
|
+
* a policy has no such parameter — dropping `@@map` makes the block's head
|
|
9
|
+
* the wire prefix.
|
|
10
|
+
*/
|
|
11
|
+
const EXACT_NAME_BODY_REMEDIATION = {
|
|
12
|
+
index: "For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted object to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.",
|
|
13
|
+
policy: "For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration."
|
|
14
|
+
};
|
|
15
|
+
/** What the user actually wrote, per subject: index `map:`, policy `@@map`. */
|
|
16
|
+
const EXACT_NAME_FEATURE = {
|
|
17
|
+
index: "map:",
|
|
18
|
+
policy: "@@map"
|
|
19
|
+
};
|
|
20
|
+
const EXACT_NAME_BODY_WARNING_CODE = "PN_EXACT_NAME_BODY_COMPARISON";
|
|
21
|
+
/**
|
|
22
|
+
* Mints the exact-name body-comparison warning for a `map:`-named object
|
|
23
|
+
* carrying a hand-authorable SQL body — fully formed, so the transport and
|
|
24
|
+
* the flush stay generic. `subject` is `index` here and `policy` where
|
|
25
|
+
* policies mint the same warning; the feature name and the remediation are
|
|
26
|
+
* subject-specific end to end, so a batched summary (grouped on
|
|
27
|
+
* code + summary) is true of every object it covers.
|
|
28
|
+
*/
|
|
29
|
+
function exactNameBodyWarning(subject, exactName) {
|
|
30
|
+
const item = `${subject} "${exactName}"`;
|
|
31
|
+
const feature = EXACT_NAME_FEATURE[subject];
|
|
32
|
+
const tail = `with a SQL body. ${EXACT_NAME_BODY_PREAMBLE} ${EXACT_NAME_BODY_REMEDIATION[subject]}`;
|
|
33
|
+
return {
|
|
34
|
+
code: EXACT_NAME_BODY_WARNING_CODE,
|
|
35
|
+
message: `${item} uses ${feature} ${tail}`,
|
|
36
|
+
item,
|
|
37
|
+
summary: `objects use ${feature} ${tail}`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Lowers an authored index into the name-identified entity `contract.json`
|
|
42
|
+
* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire
|
|
43
|
+
* mode appends the content-hash suffix to the authored or default prefix.
|
|
44
|
+
* The cross-field guards are the shared enforcement backstop for both
|
|
45
|
+
* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).
|
|
46
|
+
*/
|
|
47
|
+
function lowerAuthoredIndex(tableName, authored, warnings) {
|
|
48
|
+
if (authored.columns === void 0 === (authored.expression === void 0)) throw contractError("CONTRACT.ARGUMENT_INVALID", `Index on table "${tableName}": an index takes either fields (columns) or an expression — exactly one, not both.`);
|
|
49
|
+
if (authored.map !== void 0 && authored.name !== void 0) throw contractError("CONTRACT.ARGUMENT_INVALID", `Index "${authored.map}" on table "${tableName}": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);
|
|
50
|
+
if (authored.expression !== void 0 && authored.name === void 0 && authored.map === void 0) throw contractError("CONTRACT.ARGUMENT_INVALID", `Index on table "${tableName}": an expression index requires an explicit name (name:) or exact physical name (map:) — a default name cannot be derived from an expression.`);
|
|
51
|
+
if (authored.options !== void 0 && authored.type === void 0) throw contractError("CONTRACT.ARGUMENT_INVALID", `Index on table "${tableName}": options requires an explicit type — an index with options but no type cannot round-trip through contract infer (the emitted type: would change the wire name).`);
|
|
52
|
+
const unique = authored.unique ?? false;
|
|
53
|
+
if (authored.map !== void 0) {
|
|
54
|
+
if (authored.expression !== void 0 || authored.where !== void 0) {
|
|
55
|
+
const warning = exactNameBodyWarning("index", authored.map);
|
|
56
|
+
if (warnings !== void 0) warnings.push(warning);
|
|
57
|
+
else flushAuthoringWarnings([warning]);
|
|
58
|
+
}
|
|
59
|
+
const carried = {
|
|
60
|
+
naming: {
|
|
61
|
+
kind: "exact",
|
|
62
|
+
name: authored.map
|
|
63
|
+
},
|
|
64
|
+
where: authored.where,
|
|
65
|
+
unique,
|
|
66
|
+
type: authored.type,
|
|
67
|
+
options: authored.options
|
|
68
|
+
};
|
|
69
|
+
return authored.expression !== void 0 ? {
|
|
70
|
+
...carried,
|
|
71
|
+
expression: authored.expression
|
|
72
|
+
} : {
|
|
73
|
+
...carried,
|
|
74
|
+
columns: authored.columns ?? []
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const prefix = authored.name ?? defaultIndexName(tableName, authored.columns ?? []);
|
|
78
|
+
assertWireNamePrefixLength(prefix, "index prefix");
|
|
79
|
+
const carried = {
|
|
80
|
+
naming: {
|
|
81
|
+
kind: "wire",
|
|
82
|
+
prefix,
|
|
83
|
+
hash: computeIndexContentHash({
|
|
84
|
+
...authored.columns !== void 0 && { columns: authored.columns },
|
|
85
|
+
...authored.expression !== void 0 && { expression: authored.expression },
|
|
86
|
+
...authored.where !== void 0 && { where: authored.where },
|
|
87
|
+
unique,
|
|
88
|
+
...authored.type !== void 0 && { type: authored.type },
|
|
89
|
+
...authored.options !== void 0 && { options: authored.options }
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
where: authored.where,
|
|
93
|
+
unique,
|
|
94
|
+
type: authored.type,
|
|
95
|
+
options: authored.options
|
|
96
|
+
};
|
|
97
|
+
return authored.expression !== void 0 ? {
|
|
98
|
+
...carried,
|
|
99
|
+
expression: authored.expression
|
|
100
|
+
} : {
|
|
101
|
+
...carried,
|
|
102
|
+
columns: authored.columns ?? []
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { lowerAuthoredIndex as n, exactNameBodyWarning as t };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=index-naming-BoGBcMmI-DiJAr66H.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-naming-BoGBcMmI-DiJAr66H.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming-BoGBcMmI.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName } from \"@internal/sql-schema-ir/naming\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\n//#region src/index-naming.ts\nconst EXACT_NAME_BODY_PREAMBLE = \"Drift detection compares the authored SQL text byte-for-byte against Postgres's reprinted form, which is only reliable when the text was captured by contract infer.\";\n/**\n* Per-subject remediation: an index moves to wire naming via `name:`;\n* a policy has no such parameter — dropping `@@map` makes the block's head\n* the wire prefix.\n*/\nconst EXACT_NAME_BODY_REMEDIATION = {\n\tindex: \"For hand-authored definitions, use name: and let Prisma Next manage the physical name; to migrate an adopted object to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\",\n\tpolicy: \"For hand-authored definitions, drop @@map and let the policy block's head name the policy; to migrate an adopted policy to wire naming, remove @@map (keeping the body text unchanged) and apply the resulting rename migration.\"\n};\n/** What the user actually wrote, per subject: index `map:`, policy `@@map`. */\nconst EXACT_NAME_FEATURE = {\n\tindex: \"map:\",\n\tpolicy: \"@@map\"\n};\nconst EXACT_NAME_BODY_WARNING_CODE = \"PN_EXACT_NAME_BODY_COMPARISON\";\n/**\n* Mints the exact-name body-comparison warning for a `map:`-named object\n* carrying a hand-authorable SQL body — fully formed, so the transport and\n* the flush stay generic. `subject` is `index` here and `policy` where\n* policies mint the same warning; the feature name and the remediation are\n* subject-specific end to end, so a batched summary (grouped on\n* code + summary) is true of every object it covers.\n*/\nfunction exactNameBodyWarning(subject, exactName) {\n\tconst item = `${subject} \"${exactName}\"`;\n\tconst feature = EXACT_NAME_FEATURE[subject];\n\tconst tail = `with a SQL body. ${EXACT_NAME_BODY_PREAMBLE} ${EXACT_NAME_BODY_REMEDIATION[subject]}`;\n\treturn {\n\t\tcode: EXACT_NAME_BODY_WARNING_CODE,\n\t\tmessage: `${item} uses ${feature} ${tail}`,\n\t\titem,\n\t\tsummary: `objects use ${feature} ${tail}`\n\t};\n}\n/**\n* Lowers an authored index into the name-identified entity `contract.json`\n* persists: exact mode adopts `map` verbatim (no prefix, no hash); wire\n* mode appends the content-hash suffix to the authored or default prefix.\n* The cross-field guards are the shared enforcement backstop for both\n* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).\n*/\nfunction lowerAuthoredIndex(tableName, authored, warnings) {\n\tif (authored.columns === void 0 === (authored.expression === void 0)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an index takes either fields (columns) or an expression — exactly one, not both.`);\n\tif (authored.map !== void 0 && authored.name !== void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index \"${authored.map}\" on table \"${tableName}\": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);\n\tif (authored.expression !== void 0 && authored.name === void 0 && authored.map === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": an expression index requires an explicit name (name:) or exact physical name (map:) — a default name cannot be derived from an expression.`);\n\tif (authored.options !== void 0 && authored.type === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Index on table \"${tableName}\": options requires an explicit type — an index with options but no type cannot round-trip through contract infer (the emitted type: would change the wire name).`);\n\tconst unique = authored.unique ?? false;\n\tif (authored.map !== void 0) {\n\t\tif (authored.expression !== void 0 || authored.where !== void 0) {\n\t\t\tconst warning = exactNameBodyWarning(\"index\", authored.map);\n\t\t\tif (warnings !== void 0) warnings.push(warning);\n\t\t\telse flushAuthoringWarnings([warning]);\n\t\t}\n\t\tconst carried = {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: authored.map\n\t\t\t},\n\t\t\twhere: authored.where,\n\t\t\tunique,\n\t\t\ttype: authored.type,\n\t\t\toptions: authored.options\n\t\t};\n\t\treturn authored.expression !== void 0 ? {\n\t\t\t...carried,\n\t\t\texpression: authored.expression\n\t\t} : {\n\t\t\t...carried,\n\t\t\tcolumns: authored.columns ?? []\n\t\t};\n\t}\n\tconst prefix = authored.name ?? defaultIndexName(tableName, authored.columns ?? []);\n\tassertWireNamePrefixLength(prefix, \"index prefix\");\n\tconst carried = {\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix,\n\t\t\thash: computeIndexContentHash({\n\t\t\t\t...authored.columns !== void 0 && { columns: authored.columns },\n\t\t\t\t...authored.expression !== void 0 && { expression: authored.expression },\n\t\t\t\t...authored.where !== void 0 && { where: authored.where },\n\t\t\t\tunique,\n\t\t\t\t...authored.type !== void 0 && { type: authored.type },\n\t\t\t\t...authored.options !== void 0 && { options: authored.options }\n\t\t\t})\n\t\t},\n\t\twhere: authored.where,\n\t\tunique,\n\t\ttype: authored.type,\n\t\toptions: authored.options\n\t};\n\treturn authored.expression !== void 0 ? {\n\t\t...carried,\n\t\texpression: authored.expression\n\t} : {\n\t\t...carried,\n\t\tcolumns: authored.columns ?? []\n\t};\n}\n//#endregion\nexport { lowerAuthoredIndex as n, exactNameBodyWarning as t };\n\n//# sourceMappingURL=index-naming-BoGBcMmI.mjs.map"],"mappings":";;;;AAIA,MAAM,2BAA2B;;;;;;AAMjC,MAAM,8BAA8B;CACnC,OAAO;CACP,QAAQ;AACT;;AAEA,MAAM,qBAAqB;CAC1B,OAAO;CACP,QAAQ;AACT;AACA,MAAM,+BAA+B;;;;;;;;;AASrC,SAAS,qBAAqB,SAAS,WAAW;CACjD,MAAM,OAAO,GAAG,QAAQ,IAAI,UAAU;CACtC,MAAM,UAAU,mBAAmB;CACnC,MAAM,OAAO,oBAAoB,yBAAyB,GAAG,4BAA4B;CACzF,OAAO;EACN,MAAM;EACN,SAAS,GAAG,KAAK,QAAQ,QAAQ,GAAG;EACpC;EACA,SAAS,eAAe,QAAQ,GAAG;CACpC;AACD;;;;;;;;AAQA,SAAS,mBAAmB,WAAW,UAAU,UAAU;CAC1D,IAAI,SAAS,YAAY,KAAK,OAAO,SAAS,eAAe,KAAK,IAAI,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,oFAAoF;CACxO,IAAI,SAAS,QAAQ,KAAK,KAAK,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,UAAU,SAAS,IAAI,cAAc,UAAU,mGAAmG;CAC5P,IAAI,SAAS,eAAe,KAAK,KAAK,SAAS,SAAS,KAAK,KAAK,SAAS,QAAQ,KAAK,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,8IAA8I;CACvT,IAAI,SAAS,YAAY,KAAK,KAAK,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,kKAAkK;CAC7S,MAAM,SAAS,SAAS,UAAU;CAClC,IAAI,SAAS,QAAQ,KAAK,GAAG;EAC5B,IAAI,SAAS,eAAe,KAAK,KAAK,SAAS,UAAU,KAAK,GAAG;GAChE,MAAM,UAAU,qBAAqB,SAAS,SAAS,GAAG;GAC1D,IAAI,aAAa,KAAK,GAAG,SAAS,KAAK,OAAO;QACzC,uBAAuB,CAAC,OAAO,CAAC;EACtC;EACA,MAAM,UAAU;GACf,QAAQ;IACP,MAAM;IACN,MAAM,SAAS;GAChB;GACA,OAAO,SAAS;GAChB;GACA,MAAM,SAAS;GACf,SAAS,SAAS;EACnB;EACA,OAAO,SAAS,eAAe,KAAK,IAAI;GACvC,GAAG;GACH,YAAY,SAAS;EACtB,IAAI;GACH,GAAG;GACH,SAAS,SAAS,WAAW,CAAC;EAC/B;CACD;CACA,MAAM,SAAS,SAAS,QAAQ,iBAAiB,WAAW,SAAS,WAAW,CAAC,CAAC;CAClF,2BAA2B,QAAQ,cAAc;CACjD,MAAM,UAAU;EACf,QAAQ;GACP,MAAM;GACN;GACA,MAAM,wBAAwB;IAC7B,GAAG,SAAS,YAAY,KAAK,KAAK,EAAE,SAAS,SAAS,QAAQ;IAC9D,GAAG,SAAS,eAAe,KAAK,KAAK,EAAE,YAAY,SAAS,WAAW;IACvE,GAAG,SAAS,UAAU,KAAK,KAAK,EAAE,OAAO,SAAS,MAAM;IACxD;IACA,GAAG,SAAS,SAAS,KAAK,KAAK,EAAE,MAAM,SAAS,KAAK;IACrD,GAAG,SAAS,YAAY,KAAK,KAAK,EAAE,SAAS,SAAS,QAAQ;GAC/D,CAAC;EACF;EACA,OAAO,SAAS;EAChB;EACA,MAAM,SAAS;EACf,SAAS,SAAS;CACnB;CACA,OAAO,SAAS,eAAe,KAAK,IAAI;EACvC,GAAG;EACH,YAAY,SAAS;CACtB,IAAI;EACH,GAAG;EACH,SAAS,SAAS,WAAW,CAAC;CAC/B;AACD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
//#region ../../../2-sql/1-core/contract/dist/index-type-validation.mjs
|
|
4
|
+
function validateIndexTypes(contract, indexTypeRegistry) {
|
|
5
|
+
for (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const index of table.indexes) {
|
|
6
|
+
if (index.type === void 0) continue;
|
|
7
|
+
const entry = indexTypeRegistry.get(index.type);
|
|
8
|
+
if (entry === void 0) throw new ContractValidationError(`Namespace "${namespaceId}" table "${tableName}" index "${index.name}" uses unregistered index type "${index.type}"`, "storage");
|
|
9
|
+
const optionsValue = index.options ?? {};
|
|
10
|
+
const result = entry.options(optionsValue);
|
|
11
|
+
if (result instanceof type.errors) throw new ContractValidationError(`Namespace "${namespaceId}" table "${tableName}" index "${index.name}" has invalid options for type "${index.type}": ${result.summary}`, "storage");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { validateIndexTypes as t };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index-type-validation-COH4d78M.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-type-validation-COH4d78M.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-type-validation.mjs"],"sourcesContent":["import { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { type } from \"arktype\";\n//#region src/index-type-validation.ts\nfunction validateIndexTypes(contract, indexTypeRegistry) {\n\tfor (const [namespaceId, ns] of Object.entries(contract.storage.namespaces)) for (const [tableName, table] of Object.entries(ns.entries.table ?? {})) for (const index of table.indexes) {\n\t\tif (index.type === void 0) continue;\n\t\tconst entry = indexTypeRegistry.get(index.type);\n\t\tif (entry === void 0) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" index \"${index.name}\" uses unregistered index type \"${index.type}\"`, \"storage\");\n\t\tconst optionsValue = index.options ?? {};\n\t\tconst result = entry.options(optionsValue);\n\t\tif (result instanceof type.errors) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" index \"${index.name}\" has invalid options for type \"${index.type}\": ${result.summary}`, \"storage\");\n\t}\n}\n//#endregion\nexport { validateIndexTypes };\n\n//# sourceMappingURL=index-type-validation.mjs.map"],"mappings":";;;AAGA,SAAS,mBAAmB,UAAU,mBAAmB;CACxD,KAAK,MAAM,CAAC,aAAa,OAAO,OAAO,QAAQ,SAAS,QAAQ,UAAU,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,GAAG,QAAQ,SAAS,CAAC,CAAC,GAAG,KAAK,MAAM,SAAS,MAAM,SAAS;EACxL,IAAI,MAAM,SAAS,KAAK,GAAG;EAC3B,MAAM,QAAQ,kBAAkB,IAAI,MAAM,IAAI;EAC9C,IAAI,UAAU,KAAK,GAAG,MAAM,IAAI,wBAAwB,cAAc,YAAY,WAAW,UAAU,WAAW,MAAM,KAAK,kCAAkC,MAAM,KAAK,IAAI,SAAS;EACvL,MAAM,eAAe,MAAM,WAAW,CAAC;EACvC,MAAM,SAAS,MAAM,QAAQ,YAAY;EACzC,IAAI,kBAAkB,KAAK,QAAQ,MAAM,IAAI,wBAAwB,cAAc,YAAY,WAAW,UAAU,WAAW,MAAM,KAAK,kCAAkC,MAAM,KAAK,KAAK,OAAO,WAAW,SAAS;CACxN;AACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { c as SqlStorage } from "./sql-storage-B0QwiTg6-B8DVctJm.mjs";
|
|
2
|
+
import "./types-CuDrWc5v-ISVXBmBs.mjs";
|
|
3
|
+
import { a as IndexTypeRegistry } from "./index-types-DPVhsW0v-D-BikM4h.mjs";
|
|
4
|
+
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
|
+
//#region ../../../2-sql/1-core/contract/dist/index-type-validation.d.mts
|
|
6
|
+
//#region src/index-type-validation.d.ts
|
|
7
|
+
declare function validateIndexTypes(contract: Contract<SqlStorage>, indexTypeRegistry: IndexTypeRegistry): void;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { validateIndexTypes as t };
|
|
10
|
+
//# sourceMappingURL=index-type-validation-DN0L2mqm.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-type-validation-DN0L2mqm.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-type-validation.d.mts"],"mappings":";;;;;;iBAKiB,mBAAmB,UAAU,SAAS,aAAa,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-types-DPVhsW0v-D-BikM4h.mjs";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
+
//#region ../../../2-sql/1-core/contract/dist/index-types.mjs
|
|
3
|
+
var IndexTypeBuilderImpl = class IndexTypeBuilderImpl {
|
|
4
|
+
entries;
|
|
5
|
+
IndexTypes;
|
|
6
|
+
constructor(entries) {
|
|
7
|
+
this.entries = entries;
|
|
8
|
+
this.IndexTypes = {};
|
|
9
|
+
}
|
|
10
|
+
add(typeLiteral, entry) {
|
|
11
|
+
if (this.entries.some((e) => e.type === typeLiteral)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Index type "${typeLiteral}" is already declared in this builder`, { meta: { indexType: typeLiteral } });
|
|
12
|
+
return new IndexTypeBuilderImpl([...this.entries, {
|
|
13
|
+
type: typeLiteral,
|
|
14
|
+
options: entry.options
|
|
15
|
+
}]);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function defineIndexTypes() {
|
|
19
|
+
return new IndexTypeBuilderImpl([]);
|
|
20
|
+
}
|
|
21
|
+
var IndexTypeRegistryImpl = class {
|
|
22
|
+
entries = /* @__PURE__ */ new Map();
|
|
23
|
+
register(entry) {
|
|
24
|
+
if (this.entries.has(entry.type)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Index type "${entry.type}" is already registered`, { meta: { indexType: entry.type } });
|
|
25
|
+
this.entries.set(entry.type, entry);
|
|
26
|
+
}
|
|
27
|
+
get(typeLiteral) {
|
|
28
|
+
return this.entries.get(typeLiteral);
|
|
29
|
+
}
|
|
30
|
+
has(typeLiteral) {
|
|
31
|
+
return this.entries.has(typeLiteral);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function createIndexTypeRegistry() {
|
|
35
|
+
return new IndexTypeRegistryImpl();
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { defineIndexTypes as n, createIndexTypeRegistry as t };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index-types-DJQ_xwaE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types-DJQ_xwaE.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-types.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\n//#region src/index-types.ts\nvar IndexTypeBuilderImpl = class IndexTypeBuilderImpl {\n\tentries;\n\tIndexTypes;\n\tconstructor(entries) {\n\t\tthis.entries = entries;\n\t\tthis.IndexTypes = {};\n\t}\n\tadd(typeLiteral, entry) {\n\t\tif (this.entries.some((e) => e.type === typeLiteral)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Index type \"${typeLiteral}\" is already declared in this builder`, { meta: { indexType: typeLiteral } });\n\t\treturn new IndexTypeBuilderImpl([...this.entries, {\n\t\t\ttype: typeLiteral,\n\t\t\toptions: entry.options\n\t\t}]);\n\t}\n};\nfunction defineIndexTypes() {\n\treturn new IndexTypeBuilderImpl([]);\n}\nvar IndexTypeRegistryImpl = class {\n\tentries = /* @__PURE__ */ new Map();\n\tregister(entry) {\n\t\tif (this.entries.has(entry.type)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Index type \"${entry.type}\" is already registered`, { meta: { indexType: entry.type } });\n\t\tthis.entries.set(entry.type, entry);\n\t}\n\tget(typeLiteral) {\n\t\treturn this.entries.get(typeLiteral);\n\t}\n\thas(typeLiteral) {\n\t\treturn this.entries.has(typeLiteral);\n\t}\n};\nfunction createIndexTypeRegistry() {\n\treturn new IndexTypeRegistryImpl();\n}\n//#endregion\nexport { createIndexTypeRegistry, defineIndexTypes };\n\n//# sourceMappingURL=index-types.mjs.map"],"mappings":";;AAEA,IAAI,uBAAuB,MAAM,qBAAqB;CACrD;CACA;CACA,YAAY,SAAS;EACpB,KAAK,UAAU;EACf,KAAK,aAAa,CAAC;CACpB;CACA,IAAI,aAAa,OAAO;EACvB,IAAI,KAAK,QAAQ,MAAM,MAAM,EAAE,SAAS,WAAW,GAAG,MAAM,cAAc,sCAAsC,eAAe,YAAY,wCAAwC,EAAE,MAAM,EAAE,WAAW,YAAY,EAAE,CAAC;EACvN,OAAO,IAAI,qBAAqB,CAAC,GAAG,KAAK,SAAS;GACjD,MAAM;GACN,SAAS,MAAM;EAChB,CAAC,CAAC;CACH;AACD;AACA,SAAS,mBAAmB;CAC3B,OAAO,IAAI,qBAAqB,CAAC,CAAC;AACnC;AACA,IAAI,wBAAwB,MAAM;CACjC,0BAA0B,IAAI,IAAI;CAClC,SAAS,OAAO;EACf,IAAI,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,MAAM,cAAc,sCAAsC,eAAe,MAAM,KAAK,0BAA0B,EAAE,MAAM,EAAE,WAAW,MAAM,KAAK,EAAE,CAAC;EACnL,KAAK,QAAQ,IAAI,MAAM,MAAM,KAAK;CACnC;CACA,IAAI,aAAa;EAChB,OAAO,KAAK,QAAQ,IAAI,WAAW;CACpC;CACA,IAAI,aAAa;EAChB,OAAO,KAAK,QAAQ,IAAI,WAAW;CACpC;AACD;AACA,SAAS,0BAA0B;CAClC,OAAO,IAAI,sBAAsB;AAClC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Type } from "arktype";
|
|
2
|
+
//#region ../../../2-sql/1-core/contract/dist/index-types-DPVhsW0v.d.mts
|
|
3
|
+
//#region src/index-types.d.ts
|
|
4
|
+
interface IndexTypeEntry<TOptions = unknown> {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly options: Type<TOptions>;
|
|
7
|
+
}
|
|
8
|
+
type IndexTypeMap = { readonly [K in string]: {
|
|
9
|
+
readonly options: unknown;
|
|
10
|
+
}; };
|
|
11
|
+
interface IndexTypeRegistration<TMap extends IndexTypeMap = Record<never, never>> {
|
|
12
|
+
readonly IndexTypes: TMap;
|
|
13
|
+
readonly entries: ReadonlyArray<IndexTypeEntry>;
|
|
14
|
+
}
|
|
15
|
+
interface IndexTypeBuilder<TMap extends IndexTypeMap = Record<never, never>> extends IndexTypeRegistration<TMap> {
|
|
16
|
+
add<TLit extends string, TOpts>(typeLiteral: TLit, entry: {
|
|
17
|
+
readonly options: Type<TOpts>;
|
|
18
|
+
}): IndexTypeBuilder<TMap & Record<TLit, {
|
|
19
|
+
readonly options: TOpts;
|
|
20
|
+
}>>;
|
|
21
|
+
}
|
|
22
|
+
declare function defineIndexTypes(): IndexTypeBuilder<Record<never, never>>;
|
|
23
|
+
interface IndexTypeRegistry {
|
|
24
|
+
register(entry: IndexTypeEntry): void;
|
|
25
|
+
get(typeLiteral: string): IndexTypeEntry | undefined;
|
|
26
|
+
has(typeLiteral: string): boolean;
|
|
27
|
+
}
|
|
28
|
+
declare function createIndexTypeRegistry(): IndexTypeRegistry;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { IndexTypeRegistry as a, IndexTypeRegistration as i, IndexTypeEntry as n, createIndexTypeRegistry as o, IndexTypeMap as r, defineIndexTypes as s, IndexTypeBuilder as t };
|
|
31
|
+
//# sourceMappingURL=index-types-DPVhsW0v-D-BikM4h.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types-DPVhsW0v-D-BikM4h.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-types-DPVhsW0v.d.mts"],"mappings":";;;UAEU,eAAe;WACd;WACA,SAAS,KAAK;;KAEpB,2BAA2B;WACrB;;UAED,sBAAsB,aAAa,eAAe;WACjD,YAAY;WACZ,SAAS,cAAc;;UAExB,iBAAiB,aAAa,eAAe,8BAA8B,sBAAsB;EACzG,IAAI,qBAAqB,OAAO,aAAa,MAAM;aACxC,SAAS,KAAK;MACrB,iBAAiB,OAAO,OAAO;aACxB,SAAS;;;iBAGL,oBAAoB,iBAAiB;UAC5C;EACR,SAAS,OAAO;EAChB,IAAI,sBAAsB;EAC1B,IAAI;;iBAEW,2BAA2B"}
|