@prisma/orm-family-sql 8.0.0-rc.17-dev.3 → 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 +15 -15
- package/dist/orm-client.mjs +3 -3
- 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,5 +1,5 @@
|
|
|
1
|
-
import { c as SqlNamespaceInput, d as SqlStorageTypeEntry, l as SqlStorage } from "./sql-storage-BTlJLUID-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { c as SqlNamespaceInput, d as SqlStorageTypeEntry, l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
2
|
+
import "./types-Uv3oTMAb.mjs";
|
|
3
3
|
import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
|
|
4
4
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import { ContractSerializer, SchemaDiffIssue, SchemaVerifier, SchemaVerifyOptions, SchemaVerifyResult } from "@prisma/orm-framework/components/control";
|
|
@@ -124,4 +124,4 @@ declare abstract class SqlSchemaVerifierBase<TContract, TSchema> implements Sche
|
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
126
|
export { SqlSchemaVerifierBase as i, SqlContractSerializerBase as n, SqlEntityHydrationFactory as r, SqlContractSerializer as t };
|
|
127
|
-
//# sourceMappingURL=ir-
|
|
127
|
+
//# sourceMappingURL=ir-OBn7ct21.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-
|
|
1
|
+
{"version":3,"file":"ir-OBn7ct21.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/ir.d.mts"],"mappings":";;;;;;;;KAMK,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;uBAyBX,0BAA0B,kBAAkB,SAAS,wBAAwB,mBAAmB;qBAClG,yBAAyB,oBAAoB;mBAC/C;mBACA;EACjB,YAAY,0BAA0B,oBAAoB,4BAA4B,2BAA2B;EACjH,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;EACrE,kBAAkB,UAAU,YAAY;EACxC,0DAA0D;EAC1D,kDAAkD;EAClD;aACW,0DAA0D;aAC1D,kDAAkD;;YAEnD,0BAA0B,gBAAgB,SAAS;YACnD,kBAAkB,WAAW,SAAS,cAAc,SAAS;YAC7D,uBAAuB,YAAY,SAAS,eAAe,4BAA4B,SAAS,eAAe;YAC/G,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;YAClF,wBAAwB,OAAO,sBAAsB;YACrD,wBAAwB,UAAU,SAAS,cAAc;;;;;;;;;;;YAWzD,0BAA0B,SAAS,SAAS,eAAe,SAAS,6BAA6B,eAAe,eAAe;UACjI;YACE,oBAAoB,iBAAiB;UACvC;;;;;;;;;;;;;;;;;;cAkBI,8BAA8B,0BAA0B,SAAS;EAC7E;;;;;;;;;;;;;;;;;;;;;;;;uBAwBqB,sBAAsB,WAAW,oBAAoB,eAAe,WAAW;EACpG,aAAa,SAAS,oBAAoB,WAAW,WAAW;;;;;;;qBAO7C,sBAAsB,SAAS,oBAAoB,WAAW,oBAAoB;;;;;;qBAMlF,uBAAuB,SAAS,oBAAoB,WAAW,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./middleware-mLwvcOLS-wIYSKgog.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-C7XauPPu-
|
|
1
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-C7XauPPu-eskZJbmm.mjs";
|
|
2
2
|
import { ParamRefMutator } from "@prisma/orm-framework/components/runtime";
|
|
3
3
|
//#region ../../../2-sql/4-lanes/relational-core/dist/middleware-mLwvcOLS.d.mts
|
|
4
4
|
//#region src/middleware/param-ref-mutator.d.ts
|
|
@@ -116,4 +116,4 @@ interface SqlParamRefMutatorInternal<TCodecMap extends Record<string, unknown> =
|
|
|
116
116
|
declare function createSqlParamRefMutator<TCodecMap extends Record<string, unknown> = Record<string, unknown>>(plan: SqlExecutionPlan): SqlParamRefMutatorInternal<TCodecMap>;
|
|
117
117
|
//#endregion
|
|
118
118
|
export { SqlParamRefMutatorInternal as a, SqlParamRefMutator as i, ParamRefEntryUnion as n, createSqlParamRefMutator as o, ParamRefHandle as r, ParamRefEntry as t };
|
|
119
|
-
//# sourceMappingURL=middleware-mLwvcOLS-
|
|
119
|
+
//# sourceMappingURL=middleware-mLwvcOLS-wIYSKgog.d.mts.map
|
package/dist/{middleware-mLwvcOLS-SaqhgsmA.d.mts.map → middleware-mLwvcOLS-wIYSKgog.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-mLwvcOLS-
|
|
1
|
+
{"version":3,"file":"middleware-mLwvcOLS-wIYSKgog.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/middleware-mLwvcOLS.d.mts"],"mappings":";;;;;;;;;;;;;;cAac;;;;;;;;;;UAUJ,eAAe;YACb,sBAAsB;;;;;;;UAOxB,cAAc;WACb,KAAK,eAAe;WACpB;WACA,SAAS;;;;;;;;;;KAUf,mBAAmB,kBAAkB,8BAA8B,WAAW,qBAAqB,cAAc,YAAY,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UAyB9I,mBAAmB,kBAAkB,0BAA0B,iCAAiC;;EAExG,WAAW,iBAAiB,mBAAmB;;;;;;;EAO/C,aAAa,uBAAuB,oBAAoB,KAAK,eAAe,WAAW,UAAU,UAAU;EAC3G,aAAa,KAAK,2BAA2B;;EAE7C,cAAc,SAAS;aACZ,KAAK,sBAAsB;aAC3B;;;;;;;;;;;;;UAaH,2BAA2B,kBAAkB,0BAA0B,iCAAiC,mBAAmB;EACnI;;;;;;;;;;;;;;;;;iBAiBe,yBAAyB,kBAAkB,0BAA0B,yBAAyB,MAAM,mBAAmB,2BAA2B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as SqlStorage } from "./sql-storage-BTlJLUID-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { C as SqlPlanTargetDetails, d as SqlMigrationPlanOperation } from "./types-CzxOObSY-
|
|
1
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
2
|
+
import "./types-Uv3oTMAb.mjs";
|
|
3
|
+
import { C as SqlPlanTargetDetails, d as SqlMigrationPlanOperation } from "./types-CzxOObSY-CxZ_bdVi.mjs";
|
|
4
4
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
6
6
|
//#region ../../../2-sql/9-family/dist/migration.d.mts
|
|
@@ -41,4 +41,4 @@ declare abstract class SqlMigration<TDetails extends SqlPlanTargetDetails, TTarg
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
export { SqlMigration as t };
|
|
44
|
-
//# sourceMappingURL=migration-
|
|
44
|
+
//# sourceMappingURL=migration-DEK3Hxlo.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-DEK3Hxlo.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/migration.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BuB,aAAa,iBAAiB,sBAAsB,mCAAmC,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,0BAA0B,kBAAkB,WAAW,OAAO;;;;;;;;;;;MAW5S"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../../2-sql/1-core/schema-ir/dist/naming-
|
|
1
|
+
//#region ../../../2-sql/1-core/schema-ir/dist/naming-BcD36g9T.d.mts
|
|
2
2
|
//#region src/naming.d.ts
|
|
3
3
|
declare function defaultIndexName(tableName: string, columns: readonly string[]): string;
|
|
4
4
|
interface WireName {
|
|
@@ -151,14 +151,7 @@ interface IndexContentHashParts {
|
|
|
151
151
|
* status as the RLS tuple: any change re-suffixes every wire name.
|
|
152
152
|
*/
|
|
153
153
|
/**
|
|
154
|
-
* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling:
|
|
155
|
-
* JS booleans and the common catalog spellings (`pg_class.reloptions`
|
|
156
|
-
* stores whatever spelling the DDL used, so a live index may carry
|
|
157
|
-
* `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; everything
|
|
158
|
-
* else via `String()` (fully specified for numbers, so no platform
|
|
159
|
-
* variance). Shared by the wire-name hash tuple, the node's option
|
|
160
|
-
* equality, and the DDL renderer, so an authored `{ fastupdate: true }`
|
|
161
|
-
* agrees with a live index created under any boolean spelling.
|
|
154
|
+
* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling: JS booleans and the common catalog spellings (`pg_class.reloptions` stores whatever spelling the DDL used, so a live index may carry `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; every other scalar via `String()` (fully specified for numbers, so no platform variance); an array or object as JSON, since `String()` would flatten `[['a', 'b']]` and `[['a'], ['b']]` to the same text, with object keys sorted at every depth so key order never changes the value. Shared by the wire-name hash tuple, the node's option equality, and the DDL renderer, so an authored `{ fastupdate: true }` agrees with a live index created under any boolean spelling.
|
|
162
155
|
*/
|
|
163
156
|
declare function normalizeIndexOptionValue(value: unknown): string;
|
|
164
157
|
declare function computeIndexContentHash(parts: IndexContentHashParts): string;
|
|
@@ -185,4 +178,4 @@ declare function assertWireNamePrefixLength(prefix: string, subject: string): vo
|
|
|
185
178
|
declare function truncateToWireNamePrefixBytes(prefix: string): string;
|
|
186
179
|
//#endregion
|
|
187
180
|
export { normalizeSqlBody as _, WireName as a, truncateToWireNamePrefixBytes as b, computeCheckContentHash as c, derivedCheckPrefixes as d, formatWireName as f, normalizeIndexOptionValue as g, namingOfLiveName as h, WIRE_NAME_PREFIX_MAX_BYTES as i, computeIndexContentHash as l, namingOf as m, IndexContentHashParts as n, assertWireNamePrefixLength as o, nameOf as p, SqlObjectNaming as r, composeCheckWirePrefix as s, CheckKind as t, defaultIndexName as u, parseNaming as v, parseWireName as y };
|
|
188
|
-
//# sourceMappingURL=naming-
|
|
181
|
+
//# sourceMappingURL=naming-BcD36g9T-DFyaudUa.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-
|
|
1
|
+
{"version":3,"file":"naming-BcD36g9T-DFyaudUa.d.mts","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-BcD36g9T.d.mts"],"mappings":";;iBACiB,iBAAiB,mBAAmB;UAC3C;;WAEC;;WAEA;;;;;;;;;;;KAWN;WACM;WACA;;WAEA;IACP;;iBAEa,OAAO,QAAQ;;;;;;;;iBAQf,SAAS,cAAc,6BAA6B;;;;;;iBAMpD,YAAY,cAAc,6BAA6B;;;;;;;;;;;;;;iBAcvD,iBAAiB,eAAe;;;;;;;iBAOhC,eAAe,gBAAgB;;;;;;;;iBAQ/B,cAAc,eAAe;;;;;;;;;;;;;;;;;;iBAkB7B,iBAAiB;;;;;;;;;;;;;;;iBAejB,wBAAwB;;;;;;KAMpC;;;;;;;;iBAQY,uBAAuB,mBAAmB,oBAAoB,MAAM;;;;;;;;;;;;;iBAapE,qBAAqB,mBAAmB,aAAa,mBAAmB;UAC/E;WACC;WACA;WACA;WACA;WACA;WACA,UAAU;;;;;;;;;;;;;;;;;;;;iBAoBJ,0BAA0B;iBAC1B,wBAAwB,OAAO;;;;;;;;;cASlC;;;;;iBAKG,2BAA2B,gBAAgB;;;;;;;iBAO3C,8BAA8B"}
|
|
@@ -2,7 +2,7 @@ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
4
4
|
import { clipToUtf8Bytes, utf8ByteLength } from "@prisma/orm-framework/utils/text";
|
|
5
|
-
//#region ../../../2-sql/1-core/schema-ir/dist/naming-
|
|
5
|
+
//#region ../../../2-sql/1-core/schema-ir/dist/naming-CT8tRisJ.mjs
|
|
6
6
|
function defaultIndexName(tableName, columns) {
|
|
7
7
|
return `${tableName}_${columns.join("_")}_idx`;
|
|
8
8
|
}
|
|
@@ -189,20 +189,19 @@ function derivedCheckPrefixes(tableName, columnNames) {
|
|
|
189
189
|
* status as the RLS tuple: any change re-suffixes every wire name.
|
|
190
190
|
*/
|
|
191
191
|
/**
|
|
192
|
-
* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling:
|
|
193
|
-
* JS booleans and the common catalog spellings (`pg_class.reloptions`
|
|
194
|
-
* stores whatever spelling the DDL used, so a live index may carry
|
|
195
|
-
* `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; everything
|
|
196
|
-
* else via `String()` (fully specified for numbers, so no platform
|
|
197
|
-
* variance). Shared by the wire-name hash tuple, the node's option
|
|
198
|
-
* equality, and the DDL renderer, so an authored `{ fastupdate: true }`
|
|
199
|
-
* agrees with a live index created under any boolean spelling.
|
|
192
|
+
* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling: JS booleans and the common catalog spellings (`pg_class.reloptions` stores whatever spelling the DDL used, so a live index may carry `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; every other scalar via `String()` (fully specified for numbers, so no platform variance); an array or object as JSON, since `String()` would flatten `[['a', 'b']]` and `[['a'], ['b']]` to the same text, with object keys sorted at every depth so key order never changes the value. Shared by the wire-name hash tuple, the node's option equality, and the DDL renderer, so an authored `{ fastupdate: true }` agrees with a live index created under any boolean spelling.
|
|
200
193
|
*/
|
|
201
194
|
function normalizeIndexOptionValue(value) {
|
|
202
195
|
if (value === true || value === "true" || value === "on") return "on";
|
|
203
196
|
if (value === false || value === "false" || value === "off") return "off";
|
|
197
|
+
if (typeof value === "object" && value !== null) return JSON.stringify(withSortedKeys(value));
|
|
204
198
|
return String(value);
|
|
205
199
|
}
|
|
200
|
+
function withSortedKeys(value) {
|
|
201
|
+
if (Array.isArray(value)) return value.map(withSortedKeys);
|
|
202
|
+
if (typeof value !== "object" || value === null) return value;
|
|
203
|
+
return Object.fromEntries(Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, entry]) => [key, withSortedKeys(entry)]));
|
|
204
|
+
}
|
|
206
205
|
function computeIndexContentHash(parts) {
|
|
207
206
|
const sortedOptions = Object.entries(parts.options ?? {}).map(([key, value]) => [key, normalizeIndexOptionValue(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
208
207
|
const tuple = JSON.stringify([
|
|
@@ -246,4 +245,4 @@ function truncateToWireNamePrefixBytes(prefix) {
|
|
|
246
245
|
//#endregion
|
|
247
246
|
export { computeIndexContentHash as a, formatWireName as c, namingOfLiveName as d, normalizeIndexOptionValue as f, truncateToWireNamePrefixBytes as g, parseWireName as h, computeCheckContentHash as i, nameOf as l, parseNaming as m, assertWireNamePrefixLength as n, defaultIndexName as o, normalizeSqlBody as p, composeCheckWirePrefix as r, derivedCheckPrefixes as s, WIRE_NAME_PREFIX_MAX_BYTES as t, namingOf as u };
|
|
248
247
|
|
|
249
|
-
//# sourceMappingURL=naming-
|
|
248
|
+
//# sourceMappingURL=naming-CT8tRisJ-DLHKo0Hm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-DkG_OegU-DpENNdZX.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-DkG_OegU.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { createHash } from \"node:crypto\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { clipToUtf8Bytes, utf8ByteLength } from \"@internal/utils/text\";\n//#region src/naming.ts\nfunction defaultIndexName(tableName, columns) {\n\treturn `${tableName}_${columns.join(\"_\")}_idx`;\n}\n/** The flat name the union describes. Inverse of {@link namingOf}. */\nfunction nameOf(naming) {\n\treturn naming.kind === \"wire\" ? formatWireName(naming.prefix, naming.hash) : naming.name;\n}\n/**\n* The naming a name-identified node was built with, read back off the flat\n* pair it stores. Inverse of {@link nameOf}, and total for that\n* reason: the constructor derived `name` from the union, so the two agree.\n* Flat data arriving from outside the process goes through\n* {@link parseNaming} instead.\n*/\nfunction namingOf(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix,\n\t\thash: name.slice(prefix.length + 1)\n\t};\n}\n/**\n* Reads naming out of flat stored data — deserialized contract JSON and the\n* literals a user may hand-edit, the one place a name and a prefix can still\n* disagree. Throws when a declared prefix does not parse back out of the name.\n*/\nfunction parseNaming(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\tconst parsed = parseWireName(name);\n\tif (parsed === void 0 || parsed.prefix !== prefix) throw new ContractValidationError(`\"${name}\": prefix \"${prefix}\" does not match the wire name (expected \"${formatWireName(prefix, \"<8hex>\")}\").`, \"storage\");\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix: parsed.prefix,\n\t\thash: parsed.hash\n\t};\n}\n/**\n* The naming an object read out of a live catalog has: a wire-shaped name\n* gets the wire arm so the rename pass can pair it by prefix, and every\n* other name is exact.\n*\n* The wire answer is a claim about the name's SHAPE only — the hash is\n* deliberately not recomputed from the object's content here. Nothing\n* downstream reads it as more than that: the differ always asks the\n* contract-derived side to choose the comparison, so a shape-only wire\n* claim on the introspected side never suppresses a body comparison, and\n* `contract infer` recomputes the hash independently before it will emit an\n* index as wire-named.\n*/\nfunction namingOfLiveName(name) {\n\tconst wire = parseWireName(name);\n\treturn wire === void 0 ? {\n\t\tkind: \"exact\",\n\t\tname\n\t} : {\n\t\tkind: \"wire\",\n\t\tprefix: wire.prefix,\n\t\thash: wire.hash\n\t};\n}\nconst WIRE_NAME_PATTERN = /^(.+)_([0-9a-f]{8})$/;\n/**\n* Assembles a wire name from its user-supplied prefix and its 8-hex\n* content-hash suffix. This module owns the `<prefix>_<hash>` format on both\n* sides — construction here and parsing in {@link parseWireName} — so the two\n* never drift.\n*/\nfunction formatWireName(prefix, hash) {\n\treturn `${prefix}_${hash}`;\n}\n/**\n* Splits a wire name (`<prefix>_<8hex>`) into its prefix and content-hash\n* suffix. Returns `undefined` when the name does not follow the wire-name\n* shape (e.g. an object created outside the toolchain) — callers treat such\n* names as all-prefix. Consumed by introspection (prefix extraction) and by\n* rename pairing (same hash, different prefix).\n*/\nfunction parseWireName(name) {\n\tconst match = WIRE_NAME_PATTERN.exec(name);\n\tconst prefix = match?.[1];\n\tconst hash = match?.[2];\n\tif (prefix === void 0 || hash === void 0) return void 0;\n\treturn {\n\t\tprefix,\n\t\thash\n\t};\n}\n/**\n* Stabilizes an authored SQL body (index expression, partial-index predicate, RLS policy predicate) for hashing: trim, and collapse runs of internal whitespace to a single space. A body that contains `--` is collapsed line by line and keeps its line breaks.\n*\n* This is deliberately minimal. The content hash is the equivalence relation\n* for a wire-named object, and the wire name (prefix + hash) is the only\n* thing ever compared — the hash is never recomputed from an introspected\n* body, so there is no need to match the database's reprinted form. Minimal\n* normalization also protects the no-collision property: aggressive rewriting\n* (lowercasing, paren-stripping, cast-alias folding) risks collapsing two\n* distinct bodies onto one hash.\n*\n* A body that contains `--` keeps its line breaks, because a line break ends a line comment: `a --c` followed by a line break and `b` compares `b`, while `a --c b` does not. Such a body is split into lines, each line is collapsed and trimmed, blank lines are dropped, and the lines are joined with `\\n`. Every body without `--` normalizes as it always has.\n*\n* The normalizer gives the same output on its own output, which policy hashing relies on: it normalizes twice.\n*\n* The normalizer is a stability commitment: a change to it re-suffixes the wire name of every body whose normalized form changes, so a change must say which bodies it affects. See ADR 234, \"Normalizer stability\".\n*/\nfunction normalizeSqlBody(sql) {\n\tif (!sql.includes(\"--\")) return sql.replace(/\\s+/g, \" \").trim();\n\treturn sql.split(/\\r\\n|\\r|\\n/).map((line) => line.replace(/\\s+/g, \" \").trim()).filter((line) => line !== \"\").join(\"\\n\");\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for a check constraint:\n*\n* [normalizeSqlBody(expression)]\n*\n* The predicate is the whole of a check's content — the constraint name,\n* schema, and table are orthogonal to its equivalence. The one-element tuple\n* keeps the encoding in the same shape as the index and RLS tuples so a member\n* can be added later without re-reading which encoding a kind uses.\n*\n* The tuple order and encoding are a stability commitment: any change\n* re-suffixes every wire name.\n*/\nfunction computeCheckContentHash(expression) {\n\tconst tuple = JSON.stringify([normalizeSqlBody(expression)]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/** The trailing segment a check's wire-name prefix carries, per kind. */\nconst CHECK_KIND_SUFFIX = {\n\tmembership: \"check\",\n\telementNotNull: \"elem_not_null\"\n};\n/**\n* Composes the wire-name prefix of a derived CHECK constraint:\n* `${table}_${column}_${kindSuffix}`, capped at the wire-name byte budget.\n* Shared by contract authoring (naming emitted checks) and `contract infer`\n* (recomputing the name a derived check would carry), so truncated and\n* multibyte prefixes match by construction.\n*/\nfunction composeCheckWirePrefix(tableName, columnName, kind) {\n\treturn truncateToWireNamePrefixBytes(`${tableName}_${columnName}_${CHECK_KIND_SUFFIX[kind]}`);\n}\n/**\n* Every {@link CheckKind} value, read off {@link CHECK_KIND_SUFFIX}'s own keys\n* so the enumeration can never drift out of step with it.\n*/\nconst CHECK_KINDS = Object.keys(CHECK_KIND_SUFFIX).filter((kind) => kind in CHECK_KIND_SUFFIX);\n/**\n* The wire-name prefixes derivation could produce for `tableName`: every\n* {@link composeCheckWirePrefix} result crossing each of `columnNames` with\n* each {@link CheckKind}. A check is derived iff its prefix is a member of\n* this set.\n*\n* This is the prefix SHAPE only, not the full name-with-hash: it does not\n* know which kind a specific column's type would actually derive (that needs\n* the target's `renderCheckExpressions` hook, which callers of this function\n* do not have in hand), so every column is conservatively treated as capable\n* of producing every kind.\n*/\nfunction derivedCheckPrefixes(tableName, columnNames) {\n\tconst prefixes = /* @__PURE__ */ new Set();\n\tfor (const columnName of columnNames) for (const kind of CHECK_KINDS) prefixes.add(composeCheckWirePrefix(tableName, columnName, kind));\n\treturn prefixes;\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for an index:\n*\n* [normalizeSqlBody(expression), normalizeSqlBody(where), columns, unique, type, sortedOptions]\n*\n* Columns hash in authored order — column order is semantic in an index.\n* Option values are `String()`-coerced (matching the loose option equality\n* used for diffing) so a hash computed from typed contract values agrees with\n* one recomputed from introspected reloptions strings. The prefix, schema,\n* and table are excluded (they are orthogonal to index equivalence).\n*\n* The tuple order and encoding are a stability commitment with the same\n* status as the RLS tuple: any change re-suffixes every wire name.\n*/\n/**\n* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling:\n* JS booleans and the common catalog spellings (`pg_class.reloptions`\n* stores whatever spelling the DDL used, so a live index may carry\n* `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; everything\n* else via `String()` (fully specified for numbers, so no platform\n* variance). Shared by the wire-name hash tuple, the node's option\n* equality, and the DDL renderer, so an authored `{ fastupdate: true }`\n* agrees with a live index created under any boolean spelling.\n*/\nfunction normalizeIndexOptionValue(value) {\n\tif (value === true || value === \"true\" || value === \"on\") return \"on\";\n\tif (value === false || value === \"false\" || value === \"off\") return \"off\";\n\treturn String(value);\n}\nfunction computeIndexContentHash(parts) {\n\tconst sortedOptions = Object.entries(parts.options ?? {}).map(([key, value]) => [key, normalizeIndexOptionValue(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);\n\tconst tuple = JSON.stringify([\n\t\tnormalizeSqlBody(parts.expression ?? \"\"),\n\t\tnormalizeSqlBody(parts.where ?? \"\"),\n\t\tparts.columns ?? [],\n\t\tparts.unique,\n\t\tparts.type ?? \"\",\n\t\tsortedOptions\n\t]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/**\n* Postgres truncates identifiers at `NAMEDATALEN - 1` = 63 **bytes**, not\n* characters, and the wire name appends a 9-byte `_<8hex>` suffix — so a\n* prefix is bounded at 54 bytes. A prefix of non-ASCII characters can sit well\n* under 54 characters and still overrun: the database would silently truncate\n* the name, leaving the declared object permanently unmatchable against the\n* live one.\n*/\nconst WIRE_NAME_PREFIX_MAX_BYTES = 54;\n/**\n* Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_BYTES}.\n* `subject` opens the error message (e.g. `defineContract: policy prefix`).\n*/\nfunction assertWireNamePrefixLength(prefix, subject) {\n\tif (utf8ByteLength(prefix) > 54) throw structuredError(\"CONTRACT.WIRE_NAME_PREFIX_TOO_LONG\", `${subject} \"${prefix}\" exceeds the 54-byte maximum (Postgres identifiers cap at 63 bytes and the wire name appends a 9-byte hash suffix).`, { meta: {\n\t\tprefix,\n\t\tmaxBytes: 54\n\t} });\n}\n/**\n* Shortens a DERIVED wire-name prefix to {@link WIRE_NAME_PREFIX_MAX_BYTES},\n* cutting on a code-point boundary so a multibyte character is never split.\n* Only derived prefixes truncate — an authored one throws\n* ({@link assertWireNamePrefixLength}), because its author can shorten it.\n*/\nfunction truncateToWireNamePrefixBytes(prefix) {\n\treturn clipToUtf8Bytes(prefix, 54);\n}\n//#endregion\nexport { computeIndexContentHash as a, formatWireName as c, namingOfLiveName as d, normalizeIndexOptionValue as f, truncateToWireNamePrefixBytes as g, parseWireName as h, computeCheckContentHash as i, nameOf as l, parseNaming as m, assertWireNamePrefixLength as n, defaultIndexName as o, normalizeSqlBody as p, composeCheckWirePrefix as r, derivedCheckPrefixes as s, WIRE_NAME_PREFIX_MAX_BYTES as t, namingOf as u };\n\n//# sourceMappingURL=naming-DkG_OegU.mjs.map"],"mappings":";;;;;AAKA,SAAS,iBAAiB,WAAW,SAAS;CAC7C,OAAO,GAAG,UAAU,GAAG,QAAQ,KAAK,GAAG,EAAE;AAC1C;;AAEA,SAAS,OAAO,QAAQ;CACvB,OAAO,OAAO,SAAS,SAAS,eAAe,OAAO,QAAQ,OAAO,IAAI,IAAI,OAAO;AACrF;;;;;;;;AAQA,SAAS,SAAS,MAAM,QAAQ;CAC/B,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO;EACN,MAAM;EACN;EACA,MAAM,KAAK,MAAM,OAAO,SAAS,CAAC;CACnC;AACD;;;;;;AAMA,SAAS,YAAY,MAAM,QAAQ;CAClC,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,MAAM,SAAS,cAAc,IAAI;CACjC,IAAI,WAAW,KAAK,KAAK,OAAO,WAAW,QAAQ,MAAM,IAAI,wBAAwB,IAAI,KAAK,aAAa,OAAO,4CAA4C,eAAe,QAAQ,QAAQ,EAAE,MAAM,SAAS;CAC9M,OAAO;EACN,MAAM;EACN,QAAQ,OAAO;EACf,MAAM,OAAO;CACd;AACD;;;;;;;;;;;;;;AAcA,SAAS,iBAAiB,MAAM;CAC/B,MAAM,OAAO,cAAc,IAAI;CAC/B,OAAO,SAAS,KAAK,IAAI;EACxB,MAAM;EACN;CACD,IAAI;EACH,MAAM;EACN,QAAQ,KAAK;EACb,MAAM,KAAK;CACZ;AACD;AACA,MAAM,oBAAoB;;;;;;;AAO1B,SAAS,eAAe,QAAQ,MAAM;CACr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;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,0BAA0B,OAAO;CACzC,IAAI,UAAU,QAAQ,UAAU,UAAU,UAAU,MAAM,OAAO;CACjE,IAAI,UAAU,SAAS,UAAU,WAAW,UAAU,OAAO,OAAO;CACpE,OAAO,OAAO,KAAK;AACpB;AACA,SAAS,wBAAwB,OAAO;CACvC,MAAM,gBAAgB,OAAO,QAAQ,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,0BAA0B,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC;CACtK,MAAM,QAAQ,KAAK,UAAU;EAC5B,iBAAiB,MAAM,cAAc,EAAE;EACvC,iBAAiB,MAAM,SAAS,EAAE;EAClC,MAAM,WAAW,CAAC;EAClB,MAAM;EACN,MAAM,QAAQ;EACd;CACD,CAAC;CACD,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;AACnE;;;;;;;;;AASA,MAAM,6BAA6B;;;;;AAKnC,SAAS,2BAA2B,QAAQ,SAAS;CACpD,IAAI,eAAe,MAAM,IAAI,IAAI,MAAM,gBAAgB,sCAAsC,GAAG,QAAQ,IAAI,OAAO,uHAAuH,EAAE,MAAM;EACjP;EACA,UAAU;CACX,EAAE,CAAC;AACJ;;;;;;;AAOA,SAAS,8BAA8B,QAAQ;CAC9C,OAAO,gBAAgB,QAAQ,EAAE;AAClC"}
|
|
1
|
+
{"version":3,"file":"naming-CT8tRisJ-DLHKo0Hm.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/naming-CT8tRisJ.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { createHash } from \"node:crypto\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { clipToUtf8Bytes, utf8ByteLength } from \"@internal/utils/text\";\n//#region src/naming.ts\nfunction defaultIndexName(tableName, columns) {\n\treturn `${tableName}_${columns.join(\"_\")}_idx`;\n}\n/** The flat name the union describes. Inverse of {@link namingOf}. */\nfunction nameOf(naming) {\n\treturn naming.kind === \"wire\" ? formatWireName(naming.prefix, naming.hash) : naming.name;\n}\n/**\n* The naming a name-identified node was built with, read back off the flat\n* pair it stores. Inverse of {@link nameOf}, and total for that\n* reason: the constructor derived `name` from the union, so the two agree.\n* Flat data arriving from outside the process goes through\n* {@link parseNaming} instead.\n*/\nfunction namingOf(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix,\n\t\thash: name.slice(prefix.length + 1)\n\t};\n}\n/**\n* Reads naming out of flat stored data — deserialized contract JSON and the\n* literals a user may hand-edit, the one place a name and a prefix can still\n* disagree. Throws when a declared prefix does not parse back out of the name.\n*/\nfunction parseNaming(name, prefix) {\n\tif (prefix === void 0) return {\n\t\tkind: \"exact\",\n\t\tname\n\t};\n\tconst parsed = parseWireName(name);\n\tif (parsed === void 0 || parsed.prefix !== prefix) throw new ContractValidationError(`\"${name}\": prefix \"${prefix}\" does not match the wire name (expected \"${formatWireName(prefix, \"<8hex>\")}\").`, \"storage\");\n\treturn {\n\t\tkind: \"wire\",\n\t\tprefix: parsed.prefix,\n\t\thash: parsed.hash\n\t};\n}\n/**\n* The naming an object read out of a live catalog has: a wire-shaped name\n* gets the wire arm so the rename pass can pair it by prefix, and every\n* other name is exact.\n*\n* The wire answer is a claim about the name's SHAPE only — the hash is\n* deliberately not recomputed from the object's content here. Nothing\n* downstream reads it as more than that: the differ always asks the\n* contract-derived side to choose the comparison, so a shape-only wire\n* claim on the introspected side never suppresses a body comparison, and\n* `contract infer` recomputes the hash independently before it will emit an\n* index as wire-named.\n*/\nfunction namingOfLiveName(name) {\n\tconst wire = parseWireName(name);\n\treturn wire === void 0 ? {\n\t\tkind: \"exact\",\n\t\tname\n\t} : {\n\t\tkind: \"wire\",\n\t\tprefix: wire.prefix,\n\t\thash: wire.hash\n\t};\n}\nconst WIRE_NAME_PATTERN = /^(.+)_([0-9a-f]{8})$/;\n/**\n* Assembles a wire name from its user-supplied prefix and its 8-hex\n* content-hash suffix. This module owns the `<prefix>_<hash>` format on both\n* sides — construction here and parsing in {@link parseWireName} — so the two\n* never drift.\n*/\nfunction formatWireName(prefix, hash) {\n\treturn `${prefix}_${hash}`;\n}\n/**\n* Splits a wire name (`<prefix>_<8hex>`) into its prefix and content-hash\n* suffix. Returns `undefined` when the name does not follow the wire-name\n* shape (e.g. an object created outside the toolchain) — callers treat such\n* names as all-prefix. Consumed by introspection (prefix extraction) and by\n* rename pairing (same hash, different prefix).\n*/\nfunction parseWireName(name) {\n\tconst match = WIRE_NAME_PATTERN.exec(name);\n\tconst prefix = match?.[1];\n\tconst hash = match?.[2];\n\tif (prefix === void 0 || hash === void 0) return void 0;\n\treturn {\n\t\tprefix,\n\t\thash\n\t};\n}\n/**\n* Stabilizes an authored SQL body (index expression, partial-index predicate, RLS policy predicate) for hashing: trim, and collapse runs of internal whitespace to a single space. A body that contains `--` is collapsed line by line and keeps its line breaks.\n*\n* This is deliberately minimal. The content hash is the equivalence relation\n* for a wire-named object, and the wire name (prefix + hash) is the only\n* thing ever compared — the hash is never recomputed from an introspected\n* body, so there is no need to match the database's reprinted form. Minimal\n* normalization also protects the no-collision property: aggressive rewriting\n* (lowercasing, paren-stripping, cast-alias folding) risks collapsing two\n* distinct bodies onto one hash.\n*\n* A body that contains `--` keeps its line breaks, because a line break ends a line comment: `a --c` followed by a line break and `b` compares `b`, while `a --c b` does not. Such a body is split into lines, each line is collapsed and trimmed, blank lines are dropped, and the lines are joined with `\\n`. Every body without `--` normalizes as it always has.\n*\n* The normalizer gives the same output on its own output, which policy hashing relies on: it normalizes twice.\n*\n* The normalizer is a stability commitment: a change to it re-suffixes the wire name of every body whose normalized form changes, so a change must say which bodies it affects. See ADR 234, \"Normalizer stability\".\n*/\nfunction normalizeSqlBody(sql) {\n\tif (!sql.includes(\"--\")) return sql.replace(/\\s+/g, \" \").trim();\n\treturn sql.split(/\\r\\n|\\r|\\n/).map((line) => line.replace(/\\s+/g, \" \").trim()).filter((line) => line !== \"\").join(\"\\n\");\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for a check constraint:\n*\n* [normalizeSqlBody(expression)]\n*\n* The predicate is the whole of a check's content — the constraint name,\n* schema, and table are orthogonal to its equivalence. The one-element tuple\n* keeps the encoding in the same shape as the index and RLS tuples so a member\n* can be added later without re-reading which encoding a kind uses.\n*\n* The tuple order and encoding are a stability commitment: any change\n* re-suffixes every wire name.\n*/\nfunction computeCheckContentHash(expression) {\n\tconst tuple = JSON.stringify([normalizeSqlBody(expression)]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/** The trailing segment a check's wire-name prefix carries, per kind. */\nconst CHECK_KIND_SUFFIX = {\n\tmembership: \"check\",\n\telementNotNull: \"elem_not_null\"\n};\n/**\n* Composes the wire-name prefix of a derived CHECK constraint:\n* `${table}_${column}_${kindSuffix}`, capped at the wire-name byte budget.\n* Shared by contract authoring (naming emitted checks) and `contract infer`\n* (recomputing the name a derived check would carry), so truncated and\n* multibyte prefixes match by construction.\n*/\nfunction composeCheckWirePrefix(tableName, columnName, kind) {\n\treturn truncateToWireNamePrefixBytes(`${tableName}_${columnName}_${CHECK_KIND_SUFFIX[kind]}`);\n}\n/**\n* Every {@link CheckKind} value, read off {@link CHECK_KIND_SUFFIX}'s own keys\n* so the enumeration can never drift out of step with it.\n*/\nconst CHECK_KINDS = Object.keys(CHECK_KIND_SUFFIX).filter((kind) => kind in CHECK_KIND_SUFFIX);\n/**\n* The wire-name prefixes derivation could produce for `tableName`: every\n* {@link composeCheckWirePrefix} result crossing each of `columnNames` with\n* each {@link CheckKind}. A check is derived iff its prefix is a member of\n* this set.\n*\n* This is the prefix SHAPE only, not the full name-with-hash: it does not\n* know which kind a specific column's type would actually derive (that needs\n* the target's `renderCheckExpressions` hook, which callers of this function\n* do not have in hand), so every column is conservatively treated as capable\n* of producing every kind.\n*/\nfunction derivedCheckPrefixes(tableName, columnNames) {\n\tconst prefixes = /* @__PURE__ */ new Set();\n\tfor (const columnName of columnNames) for (const kind of CHECK_KINDS) prefixes.add(composeCheckWirePrefix(tableName, columnName, kind));\n\treturn prefixes;\n}\n/**\n* Returns the first 8 lowercase hex characters of the SHA-256 digest over the\n* canonical content tuple for an index:\n*\n* [normalizeSqlBody(expression), normalizeSqlBody(where), columns, unique, type, sortedOptions]\n*\n* Columns hash in authored order — column order is semantic in an index.\n* Option values are `String()`-coerced (matching the loose option equality\n* used for diffing) so a hash computed from typed contract values agrees with\n* one recomputed from introspected reloptions strings. The prefix, schema,\n* and table are excluded (they are orthogonal to index equivalence).\n*\n* The tuple order and encoding are a stability commitment with the same\n* status as the RLS tuple: any change re-suffixes every wire name.\n*/\n/**\n* Canonicalizes one index option VALUE to the `on`/`off` boolean spelling: JS booleans and the common catalog spellings (`pg_class.reloptions` stores whatever spelling the DDL used, so a live index may carry `'true'`/`'false'` or `'on'`/`'off'`) all map to one form; every other scalar via `String()` (fully specified for numbers, so no platform variance); an array or object as JSON, since `String()` would flatten `[['a', 'b']]` and `[['a'], ['b']]` to the same text, with object keys sorted at every depth so key order never changes the value. Shared by the wire-name hash tuple, the node's option equality, and the DDL renderer, so an authored `{ fastupdate: true }` agrees with a live index created under any boolean spelling.\n*/\nfunction normalizeIndexOptionValue(value) {\n\tif (value === true || value === \"true\" || value === \"on\") return \"on\";\n\tif (value === false || value === \"false\" || value === \"off\") return \"off\";\n\tif (typeof value === \"object\" && value !== null) return JSON.stringify(withSortedKeys(value));\n\treturn String(value);\n}\nfunction withSortedKeys(value) {\n\tif (Array.isArray(value)) return value.map(withSortedKeys);\n\tif (typeof value !== \"object\" || value === null) return value;\n\treturn Object.fromEntries(Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, entry]) => [key, withSortedKeys(entry)]));\n}\nfunction computeIndexContentHash(parts) {\n\tconst sortedOptions = Object.entries(parts.options ?? {}).map(([key, value]) => [key, normalizeIndexOptionValue(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);\n\tconst tuple = JSON.stringify([\n\t\tnormalizeSqlBody(parts.expression ?? \"\"),\n\t\tnormalizeSqlBody(parts.where ?? \"\"),\n\t\tparts.columns ?? [],\n\t\tparts.unique,\n\t\tparts.type ?? \"\",\n\t\tsortedOptions\n\t]);\n\treturn createHash(\"sha256\").update(tuple).digest(\"hex\").slice(0, 8);\n}\n/**\n* Postgres truncates identifiers at `NAMEDATALEN - 1` = 63 **bytes**, not\n* characters, and the wire name appends a 9-byte `_<8hex>` suffix — so a\n* prefix is bounded at 54 bytes. A prefix of non-ASCII characters can sit well\n* under 54 characters and still overrun: the database would silently truncate\n* the name, leaving the declared object permanently unmatchable against the\n* live one.\n*/\nconst WIRE_NAME_PREFIX_MAX_BYTES = 54;\n/**\n* Rejects a wire-name prefix over {@link WIRE_NAME_PREFIX_MAX_BYTES}.\n* `subject` opens the error message (e.g. `defineContract: policy prefix`).\n*/\nfunction assertWireNamePrefixLength(prefix, subject) {\n\tif (utf8ByteLength(prefix) > 54) throw structuredError(\"CONTRACT.WIRE_NAME_PREFIX_TOO_LONG\", `${subject} \"${prefix}\" exceeds the 54-byte maximum (Postgres identifiers cap at 63 bytes and the wire name appends a 9-byte hash suffix).`, { meta: {\n\t\tprefix,\n\t\tmaxBytes: 54\n\t} });\n}\n/**\n* Shortens a DERIVED wire-name prefix to {@link WIRE_NAME_PREFIX_MAX_BYTES},\n* cutting on a code-point boundary so a multibyte character is never split.\n* Only derived prefixes truncate — an authored one throws\n* ({@link assertWireNamePrefixLength}), because its author can shorten it.\n*/\nfunction truncateToWireNamePrefixBytes(prefix) {\n\treturn clipToUtf8Bytes(prefix, 54);\n}\n//#endregion\nexport { computeIndexContentHash as a, formatWireName as c, namingOfLiveName as d, normalizeIndexOptionValue as f, truncateToWireNamePrefixBytes as g, parseWireName as h, computeCheckContentHash as i, nameOf as l, parseNaming as m, assertWireNamePrefixLength as n, defaultIndexName as o, normalizeSqlBody as p, composeCheckWirePrefix as r, derivedCheckPrefixes as s, WIRE_NAME_PREFIX_MAX_BYTES as t, namingOf as u };\n\n//# sourceMappingURL=naming-CT8tRisJ.mjs.map"],"mappings":";;;;;AAKA,SAAS,iBAAiB,WAAW,SAAS;CAC7C,OAAO,GAAG,UAAU,GAAG,QAAQ,KAAK,GAAG,EAAE;AAC1C;;AAEA,SAAS,OAAO,QAAQ;CACvB,OAAO,OAAO,SAAS,SAAS,eAAe,OAAO,QAAQ,OAAO,IAAI,IAAI,OAAO;AACrF;;;;;;;;AAQA,SAAS,SAAS,MAAM,QAAQ;CAC/B,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,OAAO;EACN,MAAM;EACN;EACA,MAAM,KAAK,MAAM,OAAO,SAAS,CAAC;CACnC;AACD;;;;;;AAMA,SAAS,YAAY,MAAM,QAAQ;CAClC,IAAI,WAAW,KAAK,GAAG,OAAO;EAC7B,MAAM;EACN;CACD;CACA,MAAM,SAAS,cAAc,IAAI;CACjC,IAAI,WAAW,KAAK,KAAK,OAAO,WAAW,QAAQ,MAAM,IAAI,wBAAwB,IAAI,KAAK,aAAa,OAAO,4CAA4C,eAAe,QAAQ,QAAQ,EAAE,MAAM,SAAS;CAC9M,OAAO;EACN,MAAM;EACN,QAAQ,OAAO;EACf,MAAM,OAAO;CACd;AACD;;;;;;;;;;;;;;AAcA,SAAS,iBAAiB,MAAM;CAC/B,MAAM,OAAO,cAAc,IAAI;CAC/B,OAAO,SAAS,KAAK,IAAI;EACxB,MAAM;EACN;CACD,IAAI;EACH,MAAM;EACN,QAAQ,KAAK;EACb,MAAM,KAAK;CACZ;AACD;AACA,MAAM,oBAAoB;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A2B,QAAQ,SAAS;CACpD,IAAI,eAAe,MAAM,IAAI,IAAI,MAAM,gBAAgB,sCAAsC,GAAG,QAAQ,IAAI,OAAO,uHAAuH,EAAE,MAAM;EACjP;EACA,UAAU;CACX,EAAE,CAAC;AACJ;;;;;;;AAOA,SAAS,8BAA8B,QAAQ;CAC9C,OAAO,gBAAgB,QAAQ,EAAE;AAClC"}
|
package/dist/operations.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-
|
|
1
|
+
import { a as SqlOperationRegistry, i as SqlOperationEntry, n as SqlOperationDescriptor, o as createSqlOperationRegistry, r as SqlOperationDescriptors, t as SqlLoweringSpec } from "./index-We-mbWnZ.mjs";
|
|
2
2
|
export { SqlLoweringSpec, SqlOperationDescriptor, SqlOperationDescriptors, SqlOperationEntry, SqlOperationRegistry, createSqlOperationRegistry };
|
package/dist/orm-client.d.mts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as StorageColumn } from "./storage-table-WXeVNycx-
|
|
2
|
-
import { l as SqlStorage } from "./sql-storage-BTlJLUID-
|
|
3
|
-
import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-DFZhLz18-
|
|
4
|
-
import "./types-
|
|
5
|
-
import { E as CodecRef$1, Ht as WhereArg, St as OrderByNulls, _ as BinaryExpr, a as AndExpr, bt as OrExpr, c as AnyExpression, ft as LockingClause, r as AggregateFn, st as LimitOffsetValue, ut as LockStrength, vt as NullCheckExpr, xt as OrderByItem } from "./types-Sh5HuaZE-
|
|
6
|
-
import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-
|
|
7
|
-
import { n as SqlQueryPlan, t as Preparable } from "./plan-cGEaSXHv-
|
|
8
|
-
import { S as TraitExpression, i as CodecTypesBase, o as Expression } from "./expression-
|
|
9
|
-
import "./plan-
|
|
10
|
-
import { n as ExecutionContext } from "./query-lane-context-CJoNBspB
|
|
11
|
-
import "./query-lane-context-
|
|
12
|
-
import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-BJQcLx-8-
|
|
13
|
-
import "./types-
|
|
14
|
-
import { i as Declaration, l as ParamsFromDeclaration, m as PreparedStatement, p as PreparedFor, t as BindSiteParams, w as RuntimeQueryable$1, y as Runtime } from "./prepared-statement-YtgdlN7e-
|
|
15
|
-
import "./index-
|
|
1
|
+
import { t as StorageColumn } from "./storage-table-WXeVNycx-BCwDhdq5.mjs";
|
|
2
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
3
|
+
import { f as ExtractFieldOutputTypes, l as ExtractAggregateTypes, p as ExtractQueryOperationTypes, u as ExtractCodecTypes } from "./types-DFZhLz18-Msi8wwig.mjs";
|
|
4
|
+
import "./types-Uv3oTMAb.mjs";
|
|
5
|
+
import { E as CodecRef$1, Ht as WhereArg, St as OrderByNulls, _ as BinaryExpr, a as AndExpr, bt as OrExpr, c as AnyExpression, ft as LockingClause, r as AggregateFn, st as LimitOffsetValue, ut as LockStrength, vt as NullCheckExpr, xt as OrderByItem } from "./types-Sh5HuaZE-CqThc46M.mjs";
|
|
6
|
+
import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-Dp6lQXUX.mjs";
|
|
7
|
+
import { n as SqlQueryPlan, t as Preparable } from "./plan-cGEaSXHv-j0w37mVT.mjs";
|
|
8
|
+
import { S as TraitExpression, i as CodecTypesBase, o as Expression } from "./expression-CvXfXCGs.mjs";
|
|
9
|
+
import "./plan-_8dKi13Q.mjs";
|
|
10
|
+
import { n as ExecutionContext } from "./query-lane-context-CJoNBspB--ieuKEei.mjs";
|
|
11
|
+
import "./query-lane-context-DNt2DeQu.mjs";
|
|
12
|
+
import { h as RuntimeScope, o as ComputeColumnJsType } from "./types-BJQcLx-8-BHNxJ_df.mjs";
|
|
13
|
+
import "./types-BCPHaykc.mjs";
|
|
14
|
+
import { i as Declaration, l as ParamsFromDeclaration, m as PreparedStatement, p as PreparedFor, t as BindSiteParams, w as RuntimeQueryable$1, y as Runtime } from "./prepared-statement-YtgdlN7e-D4MSU3i0.mjs";
|
|
15
|
+
import "./index-BzAG1PFV.mjs";
|
|
16
16
|
import { CodecDescriptorRef, ScalarFieldDeclarationBuilder } from "@prisma/orm-framework/components/codec";
|
|
17
17
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
18
18
|
import { AnnotationValue, AsyncIterableResult, MetaBuilder, OperationKind, ResultType, RuntimeExecuteOptions } from "@prisma/orm-framework/components/runtime";
|
package/dist/orm-client.mjs
CHANGED
|
@@ -2,12 +2,12 @@ import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
|
|
|
2
2
|
import { i as isUniqueConstraintViolation } from "./dist-x6jvtkKM.mjs";
|
|
3
3
|
import { A as ParamRef, C as LiteralExpr, E as NullCheckExpr, F as SelectAst, G as isOrderByNulls, I as SubqueryExpr, L as TableSource, M as ProjectionItem, O as OrExpr, R as UpdateAst, S as ListExpression, T as NotExpr, U as isAggregateFn, V as checkLimitOffset, W as isOrderByDirection, _ as InsertAst, b as JsonArrayAggExpr, c as DeleteAst, f as EqColJoinOn, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, q as isWhereExpr, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, v as InsertOnConflict, w as LockingClause, x as JsonObjectExpr, y as JoinAst, z as WindowFuncExpr } from "./types-NTQsD2MS-DAP2yVDn.mjs";
|
|
4
4
|
import { t as collectOrderedParamRefs } from "./util-BBgcP3gI-XJBkxo1K.mjs";
|
|
5
|
-
import { C as lockStrengthCapabilities, S as lockOptionCapabilities, T as missingCapability, n as JsonDocumentProjection, r as NativeJsonValueProjection, t as CodecJsonValueProjection, w as lockWaitPolicyOf, x as lockIncompatible } from "./ast-
|
|
5
|
+
import { C as lockStrengthCapabilities, S as lockOptionCapabilities, T as missingCapability, n as JsonDocumentProjection, r as NativeJsonValueProjection, t as CodecJsonValueProjection, w as lockWaitPolicyOf, x as lockIncompatible } from "./ast-De8XGuVW.mjs";
|
|
6
6
|
import { i as isExpression, o as toExpr } from "./expression-JOe6lo4g.mjs";
|
|
7
|
-
import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-
|
|
7
|
+
import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-CYK0Wzja.mjs";
|
|
8
8
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
9
|
-
import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
|
|
10
9
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
10
|
+
import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
|
|
11
11
|
import { InternalError, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
12
12
|
import { domainModelsAtDefaultNamespace } from "@prisma/orm-framework/contract/types";
|
|
13
13
|
import { AsyncIterableResult, createMetaBuilder, isRuntimeError, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as sqlFamilyEnumSpec } from "./authoring-entity-types-CZ-vdwYS-
|
|
1
|
+
import { t as sqlFamilyEnumSpec } from "./authoring-entity-types-CZ-vdwYS-BQPeBSla.mjs";
|
|
2
2
|
//#region ../../../2-sql/9-family/dist/pack.d.mts
|
|
3
3
|
//#region src/exports/pack.d.ts
|
|
4
4
|
declare const sqlFamilyPack: {
|
|
@@ -306,4 +306,4 @@ declare const sqlFamilyPack: {
|
|
|
306
306
|
};
|
|
307
307
|
//#endregion
|
|
308
308
|
export { sqlFamilyPack as t };
|
|
309
|
-
//# sourceMappingURL=pack-
|
|
309
|
+
//# sourceMappingURL=pack-D3L1b4Ag.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-
|
|
1
|
+
{"version":3,"file":"pack-D3L1b4Ag.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/pack.d.mts"],"mappings":";;;cAEc;WACH;WACA;WACA;WACA;WACA;aACE;eACE;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;;;;;eAKR;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;yBACA;yBACA;yBACA;;;;mBAIN;qBACE;qBACA;uBACE;yBACE;yBACA;yBACA;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;6BACA;;;;;qBAKR;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;;;aAKR;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;;aAOZ,gEAAgE;aAChE;eACE;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;UACE,2CAA2C;YACzC;4CACgC;;;;aAI/B;eACE;iBACE,0CAA0C;UACjD;0CACgC;iBACzB,yCAAyC;UAChD;mBACS;0CACuB;iBACzB,6CAA6C;UACpD;mBACS;0CACuB;iBACzB,4CAA4C;UACnD;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA,UAAU;0CACa;iBACzB,4CAA4C;mBAC1C;mBACA;mBACA;0CACuB;iBACzB,8CAA8C;UACrD;0CACgC;iBACzB,oDAAoD;UAC3D;0CACgC;iBACzB,2CAA2C;UAClD,qCAAqC,uDAAuD;UAC5F;0CACgC;;eAE3B;iBACE,0CAA0C;UACjD;0CACgC;iBACzB,yCAAyC;mBACvC;0CACuB;iBACzB,6CAA6C;mBAC3C;0CACuB;iBACzB,8CAA8C;UACrD;UACA;0CACgC;iBACzB,+CAA+C;UACtD;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;0CACuB;iBACzB,UAAU,oCAAoC,6DAA6D;UAClH,sCAAsC,mEAAmE,4CAA4C,iFAAiF,4CAA4C;0CAClP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as SqlStorage } from "./sql-storage-BTlJLUID-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { h as AnyQueryAst } from "./types-Sh5HuaZE-
|
|
1
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
2
|
+
import "./types-Uv3oTMAb.mjs";
|
|
3
|
+
import { h as AnyQueryAst } from "./types-Sh5HuaZE-CqThc46M.mjs";
|
|
4
4
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import { AsyncIterableResult, QueryPlan } from "@prisma/orm-framework/components/runtime";
|
|
6
6
|
//#region ../../../2-sql/4-lanes/relational-core/dist/plan-cGEaSXHv.d.mts
|
|
@@ -47,4 +47,4 @@ interface Preparable<DbRow, Result> {
|
|
|
47
47
|
declare function planFromAst<Row = unknown>(ast: AnyQueryAst, contract: Contract<SqlStorage>, laneId?: string): SqlQueryPlan<Row>;
|
|
48
48
|
//#endregion
|
|
49
49
|
export { SqlQueryPlan as n, planFromAst as r, Preparable as t };
|
|
50
|
-
//# sourceMappingURL=plan-cGEaSXHv-
|
|
50
|
+
//# sourceMappingURL=plan-cGEaSXHv-j0w37mVT.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-cGEaSXHv-
|
|
1
|
+
{"version":3,"file":"plan-cGEaSXHv-j0w37mVT.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/plan-cGEaSXHv.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAkBU,aAAa,uBAAuB,UAAU;WAC7C,KAAK;WACL;;UAED,WAAW,OAAO;WACjB,MAAM,aAAa;EAC5B,QAAQ,MAAM,oBAAoB,SAAS;;;;;;;;;;;;;;;;;;;;iBAoB5B,YAAY,eAAe,KAAK,aAAa,UAAU,SAAS,aAAa,kBAAkB,aAAa"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { l as SqlStorage } from "./sql-storage-BTlJLUID-
|
|
2
|
-
import "./types-
|
|
3
|
-
import { r as SqlOperationDescriptors } from "./index-
|
|
4
|
-
import { E as CodecRef$1, Pt as SqlCodecCallContext, S as Codec$1, h as AnyQueryAst, ht as LoweredStatement, k as ContractCodecRegistry, mt as LoweredParam } from "./types-Sh5HuaZE-
|
|
1
|
+
import { l as SqlStorage } from "./sql-storage-BTlJLUID-CGy3wuH4.mjs";
|
|
2
|
+
import "./types-Uv3oTMAb.mjs";
|
|
3
|
+
import { r as SqlOperationDescriptors } from "./index-We-mbWnZ.mjs";
|
|
4
|
+
import { E as CodecRef$1, Pt as SqlCodecCallContext, S as Codec$1, h as AnyQueryAst, ht as LoweredStatement, k as ContractCodecRegistry, mt as LoweredParam } from "./types-Sh5HuaZE-CqThc46M.mjs";
|
|
5
5
|
import { c as SqlQueryable, i as SqlDriver, l as SqlStatementStats, r as SqlConnection, u as SqlTransaction } from "./driver-types-DRsYeq3j-X_D6hNMZ.mjs";
|
|
6
|
-
import { m as MarkerReadResult, t as Adapter } from "./ast-
|
|
7
|
-
import { n as SqlQueryPlan } from "./plan-cGEaSXHv-
|
|
8
|
-
import { a as CodecValue, i as CodecTypesBase, l as RawCodecInferer, o as Expression, t as AffectedCount } from "./expression-
|
|
9
|
-
import { t as SqlExecutionPlan } from "./sql-execution-plan-C7XauPPu-
|
|
10
|
-
import "./plan-
|
|
11
|
-
import { n as ExecutionContext } from "./query-lane-context-CJoNBspB
|
|
12
|
-
import "./query-lane-context-
|
|
13
|
-
import { h as RuntimeScope } from "./types-BJQcLx-8-
|
|
14
|
-
import "./types-
|
|
15
|
-
import { i as SqlParamRefMutator } from "./middleware-mLwvcOLS-
|
|
16
|
-
import "./middleware-
|
|
6
|
+
import { m as MarkerReadResult, t as Adapter } from "./ast-Dp6lQXUX.mjs";
|
|
7
|
+
import { n as SqlQueryPlan } from "./plan-cGEaSXHv-j0w37mVT.mjs";
|
|
8
|
+
import { a as CodecValue, i as CodecTypesBase, l as RawCodecInferer, o as Expression, t as AffectedCount } from "./expression-CvXfXCGs.mjs";
|
|
9
|
+
import { t as SqlExecutionPlan } from "./sql-execution-plan-C7XauPPu-eskZJbmm.mjs";
|
|
10
|
+
import "./plan-_8dKi13Q.mjs";
|
|
11
|
+
import { n as ExecutionContext } from "./query-lane-context-CJoNBspB--ieuKEei.mjs";
|
|
12
|
+
import "./query-lane-context-DNt2DeQu.mjs";
|
|
13
|
+
import { h as RuntimeScope } from "./types-BJQcLx-8-BHNxJ_df.mjs";
|
|
14
|
+
import "./types-BCPHaykc.mjs";
|
|
15
|
+
import { i as SqlParamRefMutator } from "./middleware-mLwvcOLS-wIYSKgog.mjs";
|
|
16
|
+
import "./middleware-FHkIPvYR.mjs";
|
|
17
17
|
import { AnyCodecDescriptor, CodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
18
18
|
import { Contract, JsonValue, PlanMeta } from "@prisma/orm-framework/contract/types";
|
|
19
19
|
import { AfterExecuteResult, AfterQueryResult, AsyncIterableResult, ExecuteInterceptResult, ExecutionPlan, MutationDefaultGeneratorContributor, QueryInterceptResult, RuntimeCore, RuntimeExecuteOptions, RuntimeLog, RuntimeMiddleware, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
|
|
@@ -536,4 +536,4 @@ declare class PreparedExecutionImpl<Params> implements PreparedExecution<Params>
|
|
|
536
536
|
}
|
|
537
537
|
//#endregion
|
|
538
538
|
export { SqlMiddlewareContext as A, TransactionContext as B, RuntimeParameterizedCodecDescriptor as C, SqlExecutionStack as D, RuntimeTransaction as E, SqlRuntimeExtensionDescriptor as F, encodeParamsWithMetadata as G, createExecutionContext as H, SqlRuntimeExtensionInstance as I, withTransaction as J, preparedStatementExecute as K, SqlRuntimeTargetDescriptor as L, SqlRuntimeAdapterInstance as M, SqlRuntimeBase as N, SqlExecutionStackWithDriver as O, SqlRuntimeDriverInstance as P, SqlStaticContributions as R, RuntimeOptions as S, RuntimeTelemetryEvent as T, createSqlExecutionStack as U, VerifyMarkerOption as V, deriveParamMetadata as W, PreparedStatementInternals as _, DeclaredCodecId as a, RuntimeConnection as b, ParamSpec as c, PreparedExecution as d, PreparedExecutionImpl as f, PreparedStatementImpl as g, PreparedStatementExecuteTarget as h, Declaration as i, SqlRuntimeAdapterDescriptor as j, SqlMiddleware as k, ParamsFromDeclaration as l, PreparedStatement as m, CloseRefusal as n, DeclaredNullable as o, PreparedFor as p, preparedStatementQuery as q, ConnectionProvider as r, MarkerReader as s, BindSiteParams as t, PrepareCallback as u, PreparedStatementQueryTarget as v, RuntimeQueryable as w, RuntimeFamilyAdapter as x, Runtime as y, TelemetryOutcome as z };
|
|
539
|
-
//# sourceMappingURL=prepared-statement-YtgdlN7e-
|
|
539
|
+
//# sourceMappingURL=prepared-statement-YtgdlN7e-D4MSU3i0.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-statement-YtgdlN7e-
|
|
1
|
+
{"version":3,"file":"prepared-statement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
-
import { m as defaultInCanonicalForm } from "./types-
|
|
3
|
+
import { m as defaultInCanonicalForm } from "./types-D0GFxty0-CP8b4dR3.mjs";
|
|
4
4
|
import { i as printSqlExpressionLiteral } from "./sql-expression-D7GsLgDM.mjs";
|
|
5
5
|
import { authoringEntryType, printTaggedLiteral } from "@prisma/orm-framework/components/authoring";
|
|
6
6
|
import { canonicalFormOf, dataTypeId } from "@prisma/orm-framework/components/codec";
|
|
@@ -213,4 +213,4 @@ function sameForm(left, right) {
|
|
|
213
213
|
//#endregion
|
|
214
214
|
export { mapDefault as t };
|
|
215
215
|
|
|
216
|
-
//# sourceMappingURL=psl-build-
|
|
216
|
+
//# sourceMappingURL=psl-build-DTE03hcr.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-build-B5iMVWHu.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { printSqlExpressionLiteral } from \"@internal/sql-contract/sql-expression\";\nimport { authoringEntryType, printTaggedLiteral } from \"@internal/framework-components/authoring\";\nimport { canonicalFormOf, dataTypeId } from \"@internal/framework-components/codec\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\nimport { defaultInCanonicalForm } from \"@internal/sql-schema-ir/types\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form.\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printSqlExpressionLiteral(columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(entries) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tlet classify;\n\tlet plainStringType;\n\tlet plainBooleanType;\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(authoringEntryType(key, entry));\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tclassify = written.classify;\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t\tif (written.syntax === \"string\") plainStringType = dataTypeId(key);\n\t\telse plainBooleanType = dataTypeId(key);\n\t}\n\treturn {\n\t\tentryOf,\n\t\tclassify,\n\t\tplainStringType,\n\t\tplainBooleanType,\n\t\ttagTypes\n\t};\n}\n/**\n* Every type the stored form could be a value of, in the order a written value would be read: a\n* number or numeral text through the classifier first, then the plain syntax that matches the\n* shape, then each tag, whose canonical form is a whole document.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") {\n\t\tconst classified = surface.classify?.(numeralText(value));\n\t\treturn classified === void 0 ? [] : [classified];\n\t}\n\tif (typeof value === \"boolean\") return surface.plainBooleanType === void 0 ? [] : [{\n\t\ttype: surface.plainBooleanType,\n\t\tvalue\n\t}];\n\tif (typeof value === \"string\") {\n\t\tconst classified = surface.classify?.(value);\n\t\tif (classified !== void 0) found.push(classified);\n\t\tif (surface.plainStringType !== void 0) found.push({\n\t\t\ttype: surface.plainStringType,\n\t\t\tvalue\n\t\t});\n\t}\n\tfor (const type of surface.tagTypes) found.push({\n\t\ttype,\n\t\tvalue\n\t});\n\treturn found;\n}\n/** The stored form the column takes this value as, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, columnDataType, lookup) {\n\tif (candidate.type === columnDataType) return candidate.value;\n\tconst cast = lookup.get(columnDataType)?.casts[candidate.type];\n\tif (cast === void 0) return void 0;\n\ttry {\n\t\treturn cast(candidate.value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** What the entry reads the printed text back as, which for a number is the classifier's answer. */\nfunction readBack(entry, type, text) {\n\tconst written = entry.written;\n\ttry {\n\t\treturn written.kind === \"plain\" && written.syntax === \"number\" ? written.classify(text) : {\n\t\t\ttype,\n\t\t\tvalue: written.parse(text)\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same entry, the same cast, and the stored form again.\n*/\nfunction writeScalar(value, columnDataType, lookup, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, columnDataType, lookup);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, columnDataType, lookup);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value.\n* Each element is classified on its own and must be of a type the cast takes.\n*/\nfunction writeListCast(value, columnDataType, lookup, surface) {\n\tconst listCast = lookup.get(columnDataType)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\ttry {\n\t\tif (!sameForm(listCast.cast(elements), value)) return void 0;\n\t} catch {\n\t\treturn;\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\nfunction writeDefaultLiteral(stored, options) {\n\tif (stored instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { entries, lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst { value } = defaultInCanonicalForm(stored, canonicalFormOf(columnCodec, lookup), options?.list === true);\n\tif (value instanceof Date) return void 0;\n\tconst surface = writingSurface(entries);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, columnDataType, lookup, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, columnDataType, lookup, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, columnDataType, lookup, surface) : void 0;\n}\n/** Whether two canonical forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\nexport { mapDefault, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;AAQA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;;;;;AAKA,SAAS,WAAW,eAAe,SAAS;CAC3C,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW;GACf,MAAM,OAAO,oBAAoB,cAAc,OAAO,OAAO;GAC7D,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,EAAE,WAAW,YAAY,KAAK,GAAG;EACpE;EACA,KAAK,YAAY,OAAO,EAAE,WAAW,SAAS,qBAAqB,cAAc,eAAe,4BAA4B,cAAc,eAAe,YAAY,0BAA0B,cAAc,UAAU,EAAE,GAAG;CAC7N;AACD;AACA,SAAS,eAAe,SAAS;CAChC,MAAM,0BAA0B,IAAI,IAAI;CACxC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,WAAW,CAAC;CAClB,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,GAAG;EACnD,MAAM,UAAU,MAAM;EACtB,IAAI,QAAQ,SAAS,OAAO;GAC3B,MAAM,OAAO,WAAW,mBAAmB,KAAK,KAAK,CAAC;GACtD,IAAI,CAAC,QAAQ,IAAI,IAAI,GAAG,QAAQ,IAAI,MAAM,KAAK;GAC/C,SAAS,KAAK,IAAI;GAClB;EACD;EACA,IAAI,QAAQ,WAAW,UAAU;GAChC,WAAW,QAAQ;GACnB,KAA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MAAM,QAAQ,CAAC;EACf,KAAK,MAAM,WAAW,OAAO;GAC5B,MAAM,UAAU,YAAY,SAAS,gBAAgB,QAAQ,OAAO;GACpE,IAAI,YAAY,KAAK,GAAG,OAAO,KAAK;GACpC,MAAM,KAAK,OAAO;EACnB;EACA,OAAO,IAAI,MAAM,KAAK,IAAI,EAAE;CAC7B;CACA,MAAM,UAAU,YAAY,OAAO,gBAAgB,QAAQ,OAAO;CAClE,IAAI,YAAY,KAAK,GAAG,OAAO;CAC/B,OAAO,MAAM,QAAQ,KAAK,IAAI,cAAc,OAAO,gBAAgB,QAAQ,OAAO,IAAI,KAAK;AAC5F;;AAEA,SAAS,SAAS,MAAM,OAAO;CAC9B,IAAI,SAAS,OAAO,OAAO;CAC3B,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,QAAQ,KAAK,GAAG,OAAO;CACzD,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,YAAY,SAAS,QAAQ,UAAU,MAAM,OAAO;CACrG,MAAM,UAAU,OAAO,QAAQ,IAAI;CACnC,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,KAAK,CAAC;CAC5C,OAAO,QAAQ,WAAW,OAAO,QAAQ,QAAQ,OAAO,CAAC,KAAK,YAAY;EACzE,MAAM,QAAQ,OAAO,IAAI,GAAG;EAC5B,OAAO,UAAU,KAAK,KAAK,SAAS,QAAQ,KAAK;CAClD,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"psl-build-DTE03hcr.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { printSqlExpressionLiteral } from \"@internal/sql-contract/sql-expression\";\nimport { authoringEntryType, printTaggedLiteral } from \"@internal/framework-components/authoring\";\nimport { canonicalFormOf, dataTypeId } from \"@internal/framework-components/codec\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\nimport { defaultInCanonicalForm } from \"@internal/sql-schema-ir/types\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form.\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printSqlExpressionLiteral(columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(entries) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tlet classify;\n\tlet plainStringType;\n\tlet plainBooleanType;\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(authoringEntryType(key, entry));\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tclassify = written.classify;\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t\tif (written.syntax === \"string\") plainStringType = dataTypeId(key);\n\t\telse plainBooleanType = dataTypeId(key);\n\t}\n\treturn {\n\t\tentryOf,\n\t\tclassify,\n\t\tplainStringType,\n\t\tplainBooleanType,\n\t\ttagTypes\n\t};\n}\n/**\n* Every type the stored form could be a value of, in the order a written value would be read: a\n* number or numeral text through the classifier first, then the plain syntax that matches the\n* shape, then each tag, whose canonical form is a whole document.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") {\n\t\tconst classified = surface.classify?.(numeralText(value));\n\t\treturn classified === void 0 ? [] : [classified];\n\t}\n\tif (typeof value === \"boolean\") return surface.plainBooleanType === void 0 ? [] : [{\n\t\ttype: surface.plainBooleanType,\n\t\tvalue\n\t}];\n\tif (typeof value === \"string\") {\n\t\tconst classified = surface.classify?.(value);\n\t\tif (classified !== void 0) found.push(classified);\n\t\tif (surface.plainStringType !== void 0) found.push({\n\t\t\ttype: surface.plainStringType,\n\t\t\tvalue\n\t\t});\n\t}\n\tfor (const type of surface.tagTypes) found.push({\n\t\ttype,\n\t\tvalue\n\t});\n\treturn found;\n}\n/** The stored form the column takes this value as, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, columnDataType, lookup) {\n\tif (candidate.type === columnDataType) return candidate.value;\n\tconst cast = lookup.get(columnDataType)?.casts[candidate.type];\n\tif (cast === void 0) return void 0;\n\ttry {\n\t\treturn cast(candidate.value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** What the entry reads the printed text back as, which for a number is the classifier's answer. */\nfunction readBack(entry, type, text) {\n\tconst written = entry.written;\n\ttry {\n\t\treturn written.kind === \"plain\" && written.syntax === \"number\" ? written.classify(text) : {\n\t\t\ttype,\n\t\t\tvalue: written.parse(text)\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same entry, the same cast, and the stored form again.\n*/\nfunction writeScalar(value, columnDataType, lookup, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, columnDataType, lookup);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, columnDataType, lookup);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value.\n* Each element is classified on its own and must be of a type the cast takes.\n*/\nfunction writeListCast(value, columnDataType, lookup, surface) {\n\tconst listCast = lookup.get(columnDataType)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\ttry {\n\t\tif (!sameForm(listCast.cast(elements), value)) return void 0;\n\t} catch {\n\t\treturn;\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\nfunction writeDefaultLiteral(stored, options) {\n\tif (stored instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { entries, lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst { value } = defaultInCanonicalForm(stored, canonicalFormOf(columnCodec, lookup), options?.list === true);\n\tif (value instanceof Date) return void 0;\n\tconst surface = writingSurface(entries);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, columnDataType, lookup, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, columnDataType, lookup, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, columnDataType, lookup, surface) : void 0;\n}\n/** Whether two canonical forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\nexport { mapDefault, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;AAQA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;;;;;AAKA,SAAS,WAAW,eAAe,SAAS;CAC3C,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW;GACf,MAAM,OAAO,oBAAoB,cAAc,OAAO,OAAO;GAC7D,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,EAAE,WAAW,YAAY,KAAK,GAAG;EACpE;EACA,KAAK,YAAY,OAAO,EAAE,WAAW,SAAS,qBAAqB,cAAc,eAAe,4BAA4B,cAAc,eAAe,YAAY,0BAA0B,cAAc,UAAU,EAAE,GAAG;CAC7N;AACD;AACA,SAAS,eAAe,SAAS;CAChC,MAAM,0B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AO,UAAU,KAAK,KAAK,SAAS,QAAQ,KAAK;CAClD,CAAC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./contract-builder-
|
|
1
|
+
import "./contract-builder-DWQhH8FQ.mjs";
|
|
2
2
|
import { AuthoringTypeConstructorDescriptor } from "@prisma/orm-framework/components/authoring";
|
|
3
3
|
import { CodecLookupWithDescriptors } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { ColumnDefault, ExecutionMutationDefaultPhases, ValueSetRef } from "@prisma/orm-framework/contract/types";
|
|
@@ -22,4 +22,4 @@ type ColumnDescriptor = {
|
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
24
|
export { ColumnDescriptor as t };
|
|
25
|
-
//# sourceMappingURL=psl-column-resolution-CNtNJ7g7-
|
|
25
|
+
//# sourceMappingURL=psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-column-resolution-CNtNJ7g7-
|
|
1
|
+
{"version":3,"file":"psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-CNtNJ7g7.d.mts"],"mappings":";;;;;;;;KAQK;WACM;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { s as sqlTextFromCanonical, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-D7GsLgDM.mjs";
|
|
2
|
-
import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-
|
|
3
|
-
import { a as storedAsListColumn, i as isValueObjectMember } from "./derived-checks-
|
|
2
|
+
import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-CIfn8ezs.mjs";
|
|
3
|
+
import { a as storedAsListColumn, i as isValueObjectMember } from "./derived-checks-CfXjGvNH-CrXoMrPU.mjs";
|
|
4
4
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
5
6
|
import { admittedForms, castTypedValue, describeExpected, describeRefusal, describeRefusedValueType, exactRewrite, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, readWrittenValue, tagForm, validateAuthoringHelperArguments, validateAuthoringTypeParams } from "@prisma/orm-framework/components/authoring";
|
|
6
7
|
import { canonicalFormOf, codecForRef } from "@prisma/orm-framework/components/codec";
|
|
7
8
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
9
9
|
import { InternalError, isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
10
10
|
import { ArrayLiteralAst, FunctionCallAst, IdentifierAst } from "@prisma/orm-framework/psl-parser/syntax";
|
|
11
11
|
import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
|
|
@@ -1946,4 +1946,4 @@ function collectResolvedFields(input) {
|
|
|
1946
1946
|
//#endregion
|
|
1947
1947
|
export { toNamedTypeFieldDescriptor as S, readDataTypeDefault as _, describeUnsupportedSqlAttribute as a, sqlAttributeSpecs as b, getAuthoringEntity as c, instantiatePslTypeConstructor as d, interpretFieldAttribute as f, modelCoordinateKey as g, modelAttributeSpecsFrom as h, contractError as i, getNamedArgument as l, mapFieldNamesToColumns as m, bareTypeConstructorOf as n, formatDbAttributeMigrationMessage as o, interpretModelAttribute as p, collectResolvedFields as r, getAttribute as s, PSL_CHECK_ON_STI_VARIANT as t, instantiateFieldTypeConstructor as u, readWrittenNumberForCodec as v, storageName as x, resolveFieldTypeDescriptor as y };
|
|
1948
1948
|
|
|
1949
|
-
//# sourceMappingURL=psl-field-resolution-BW0ZuqBd
|
|
1949
|
+
//# sourceMappingURL=psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs.map
|