@prisma/orm-family-sql 8.0.0-rc.17-dev.2 → 8.0.0-rc.17-dev.4
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/dist/{ast-DUU5OVjo.mjs → ast-De8XGuVW.mjs} +2 -2
- package/dist/{ast-DUU5OVjo.mjs.map → ast-De8XGuVW.mjs.map} +1 -1
- package/dist/{ast-Bmb-2vbO.d.mts → ast-Dp6lQXUX.d.mts} +3 -3
- package/dist/{ast-Bmb-2vbO.d.mts.map → ast-Dp6lQXUX.d.mts.map} +1 -1
- package/dist/{authored-check-naming-C8_TvzU6.d.mts → authored-check-naming-CK6T_Dfh.d.mts} +2 -2
- package/dist/{authored-check-naming-C8_TvzU6.d.mts.map → authored-check-naming-CK6T_Dfh.d.mts.map} +1 -1
- package/dist/{authored-check-naming-BBdhHujS.mjs → authored-check-naming-CO3GA46Y.mjs} +3 -3
- package/dist/{authored-check-naming-BBdhHujS.mjs.map → authored-check-naming-CO3GA46Y.mjs.map} +1 -1
- package/dist/{authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts → authoring-entity-types-CZ-vdwYS-BQPeBSla.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-BLYHcBXG.d.mts.map → authoring-entity-types-CZ-vdwYS-BQPeBSla.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs → authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-ClKI8Uuk.mjs.map → authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs.map} +1 -1
- package/dist/builder.d.mts +2 -2
- package/dist/builder__runtime.d.mts +9 -9
- package/dist/builder__runtime.mjs +129 -2
- package/dist/builder__runtime.mjs.map +1 -1
- package/dist/builder__types.d.mts +3 -3
- package/dist/{check-constraint-B7qGu6rc-agxAjKLG.d.mts → check-constraint-B7qGu6rc-CBVYAMwG.d.mts} +2 -2
- package/dist/{check-constraint-B7qGu6rc-agxAjKLG.d.mts.map → check-constraint-B7qGu6rc-CBVYAMwG.d.mts.map} +1 -1
- package/dist/{codec-descriptor-registry-CdIIOkuE.mjs → codec-descriptor-registry-CYK0Wzja.mjs} +2 -2
- package/dist/{codec-descriptor-registry-CdIIOkuE.mjs.map → codec-descriptor-registry-CYK0Wzja.mjs.map} +1 -1
- package/dist/{config-types-DB6gRJ5K.d.mts → config-types-Ci51fcnp.d.mts} +4 -4
- package/dist/{config-types-DB6gRJ5K.d.mts.map → config-types-Ci51fcnp.d.mts.map} +1 -1
- package/dist/{config-types-D0sxpKAN.mjs → config-types-DsRO_uxd.mjs} +3 -3
- package/dist/{config-types-D0sxpKAN.mjs.map → config-types-DsRO_uxd.mjs.map} +1 -1
- package/dist/{contract-builder-tEax3I2q.mjs → contract-builder-DEtvdts6.mjs} +15 -9
- package/dist/contract-builder-DEtvdts6.mjs.map +1 -0
- package/dist/{contract-builder-V5pFHDv3.d.mts → contract-builder-DWQhH8FQ.d.mts} +21 -13
- package/dist/contract-builder-DWQhH8FQ.d.mts.map +1 -0
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-prisma7__provider.d.mts +2 -2
- package/dist/contract-prisma7__provider.mjs +8 -8
- package/dist/contract-psl.d.mts +3 -3
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +2 -2
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.d.mts +2 -2
- package/dist/contract-psl__provider.mjs +3 -3
- package/dist/contract-ts.d.mts +5 -5
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.d.mts +1 -1
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +4 -4
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/{contract-view-C1xX3yIj.d.mts → contract-view-CijuTaer.d.mts} +2 -2
- package/dist/{contract-view-C1xX3yIj.d.mts.map → contract-view-CijuTaer.d.mts.map} +1 -1
- package/dist/contract.d.mts +19 -19
- package/dist/contract.mjs +14 -14
- package/dist/contract__authored-check-naming.d.mts +1 -1
- package/dist/contract__authored-check-naming.mjs +1 -1
- package/dist/contract__contract-view.d.mts +1 -1
- package/dist/contract__data-type.mjs +1 -1
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.d.mts +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.mjs +2 -2
- package/dist/contract__index-naming.d.mts +1 -1
- package/dist/contract__index-naming.mjs +1 -1
- package/dist/contract__index-type-validation.d.mts +2 -2
- package/dist/contract__index-type-validation.mjs +1 -1
- package/dist/contract__index-types.d.mts +3 -3
- package/dist/contract__index-types.mjs +2 -2
- package/dist/contract__resolve-storage-table.d.mts +1 -1
- package/dist/contract__types.d.mts +7 -7
- package/dist/contract__types.mjs +3 -3
- package/dist/contract__validators.d.mts +1 -1
- package/dist/contract__validators.mjs +2 -2
- package/dist/{control-C5Yy0n3w.mjs → control-4kwMnHYO.mjs} +13 -13
- package/dist/{control-C5Yy0n3w.mjs.map → control-4kwMnHYO.mjs.map} +1 -1
- package/dist/{control-B3Mb21Md.d.mts → control-BK2oKZmT.d.mts} +16 -16
- package/dist/{control-B3Mb21Md.d.mts.map → control-BK2oKZmT.d.mts.map} +1 -1
- package/dist/{control-adapter-CkFfBVei-BLYeKcLW.d.mts → control-adapter-CkFfBVei-DH5DAObc.d.mts} +8 -8
- package/dist/{control-adapter-CkFfBVei-BLYeKcLW.d.mts.map → control-adapter-CkFfBVei-DH5DAObc.d.mts.map} +1 -1
- package/dist/control-adapter-DB7MPI5L.d.mts +1 -0
- package/dist/{data-type-CAPmGXg9.mjs → data-type-C_PI_Jsa.mjs} +2 -2
- package/dist/{data-type-CAPmGXg9.mjs.map → data-type-C_PI_Jsa.mjs.map} +1 -1
- package/dist/{db-D7R5zKiH-P7Tg4ZXk.d.mts → db-DB1FVK1P-DbwoL7vg.d.mts} +48 -11
- package/dist/db-DB1FVK1P-DbwoL7vg.d.mts.map +1 -0
- package/dist/{ddl-types-DtKZjNtN-CByECwns.d.mts → ddl-types-DtKZjNtN-CwtcEWLd.d.mts} +3 -3
- package/dist/{ddl-types-DtKZjNtN-CByECwns.d.mts.map → ddl-types-DtKZjNtN-CwtcEWLd.d.mts.map} +1 -1
- package/dist/{derived-checks-D5zdlyyh-CPofdm1W.mjs → derived-checks-CfXjGvNH-CrXoMrPU.mjs} +22 -32
- package/dist/derived-checks-CfXjGvNH-CrXoMrPU.mjs.map +1 -0
- package/dist/{derived-checks-DpPkO6Dt-D3M7YEr2.d.mts → derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts} +3 -3
- package/dist/{derived-checks-DpPkO6Dt-D3M7YEr2.d.mts.map → derived-checks-DpPkO6Dt-ZEbWeWKL.d.mts.map} +1 -1
- package/dist/{diff-CBqsNkxe.d.mts → diff-l4-qJpTV.d.mts} +8 -8
- package/dist/{diff-CBqsNkxe.d.mts.map → diff-l4-qJpTV.d.mts.map} +1 -1
- package/dist/{dist-Dm_hQ-hh.mjs → dist-D8EkCena.mjs} +2 -2
- package/dist/{dist-Dm_hQ-hh.mjs.map → dist-D8EkCena.mjs.map} +1 -1
- package/dist/{entity-kinds-O3V1K26U-B8TUrsX2.mjs → entity-kinds-DDTkNIr9-DJ2EIO94.mjs} +5 -5
- package/dist/{entity-kinds-O3V1K26U-B8TUrsX2.mjs.map → entity-kinds-DDTkNIr9-DJ2EIO94.mjs.map} +1 -1
- package/dist/{entity-kinds--HvqT50S.d.mts → entity-kinds-DqUYen0Y.d.mts} +5 -5
- package/dist/{entity-kinds--HvqT50S.d.mts.map → entity-kinds-DqUYen0Y.d.mts.map} +1 -1
- package/dist/{expression-DE893va7.d.mts → expression-CvXfXCGs.d.mts} +7 -7
- package/dist/{expression-DE893va7.d.mts.map → expression-CvXfXCGs.d.mts.map} +1 -1
- package/dist/{factories-DzLBAAvj.d.mts → factories-BVIVyHQU.d.mts} +4 -4
- package/dist/{factories-DzLBAAvj.d.mts.map → factories-BVIVyHQU.d.mts.map} +1 -1
- package/dist/{factories-Bp41Aity.mjs → factories-CScqMnFk.mjs} +3 -3
- package/dist/{factories-Bp41Aity.mjs.map → factories-CScqMnFk.mjs.map} +1 -1
- package/dist/family.d.mts +13 -13
- package/dist/family.mjs +6 -6
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +4 -4
- package/dist/family__control.mjs +3 -3
- package/dist/family__diff.d.mts +2 -2
- package/dist/family__diff.mjs +1 -1
- package/dist/family__ir.d.mts +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/family__runtime.d.mts +2 -2
- package/dist/{foreign-key-materialization-D0Ltg78T.d.mts → foreign-key-materialization-DBYDet74.d.mts} +6 -4
- package/dist/foreign-key-materialization-DBYDet74.d.mts.map +1 -0
- package/dist/{foreign-key-materialization-Cv3q8Pix.mjs → foreign-key-materialization-DyoakLGY.mjs} +16 -7
- package/dist/foreign-key-materialization-DyoakLGY.mjs.map +1 -0
- package/dist/{index-oNRBExeI.d.mts → index-BzAG1PFV.d.mts} +11 -11
- package/dist/{index-oNRBExeI.d.mts.map → index-BzAG1PFV.d.mts.map} +1 -1
- package/dist/{index-CnpTmyXs.d.mts → index-We-mbWnZ.d.mts} +3 -3
- package/dist/{index-CnpTmyXs.d.mts.map → index-We-mbWnZ.d.mts.map} +1 -1
- package/dist/{index-equivalence-DswCiq5l-C7wLMPwF.mjs → index-equivalence-DswCiq5l-_gF1Un8p.mjs} +2 -2
- package/dist/{index-equivalence-DswCiq5l-C7wLMPwF.mjs.map → index-equivalence-DswCiq5l-_gF1Un8p.mjs.map} +1 -1
- package/dist/{index-naming-Cj1Anq-T-NX841eiU.mjs → index-naming-BOcJT1B3-CeEoP8t3.mjs} +7 -5
- package/dist/index-naming-BOcJT1B3-CeEoP8t3.mjs.map +1 -0
- package/dist/{index-naming-UEtT94f5.d.mts → index-naming-C7pme5Pj.d.mts} +4 -3
- package/dist/index-naming-C7pme5Pj.d.mts.map +1 -0
- package/dist/index-type-validation-Bcme_Ust.mjs +42 -0
- package/dist/index-type-validation-Bcme_Ust.mjs.map +1 -0
- package/dist/index-type-validation-D7-fPxIJ.d.mts +16 -0
- package/dist/index-type-validation-D7-fPxIJ.d.mts.map +1 -0
- package/dist/index-types-ByX8MLso.d.mts +1 -0
- package/dist/index-types-H1O43iYT-ONvDbszL.d.mts +66 -0
- package/dist/index-types-H1O43iYT-ONvDbszL.d.mts.map +1 -0
- package/dist/index-types-pC_5vADQ-TTUXAfmL.mjs +95 -0
- package/dist/index-types-pC_5vADQ-TTUXAfmL.mjs.map +1 -0
- package/dist/{interpreter-DlG-2o64-DmykcFbp.mjs → interpreter-DlG-2o64-CDb20sM1.mjs} +7 -7
- package/dist/{interpreter-DlG-2o64-DmykcFbp.mjs.map → interpreter-DlG-2o64-CDb20sM1.mjs.map} +1 -1
- package/dist/{ir-BPrf_vgX.d.mts → ir-OBn7ct21.d.mts} +3 -3
- package/dist/{ir-BPrf_vgX.d.mts.map → ir-OBn7ct21.d.mts.map} +1 -1
- package/dist/middleware-FHkIPvYR.d.mts +1 -0
- package/dist/{middleware-mLwvcOLS-SaqhgsmA.d.mts → middleware-mLwvcOLS-wIYSKgog.d.mts} +2 -2
- package/dist/{middleware-mLwvcOLS-SaqhgsmA.d.mts.map → middleware-mLwvcOLS-wIYSKgog.d.mts.map} +1 -1
- package/dist/{migration-C_J49WKy.d.mts → migration-DEK3Hxlo.d.mts} +4 -4
- package/dist/{migration-C_J49WKy.d.mts.map → migration-DEK3Hxlo.d.mts.map} +1 -1
- package/dist/{naming-C1OcnGJg-DB1o9TS6.d.mts → naming-BcD36g9T-DFyaudUa.d.mts} +3 -10
- package/dist/{naming-C1OcnGJg-DB1o9TS6.d.mts.map → naming-BcD36g9T-DFyaudUa.d.mts.map} +1 -1
- package/dist/{naming-DkG_OegU-DpENNdZX.mjs → naming-CT8tRisJ-DLHKo0Hm.mjs} +9 -10
- package/dist/{naming-DkG_OegU-DpENNdZX.mjs.map → naming-CT8tRisJ-DLHKo0Hm.mjs.map} +1 -1
- package/dist/operations.d.mts +1 -1
- package/dist/orm-client.d.mts +22 -25
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +20 -7
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{pack-DZtuLikU.d.mts → pack-D3L1b4Ag.d.mts} +2 -2
- package/dist/{pack-DZtuLikU.d.mts.map → pack-D3L1b4Ag.d.mts.map} +1 -1
- package/dist/plan-_8dKi13Q.d.mts +2 -0
- package/dist/{plan-cGEaSXHv-BeW-cC5v.d.mts → plan-cGEaSXHv-j0w37mVT.d.mts} +4 -4
- package/dist/{plan-cGEaSXHv-BeW-cC5v.d.mts.map → plan-cGEaSXHv-j0w37mVT.d.mts.map} +1 -1
- package/dist/{prepared-statement-YtgdlN7e-CI1fD5IM.d.mts → prepared-statement-YtgdlN7e-D4MSU3i0.d.mts} +16 -16
- package/dist/{prepared-statement-YtgdlN7e-CI1fD5IM.d.mts.map → prepared-statement-YtgdlN7e-D4MSU3i0.d.mts.map} +1 -1
- package/dist/{psl-build-B5iMVWHu.mjs → psl-build-DTE03hcr.mjs} +2 -2
- package/dist/{psl-build-B5iMVWHu.mjs.map → psl-build-DTE03hcr.mjs.map} +1 -1
- package/dist/{psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts → psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts} +2 -2
- package/dist/{psl-column-resolution-CNtNJ7g7-CEuutj8I.d.mts.map → psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts.map} +1 -1
- package/dist/{psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs → psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs} +4 -4
- package/dist/{psl-field-resolution-BW0ZuqBd-Dv18ERa7.mjs.map → psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs.map} +1 -1
- package/dist/{psl-infer-B0yuv-j_.mjs → psl-infer-DHO72J_m.mjs} +2 -2
- package/dist/{psl-infer-B0yuv-j_.mjs.map → psl-infer-DHO72J_m.mjs.map} +1 -1
- package/dist/{psl-infer-DkPZJnUM.d.mts → psl-infer-DsHE9xAU.d.mts} +3 -3
- package/dist/{psl-infer-DkPZJnUM.d.mts.map → psl-infer-DsHE9xAU.d.mts.map} +1 -1
- package/dist/{query-lane-context-CJoNBspB-CR_n8DNB.d.mts → query-lane-context-CJoNBspB--ieuKEei.d.mts} +5 -5
- package/dist/{query-lane-context-CJoNBspB-CR_n8DNB.d.mts.map → query-lane-context-CJoNBspB--ieuKEei.d.mts.map} +1 -1
- package/dist/query-lane-context-DNt2DeQu.d.mts +1 -0
- package/dist/relational-core.d.mts +11 -11
- package/dist/relational-core.mjs +1 -1
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__ast.d.mts +3 -3
- package/dist/relational-core__ast.mjs +1 -1
- package/dist/relational-core__codec-descriptor-registry.d.mts +4 -4
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__contract-free.d.mts +3 -3
- package/dist/relational-core__expression.d.mts +1 -1
- package/dist/relational-core__middleware.d.mts +2 -2
- package/dist/relational-core__plan.d.mts +3 -3
- package/dist/relational-core__query-lane-context.d.mts +2 -2
- package/dist/relational-core__types.d.mts +2 -2
- package/dist/{resolve-storage-table-B7m9cFy4.d.mts → resolve-storage-table-wSUswl-4.d.mts} +3 -3
- package/dist/{resolve-storage-table-B7m9cFy4.d.mts.map → resolve-storage-table-wSUswl-4.d.mts.map} +1 -1
- package/dist/{runtime-Ca7PVQcJ.d.mts → runtime-BHJXmBhw.d.mts} +2 -2
- package/dist/{runtime-Ca7PVQcJ.d.mts.map → runtime-BHJXmBhw.d.mts.map} +1 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +2 -2
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-CqWOkoW9-BABSAGGB.d.mts → schema-differ-CqWOkoW9-DQkzKV8b.d.mts} +5 -5
- package/dist/{schema-differ-CqWOkoW9-BABSAGGB.d.mts.map → schema-differ-CqWOkoW9-DQkzKV8b.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +1 -1
- package/dist/schema-ir.mjs +1 -1
- package/dist/schema-ir__naming.d.mts +1 -1
- package/dist/schema-ir__naming.mjs +1 -1
- package/dist/schema-ir__types.d.mts +2 -2
- package/dist/schema-ir__types.mjs +1 -1
- package/dist/{schema-verify-DIfHSB4I-Dx3Tq9hf.mjs → schema-verify-DIfHSB4I-k8l0LZZB.mjs} +4 -4
- package/dist/{schema-verify-DIfHSB4I-Dx3Tq9hf.mjs.map → schema-verify-DIfHSB4I-k8l0LZZB.mjs.map} +1 -1
- package/dist/{serialized-index-C26m_DWu-CnNi8WAI.mjs → serialized-index-C26m_DWu-BjU519sW.mjs} +3 -3
- package/dist/{serialized-index-C26m_DWu-CnNi8WAI.mjs.map → serialized-index-C26m_DWu-BjU519sW.mjs.map} +1 -1
- package/dist/{serialized-index-CrgG8ct1-D64Figsu.d.mts → serialized-index-CrgG8ct1-DDfHKUEK.d.mts} +3 -3
- package/dist/{serialized-index-CrgG8ct1-D64Figsu.d.mts.map → serialized-index-CrgG8ct1-DDfHKUEK.d.mts.map} +1 -1
- package/dist/{sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs → sql-contract-serializer-DDaAVCQr-CGG0I8ur.mjs} +5 -5
- package/dist/{sql-contract-serializer-DDaAVCQr-c3jZiPS3.mjs.map → sql-contract-serializer-DDaAVCQr-CGG0I8ur.mjs.map} +1 -1
- package/dist/{sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts → sql-execution-plan-C7XauPPu-eskZJbmm.d.mts} +2 -2
- package/dist/{sql-execution-plan-C7XauPPu-BFhGKvp4.d.mts.map → sql-execution-plan-C7XauPPu-eskZJbmm.d.mts.map} +1 -1
- package/dist/{sql-index-ByAAE7K8-DPkZtr7t.d.mts → sql-index-ByAAE7K8-BpbPBWPD.d.mts} +2 -2
- package/dist/{sql-index-ByAAE7K8-DPkZtr7t.d.mts.map → sql-index-ByAAE7K8-BpbPBWPD.d.mts.map} +1 -1
- package/dist/{sql-storage-BTlJLUID-O6fBB_am.d.mts → sql-storage-BTlJLUID-CGy3wuH4.d.mts} +2 -2
- package/dist/{sql-storage-BTlJLUID-O6fBB_am.d.mts.map → sql-storage-BTlJLUID-CGy3wuH4.d.mts.map} +1 -1
- package/dist/{storage-table-B7OSPl3G-EOodFPzq.mjs → storage-table-B7OSPl3G-p1j6AjMS.mjs} +2 -2
- package/dist/{storage-table-B7OSPl3G-EOodFPzq.mjs.map → storage-table-B7OSPl3G-p1j6AjMS.mjs.map} +1 -1
- package/dist/{storage-table-WXeVNycx-tlFMnbig.d.mts → storage-table-WXeVNycx-BCwDhdq5.d.mts} +4 -4
- package/dist/{storage-table-WXeVNycx-tlFMnbig.d.mts.map → storage-table-WXeVNycx-BCwDhdq5.d.mts.map} +1 -1
- package/dist/types-BCPHaykc.d.mts +1 -0
- package/dist/{types-BJQcLx-8-DY221fiX.d.mts → types-BJQcLx-8-BHNxJ_df.d.mts} +10 -10
- package/dist/{types-BJQcLx-8-DY221fiX.d.mts.map → types-BJQcLx-8-BHNxJ_df.d.mts.map} +1 -1
- package/dist/{types-CzxOObSY-DEfjmbj1.d.mts → types-CzxOObSY-CxZ_bdVi.d.mts} +9 -9
- package/dist/{types-CzxOObSY-DEfjmbj1.d.mts.map → types-CzxOObSY-CxZ_bdVi.d.mts.map} +1 -1
- package/dist/{types-Cz_bcUWN-CC3lFQOi.mjs → types-D0GFxty0-CP8b4dR3.mjs} +4 -4
- package/dist/{types-Cz_bcUWN-CC3lFQOi.mjs.map → types-D0GFxty0-CP8b4dR3.mjs.map} +1 -1
- package/dist/{types-DFZhLz18-C_h0u-Zx.d.mts → types-DFZhLz18-Msi8wwig.d.mts} +6 -6
- package/dist/{types-DFZhLz18-C_h0u-Zx.d.mts.map → types-DFZhLz18-Msi8wwig.d.mts.map} +1 -1
- package/dist/{types-CLsPsUiw-Db1BsN9R.d.mts → types-DIZSW9JI-DNUF-RnL.d.mts} +3 -3
- package/dist/{types-CLsPsUiw-Db1BsN9R.d.mts.map → types-DIZSW9JI-DNUF-RnL.d.mts.map} +1 -1
- package/dist/{types-C7oOtFcJ.mjs → types-DXrO0fxT.mjs} +2 -2
- package/dist/{types-C7oOtFcJ.mjs.map → types-DXrO0fxT.mjs.map} +1 -1
- package/dist/types-DqSCaTK3.d.mts +1 -0
- package/dist/{types-Sh5HuaZE-B_FQUPng.d.mts → types-Sh5HuaZE-CqThc46M.d.mts} +2 -2
- package/dist/{types-Sh5HuaZE-B_FQUPng.d.mts.map → types-Sh5HuaZE-CqThc46M.d.mts.map} +1 -1
- package/dist/{types-BURWzacK.d.mts → types-Uv3oTMAb.d.mts} +7 -7
- package/dist/{types-BURWzacK.d.mts.map → types-Uv3oTMAb.d.mts.map} +1 -1
- package/dist/{validators-oyDG5mVX.mjs → validators-CIfn8ezs.mjs} +5 -5
- package/dist/{validators-oyDG5mVX.mjs.map → validators-CIfn8ezs.mjs.map} +1 -1
- package/dist/{validators-Cr_FFJAG.d.mts → validators-COcD3_iw.d.mts} +3 -3
- package/dist/{validators-Cr_FFJAG.d.mts.map → validators-COcD3_iw.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/contract-builder-V5pFHDv3.d.mts.map +0 -1
- package/dist/contract-builder-tEax3I2q.mjs.map +0 -1
- package/dist/control-adapter-BXQ29_fa.d.mts +0 -1
- package/dist/db-D7R5zKiH-P7Tg4ZXk.d.mts.map +0 -1
- package/dist/derived-checks-D5zdlyyh-CPofdm1W.mjs.map +0 -1
- package/dist/foreign-key-materialization-Cv3q8Pix.mjs.map +0 -1
- package/dist/foreign-key-materialization-D0Ltg78T.d.mts.map +0 -1
- package/dist/index-naming-Cj1Anq-T-NX841eiU.mjs.map +0 -1
- package/dist/index-naming-UEtT94f5.d.mts.map +0 -1
- package/dist/index-type-validation-B925ye4q.d.mts +0 -10
- package/dist/index-type-validation-B925ye4q.d.mts.map +0 -1
- package/dist/index-type-validation-COH4d78M.mjs +0 -17
- package/dist/index-type-validation-COH4d78M.mjs.map +0 -1
- package/dist/index-types-CNhHgKHi.d.mts +0 -1
- package/dist/index-types-DJQ_xwaE.mjs +0 -40
- package/dist/index-types-DJQ_xwaE.mjs.map +0 -1
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts +0 -31
- package/dist/index-types-DPVhsW0v-D-BikM4h.d.mts.map +0 -1
- package/dist/middleware-DwaZ6s12.d.mts +0 -1
- package/dist/plan-Dhl03MtT.d.mts +0 -2
- package/dist/query-lane-context-BaoHpLsE.d.mts +0 -1
- package/dist/types-D6XuABFQ.d.mts +0 -1
- package/dist/types-DLjT0ADz.d.mts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-equivalence-DswCiq5l-
|
|
1
|
+
{"version":3,"file":"index-equivalence-DswCiq5l-_gF1Un8p.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-equivalence-DswCiq5l.mjs"],"sourcesContent":["import { SqlIndexIR } from \"@internal/sql-schema-ir/types\";\n//#region src/index-equivalence.ts\n/** The schema node the planner builds for an index the contract states, which is what it compares. */\nfunction indexNodeOf(index) {\n\treturn new SqlIndexIR({\n\t\t...index,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: index.where !== void 0\n\t});\n}\n/** Whether the planner sees two indexes as the same index apart from their names. */\nfunction identicalIndexes(a, b) {\n\treturn a.contentEquals(b, {\n\t\tcolumnPresence: \"matching\",\n\t\tbodies: \"verbatim\"\n\t});\n}\n/** The index the contract build derives to back a foreign key on `columns`, as the planner sees it. */\nfunction derivedBackingIndexNode(columns) {\n\treturn new SqlIndexIR({\n\t\tnaming: {\n\t\t\tkind: \"exact\",\n\t\t\tname: \"derived backing index\"\n\t\t},\n\t\tcolumns,\n\t\twhere: void 0,\n\t\tunique: false,\n\t\ttype: void 0,\n\t\toptions: void 0,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: false\n\t});\n}\nfunction sameColumns(a, b) {\n\treturn a.length === b.length && startsWithColumns(a, b);\n}\n/** Whether `columns` begins with `leading`, in order: an index or key on such columns serves lookups on `leading`. */\nfunction startsWithColumns(columns, leading) {\n\treturn leading.length <= columns.length && leading.every((column, position) => column === columns[position]);\n}\n/**\n* The key that serves every lookup of `index`, when `index` is a plain non-unique index: one the planner sees as identical to an index derived on its columns. A unique index serves only when it has no predicate.\n*/\nfunction servingKey(index, table) {\n\tconst { columns } = index;\n\tif (columns === void 0 || !identicalIndexes(index, derivedBackingIndexNode(columns))) return;\n\tif (table.primaryKey !== void 0 && sameColumns(table.primaryKey.columns, columns)) return {\n\t\tkind: \"primaryKey\",\n\t\tprimaryKey: table.primaryKey\n\t};\n\tconst unique = table.uniques.find((constraint) => sameColumns(constraint.columns, columns));\n\tif (unique !== void 0) return {\n\t\tkind: \"uniqueConstraint\",\n\t\tunique\n\t};\n\tconst uniqueIndex = table.indexes.find((candidate) => {\n\t\tconst node = table.nodeOf(candidate);\n\t\treturn node.unique && node.where === void 0 && node.columns !== void 0 && sameColumns(node.columns, columns);\n\t});\n\treturn uniqueIndex === void 0 ? void 0 : {\n\t\tkind: \"index\",\n\t\tindex: uniqueIndex\n\t};\n}\n/**\n* Whether the contract build would drop the backing index it derives for a foreign key on `columns`, because the table already has an identical index or a key serving its lookups. `contract infer` asks this of a live table to decide whether a relation needs `index: false`.\n*/\nfunction derivedBackingIndexIsRedundant(columns, table) {\n\tconst derived = derivedBackingIndexNode(columns);\n\treturn table.indexes.some((index) => identicalIndexes(table.nodeOf(index), derived)) || servingKey(derived, table) !== void 0;\n}\n/** Whether the planner sees `index` as a plain index: its columns, uniqueness and nothing else. */\nfunction isPlainIndexNode(index) {\n\tif (index.columns === void 0) return false;\n\treturn identicalIndexes(index, new SqlIndexIR({\n\t\tnaming: {\n\t\t\tkind: \"exact\",\n\t\t\tname: \"plain index\"\n\t\t},\n\t\tcolumns: index.columns,\n\t\twhere: void 0,\n\t\tunique: index.unique,\n\t\ttype: void 0,\n\t\toptions: void 0,\n\t\tannotations: void 0,\n\t\tdependsOn: void 0,\n\t\tpartial: false\n\t}));\n}\n/**\n* The name of an object of the table that serves lookups on `columns` although the build would keep a derived backing index beside it: a named primary key or unique constraint, or a plain index, whose first columns are `columns`. A source that derives no backing index of its own names it on the relation instead of writing `index: false`.\n*/\nfunction leadingBackingObjectName(columns, table) {\n\tconst { primaryKey } = table;\n\tif (primaryKey?.name !== void 0 && startsWithColumns(primaryKey.columns, columns)) return primaryKey.name;\n\tconst unique = table.uniques.find((constraint) => constraint.name !== void 0 && startsWithColumns(constraint.columns, columns));\n\tif (unique?.name !== void 0) return unique.name;\n\tconst index = table.indexes.find((candidate) => {\n\t\tconst node = table.nodeOf(candidate);\n\t\treturn node.columns !== void 0 && startsWithColumns(node.columns, columns) && isPlainIndexNode(node);\n\t});\n\treturn index === void 0 ? void 0 : table.nameOf(index);\n}\n//#endregion\nexport { sameColumns as a, leadingBackingObjectName as i, identicalIndexes as n, servingKey as o, indexNodeOf as r, startsWithColumns as s, derivedBackingIndexIsRedundant as t };\n\n//# sourceMappingURL=index-equivalence-DswCiq5l.mjs.map"],"mappings":";;;AAGA,SAAS,YAAY,OAAO;CAC3B,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,SAAS,MAAM,UAAU,KAAK;CAC/B,CAAC;AACF;;AAEA,SAAS,iBAAiB,GAAG,GAAG;CAC/B,OAAO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AM,QAAQ,MAAM,UAAU,iBAAiB,MAAM,OAAO,KAAK,GAAG,OAAO,CAAC,KAAK,WAAW,SAAS,KAAK,MAAM,KAAK;AAC7H;;AAEA,SAAS,iBAAiB,OAAO;CAChC,IAAI,MAAM,YAAY,KAAK,GAAG,OAAO;CACrC,OAAO,iBAAiB,OAAO,IAAI,WAAW;EAC7C,QAAQ;GACP,MAAM;GACN,MAAM;EACP;EACA,SAAS,MAAM;EACf,OAAO,KAAK;EACZ,QAAQ,MAAM;EACd,MAAM,KAAK;EACX,SAAS,KAAK;EACd,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,SAAS;CACV,CAAC,CAAC;AACH;;;;AAIA,SAAS,yBAAyB,SAAS,OAAO;CACjD,MAAM,EAAE,eAAe;CACvB,IAAI,YAAY,SAAS,KAAK,KAAK,kBAAkB,WAAW,SAAS,OAAO,GAAG,OAAO,WAAW;CACrG,MAAM,SAAS,MAAM,QAAQ,MAAM,eAAe,WAAW,SAAS,KAAK,KAAK,kBAAkB,WAAW,SAAS,OAAO,CAAC;CAC9H,IAAI,QAAQ,SAAS,KAAK,GAAG,OAAO,OAAO;CAC3C,MAAM,QAAQ,MAAM,QAAQ,MAAM,cAAc;EAC/C,MAAM,OAAO,MAAM,OAAO,SAAS;EACnC,OAAO,KAAK,YAAY,KAAK,KAAK,kBAAkB,KAAK,SAAS,OAAO,KAAK,iBAAiB,IAAI;CACpG,CAAC;CACD,OAAO,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,OAAO,KAAK;AACtD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as rendersIndexBody } from "./index-types-pC_5vADQ-TTUXAfmL.mjs";
|
|
3
|
+
import { a as computeIndexContentHash, n as assertWireNamePrefixLength, o as defaultIndexName } from "./naming-CT8tRisJ-DLHKo0Hm.mjs";
|
|
3
4
|
import { flushAuthoringWarnings } from "@prisma/orm-framework/components/authoring";
|
|
4
|
-
//#region ../../../2-sql/1-core/contract/dist/index-naming-
|
|
5
|
+
//#region ../../../2-sql/1-core/contract/dist/index-naming-BOcJT1B3.mjs
|
|
5
6
|
/**
|
|
6
7
|
* Narrows the opaque payload a contributed model attribute returns under
|
|
7
8
|
* `index` (see `AuthoringModelAttributeIndexOutput`). The framework hands the
|
|
@@ -70,14 +71,15 @@ function exactNameBodyWarning(subject, exactName) {
|
|
|
70
71
|
* The cross-field guards are the shared enforcement backstop for both
|
|
71
72
|
* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).
|
|
72
73
|
*/
|
|
73
|
-
function lowerAuthoredIndex(tableName, authored, warnings) {
|
|
74
|
+
function lowerAuthoredIndex(tableName, authored, warnings, indexTypes) {
|
|
74
75
|
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.`);
|
|
75
76
|
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.`);
|
|
76
77
|
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.`);
|
|
77
78
|
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).`);
|
|
78
79
|
const unique = authored.unique ?? false;
|
|
79
80
|
if (authored.map !== void 0) {
|
|
80
|
-
|
|
81
|
+
const typeEntry = authored.type === void 0 ? void 0 : indexTypes?.get(authored.type);
|
|
82
|
+
if (authored.expression !== void 0 || authored.where !== void 0 || typeEntry !== void 0 && rendersIndexBody(typeEntry)) {
|
|
81
83
|
const warning = exactNameBodyWarning("index", authored.map);
|
|
82
84
|
if (warnings !== void 0) warnings.push(warning);
|
|
83
85
|
else flushAuthoringWarnings([warning]);
|
|
@@ -131,4 +133,4 @@ function lowerAuthoredIndex(tableName, authored, warnings) {
|
|
|
131
133
|
//#endregion
|
|
132
134
|
export { isAuthoredIndexInput as n, lowerAuthoredIndex as r, exactNameBodyWarning as t };
|
|
133
135
|
|
|
134
|
-
//# sourceMappingURL=index-naming-
|
|
136
|
+
//# sourceMappingURL=index-naming-BOcJT1B3-CeEoP8t3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-naming-BOcJT1B3-CeEoP8t3.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming-BOcJT1B3.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as rendersIndexBody } from \"./index-types-pC_5vADQ.mjs\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { assertWireNamePrefixLength, computeIndexContentHash, defaultIndexName } from \"@internal/sql-schema-ir/naming\";\n//#region src/index-naming.ts\n/**\n* Narrows the opaque payload a contributed model attribute returns under\n* `index` (see `AuthoringModelAttributeIndexOutput`). The framework hands the\n* value through untyped because an index's shape belongs to the family; this\n* is the SQL family's boundary check. It proves the structure only — the\n* name/map and expression rules stay where `@@index` enforces them, in\n* {@link lowerAuthoredIndex}.\n*/\nfunction isAuthoredIndexInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = { ...value };\n\tif (typeof candidate[\"expression\"] === \"string\" === (Array.isArray(candidate[\"columns\"]) && candidate[\"columns\"].every((element) => typeof element === \"string\"))) return false;\n\tif (!isOptionalString(candidate[\"where\"])) return false;\n\tif (!isOptionalString(candidate[\"map\"])) return false;\n\tif (!isOptionalString(candidate[\"name\"])) return false;\n\tif (candidate[\"unique\"] !== void 0 && typeof candidate[\"unique\"] !== \"boolean\") return false;\n\tif (candidate[\"type\"] === void 0) return candidate[\"options\"] === void 0;\n\tif (typeof candidate[\"type\"] !== \"string\") return false;\n\tconst options = candidate[\"options\"];\n\treturn options === void 0 || typeof options === \"object\" && options !== null && !Array.isArray(options);\n}\nfunction isOptionalString(value) {\n\treturn value === void 0 || typeof value === \"string\";\n}\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 or check moves to wire naming via\n* `name:`; a policy has no such parameter — dropping `@@map` makes the\n* block's head the wire prefix.\n*/\nconst EXACT_NAME_BODY_REMEDIATION = {\n\tindex: \"For hand-authored definitions, use name: and let Prisma 8 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\tcheck: \"For hand-authored definitions, use name: and let Prisma 8 manage the physical name; to migrate an adopted check to wire naming, replace map: with name: (keeping the body text unchanged) and apply the resulting rename migration.\"\n};\n/** What the user actually wrote, per subject: index and check `map:`, policy `@@map`. */\nconst EXACT_NAME_FEATURE = {\n\tindex: \"map:\",\n\tpolicy: \"@@map\",\n\tcheck: \"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` distinguishes the index, policy, and\n* check callers that mint this same warning; the feature name and the\n* remediation are subject-specific end to end, so a batched summary\n* (grouped on 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, indexTypes) {\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\tconst typeEntry = authored.type === void 0 ? void 0 : indexTypes?.get(authored.type);\n\t\tif (authored.expression !== void 0 || authored.where !== void 0 || typeEntry !== void 0 && rendersIndexBody(typeEntry)) {\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 { isAuthoredIndexInput as n, lowerAuthoredIndex as r, exactNameBodyWarning as t };\n\n//# sourceMappingURL=index-naming-BOcJT1B3.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,qBAAqB,OAAO;CACpC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY,EAAE,GAAG,MAAM;CAC7B,IAAI,OAAO,UAAU,kBAAkB,cAAc,MAAM,QAAQ,UAAU,UAAU,KAAK,UAAU,UAAU,CAAC,OAAO,YAAY,OAAO,YAAY,QAAQ,IAAI,OAAO;CAC1K,IAAI,CAAC,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K,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { r as IndexInput } from "./sql-index-ByAAE7K8-
|
|
1
|
+
import { r as IndexInput } from "./sql-index-ByAAE7K8-BpbPBWPD.mjs";
|
|
2
|
+
import { a as IndexTypeRegistry } from "./index-types-H1O43iYT-ONvDbszL.mjs";
|
|
2
3
|
import { AuthoringWarning, AuthoringWarningSink } from "@prisma/orm-framework/components/authoring";
|
|
3
4
|
//#region ../../../2-sql/1-core/contract/dist/index-naming.d.mts
|
|
4
5
|
//#region src/index-naming.d.ts
|
|
@@ -65,7 +66,7 @@ declare function exactNameBodyWarning(subject: 'index' | 'policy' | 'check', exa
|
|
|
65
66
|
* The cross-field guards are the shared enforcement backstop for both
|
|
66
67
|
* authoring surfaces (PSL pre-empts them with span-anchored diagnostics).
|
|
67
68
|
*/
|
|
68
|
-
declare function lowerAuthoredIndex(tableName: string, authored: AuthoredIndexInput, warnings?: AuthoringWarningSink): IndexInput;
|
|
69
|
+
declare function lowerAuthoredIndex(tableName: string, authored: AuthoredIndexInput, warnings?: AuthoringWarningSink, indexTypes?: Pick<IndexTypeRegistry, 'get'>): IndexInput;
|
|
69
70
|
//#endregion
|
|
70
71
|
export { lowerAuthoredIndex as a, isAuthoredIndexInput as i, AuthoredIndexMethod as n, exactNameBodyWarning as r, AuthoredIndexInput as t };
|
|
71
|
-
//# sourceMappingURL=index-naming-
|
|
72
|
+
//# sourceMappingURL=index-naming-C7pme5Pj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-naming-C7pme5Pj.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-naming.d.mts"],"mappings":";;;;;;;;;KAQK;WACM;WACA;;WAEA;WACA;;;;;;;;;KASN;WACM;WACA;;WAEA;WACA,SAAS;;;;;;;;;KASf,qBAAqB,wBAAwB;WACvC;WACA;WACA;WACA;;;;;;;;;;iBAUM,qBAAqB,iBAAiB,SAAS;;;;;;;;;iBAS/C,qBAAqB,uCAAuC,oBAAoB;;;;;;;;iBAQhF,mBAAmB,mBAAmB,UAAU,oBAAoB,WAAW,sBAAsB,aAAa,KAAK,4BAA4B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
+
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
3
|
+
import { type } from "arktype";
|
|
4
|
+
//#region ../../../2-sql/1-core/contract/dist/index-type-validation.mjs
|
|
5
|
+
function validateIndexTypes(contract, indexTypeRegistry, codecTraits) {
|
|
6
|
+
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) {
|
|
7
|
+
if (index.type === void 0) continue;
|
|
8
|
+
const entry = indexTypeRegistry.get(index.type);
|
|
9
|
+
if (entry === void 0) throw new ContractValidationError(`Namespace "${namespaceId}" table "${tableName}" index "${index.name}" uses unregistered index type "${index.type}"`, "storage");
|
|
10
|
+
const optionsValue = index.options ?? {};
|
|
11
|
+
const result = entry.options(optionsValue);
|
|
12
|
+
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");
|
|
13
|
+
assertColumnTraits(entry, index, table.columns, codecTraits);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function assertColumnTraits(entry, index, columns, codecTraits) {
|
|
17
|
+
const required = entry.columnTraits ?? [];
|
|
18
|
+
if (required.length === 0) return;
|
|
19
|
+
for (const column of index.columns ?? []) {
|
|
20
|
+
const codecId = columns[column]?.codecId;
|
|
21
|
+
if (codecId === void 0) continue;
|
|
22
|
+
const traits = codecTraits(codecId);
|
|
23
|
+
const missing = required.filter((trait) => traits?.includes(trait) !== true);
|
|
24
|
+
if (missing.length === 0) continue;
|
|
25
|
+
const missingList = missing.map((trait) => `"${trait}"`).join(", ");
|
|
26
|
+
throw contractError("CONTRACT.INDEX_INVALID", `Index "${index.name}" of type "${entry.type}" covers the column "${column}", stored as \`${codecId}\`, which lacks the trait ${missingList} the type requires.`, {
|
|
27
|
+
why: `An index of type "${entry.type}" can only cover columns whose codec carries ${required.map((trait) => `"${trait}"`).join(", ")}.`,
|
|
28
|
+
fix: "Index a column of a type this index type supports, or use another index type.",
|
|
29
|
+
meta: {
|
|
30
|
+
indexType: entry.type,
|
|
31
|
+
index: index.name,
|
|
32
|
+
column,
|
|
33
|
+
codecId,
|
|
34
|
+
missingTraits: missing
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { validateIndexTypes as t };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=index-type-validation-Bcme_Ust.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-type-validation-Bcme_Ust.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-type-validation.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { type } from \"arktype\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\n//#region src/index-type-validation.ts\nfunction validateIndexTypes(contract, indexTypeRegistry, codecTraits) {\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\tassertColumnTraits(entry, index, table.columns, codecTraits);\n\t}\n}\nfunction assertColumnTraits(entry, index, columns, codecTraits) {\n\tconst required = entry.columnTraits ?? [];\n\tif (required.length === 0) return;\n\tfor (const column of index.columns ?? []) {\n\t\tconst codecId = columns[column]?.codecId;\n\t\tif (codecId === void 0) continue;\n\t\tconst traits = codecTraits(codecId);\n\t\tconst missing = required.filter((trait) => traits?.includes(trait) !== true);\n\t\tif (missing.length === 0) continue;\n\t\tconst missingList = missing.map((trait) => `\"${trait}\"`).join(\", \");\n\t\tthrow contractError(\"CONTRACT.INDEX_INVALID\", `Index \"${index.name}\" of type \"${entry.type}\" covers the column \"${column}\", stored as \\`${codecId}\\`, which lacks the trait ${missingList} the type requires.`, {\n\t\t\twhy: `An index of type \"${entry.type}\" can only cover columns whose codec carries ${required.map((trait) => `\"${trait}\"`).join(\", \")}.`,\n\t\t\tfix: \"Index a column of a type this index type supports, or use another index type.\",\n\t\t\tmeta: {\n\t\t\t\tindexType: entry.type,\n\t\t\t\tindex: index.name,\n\t\t\t\tcolumn,\n\t\t\t\tcodecId,\n\t\t\t\tmissingTraits: missing\n\t\t\t}\n\t\t});\n\t}\n}\n//#endregion\nexport { validateIndexTypes };\n\n//# sourceMappingURL=index-type-validation.mjs.map"],"mappings":";;;;AAIA,SAAS,mBAAmB,UAAU,mBAAmB,aAAa;CACrE,KAAK,MAAM,CAAC,aAAa,OAAO,OAAO,QAAQ,SAAS,QAAQ,UAAU,GAAG,KAAK,MAAM,CAAC,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EAAE;GACrI,KAAK;GACL,MAAM;IACL,WAAW,MAAM;IACjB,OAAO,MAAM;IACb;IACA;IACA,eAAe;GAChB;EACD,CAAC;CACF;AACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
2
|
+
import "./types-DFZhLz18-Msi8wwig.mjs";
|
|
3
|
+
import { a as IndexTypeRegistry } from "./index-types-H1O43iYT-ONvDbszL.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
|
+
/**
|
|
8
|
+
* The traits of the codec registered under an id, or `undefined` when the lookup does not know the
|
|
9
|
+
* codec. The contract build refuses a column whose codec the lookup does not know before it checks
|
|
10
|
+
* index types; here an unknown codec lacks every trait.
|
|
11
|
+
*/
|
|
12
|
+
type CodecTraitsLookup = (codecId: string) => readonly string[] | undefined;
|
|
13
|
+
declare function validateIndexTypes(contract: Contract<SqlStorage>, indexTypeRegistry: IndexTypeRegistry, codecTraits: CodecTraitsLookup): void;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { validateIndexTypes as n, CodecTraitsLookup as t };
|
|
16
|
+
//# sourceMappingURL=index-type-validation-D7-fPxIJ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-type-validation-D7-fPxIJ.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-type-validation.d.mts"],"mappings":";;;;;;;;;;;KAUK,qBAAqB;iBACT,mBAAmB,UAAU,SAAS,aAAa,mBAAmB,mBAAmB,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-types-H1O43iYT-ONvDbszL.mjs";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Type } from "arktype";
|
|
2
|
+
//#region ../../../2-sql/1-core/contract/dist/index-types-H1O43iYT.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
|
+
* The access method an index of this type is created with. It is the type literal itself for an
|
|
9
|
+
* access method such as `btree`. When it differs, the type is a kind of index the target turns
|
|
10
|
+
* into an index of that access method, rendering its body from the options. Only the target
|
|
11
|
+
* provides that conversion, so {@link indexTypeRegistryOf} refuses such an entry from an extension
|
|
12
|
+
* pack. Absent, it is the type literal.
|
|
13
|
+
*/
|
|
14
|
+
readonly accessMethod?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Traits the codec of every column an index of this type covers must carry. The contract build
|
|
17
|
+
* checks them through the contract's codec lookup.
|
|
18
|
+
*/
|
|
19
|
+
readonly columnTraits?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
type IndexTypeDeclaration<TOpts> = {
|
|
22
|
+
readonly options: Type<TOpts>;
|
|
23
|
+
readonly accessMethod?: string;
|
|
24
|
+
readonly columnTraits?: readonly string[];
|
|
25
|
+
};
|
|
26
|
+
type IndexTypeMap = { readonly [K in string]: {
|
|
27
|
+
readonly options: unknown;
|
|
28
|
+
}; };
|
|
29
|
+
interface IndexTypeRegistration<TMap extends IndexTypeMap = Record<never, never>> {
|
|
30
|
+
readonly IndexTypes: TMap;
|
|
31
|
+
readonly entries: ReadonlyArray<IndexTypeEntry>;
|
|
32
|
+
}
|
|
33
|
+
interface IndexTypeBuilder<TMap extends IndexTypeMap = Record<never, never>> extends IndexTypeRegistration<TMap> {
|
|
34
|
+
add<TLit extends string, TOpts>(typeLiteral: TLit, entry: IndexTypeDeclaration<TOpts>): IndexTypeBuilder<TMap & Record<TLit, {
|
|
35
|
+
readonly options: TOpts;
|
|
36
|
+
}>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether an index of this type is rendered from its options rather than written by its author: a
|
|
40
|
+
* type whose access method is not its own literal. Its SQL body is the target's rendering, so an
|
|
41
|
+
* exact-named index of the type is compared by that body.
|
|
42
|
+
*/
|
|
43
|
+
declare function rendersIndexBody(entry: IndexTypeEntry): boolean;
|
|
44
|
+
/** The access method an index of this type is created with. */
|
|
45
|
+
declare function accessMethodOf(entry: IndexTypeEntry): string;
|
|
46
|
+
declare function defineIndexTypes(): IndexTypeBuilder<Record<never, never>>;
|
|
47
|
+
interface IndexTypeRegistry {
|
|
48
|
+
register(entry: IndexTypeEntry): void;
|
|
49
|
+
get(typeLiteral: string): IndexTypeEntry | undefined;
|
|
50
|
+
has(typeLiteral: string): boolean;
|
|
51
|
+
}
|
|
52
|
+
declare function createIndexTypeRegistry(): IndexTypeRegistry;
|
|
53
|
+
/** A pack as it offers index types: its id and, optionally, its `indexTypes` registration. */
|
|
54
|
+
interface IndexTypeRegistrant {
|
|
55
|
+
readonly id?: string;
|
|
56
|
+
readonly indexTypes?: unknown;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The registry of every index type the target and the extension packs a contract is built or
|
|
60
|
+
* inferred with register. An extension pack's entry whose access method is not its type literal is
|
|
61
|
+
* refused, because only the target converts such a type into an index of its access method.
|
|
62
|
+
*/
|
|
63
|
+
declare function indexTypeRegistryOf(target: IndexTypeRegistrant, extensions?: readonly IndexTypeRegistrant[]): IndexTypeRegistry;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { IndexTypeRegistry as a, defineIndexTypes as c, IndexTypeRegistration as i, indexTypeRegistryOf as l, IndexTypeEntry as n, accessMethodOf as o, IndexTypeMap as r, createIndexTypeRegistry as s, IndexTypeBuilder as t, rendersIndexBody as u };
|
|
66
|
+
//# sourceMappingURL=index-types-H1O43iYT-ONvDbszL.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types-H1O43iYT-ONvDbszL.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-types-H1O43iYT.d.mts"],"mappings":";;;UAEU,eAAe;WACd;WACA,SAAS,KAAK;;;;;;;;WAQd;;;;;WAKA;;KAEN,qBAAqB;WACf,SAAS,KAAK;WACd;WACA;;KAEN,2BAA2B;WACrB;;UAED,sBAAsB,aAAa,eAAe;WACjD,YAAY;WACZ,SAAS,cAAc;;UAExB,iBAAiB,aAAa,eAAe,8BAA8B,sBAAsB;EACzG,IAAI,qBAAqB,OAAO,aAAa,MAAM,OAAO,qBAAqB,SAAS,iBAAiB,OAAO,OAAO;aAC5G,SAAS;;;;;;;;iBAQL,iBAAiB,OAAO;;iBAExB,eAAe,OAAO;iBACtB,oBAAoB,iBAAiB;UAC5C;EACR,SAAS,OAAO;EAChB,IAAI,sBAAsB;EAC1B,IAAI;;iBAEW,2BAA2B;;UAElC;WACC;WACA;;;;;;;iBAOM,oBAAoB,QAAQ,qBAAqB,sBAAsB,wBAAwB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
|
+
//#region ../../../2-sql/1-core/contract/dist/index-types-pC_5vADQ.mjs
|
|
4
|
+
var IndexTypeBuilderImpl = class IndexTypeBuilderImpl {
|
|
5
|
+
entries;
|
|
6
|
+
IndexTypes;
|
|
7
|
+
constructor(entries) {
|
|
8
|
+
this.entries = entries;
|
|
9
|
+
this.IndexTypes = {};
|
|
10
|
+
}
|
|
11
|
+
add(typeLiteral, entry) {
|
|
12
|
+
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 } });
|
|
13
|
+
return new IndexTypeBuilderImpl([...this.entries, {
|
|
14
|
+
type: typeLiteral,
|
|
15
|
+
options: entry.options,
|
|
16
|
+
...ifDefined("accessMethod", entry.accessMethod),
|
|
17
|
+
...ifDefined("columnTraits", entry.columnTraits)
|
|
18
|
+
}]);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether an index of this type is rendered from its options rather than written by its author: a
|
|
23
|
+
* type whose access method is not its own literal. Its SQL body is the target's rendering, so an
|
|
24
|
+
* exact-named index of the type is compared by that body.
|
|
25
|
+
*/
|
|
26
|
+
function rendersIndexBody(entry) {
|
|
27
|
+
return accessMethodOf(entry) !== entry.type;
|
|
28
|
+
}
|
|
29
|
+
/** The access method an index of this type is created with. */
|
|
30
|
+
function accessMethodOf(entry) {
|
|
31
|
+
return entry.accessMethod ?? entry.type;
|
|
32
|
+
}
|
|
33
|
+
function defineIndexTypes() {
|
|
34
|
+
return new IndexTypeBuilderImpl([]);
|
|
35
|
+
}
|
|
36
|
+
var IndexTypeRegistryImpl = class {
|
|
37
|
+
entries = /* @__PURE__ */ new Map();
|
|
38
|
+
register(entry) {
|
|
39
|
+
if (this.entries.has(entry.type)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Index type "${entry.type}" is already registered`, { meta: { indexType: entry.type } });
|
|
40
|
+
this.entries.set(entry.type, entry);
|
|
41
|
+
}
|
|
42
|
+
get(typeLiteral) {
|
|
43
|
+
return this.entries.get(typeLiteral);
|
|
44
|
+
}
|
|
45
|
+
has(typeLiteral) {
|
|
46
|
+
return this.entries.has(typeLiteral);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function createIndexTypeRegistry() {
|
|
50
|
+
return new IndexTypeRegistryImpl();
|
|
51
|
+
}
|
|
52
|
+
function isIndexTypeRegistration(value) {
|
|
53
|
+
return typeof value === "object" && value !== null && "entries" in value && Array.isArray(value.entries);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The registry of every index type the target and the extension packs a contract is built or
|
|
57
|
+
* inferred with register. An extension pack's entry whose access method is not its type literal is
|
|
58
|
+
* refused, because only the target converts such a type into an index of its access method.
|
|
59
|
+
*/
|
|
60
|
+
function indexTypeRegistryOf(target, extensions = []) {
|
|
61
|
+
const registry = createIndexTypeRegistry();
|
|
62
|
+
for (const entry of registeredEntriesOf(target)) registry.register(entry);
|
|
63
|
+
for (const extension of extensions) for (const entry of registeredEntriesOf(extension)) {
|
|
64
|
+
if (rendersIndexBody(entry)) throw extensionIndexTypeNotAccessMethod(entry, extension.id);
|
|
65
|
+
registry.register(entry);
|
|
66
|
+
}
|
|
67
|
+
return registry;
|
|
68
|
+
}
|
|
69
|
+
function registeredEntriesOf(registrant) {
|
|
70
|
+
const registration = registrant.indexTypes;
|
|
71
|
+
if (registration === void 0) return [];
|
|
72
|
+
if (!isIndexTypeRegistration(registration)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Pack "${registrant.id ?? "<unknown>"}" declares "indexTypes" but its value is not an IndexTypeRegistration (expected an object with an "entries" array; got ${typeof registration}).`, { meta: {
|
|
73
|
+
packId: registrant.id,
|
|
74
|
+
contribution: "indexTypes",
|
|
75
|
+
reason: "invalid-shape"
|
|
76
|
+
} });
|
|
77
|
+
return registration.entries;
|
|
78
|
+
}
|
|
79
|
+
function extensionIndexTypeNotAccessMethod(entry, packId) {
|
|
80
|
+
const accessMethod = accessMethodOf(entry);
|
|
81
|
+
const pack = packId === void 0 ? "an extension pack" : `extension pack "${packId}"`;
|
|
82
|
+
return contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Index type "${entry.type}" registered by ${pack} declares the access method "${accessMethod}", but an extension pack's index type must be an access method itself.`, {
|
|
83
|
+
why: `An index type whose access method differs from its name is turned into an index of that access method by the target, which renders the index body from the options. Only the target provides that conversion, so the database would be asked for an access method named "${entry.type}".`,
|
|
84
|
+
fix: `Register the access method under its own name, or leave \`accessMethod\` out of the "${entry.type}" registration so the type name is the access method.`,
|
|
85
|
+
meta: {
|
|
86
|
+
indexType: entry.type,
|
|
87
|
+
accessMethod,
|
|
88
|
+
...ifDefined("packId", packId)
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { rendersIndexBody as a, indexTypeRegistryOf as i, createIndexTypeRegistry as n, defineIndexTypes as r, accessMethodOf as t };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=index-types-pC_5vADQ-TTUXAfmL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-types-pC_5vADQ-TTUXAfmL.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/index-types-pC_5vADQ.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\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\t...ifDefined(\"accessMethod\", entry.accessMethod),\n\t\t\t...ifDefined(\"columnTraits\", entry.columnTraits)\n\t\t}]);\n\t}\n};\n/**\n* Whether an index of this type is rendered from its options rather than written by its author: a\n* type whose access method is not its own literal. Its SQL body is the target's rendering, so an\n* exact-named index of the type is compared by that body.\n*/\nfunction rendersIndexBody(entry) {\n\treturn accessMethodOf(entry) !== entry.type;\n}\n/** The access method an index of this type is created with. */\nfunction accessMethodOf(entry) {\n\treturn entry.accessMethod ?? entry.type;\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}\nfunction isIndexTypeRegistration(value) {\n\treturn typeof value === \"object\" && value !== null && \"entries\" in value && Array.isArray(value.entries);\n}\n/**\n* The registry of every index type the target and the extension packs a contract is built or\n* inferred with register. An extension pack's entry whose access method is not its type literal is\n* refused, because only the target converts such a type into an index of its access method.\n*/\nfunction indexTypeRegistryOf(target, extensions = []) {\n\tconst registry = createIndexTypeRegistry();\n\tfor (const entry of registeredEntriesOf(target)) registry.register(entry);\n\tfor (const extension of extensions) for (const entry of registeredEntriesOf(extension)) {\n\t\tif (rendersIndexBody(entry)) throw extensionIndexTypeNotAccessMethod(entry, extension.id);\n\t\tregistry.register(entry);\n\t}\n\treturn registry;\n}\nfunction registeredEntriesOf(registrant) {\n\tconst registration = registrant.indexTypes;\n\tif (registration === void 0) return [];\n\tif (!isIndexTypeRegistration(registration)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack \"${registrant.id ?? \"<unknown>\"}\" declares \"indexTypes\" but its value is not an IndexTypeRegistration (expected an object with an \"entries\" array; got ${typeof registration}).`, { meta: {\n\t\tpackId: registrant.id,\n\t\tcontribution: \"indexTypes\",\n\t\treason: \"invalid-shape\"\n\t} });\n\treturn registration.entries;\n}\nfunction extensionIndexTypeNotAccessMethod(entry, packId) {\n\tconst accessMethod = accessMethodOf(entry);\n\tconst pack = packId === void 0 ? \"an extension pack\" : `extension pack \"${packId}\"`;\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Index type \"${entry.type}\" registered by ${pack} declares the access method \"${accessMethod}\", but an extension pack's index type must be an access method itself.`, {\n\t\twhy: `An index type whose access method differs from its name is turned into an index of that access method by the target, which renders the index body from the options. Only the target provides that conversion, so the database would be asked for an access method named \"${entry.type}\".`,\n\t\tfix: `Register the access method under its own name, or leave \\`accessMethod\\` out of the \"${entry.type}\" registration so the type name is the access method.`,\n\t\tmeta: {\n\t\t\tindexType: entry.type,\n\t\t\taccessMethod,\n\t\t\t...ifDefined(\"packId\", packId)\n\t\t}\n\t});\n}\n//#endregion\nexport { rendersIndexBody as a, indexTypeRegistryOf as i, createIndexTypeRegistry as n, defineIndexTypes as r, accessMethodOf as t };\n\n//# sourceMappingURL=index-types-pC_5vADQ.mjs.map"],"mappings":";;;AAGA,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;GACf,GAAG,UAAU,gBAAgB,MAAM,YAAY;GAC/C,GAAG,UAAU,gBAAgB,MAAM,YAAY;EAChD,CAAC,CAAC;CACH;AACD;;;;;;AAMA,SAAS,iBAAiB,OAAO;CAChC,OAAO,eAAe,KAAK,MAAM,MAAM;AACxC;;AAEA,SAAS,eAAe,OAAO;CAC9B,OAAO,MAAM,gBAAgB,MAAM;AACpC;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,E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M,KAAK;EAC5R,KAAK,wFAAwF,MAAM,KAAK;EACxG,MAAM;GACL,WAAW,MAAM;GACjB;GACA,GAAG,UAAU,UAAU,MAAM;EAC9B;CACD,CAAC;AACF"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { n as isAuthoredIndexInput } from "./index-naming-
|
|
1
|
+
import { n as isAuthoredIndexInput } from "./index-naming-BOcJT1B3-CeEoP8t3.mjs";
|
|
2
2
|
import { n as providesPslEntityPlacement } from "./entity-handle-lowering-hook-B3atrRKX.mjs";
|
|
3
|
-
import "./foreign-key-materialization-
|
|
4
|
-
import { d as resolvedTypeParams, t as CODEC_INSTANCE_KIND } from "./types-
|
|
3
|
+
import "./foreign-key-materialization-DyoakLGY.mjs";
|
|
4
|
+
import { d as resolvedTypeParams, t as CODEC_INSTANCE_KIND } from "./types-DXrO0fxT.mjs";
|
|
5
5
|
import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
|
|
6
|
-
import { n as buildSqlContractFromDefinition } from "./derived-checks-
|
|
7
|
-
import { S as toNamedTypeFieldDescriptor, b as sqlAttributeSpecs, c as getAuthoringEntity, d as instantiatePslTypeConstructor, f as interpretFieldAttribute, g as modelCoordinateKey, h as modelAttributeSpecsFrom, i as contractError, l as getNamedArgument, m as mapFieldNamesToColumns, n as bareTypeConstructorOf, o as formatDbAttributeMigrationMessage, p as interpretModelAttribute, r as collectResolvedFields, s as getAttribute, t as PSL_CHECK_ON_STI_VARIANT, v as readWrittenNumberForCodec, x as storageName, y as resolveFieldTypeDescriptor } from "./psl-field-resolution-BW0ZuqBd
|
|
6
|
+
import { n as buildSqlContractFromDefinition } from "./derived-checks-CfXjGvNH-CrXoMrPU.mjs";
|
|
7
|
+
import { S as toNamedTypeFieldDescriptor, b as sqlAttributeSpecs, c as getAuthoringEntity, d as instantiatePslTypeConstructor, f as interpretFieldAttribute, g as modelCoordinateKey, h as modelAttributeSpecsFrom, i as contractError, l as getNamedArgument, m as mapFieldNamesToColumns, n as bareTypeConstructorOf, o as formatDbAttributeMigrationMessage, p as interpretModelAttribute, r as collectResolvedFields, s as getAttribute, t as PSL_CHECK_ON_STI_VARIANT, v as readWrittenNumberForCodec, x as storageName, y as resolveFieldTypeDescriptor } from "./psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs";
|
|
8
8
|
import { t as defaultTableName } from "./default-table-name-BfFY8qYR-lHNcVmY5.mjs";
|
|
9
9
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
10
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
10
11
|
import { instantiateAuthoringEntityType, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringModelAttributeDescriptor } from "@prisma/orm-framework/components/authoring";
|
|
11
12
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
12
13
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
13
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
14
14
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
15
15
|
import { crossRef } from "@prisma/orm-framework/contract/types";
|
|
16
16
|
import { NamespaceDeclarationAst } from "@prisma/orm-framework/psl-parser/syntax";
|
|
@@ -2209,4 +2209,4 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
2209
2209
|
//#endregion
|
|
2210
2210
|
export { normalizeReferentialAction as a, interpretPslDocumentToSqlContract as i, buildEntityTypesByDiscriminator as n, indexFkRelations as r, applyBackrelationCandidates as t };
|
|
2211
2211
|
|
|
2212
|
-
//# sourceMappingURL=interpreter-DlG-2o64-
|
|
2212
|
+
//# sourceMappingURL=interpreter-DlG-2o64-CDb20sM1.mjs.map
|