@prisma/orm-family-sql 8.0.0-rc.18-dev.16 → 8.0.0-rc.18-dev.18
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/{aggregate-descriptor-registry-DrJ1vHEo.mjs → aggregate-descriptor-registry-Dd7Uj7DJ.mjs} +3 -3
- package/dist/{aggregate-descriptor-registry-DrJ1vHEo.mjs.map → aggregate-descriptor-registry-Dd7Uj7DJ.mjs.map} +1 -1
- package/dist/{ast-BDwGvnKK.mjs → ast-CBO3PEJF.mjs} +73 -47
- package/dist/ast-CBO3PEJF.mjs.map +1 -0
- package/dist/{ast-BoM9T1b2.d.mts → ast-Dzsat0Zb.d.mts} +27 -26
- package/dist/ast-Dzsat0Zb.d.mts.map +1 -0
- package/dist/{attribute-specs-D7EhHD08.d.mts → attribute-specs-2I2xuKEa.d.mts} +4 -3
- package/dist/attribute-specs-2I2xuKEa.d.mts.map +1 -0
- package/dist/{authored-check-naming-CO3GA46Y.mjs → authored-check-naming-CIX7Bbyh.mjs} +3 -3
- package/dist/{authored-check-naming-CO3GA46Y.mjs.map → authored-check-naming-CIX7Bbyh.mjs.map} +1 -1
- package/dist/{authoring-entity-types-CZ-vdwYS-Cl5erH9X.d.mts → authoring-entity-types-CZ-vdwYS-BpyuSxbj.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-Cl5erH9X.d.mts.map → authoring-entity-types-CZ-vdwYS-BpyuSxbj.d.mts.map} +1 -1
- package/dist/{authoring-type-constructors-0Iv2zdwS-yMnSyGBK.mjs → authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-yMnSyGBK.mjs.map → authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs.map} +1 -1
- package/dist/builder.d.mts +3 -3
- package/dist/builder__runtime.d.mts +7 -7
- package/dist/builder__runtime.mjs +2 -2
- package/dist/builder__types.d.mts +5 -5
- package/dist/{codec-descriptor-registry-Bg9OjQf_.mjs → codec-descriptor-registry-4kw8FPpo.mjs} +2 -2
- package/dist/{codec-descriptor-registry-Bg9OjQf_.mjs.map → codec-descriptor-registry-4kw8FPpo.mjs.map} +1 -1
- package/dist/{collection-methods-BnR4UjcW-C_55W2m0.d.mts → collection-methods-B-tM7OPZ-v8HK9Txa.d.mts} +3 -3
- package/dist/{collection-methods-BnR4UjcW-C_55W2m0.d.mts.map → collection-methods-B-tM7OPZ-v8HK9Txa.d.mts.map} +1 -1
- package/dist/collection-methods-DQAFcGEB.d.mts +1 -0
- package/dist/{config-types-ni1nb_HA.mjs → config-types-ComQZUlA.mjs} +2 -2
- package/dist/{config-types-ni1nb_HA.mjs.map → config-types-ComQZUlA.mjs.map} +1 -1
- package/dist/{contract-builder-CH0AIjsv.d.mts → contract-builder-De_fyZGT.d.mts} +6 -6
- package/dist/{contract-builder-CH0AIjsv.d.mts.map → contract-builder-De_fyZGT.d.mts.map} +1 -1
- package/dist/{contract-builder-CiYVj56_.mjs → contract-builder-fQ3gkIR5.mjs} +5 -5
- package/dist/{contract-builder-CiYVj56_.mjs.map → contract-builder-fQ3gkIR5.mjs.map} +1 -1
- package/dist/contract-emitter.mjs +1 -1
- package/dist/contract-prisma7__provider.d.mts +12 -6
- package/dist/contract-prisma7__provider.d.mts.map +1 -1
- package/dist/contract-prisma7__provider.mjs +48 -43
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +4 -4
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +3 -3
- package/dist/contract.d.mts +6 -6
- package/dist/contract.mjs +15 -15
- package/dist/contract__authored-check-naming.mjs +1 -1
- package/dist/contract__data-type-support.d.mts +2 -2
- package/dist/contract__data-type-support.mjs +2 -2
- package/dist/contract__data-type.d.mts +2 -2
- package/dist/contract__data-type.mjs +3 -3
- package/dist/contract__entity-kinds.mjs +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.mjs +1 -1
- package/dist/contract__sql-expression.d.mts +2 -2
- package/dist/contract__sql-expression.mjs +2 -2
- 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-DXqMl_gd.mjs → control-ClahTAD-.mjs} +246 -40
- package/dist/control-ClahTAD-.mjs.map +1 -0
- package/dist/{control-adapter-CkFfBVei-DGf1LihO.d.mts → control-adapter-BCopdpsT-DIHCWbq_.d.mts} +9 -26
- package/dist/control-adapter-BCopdpsT-DIHCWbq_.d.mts.map +1 -0
- package/dist/control-adapter-BsSf5pqM.d.mts +1 -0
- package/dist/{control-CPg4LwJV.d.mts → control-mpACqp72.d.mts} +72 -39
- package/dist/control-mpACqp72.d.mts.map +1 -0
- package/dist/{data-type-CYsho6Yd.d.mts → data-type-B8N33s-_.d.mts} +14 -7
- package/dist/data-type-B8N33s-_.d.mts.map +1 -0
- package/dist/{numeral-text-Cqu87pVe-DJCqBaSC.mjs → data-type-DKk8Unnz.mjs} +2 -2
- package/dist/data-type-DKk8Unnz.mjs.map +1 -0
- package/dist/{data-type-support-CfhpAKLX.mjs → data-type-support-C5-XxxeB.mjs} +11 -24
- package/dist/data-type-support-C5-XxxeB.mjs.map +1 -0
- package/dist/{data-type-support-4TcZuD7d.d.mts → data-type-support-CBcYhSkD.d.mts} +12 -16
- package/dist/data-type-support-CBcYhSkD.d.mts.map +1 -0
- package/dist/{db-BmrN9nRS-CzyybGKR.d.mts → db-BmrN9nRS-xynLbnAy.d.mts} +10 -10
- package/dist/{db-BmrN9nRS-CzyybGKR.d.mts.map → db-BmrN9nRS-xynLbnAy.d.mts.map} +1 -1
- package/dist/{ddl-types-DtKZjNtN-DWQeO79o.d.mts → ddl-types-CoP6yAw9-BDp3W_5g.d.mts} +4 -4
- package/dist/{ddl-types-DtKZjNtN-DWQeO79o.d.mts.map → ddl-types-CoP6yAw9-BDp3W_5g.d.mts.map} +1 -1
- package/dist/{default-mapping-B8_APB1M-CWcTmSQW.d.mts → default-mapping-CEISdj2g-DF1LzGBR.d.mts} +7 -5
- package/dist/default-mapping-CEISdj2g-DF1LzGBR.d.mts.map +1 -0
- package/dist/{derived-checks-Cgx_VgS3-CmFqNFgU.mjs → derived-checks-CrvMQTJF-DlxFFtNM.mjs} +18 -18
- package/dist/derived-checks-CrvMQTJF-DlxFFtNM.mjs.map +1 -0
- package/dist/{diff-CVVGktZG.d.mts → diff-Bd9ILpZL.d.mts} +20 -7
- package/dist/diff-Bd9ILpZL.d.mts.map +1 -0
- package/dist/diff-DZ82XaGR.mjs +21 -0
- package/dist/diff-DZ82XaGR.mjs.map +1 -0
- package/dist/{dist-Cg2lL1hR.mjs → dist-DAHIT4AS.mjs} +2 -2
- package/dist/{dist-Cg2lL1hR.mjs.map → dist-DAHIT4AS.mjs.map} +1 -1
- package/dist/{entity-kinds-CQ_jwgYv-HA5t2SE0.mjs → entity-kinds-CQ_jwgYv-DoOBWwvX.mjs} +3 -3
- package/dist/{entity-kinds-CQ_jwgYv-HA5t2SE0.mjs.map → entity-kinds-CQ_jwgYv-DoOBWwvX.mjs.map} +1 -1
- package/dist/exports-DVsHk8HP-DrH_2a-H.mjs +2371 -0
- package/dist/exports-DVsHk8HP-DrH_2a-H.mjs.map +1 -0
- package/dist/{expression-Ck1wys3N-Cdc7eUQS.d.mts → expression-BzrfOiPC-3NqR8UzK.d.mts} +4 -4
- package/dist/{expression-Ck1wys3N-Cdc7eUQS.d.mts.map → expression-BzrfOiPC-3NqR8UzK.d.mts.map} +1 -1
- package/dist/expression-CeerCjQG.d.mts +2 -0
- package/dist/{expression-CNBCbbzU-DOXKUxQs.d.mts → expression-sOY1120I-DOykEQlw.d.mts} +4 -4
- package/dist/expression-sOY1120I-DOykEQlw.d.mts.map +1 -0
- package/dist/{factories-vDQ3S5gW.mjs → factories-DkD3nMYt.mjs} +3 -3
- package/dist/{factories-vDQ3S5gW.mjs.map → factories-DkD3nMYt.mjs.map} +1 -1
- package/dist/family.d.mts +14 -14
- package/dist/family.mjs +8 -8
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +5 -5
- package/dist/family__control.mjs +4 -4
- package/dist/family__diff.d.mts +1 -2
- package/dist/family__diff.mjs +2 -2
- 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.d.mts +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/{foreign-key-materialization-DJ6uhBba.d.mts → foreign-key-materialization-DCaDnUs-.d.mts} +3 -3
- package/dist/{foreign-key-materialization-DJ6uhBba.d.mts.map → foreign-key-materialization-DCaDnUs-.d.mts.map} +1 -1
- package/dist/{foreign-key-materialization-DibQ9Hjg.mjs → foreign-key-materialization-DfNPQL9G.mjs} +4 -4
- package/dist/{foreign-key-materialization-DibQ9Hjg.mjs.map → foreign-key-materialization-DfNPQL9G.mjs.map} +1 -1
- package/dist/{functions-DSwXxsTg.d.mts → functions-Cp8soSAv.d.mts} +3 -3
- package/dist/{functions-DSwXxsTg.d.mts.map → functions-Cp8soSAv.d.mts.map} +1 -1
- package/dist/{index-C8jUgdUh.d.mts → index-BxlXOVeT.d.mts} +30 -23
- package/dist/{index-C8jUgdUh.d.mts.map → index-BxlXOVeT.d.mts.map} +1 -1
- package/dist/{index-equivalence-DswCiq5l-DlC2yTK1.mjs → index-equivalence-DswCiq5l-BsphajRC.mjs} +2 -2
- package/dist/{index-equivalence-DswCiq5l-DlC2yTK1.mjs.map → index-equivalence-DswCiq5l-BsphajRC.mjs.map} +1 -1
- package/dist/{index-naming-BOcJT1B3-CeEoP8t3.mjs → index-naming-BOcJT1B3-18gQUduD.mjs} +2 -2
- package/dist/{index-naming-BOcJT1B3-CeEoP8t3.mjs.map → index-naming-BOcJT1B3-18gQUduD.mjs.map} +1 -1
- package/dist/index-reference-CWppFpUV.d.mts +1 -0
- package/dist/{index-reference-DJX-CNsb-D5uoBnH_.d.mts → index-reference-DJaQLZA3-DxmYkkX-.d.mts} +3 -3
- package/dist/{index-reference-DJX-CNsb-D5uoBnH_.d.mts.map → index-reference-DJaQLZA3-DxmYkkX-.d.mts.map} +1 -1
- package/dist/{interpreter-CvmBTYyI-DNl-jr2E.mjs → interpreter-CFj2aTEP-BHL3TOqk.mjs} +13 -11
- package/dist/interpreter-CFj2aTEP-BHL3TOqk.mjs.map +1 -0
- package/dist/{ir-D0Vpm5O9.d.mts → ir-DgNo535E.d.mts} +4 -2
- package/dist/ir-DgNo535E.d.mts.map +1 -0
- package/dist/ir-I-xciGUH.mjs.map +1 -1
- package/dist/middleware-IqWk9Eff.d.mts +1 -0
- package/dist/{middleware-YsFLC19Y-5mJZCBWq.d.mts → middleware-oCT0RWkt-AFlRNCOD.d.mts} +3 -3
- package/dist/{middleware-YsFLC19Y-5mJZCBWq.d.mts.map → middleware-oCT0RWkt-AFlRNCOD.d.mts.map} +1 -1
- package/dist/{migration-ESRa6312.d.mts → migration-lg_VgP_F.d.mts} +2 -2
- package/dist/{migration-ESRa6312.d.mts.map → migration-lg_VgP_F.d.mts.map} +1 -1
- package/dist/{naming-CT8tRisJ-DLHKo0Hm.mjs → naming-bM5qm5PY-DdginUhA.mjs} +2 -2
- package/dist/{naming-CT8tRisJ-DLHKo0Hm.mjs.map → naming-bM5qm5PY-DdginUhA.mjs.map} +1 -1
- package/dist/{opaque-sql-BWxbqe5a-GGKfyakq.mjs → opaque-sql-Dset3kln-BzzXoO94.mjs} +3 -3
- package/dist/opaque-sql-Dset3kln-BzzXoO94.mjs.map +1 -0
- package/dist/orm-client.d.mts +28 -60
- package/dist/orm-client.d.mts.map +1 -1
- package/dist/orm-client.mjs +564 -233
- package/dist/orm-client.mjs.map +1 -1
- package/dist/{pack-BtGENS4_.d.mts → pack-CyjyMUN0.d.mts} +3 -3
- package/dist/{pack-BtGENS4_.d.mts.map → pack-CyjyMUN0.d.mts.map} +1 -1
- package/dist/plan-BZpZafiQ.d.mts +2 -0
- package/dist/{plan-cGEaSXHv-yuz43WrR.d.mts → plan-Cbed2eDu-BZM3geSm.d.mts} +3 -3
- package/dist/plan-Cbed2eDu-BZM3geSm.d.mts.map +1 -0
- package/dist/{psl-build-PXVtl8gM.d.mts → psl-build-BHQfP1_C.d.mts} +5 -5
- package/dist/{psl-build-PXVtl8gM.d.mts.map → psl-build-BHQfP1_C.d.mts.map} +1 -1
- package/dist/{psl-build-8bx9WTUt.mjs → psl-build-BsJ6eChh.mjs} +118 -84
- package/dist/psl-build-BsJ6eChh.mjs.map +1 -0
- package/dist/{psl-column-resolution-BCkhNzOK-Bbrs_WzK.d.mts → psl-column-resolution-BCkhNzOK-mW_8C9vr.d.mts} +2 -2
- package/dist/{psl-column-resolution-BCkhNzOK-Bbrs_WzK.d.mts.map → psl-column-resolution-BCkhNzOK-mW_8C9vr.d.mts.map} +1 -1
- package/dist/{psl-field-resolution-SPNDr-jr-CH_gs3Oy.mjs → psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs} +76 -66
- package/dist/psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs.map +1 -0
- package/dist/{psl-infer-g040TwAr.d.mts → psl-infer-B6iemK9i.d.mts} +4 -4
- package/dist/{psl-infer-g040TwAr.d.mts.map → psl-infer-B6iemK9i.d.mts.map} +1 -1
- package/dist/{psl-infer-CG0_wra6.mjs → psl-infer-HPi_YMeE.mjs} +2 -2
- package/dist/{psl-infer-CG0_wra6.mjs.map → psl-infer-HPi_YMeE.mjs.map} +1 -1
- package/dist/{query-lane-context-C42-u9L1-BSJoP83K.d.mts → query-lane-context-BLOPW1rQ-Bn3ugl9a.d.mts} +5 -5
- package/dist/{query-lane-context-C42-u9L1-BSJoP83K.d.mts.map → query-lane-context-BLOPW1rQ-Bn3ugl9a.d.mts.map} +1 -1
- package/dist/query-lane-context-Dpep1Fzy.d.mts +1 -0
- package/dist/relational-core.d.mts +12 -12
- package/dist/relational-core.mjs +2 -2
- package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
- package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
- package/dist/relational-core__ast.d.mts +3 -3
- package/dist/relational-core__ast.mjs +2 -2
- package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
- package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/relational-core__collection-methods.d.mts +2 -2
- package/dist/relational-core__contract-free.d.mts +3 -3
- package/dist/relational-core__contract-free.mjs +2 -2
- package/dist/relational-core__contract-free.mjs.map +1 -1
- package/dist/relational-core__expression.d.mts +3 -3
- package/dist/relational-core__functions.d.mts +1 -1
- package/dist/relational-core__index-reference.d.mts +2 -2
- 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/runtime.d.mts +5 -5
- package/dist/runtime.mjs +1 -2289
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-CqWOkoW9-uVU2SdFf.d.mts → schema-differ-DmP74bB8-BGA6fzOv.d.mts} +4 -4
- package/dist/{schema-differ-CqWOkoW9-uVU2SdFf.d.mts.map → schema-differ-DmP74bB8-BGA6fzOv.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/schema-ir__naming.mjs +1 -1
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +2 -2
- package/dist/{schema-verify-DIfHSB4I-wt28gB9e.mjs → schema-verify-BwRdzbHb-B9vFrm3T.mjs} +22 -6
- package/dist/schema-verify-BwRdzbHb-B9vFrm3T.mjs.map +1 -0
- package/dist/{serialized-index-52COq1yV-D8zJP-Xl.mjs → serialized-index-52COq1yV-CUJ2F65u.mjs} +3 -3
- package/dist/{serialized-index-52COq1yV-D8zJP-Xl.mjs.map → serialized-index-52COq1yV-CUJ2F65u.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-DDaAVCQr-Ba3XOCG6.mjs → sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs} +12 -7
- package/dist/sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs.map +1 -0
- package/dist/{data-type-DU0mtme5.mjs → sql-data-type-Dabuwxet-BljsNjBu.mjs} +32 -13
- package/dist/sql-data-type-Dabuwxet-BljsNjBu.mjs.map +1 -0
- package/dist/{sql-execution-plan-C7XauPPu-BgBp89vP.d.mts → sql-execution-plan-Dam5yMZg-Bc_eneSz.d.mts} +3 -3
- package/dist/sql-execution-plan-Dam5yMZg-Bc_eneSz.d.mts.map +1 -0
- package/dist/{sql-expression-BWrjmY6M.d.mts → sql-expression-BAtH-2UU.d.mts} +6 -6
- package/dist/sql-expression-BAtH-2UU.d.mts.map +1 -0
- package/dist/{sql-expression-DSRILiU2.mjs → sql-expression-BJCuy-WI.mjs} +15 -9
- package/dist/sql-expression-BJCuy-WI.mjs.map +1 -0
- package/dist/{storage-table-DN36E2yE-Bm5eKeGw.mjs → storage-table-DN36E2yE-0ncS821l.mjs} +2 -2
- package/dist/{storage-table-DN36E2yE-Bm5eKeGw.mjs.map → storage-table-DN36E2yE-0ncS821l.mjs.map} +1 -1
- package/dist/{transaction-state-DR3nKTmH-D5eFB250.d.mts → transaction-state-DR3nKTmH-n_12DsnU.d.mts} +9 -9
- package/dist/{transaction-state-DR3nKTmH-D5eFB250.d.mts.map → transaction-state-DR3nKTmH-n_12DsnU.d.mts.map} +1 -1
- package/dist/types-BLyhYk6B.d.mts +1 -0
- package/dist/{types-DvhckjSz-Cm0Oodhr.mjs → types-CaVn_xxe-D9WdU3Iy.mjs} +81 -157
- package/dist/types-CaVn_xxe-D9WdU3Iy.mjs.map +1 -0
- package/dist/{types-Cl4MLNrS-BXDsTb9U.d.mts → types-Cv5t6_Ly-CcBWTpfM.d.mts} +6 -6
- package/dist/{types-Cl4MLNrS-BXDsTb9U.d.mts.map → types-Cv5t6_Ly-CcBWTpfM.d.mts.map} +1 -1
- package/dist/{types-Sh5HuaZE-BwZNUDEi.d.mts → types-DVaVM20q-B-QcMIOa.d.mts} +9 -20
- package/dist/types-DVaVM20q-B-QcMIOa.d.mts.map +1 -0
- package/dist/{types-CzxOObSY-Cq3t_HCe.d.mts → types-DaYtBAYT-B22gkh5z.d.mts} +5 -5
- package/dist/{types-CzxOObSY-Cq3t_HCe.d.mts.map → types-DaYtBAYT-B22gkh5z.d.mts.map} +1 -1
- package/dist/{types-GS3fwvoX.mjs → types-M_FeBD9w.mjs} +2 -2
- package/dist/{types-GS3fwvoX.mjs.map → types-M_FeBD9w.mjs.map} +1 -1
- package/dist/types-_7TbRpPw.d.mts +1 -0
- package/dist/{types-C-z8HyiZ-1Nhw0pHj.d.mts → types-c1iIhJep-DdMj6TNl.d.mts} +49 -51
- package/dist/types-c1iIhJep-DdMj6TNl.d.mts.map +1 -0
- package/dist/{validators-DlpO67uZ.mjs → validators-Bvfk0aN7.mjs} +14 -11
- package/dist/validators-Bvfk0aN7.mjs.map +1 -0
- package/dist/{validators-R-Wsy5Rr.d.mts → validators-CTZ-hU2l.d.mts} +4 -1
- package/dist/validators-CTZ-hU2l.d.mts.map +1 -0
- package/package.json +18 -18
- package/dist/ast-BDwGvnKK.mjs.map +0 -1
- package/dist/ast-BoM9T1b2.d.mts.map +0 -1
- package/dist/attribute-specs-D7EhHD08.d.mts.map +0 -1
- package/dist/collection-methods-CyUXbXVw.d.mts +0 -1
- package/dist/control-CPg4LwJV.d.mts.map +0 -1
- package/dist/control-DXqMl_gd.mjs.map +0 -1
- package/dist/control-adapter-CkFfBVei-DGf1LihO.d.mts.map +0 -1
- package/dist/control-adapter-DDjgBMy3.d.mts +0 -1
- package/dist/data-type-CYsho6Yd.d.mts.map +0 -1
- package/dist/data-type-DU0mtme5.mjs.map +0 -1
- package/dist/data-type-support-4TcZuD7d.d.mts.map +0 -1
- package/dist/data-type-support-CfhpAKLX.mjs.map +0 -1
- package/dist/default-mapping-B8_APB1M-CWcTmSQW.d.mts.map +0 -1
- package/dist/derived-checks-Cgx_VgS3-CmFqNFgU.mjs.map +0 -1
- package/dist/diff-B16bL_IR.mjs +0 -13
- package/dist/diff-B16bL_IR.mjs.map +0 -1
- package/dist/diff-CVVGktZG.d.mts.map +0 -1
- package/dist/expression-CNBCbbzU-DOXKUxQs.d.mts.map +0 -1
- package/dist/expression-DUYovBa6.d.mts +0 -2
- package/dist/index-reference-DGQdSRjQ.d.mts +0 -1
- package/dist/interpreter-CvmBTYyI-DNl-jr2E.mjs.map +0 -1
- package/dist/ir-D0Vpm5O9.d.mts.map +0 -1
- package/dist/middleware-Bp-R5o9E.d.mts +0 -1
- package/dist/numeral-text-Cqu87pVe-DJCqBaSC.mjs.map +0 -1
- package/dist/opaque-sql-BWxbqe5a-GGKfyakq.mjs.map +0 -1
- package/dist/plan-DdpaNNu1.d.mts +0 -2
- package/dist/plan-cGEaSXHv-yuz43WrR.d.mts.map +0 -1
- package/dist/psl-build-8bx9WTUt.mjs.map +0 -1
- package/dist/psl-field-resolution-SPNDr-jr-CH_gs3Oy.mjs.map +0 -1
- package/dist/query-lane-context-C4xq68Mr.d.mts +0 -1
- package/dist/runtime.mjs.map +0 -1
- package/dist/schema-verify-DIfHSB4I-wt28gB9e.mjs.map +0 -1
- package/dist/sql-contract-serializer-DDaAVCQr-Ba3XOCG6.mjs.map +0 -1
- package/dist/sql-execution-plan-C7XauPPu-BgBp89vP.d.mts.map +0 -1
- package/dist/sql-expression-BWrjmY6M.d.mts.map +0 -1
- package/dist/sql-expression-DSRILiU2.mjs.map +0 -1
- package/dist/types-BSBsW0qR.d.mts +0 -1
- package/dist/types-C-z8HyiZ-1Nhw0pHj.d.mts.map +0 -1
- package/dist/types-CJK7FBdw.d.mts +0 -1
- package/dist/types-DvhckjSz-Cm0Oodhr.mjs.map +0 -1
- package/dist/types-Sh5HuaZE-BwZNUDEi.d.mts.map +0 -1
- package/dist/validators-DlpO67uZ.mjs.map +0 -1
- package/dist/validators-R-Wsy5Rr.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-expression-BJCuy-WI.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/sql-expression.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { canonicalizeTaggedLiteralBody, describeTaggedLiteralFailure, printTaggedLiteral, printedTaggedLiteralReadsBack, resolveTemplateTagEscapes } from \"@internal/framework-components/authoring\";\nimport { dataType, dataTypeId, readJsonString, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { runtimeError } from \"@internal/framework-components/components\";\n//#region src/sql-expression.ts\nconst SQL_EXPRESSION_DATA_TYPE_ID = dataTypeId(\"sql/expression\");\nconst SQL_EXPRESSION_TAG = \"sql\";\n/** The data type of a SQL expression in the target database's language. It declares no casts. The SQL family registers it. ADR 254. */\nconst sqlExpressionDataType = frozenWithCasts(dataType(SQL_EXPRESSION_DATA_TYPE_ID, { read: readStoredSqlText }));\nfunction readStoredSqlText(json) {\n\tconst text = readJsonString(SQL_EXPRESSION_DATA_TYPE_ID, json);\n\tconst canonical = storedSqlText(text);\n\tif (canonical === text) return text;\n\treturn refuseJsonValue(SQL_EXPRESSION_DATA_TYPE_ID, canonical === void 0 ? \"text a sql literal can hold\" : `${JSON.stringify(canonical)}, the canonical text of the sql literal it was written as`, json);\n}\n/** PSL support for `sql/expression`. The SQL family registers it under `SQL_EXPRESSION_DATA_TYPE_ID`. */\nconst sqlExpressionAuthoringEntry = Object.freeze({\n\twritten: Object.freeze({\n\t\tkind: \"tag\",\n\t\ttag: \"sql\",\n\t\tparse: (text) => text\n\t}),\n\tprint: (value) => sqlTextFromStored(value),\n\tdocumentation: \"A SQL expression in the target database's language. Prisma passes it to the database unchanged.\"\n});\nfunction frozenWithCasts(type) {\n\tObject.freeze(type.casts);\n\treturn Object.freeze(type);\n}\n/** The SQL family's registration of `sql/expression`, shaped as the family descriptor's `dataTypes` and `authoring.dataTypes`. */\nconst sqlExpressionRegistration = Object.freeze({\n\tdataTypes: Object.freeze([sqlExpressionDataType]),\n\tauthoring: Object.freeze({ dataTypes: Object.freeze({ [SQL_EXPRESSION_DATA_TYPE_ID]: sqlExpressionAuthoringEntry }) })\n});\n/** The SQL text held by the stored form of a `sql/expression` value. */\nfunction sqlTextFromStored(value) {\n\tif (typeof value === \"string\") return value;\n\tthrow new InternalError(`A sql/expression value is a string, got ${JSON.stringify(value)}.`);\n}\n/** The text a `sql` literal holding `text` reads back as, or `undefined` when `text` has a NUL character or is too large. */\nfunction storedSqlText(text) {\n\tconst canonical = canonicalizeTaggedLiteralBody(text);\n\treturn canonical.ok ? canonical.text : void 0;\n}\n/**\n* A `sql` literal holding `text`. Throws when the literal would read back as different text; check with `sqlTextsReadBack`\n* first. The result of `storedSqlText` always reads back.\n*/\nfunction printSqlExpressionLiteral(text) {\n\tif (!printedTaggedLiteralReadsBack(text)) throw new InternalError(`A sql literal cannot hold ${JSON.stringify(text)}: it would read back as different text.`);\n\treturn printTaggedLiteral(\"sql\", text);\n}\n/** Whether every present text reads back unchanged when printed as a `sql` literal. */\nfunction sqlTextsReadBack(texts) {\n\treturn texts.every((text) => text === void 0 || printedTaggedLiteralReadsBack(text));\n}\nfunction castFromSqlExpression(type) {\n\tif (Object.hasOwn(type.casts, SQL_EXPRESSION_DATA_TYPE_ID)) return \"a cast\";\n\tif (type.listCast?.of.includes(SQL_EXPRESSION_DATA_TYPE_ID)) return \"a list cast\";\n}\n/**\n* Throws when a data type declares a cast or a list cast from `sql/expression`. A `sql` literal is\n* SQL the database runs, so a cast would turn it into a value of another type with no diagnostic.\n* ADR 254.\n*/\nfunction assertNothingCastsFromSqlExpression(declaredDataTypes) {\n\tfor (const { type, contributedBy } of declaredDataTypes) {\n\t\tconst declared = castFromSqlExpression(type);\n\t\tif (declared === void 0) continue;\n\t\tthrow runtimeError(\"CONTRACT.DATA_TYPE_CASTS_FROM_SQL_EXPRESSION\", `Data type \"${type.id}\" from \"${contributedBy}\" declares ${declared} from ${SQL_EXPRESSION_DATA_TYPE_ID}. No data type may cast from ${SQL_EXPRESSION_DATA_TYPE_ID}: a sql literal is SQL the database runs, not a value of another type.`, {\n\t\t\tdataType: type.id,\n\t\t\tcontributedBy\n\t\t});\n\t}\n}\nconst SQL_EXPRESSION_MARKER = Symbol.for(\"@prisma/sql-expression\");\n/** A value of the data type `sql/expression` in TypeScript. Its text is always canonical. */\nvar SqlExpression = class {\n\t[SQL_EXPRESSION_MARKER] = true;\n\ttext;\n\t/** Canonicalizes `text` as a PSL `sql` literal's text is canonicalized. Throws CONTRACT.SQL_EXPRESSION_INVALID on NUL or oversize text. */\n\tconstructor(text) {\n\t\tconst canonical = canonicalizeTaggedLiteralBody(text);\n\t\tif (!canonical.ok) throw contractError(\"CONTRACT.SQL_EXPRESSION_INVALID\", describeTaggedLiteralFailure(canonical.reason), { meta: {\n\t\t\treason: canonical.reason,\n\t\t\toffset: canonical.offset\n\t\t} });\n\t\tthis.text = canonical.text;\n\t\tObject.freeze(this);\n\t}\n};\n/** Whether `value` is a `sql` value, made by this copy of the package or by another one. */\nfunction isSqlExpression(value) {\n\treturn typeof value === \"object\" && value !== null && Reflect.get(value, SQL_EXPRESSION_MARKER) === true && typeof Reflect.get(value, \"text\") === \"string\";\n}\n/**\n* This copy's `SqlExpression` for `value`: the value itself when this copy made it, a new one built\n* from the text of a `sql` value another copy made, so that text is canonicalized here too, or\n* `undefined` for anything else.\n*/\nfunction readSqlExpression(value) {\n\tif (value instanceof SqlExpression) return value;\n\treturn isSqlExpression(value) ? new SqlExpression(value.text) : void 0;\n}\n/** Raw SQL written as a template literal: `` sql`\"userId\" = auth.uid()` ``. Other `sql` values may be interpolated; each later line of one takes the indentation of the template line it sits on. */\nfunction sql(strings, ...values) {\n\tconst texts = values.map((value, index) => {\n\t\tconst expression = readSqlExpression(value);\n\t\tif (expression === void 0) throw contractError(\"CONTRACT.SQL_EXPRESSION_INTERPOLATION\", \"sql`...` only interpolates other sql`...` values; write any other text inside the template.\", { meta: { index } });\n\t\treturn expression.text;\n\t});\n\tconst pieces = strings.raw.map((piece) => resolveTemplateTagEscapes(piece));\n\tlet joined = pieces[0] ?? \"\";\n\tlet templateLineIndent = indentOfLastLine(joined);\n\ttexts.forEach((value, index) => {\n\t\tconst piece = pieces[index + 1] ?? \"\";\n\t\tjoined += value.replaceAll(\"\\n\", `\\n${templateLineIndent}`) + piece;\n\t\tif (/[\\n\\r]/.test(piece)) templateLineIndent = indentOfLastLine(piece);\n\t});\n\treturn new SqlExpression(joined);\n}\nfunction indentOfLastLine(templatePiece) {\n\tconst lastLine = templatePiece.slice(Math.max(templatePiece.lastIndexOf(\"\\n\"), templatePiece.lastIndexOf(\"\\r\")) + 1);\n\treturn LEADING_WHITESPACE.exec(lastLine)?.[0] ?? \"\";\n}\nconst LEADING_WHITESPACE = /^[ \\t]*/;\n/** Reads `value` with `readSqlExpression`; throws for anything that is not a `sql` value. For callers that JavaScript cannot type-check. */\nfunction requireSqlExpression(value, what) {\n\tconst expression = readSqlExpression(value);\n\tif (expression !== void 0) return expression;\n\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `${what} must be a sql\\`...\\` value.`, { meta: { what } });\n}\n//#endregion\nexport { SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, SqlExpression, assertNothingCastsFromSqlExpression, isSqlExpression, printSqlExpressionLiteral, readSqlExpression, requireSqlExpression, sql, sqlExpressionAuthoringEntry, sqlExpressionDataType, sqlExpressionRegistration, sqlTextFromStored, sqlTextsReadBack, storedSqlText };\n\n//# sourceMappingURL=sql-expression.mjs.map"],"mappings":";;;;;;AAMA,MAAM,8BAA8B,WAAW,gBAAgB;AAC/D,MAAM,qBAAqB;;AAE3B,MAAM,wBAAwB,gBAAgB,SAAS,6BAA6B,EAAE,MAAM,kBAAkB,CAAC,CAAC;AAChH,SAAS,kBAAkB,MAAM;CAChC,MAAM,OAAO,eAAe,6BAA6B,IAAI;CAC7D,MAAM,YAAY,cAAc,IAAI;CACpC,IAAI,cAAc,MAAM,OAAO;CAC/B,OAAO,gBAAgB,6BAA6B,cAAc,KAAK,IAAI,gCAAgC,GAAG,KAAK,UAAU,SAAS,EAAE,4DAA4D,IAAI;AACzM;;AAEA,MAAM,8BAA8B,OAAO,OAAO;CACjD,SAAS,OAAO,OAAO;EACtB,MAAM;EACN,KAAK;EACL,QAAQ,SAAS;CAClB,CAAC;CACD,QAAQ,UAAU,kBAAkB,KAAK;CACzC,eAAe;AAChB,CAAC;AACD,SAAS,gBAAgB,MAAM;CAC9B,OAAO,OAAO,KAAK,KAAK;CACxB,OAAO,OAAO,OAAO,IAAI;AAC1B;;AAEA,MAAM,4BAA4B,OAAO,OAAO;CAC/C,WAAW,OAAO,OAAO,CAAC,qBAAqB,CAAC;CAChD,WAAW,OAAO,OAAO,EAAE,WAAW,OAAO,OAAO,GAAG,8BAA8B,4BAA4B,CAAC,EAAE,CAAC;AACtH,CAAC;;AAED,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,MAAM,IAAI,cAAc,2CAA2C,KAAK,UAAU,KAAK,EAAE,EAAE;AAC5F;;AAEA,SAAS,cAAc,MAAM;CAC5B,MAAM,YA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
|
1
1
|
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
-
import { l as nameOf } from "./naming-
|
|
2
|
+
import { l as nameOf } from "./naming-bM5qm5PY-DdginUhA.mjs";
|
|
3
3
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
4
4
|
import { IRNodeBase, freezeNode } from "@prisma/orm-framework/components/ir";
|
|
5
5
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
@@ -306,4 +306,4 @@ var StorageTable = class StorageTable extends SqlNode {
|
|
|
306
306
|
//#endregion
|
|
307
307
|
export { PrimaryKey as a, StorageTable as c, Index as i, UniqueConstraint as l, ForeignKey as n, SqlNode as o, ForeignKeyReference as r, StorageColumn as s, CheckConstraint as t };
|
|
308
308
|
|
|
309
|
-
//# sourceMappingURL=storage-table-DN36E2yE-
|
|
309
|
+
//# sourceMappingURL=storage-table-DN36E2yE-0ncS821l.mjs.map
|
package/dist/{storage-table-DN36E2yE-Bm5eKeGw.mjs.map → storage-table-DN36E2yE-0ncS821l.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-table-DN36E2yE-Bm5eKeGw.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-DN36E2yE.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ir/check-constraint.ts\n/**\n* SQL Contract IR node for a table-level check constraint, name-identified:\n* `name` is the full physical name; a present `prefix` marks the constraint as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)` over the expression's\n* content hash), an absent `prefix` marks it exact (the name is adopted\n* verbatim). This is the convention indexes and RLS policies already use — see\n* ADR 234, \"Content-addressed wire names for Postgres-normalized objects\".\n*\n* The predicate is opaque: one SQL string, never parsed and never rendered\n* from structured parts. A database reprints predicates in its own normalized\n* form, so a wire-named check is compared by name — the hash already commits\n* to the expression the contract declared.\n*/\nvar CheckConstraint = class CheckConstraint extends SqlNode {\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"CheckConstraint: every check constraint carries a full physical name.\", \"storage\");\n\t\tthis.name = name;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Normalizes either shape into an instance: an existing `CheckConstraint`\n\t* passes through, canonical input is constructed. Callers that accept\n\t* \"instance or input\" go through this, so the constructor keeps one\n\t* canonical shape instead of widening to a union.\n\t*/\n\tstatic from(value) {\n\t\treturn value instanceof CheckConstraint ? value : new CheckConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/sql-index.ts\n/**\n* SQL Contract IR node for a table-level secondary index, name-identified:\n* `name` is the full physical name; a present `prefix` marks the index as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)`), an absent `prefix`\n* marks it exact (the name is adopted verbatim).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL supported natively by\n* Postgres and SQLite alike, and the family IR must be able to represent\n* anything any SQL target can introspect. A target declining to AUTHOR them\n* (SQLite's rejection at namespace construction) is a capability decision,\n* not evidence of target-specificity.\n*\n* Note that this class shadows the global TypeScript `Index` lib type\n* at the family-shared name; consumer files that need both should\n* alias one (e.g.\n* `import { Index as SqlIndexNode } from '@internal/sql-contract/types'`).\n*/\nvar Index = class Index extends SqlNode {\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new ContractValidationError(`Index \"${name}\": exactly one of columns or expression must be set.`, \"storage\");\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tif (input.type !== void 0) this.type = input.type;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof Index ? value : new Index(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key-reference.ts\n/**\n* SQL Contract IR node for one side (source or target) of a foreign-key\n* declaration. Carries the full coordinate: namespace, table, and columns.\n*\n* Cross-space discrimination is based on `spaceId` presence: absent means\n* local (same contract-space); present means cross-space (the referenced\n* table lives in the contract-space identified by `spaceId`).\n*\n* For local references `spaceId` is absent from JSON, keeping the serialized\n* shape byte-identical to contracts authored before cross-space support was\n* added. For cross-space references `spaceId` appears in JSON so round-trips\n* are lossless.\n*\n* Use `UNBOUND_NAMESPACE_ID` from `@internal/framework-components/ir`\n* as the sentinel `namespaceId` for single-namespace (unbound) references.\n*/\nvar ForeignKeyReference = class ForeignKeyReference extends SqlNode {\n\tnamespaceId;\n\ttableName;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.namespaceId = asNamespaceId(input.namespaceId);\n\t\tthis.tableName = input.tableName;\n\t\tthis.columns = input.columns;\n\t\tif (input.spaceId !== void 0) this.spaceId = input.spaceId;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKeyReference ? value : new ForeignKeyReference(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key.ts\n/**\n* SQL Contract IR node for a table-level foreign-key declaration — the\n* referential constraint only (source, target, `onDelete`/`onUpdate`).\n*\n* A persisted `foreignKeys[]` entry always denotes a real constraint: whether\n* to emit the constraint at all, and whether to back it with an index, are\n* authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,\n* index })`) resolved once at `contract emit` — a `constraint: false` FK\n* simply has no entry here, and a backing index (if any) is its own discrete,\n* named entry in the table's `indexes[]`. `index` says what serves the\n* foreign key's lookups; it is absent when nothing backs the foreign key.\n*\n* Each FK carries explicit `source` and `target` {@link ForeignKeyReference}\n* coordinates (namespace, table, columns). For single-namespace contracts the\n* sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.\n*\n* The nested references are normalised to {@link ForeignKeyReference}\n* instances inside the constructor so downstream walks see a uniform AST\n* regardless of whether the input was a JSON literal or an already-constructed\n* class instance.\n*/\nvar ForeignKey = class ForeignKey extends SqlNode {\n\tsource;\n\ttarget;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.source = ForeignKeyReference.from(input.source);\n\t\tthis.target = ForeignKeyReference.from(input.target);\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (typeof input.index === \"object\") this.index = input.index;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKey ? value : new ForeignKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* SQL Contract IR node for a table's primary-key constraint.\n*/\nvar PrimaryKey = class PrimaryKey extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-column.ts\n/**\n* SQL Contract IR node for a single column entry in `StorageTable.columns`.\n*\n* Single concrete family-shared class — every SQL target reads the\n* same column shape today, so there is no per-target subclass. The\n* class type accepts any caller that constructs via\n* `new StorageColumn(input)`; literal construction sites must pass\n* through the constructor or the family-base hydration walker.\n*\n* The column's `name` is not on the class — columns are keyed by name\n* in the parent `StorageTable.columns: Record<string, StorageColumn>`\n* map, so a `name` field would be redundant with the key.\n*/\nvar StorageColumn = class StorageColumn extends SqlNode {\n\tdataType;\n\tcodecId;\n\tnullable;\n\tmany;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (Object.hasOwn(input, \"elementNullable\")) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"StorageColumn elementNullable must be nested under many.\", { meta: { reason: \"sibling-elementNullable\" } });\n\t\tthis.dataType = input.dataType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tthis.many = input.many ?? false;\n\t\tif (input.typeParams !== void 0) this.typeParams = input.typeParams;\n\t\tif (input.typeRef !== void 0) this.typeRef = input.typeRef;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.valueSet !== void 0) this.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof StorageColumn ? value : new StorageColumn(value);\n\t}\n};\n//#endregion\n//#region src/ir/unique-constraint.ts\n/**\n* SQL Contract IR node for a table-level unique constraint.\n*/\nvar UniqueConstraint = class UniqueConstraint extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof UniqueConstraint ? value : new UniqueConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-table.ts\n/**\n* SQL Contract IR node for a single table entry in a namespace's\n* `tables` map.\n*\n* The constructor normalises nested IR-class fields (columns, primary\n* key, uniques, indexes, foreign keys) into the appropriate class\n* instances so downstream walks see a uniform AST regardless of whether\n* the input was a JSON literal or an already-constructed class.\n*\n* The table's `name` is not on the class — tables are keyed by name in\n* the parent namespace's `tables: Record<string, StorageTable>` map.\n*/\nvar StorageTable = class StorageTable extends SqlNode {\n\tcolumns;\n\tuniques;\n\tindexes;\n\tforeignKeys;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([name, col]) => [name, StorageColumn.from(col)])));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tthis.uniques = Object.freeze(input.uniques.map(UniqueConstraint.from));\n\t\tthis.indexes = Object.freeze(input.indexes.map(Index.from));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map(ForeignKey.from));\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(CheckConstraint.from));\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Runtime guard that a namespace `table` entry is really a `StorageTable`.\n\t* The compiler already types the entry as `StorageTable`, but a\n\t* freshly-deserialized contract may carry plain JSON at that slot until\n\t* hydration; this duck-types the structural shape. Accepts `undefined` so\n\t* optional-chained entry lookups pass straight through.\n\t*/\n\tstatic is(value) {\n\t\tif (typeof value !== \"object\" || value === null) return false;\n\t\treturn \"columns\" in value && \"uniques\" in value && \"indexes\" in value && \"foreignKeys\" in value;\n\t}\n\tstatic assert(value, coordinate) {\n\t\tif (!StorageTable.is(value)) throw new InternalError(`Expected a StorageTable at ${coordinate}`);\n\t}\n};\n//#endregion\nexport { ForeignKey as a, CheckConstraint as c, PrimaryKey as i, SqlNode as l, UniqueConstraint as n, ForeignKeyReference as o, StorageColumn as r, Index as s, StorageTable as t };\n\n//# sourceMappingURL=storage-table-DN36E2yE.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAI,UAAU,cAAc,WAAW;CACtC;CACA,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;CACF;AACD;;;;;;;;;;;;;;AAgBA,IAAI,kBAAkB,MAAM,wBAAwB,QAAQ;CAC3D;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,MAAM,OAAO,OA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,MAAM,IAAI,CAAC;EAC1D,KAAK,cAAc,OAAO,OAAO,MAAM,YAAY,IAAI,WAAW,IAAI,CAAC;EACvE,IAAI,MAAM,YAAY,KAAK,GAAG,KAAK,UAAU,MAAM;EACnD,IAAI,MAAM,WAAW,KAAK,KAAK,MAAM,OAAO,SAAS,GAAG,KAAK,SAAS,OAAO,OAAO,MAAM,OAAO,IAAI,gBAAgB,IAAI,CAAC;EAC1H,WAAW,IAAI;CAChB;;;;;;;;CAQA,OAAO,GAAG,OAAO;EAChB,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;EACxD,OAAO,aAAa,SAAS,aAAa,SAAS,aAAa,SAAS,iBAAiB;CAC3F;CACA,OAAO,OAAO,OAAO,YAAY;EAChC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,MAAM,IAAI,cAAc,8BAA8B,YAAY;CAChG;AACD"}
|
|
1
|
+
{"version":3,"file":"storage-table-DN36E2yE-0ncS821l.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/storage-table-DN36E2yE.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { nameOf } from \"@internal/sql-schema-ir/naming\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/ir/sql-node.ts\n/**\n* SQL family IR node base. Carries the family-level `kind` discriminator\n* `'sql'` and inherits the framework's `freezeNode` affordance.\n*\n* Single family-level discriminator (not per-leaf) reflects the fact that\n* SQL IR has no polymorphic dispatch today — verifiers and serializers\n* walk by structural position (`storage.tables[name].columns[name]`),\n* not by inspecting `kind`. The abstract bar for per-leaf discriminators\n* isn't earned until a future polymorphic consumer arrives.\n*\n* `kind` is installed as a non-enumerable own property on every instance,\n* which keeps three things clean simultaneously:\n*\n* - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope\n* shape (no `kind` field), so emitted contract.json files and the\n* `validateSqlContractFully` arktype schemas stay unchanged.\n* - Test assertions that use `toEqual({...})` against the pre-lift flat\n* shape continue to pass — only enumerable own properties are\n* compared.\n* - Direct access (`node.kind`) and runtime narrowing\n* (`if (node.kind === 'sql')`) still work, so future polymorphic\n* dispatch can begin reading `kind` without a runtime change.\n*\n* Future per-leaf overrides land cleanly: a class that gains a\n* polymorphic-dispatch consumer (e.g. an enum type instance walked\n* alongside other types) overrides `kind` with its narrower literal\n* at that leaf level. Per-leaf overrides will use enumerable kind\n* (matching the Mongo per-class-discriminator precedent) because they\n* encode dispatch-relevant information that callers need to see in\n* JSON envelopes; the family-level `'sql'` is uniform across all SQL\n* IR and carries no dispatch-relevant information.\n*/\nvar SqlNode = class extends IRNodeBase {\n\tkind;\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ir/check-constraint.ts\n/**\n* SQL Contract IR node for a table-level check constraint, name-identified:\n* `name` is the full physical name; a present `prefix` marks the constraint as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)` over the expression's\n* content hash), an absent `prefix` marks it exact (the name is adopted\n* verbatim). This is the convention indexes and RLS policies already use — see\n* ADR 234, \"Content-addressed wire names for Postgres-normalized objects\".\n*\n* The predicate is opaque: one SQL string, never parsed and never rendered\n* from structured parts. A database reprints predicates in its own normalized\n* form, so a wire-named check is compared by name — the hash already commits\n* to the expression the contract declared.\n*/\nvar CheckConstraint = class CheckConstraint extends SqlNode {\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"CheckConstraint: every check constraint carries a full physical name.\", \"storage\");\n\t\tthis.name = name;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Normalizes either shape into an instance: an existing `CheckConstraint`\n\t* passes through, canonical input is constructed. Callers that accept\n\t* \"instance or input\" go through this, so the constructor keeps one\n\t* canonical shape instead of widening to a union.\n\t*/\n\tstatic from(value) {\n\t\treturn value instanceof CheckConstraint ? value : new CheckConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/sql-index.ts\n/**\n* SQL Contract IR node for a table-level secondary index, name-identified:\n* `name` is the full physical name; a present `prefix` marks the index as\n* wire-named (`name` is `formatWireName(prefix, <8hex>)`), an absent `prefix`\n* marks it exact (the name is adopted verbatim).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL supported natively by\n* Postgres and SQLite alike, and the family IR must be able to represent\n* anything any SQL target can introspect. A target declining to AUTHOR them\n* (SQLite's rejection at namespace construction) is a capability decision,\n* not evidence of target-specificity.\n*\n* Note that this class shadows the global TypeScript `Index` lib type\n* at the family-shared name; consumer files that need both should\n* alias one (e.g.\n* `import { Index as SqlIndexNode } from '@internal/sql-contract/types'`).\n*/\nvar Index = class Index extends SqlNode {\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (name.length === 0) throw new ContractValidationError(\"Index: every index carries a full physical name; an expression index must be explicitly named (a default name cannot be derived from an expression).\", \"storage\");\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new ContractValidationError(`Index \"${name}\": exactly one of columns or expression must be set.`, \"storage\");\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tif (input.type !== void 0) this.type = input.type;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof Index ? value : new Index(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key-reference.ts\n/**\n* SQL Contract IR node for one side (source or target) of a foreign-key\n* declaration. Carries the full coordinate: namespace, table, and columns.\n*\n* Cross-space discrimination is based on `spaceId` presence: absent means\n* local (same contract-space); present means cross-space (the referenced\n* table lives in the contract-space identified by `spaceId`).\n*\n* For local references `spaceId` is absent from JSON, keeping the serialized\n* shape byte-identical to contracts authored before cross-space support was\n* added. For cross-space references `spaceId` appears in JSON so round-trips\n* are lossless.\n*\n* Use `UNBOUND_NAMESPACE_ID` from `@internal/framework-components/ir`\n* as the sentinel `namespaceId` for single-namespace (unbound) references.\n*/\nvar ForeignKeyReference = class ForeignKeyReference extends SqlNode {\n\tnamespaceId;\n\ttableName;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.namespaceId = asNamespaceId(input.namespaceId);\n\t\tthis.tableName = input.tableName;\n\t\tthis.columns = input.columns;\n\t\tif (input.spaceId !== void 0) this.spaceId = input.spaceId;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKeyReference ? value : new ForeignKeyReference(value);\n\t}\n};\n//#endregion\n//#region src/ir/foreign-key.ts\n/**\n* SQL Contract IR node for a table-level foreign-key declaration — the\n* referential constraint only (source, target, `onDelete`/`onUpdate`).\n*\n* A persisted `foreignKeys[]` entry always denotes a real constraint: whether\n* to emit the constraint at all, and whether to back it with an index, are\n* authoring-time decisions (PSL `@relation(index:)`, TS `fk({ constraint,\n* index })`) resolved once at `contract emit` — a `constraint: false` FK\n* simply has no entry here, and a backing index (if any) is its own discrete,\n* named entry in the table's `indexes[]`. `index` says what serves the\n* foreign key's lookups; it is absent when nothing backs the foreign key.\n*\n* Each FK carries explicit `source` and `target` {@link ForeignKeyReference}\n* coordinates (namespace, table, columns). For single-namespace contracts the\n* sentinel `UNBOUND_NAMESPACE_ID` appears on both sides.\n*\n* The nested references are normalised to {@link ForeignKeyReference}\n* instances inside the constructor so downstream walks see a uniform AST\n* regardless of whether the input was a JSON literal or an already-constructed\n* class instance.\n*/\nvar ForeignKey = class ForeignKey extends SqlNode {\n\tsource;\n\ttarget;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.source = ForeignKeyReference.from(input.source);\n\t\tthis.target = ForeignKeyReference.from(input.target);\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (typeof input.index === \"object\") this.index = input.index;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof ForeignKey ? value : new ForeignKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* SQL Contract IR node for a table's primary-key constraint.\n*/\nvar PrimaryKey = class PrimaryKey extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-column.ts\n/**\n* SQL Contract IR node for a single column entry in `StorageTable.columns`.\n*\n* Single concrete family-shared class — every SQL target reads the\n* same column shape today, so there is no per-target subclass. The\n* class type accepts any caller that constructs via\n* `new StorageColumn(input)`; literal construction sites must pass\n* through the constructor or the family-base hydration walker.\n*\n* The column's `name` is not on the class — columns are keyed by name\n* in the parent `StorageTable.columns: Record<string, StorageColumn>`\n* map, so a `name` field would be redundant with the key.\n*/\nvar StorageColumn = class StorageColumn extends SqlNode {\n\tdataType;\n\tcodecId;\n\tnullable;\n\tmany;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (Object.hasOwn(input, \"elementNullable\")) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"StorageColumn elementNullable must be nested under many.\", { meta: { reason: \"sibling-elementNullable\" } });\n\t\tthis.dataType = input.dataType;\n\t\tthis.codecId = input.codecId;\n\t\tthis.nullable = input.nullable;\n\t\tthis.many = input.many ?? false;\n\t\tif (input.typeParams !== void 0) this.typeParams = input.typeParams;\n\t\tif (input.typeRef !== void 0) this.typeRef = input.typeRef;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.valueSet !== void 0) this.valueSet = input.valueSet;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof StorageColumn ? value : new StorageColumn(value);\n\t}\n};\n//#endregion\n//#region src/ir/unique-constraint.ts\n/**\n* SQL Contract IR node for a table-level unique constraint.\n*/\nvar UniqueConstraint = class UniqueConstraint extends SqlNode {\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tfreezeNode(this);\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof UniqueConstraint ? value : new UniqueConstraint(value);\n\t}\n};\n//#endregion\n//#region src/ir/storage-table.ts\n/**\n* SQL Contract IR node for a single table entry in a namespace's\n* `tables` map.\n*\n* The constructor normalises nested IR-class fields (columns, primary\n* key, uniques, indexes, foreign keys) into the appropriate class\n* instances so downstream walks see a uniform AST regardless of whether\n* the input was a JSON literal or an already-constructed class.\n*\n* The table's `name` is not on the class — tables are keyed by name in\n* the parent namespace's `tables: Record<string, StorageTable>` map.\n*/\nvar StorageTable = class StorageTable extends SqlNode {\n\tcolumns;\n\tuniques;\n\tindexes;\n\tforeignKeys;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([name, col]) => [name, StorageColumn.from(col)])));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tthis.uniques = Object.freeze(input.uniques.map(UniqueConstraint.from));\n\t\tthis.indexes = Object.freeze(input.indexes.map(Index.from));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map(ForeignKey.from));\n\t\tif (input.control !== void 0) this.control = input.control;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(CheckConstraint.from));\n\t\tfreezeNode(this);\n\t}\n\t/**\n\t* Runtime guard that a namespace `table` entry is really a `StorageTable`.\n\t* The compiler already types the entry as `StorageTable`, but a\n\t* freshly-deserialized contract may carry plain JSON at that slot until\n\t* hydration; this duck-types the structural shape. Accepts `undefined` so\n\t* optional-chained entry lookups pass straight through.\n\t*/\n\tstatic is(value) {\n\t\tif (typeof value !== \"object\" || value === null) return false;\n\t\treturn \"columns\" in value && \"uniques\" in value && \"indexes\" in value && \"foreignKeys\" in value;\n\t}\n\tstatic assert(value, coordinate) {\n\t\tif (!StorageTable.is(value)) throw new InternalError(`Expected a StorageTable at ${coordinate}`);\n\t}\n};\n//#endregion\nexport { ForeignKey as a, CheckConstraint as c, PrimaryKey as i, SqlNode as l, UniqueConstraint as n, ForeignKeyReference as o, StorageColumn as r, Index as s, StorageTable as t };\n\n//# sourceMappingURL=storage-table-DN36E2yE.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAI,UAAU,cAAc,WAAW;CACtC;CACA,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;CACF;AACD;;;;;;;;;;;;;;AAgBA,IAAI,kBAAkB,MAAM,wBAAwB,QAAQ;CAC3D;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,MAAM,OAAO,OAAO,MAAM,MAAM;EAChC,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,wBAAwB,yEAAyE,SAAS;EAC3I,KAAK,OAAO;EACZ,IAAI,MAAM,OAAO,SAAS,QAAQ,KAAK,SAAS,MAAM,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AM,WAAW,KAAK,KAAK,MAAM,OAAO,SAAS,GAAG,KAAK,SAAS,OAAO,OAAO,MAAM,OAAO,IAAI,gBAAgB,IAAI,CAAC;EAC1H,WAAW,IAAI;CAChB;;;;;;;;CAQA,OAAO,GAAG,OAAO;EAChB,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;EACxD,OAAO,aAAa,SAAS,aAAa,SAAS,aAAa,SAAS,iBAAiB;CAC3F;CACA,OAAO,OAAO,OAAO,YAAY;EAChC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,MAAM,IAAI,cAAc,8BAA8B,YAAY;CAChG;AACD"}
|
package/dist/{transaction-state-DR3nKTmH-D5eFB250.d.mts → transaction-state-DR3nKTmH-n_12DsnU.d.mts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { h as AnyQueryAst, mt as LoweredParam } from "./types-
|
|
1
|
+
import { h as AnyQueryAst, mt as LoweredParam } from "./types-DVaVM20q-B-QcMIOa.mjs";
|
|
2
2
|
import { l as SqlStatementStats } from "./driver-types-DRsYeq3j-X_D6hNMZ.mjs";
|
|
3
|
-
import { n as SqlQueryPlan } from "./plan-
|
|
4
|
-
import { a as CodecValue, i as CodecTypesBase, o as Expression, t as AffectedCount } from "./expression-
|
|
5
|
-
import "./expression-
|
|
6
|
-
import "./ast-
|
|
7
|
-
import "./plan-
|
|
8
|
-
import { h as RuntimeScope } from "./types-
|
|
9
|
-
import "./types-
|
|
3
|
+
import { n as SqlQueryPlan } from "./plan-Cbed2eDu-BZM3geSm.mjs";
|
|
4
|
+
import { a as CodecValue, i as CodecTypesBase, o as Expression, t as AffectedCount } from "./expression-BzrfOiPC-3NqR8UzK.mjs";
|
|
5
|
+
import "./expression-CeerCjQG.mjs";
|
|
6
|
+
import "./ast-Dzsat0Zb.mjs";
|
|
7
|
+
import "./plan-BZpZafiQ.mjs";
|
|
8
|
+
import { h as RuntimeScope } from "./types-Cv5t6_Ly-CcBWTpfM.mjs";
|
|
9
|
+
import "./types-_7TbRpPw.mjs";
|
|
10
10
|
import { JsonValue, PlanMeta } from "@prisma/orm-framework/contract/types";
|
|
11
11
|
import { AsyncIterableResult, RuntimeExecuteOptions } from "@prisma/orm-framework/components/runtime";
|
|
12
12
|
//#region ../../../2-sql/5-runtime/dist/transaction-state-DR3nKTmH.d.mts
|
|
@@ -112,4 +112,4 @@ interface TransactionStartTarget {
|
|
|
112
112
|
declare function createTransactionStart(): TransactionStart;
|
|
113
113
|
//#endregion
|
|
114
114
|
export { transactionStart as S, createTransactionStart as _, ParamSpec as a, settlementOf as b, PreparedExecution as c, PreparedStatementExecuteTarget as d, PreparedStatementQueryTarget as f, TransactionStartTarget as g, TransactionStart as h, DeclaredNullable as i, PreparedFor as l, TransactionSettlementState as m, Declaration as n, ParamsFromDeclaration as o, SettledTransactionTarget as p, DeclaredCodecId as r, PrepareCallback as s, BindSiteParams as t, PreparedStatement as u, preparedStatementExecute as v, transactionSettlement as x, preparedStatementQuery as y };
|
|
115
|
-
//# sourceMappingURL=transaction-state-DR3nKTmH-
|
|
115
|
+
//# sourceMappingURL=transaction-state-DR3nKTmH-n_12DsnU.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-state-DR3nKTmH-
|
|
1
|
+
{"version":3,"file":"transaction-state-DR3nKTmH-n_12DsnU.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/transaction-state-DR3nKTmH.d.mts"],"mappings":";;;;;;;;;;;;;KAOK,UAAU,WAAW,iBAAiB,yBAAyB;WACzD,eAAe;WACf,aAAa;WACb;;KAEN,YAAY,WAAW,iBAAiB,kBAAkB,SAAS,eAAe,UAAU;KAC5F,gBAAgB,KAAK,mBAAmB,IAAI;WACtC,eAAe;IACtB;KACC,iBAAiB,KAAK;WAChB;;KAEN,eAAe,iBAAiB,WAAW,IAAI;EAClD,SAAS,gBAAgB,EAAE;EAC3B,UAAU,iBAAiB,EAAE;;KAE1B,sBAAsB,GAAG,WAAW,8BAA8B,WAAW,IAAI,WAAW,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK;KAC3I,gBAAgB,GAAG,QAAQ,QAAQ,eAAe,OAAO,aAAa;UACjE,kBAAkB,QAAQ;WACzB;WACA,KAAK;WACL,MAAM;WACN,gBAAgB;WAChB,UAAU;WACV,OAAO;EAChB,MAAM,QAAQ,cAAc,QAAQ,QAAQ,UAAU,wBAAwB,oBAAoB;;;;;;;;UAQ1F,kBAAkB;WACjB;WACA,KAAK;WACL,MAAM;WACN,gBAAgB;WAChB,UAAU;EACnB,QAAQ,QAAQ,cAAc,QAAQ,QAAQ,UAAU,wBAAwB,QAAQ;;;;;;;;;;;;;;;;;;KAkBrF,YAAY,QAAQ,QAAQ,uBAAuB,kBAAkB,QAAQ,QAAQ,cAAc,iBAAiB,kBAAkB,UAAU,kBAAkB,QAAQ;;;cAGjK;UACJ,uCAAuC;GAC9C,0BAA0B,QAAQ,WAAW,kBAAkB,SAAS,QAAQ,QAAQ,UAAU,wBAAwB,QAAQ;;;;cAIvH;UACJ,qCAAqC;GAC5C,wBAAwB,QAAQ,KAAK,WAAW,kBAAkB,QAAQ,MAAM,QAAQ,QAAQ,UAAU,wBAAwB,oBAAoB;;;;;;;cAO3I;UACJ;;WAEC;;WAEA;;EAET,gBAAgB;;UAER;YACE,wBAAwB;;iBAEnB,aAAa,sBAAsB;;;;cAItC;UACJ;EACR;;UAEQ;YACE,mBAAmB;;iBAEd,0BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types-c1iIhJep-DdMj6TNl.mjs";
|
|
@@ -1,62 +1,12 @@
|
|
|
1
|
-
import { f as normalizeIndexOptionValue, l as nameOf } from "./naming-
|
|
2
|
-
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
1
|
+
import { f as normalizeIndexOptionValue, l as nameOf } from "./naming-bM5qm5PY-DdginUhA.mjs";
|
|
3
2
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
3
|
import { IRNodeBase, freezeNode } from "@prisma/orm-framework/components/ir";
|
|
4
|
+
import { dataTypeValuesEqual } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
7
7
|
import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
|
|
8
8
|
import { isArrayEqual } from "@prisma/orm-framework/utils/array-equal";
|
|
9
|
-
//#region ../../../2-sql/1-core/schema-ir/dist/types-
|
|
10
|
-
/**
|
|
11
|
-
* A literal default in the canonical form of the column's values (ADR 254), element by element for
|
|
12
|
-
* a list column. A `Date` is read as its ISO text first. A value the form refuses is kept as it is,
|
|
13
|
-
* with the form's message.
|
|
14
|
-
*/
|
|
15
|
-
function defaultInCanonicalForm(value, toCanonicalForm, list) {
|
|
16
|
-
if (toCanonicalForm === void 0) return {
|
|
17
|
-
value,
|
|
18
|
-
refusal: void 0
|
|
19
|
-
};
|
|
20
|
-
if (list && Array.isArray(value)) {
|
|
21
|
-
const elements = value.map((element) => inCanonicalForm(element, toCanonicalForm));
|
|
22
|
-
return {
|
|
23
|
-
value: elements.map((element) => element.value),
|
|
24
|
-
refusal: elements.find((element) => element.refusal !== void 0)?.refusal
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const canonical = inCanonicalForm(value instanceof Date ? value.toISOString() : value, toCanonicalForm);
|
|
28
|
-
return canonical.refusal === void 0 ? canonical : {
|
|
29
|
-
value,
|
|
30
|
-
refusal: canonical.refusal
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function inCanonicalForm(value, toCanonicalForm) {
|
|
34
|
-
if (value === null) return {
|
|
35
|
-
value,
|
|
36
|
-
refusal: void 0
|
|
37
|
-
};
|
|
38
|
-
try {
|
|
39
|
-
return {
|
|
40
|
-
value: toCanonicalForm(value),
|
|
41
|
-
refusal: void 0
|
|
42
|
-
};
|
|
43
|
-
} catch (error) {
|
|
44
|
-
if (isStructuredError(error) && error.code === "CONTRACT.CAST_REFUSED") return {
|
|
45
|
-
value,
|
|
46
|
-
refusal: error.message
|
|
47
|
-
};
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The refusal of a contract's literal default that the canonical form of its column's values does
|
|
53
|
-
* not take, which a contract emitted by an earlier version can carry, with what to do about it.
|
|
54
|
-
*/
|
|
55
|
-
function contractDefaultRefusal(columnDefault, toCanonicalForm, list) {
|
|
56
|
-
if (columnDefault?.kind !== "literal") return void 0;
|
|
57
|
-
const { refusal } = defaultInCanonicalForm(columnDefault.value, toCanonicalForm, list);
|
|
58
|
-
return refusal === void 0 ? void 0 : `The contract holds this default in a form its data type does not store: ${refusal} Re-emit the contract, then try again.`;
|
|
59
|
-
}
|
|
9
|
+
//#region ../../../2-sql/1-core/schema-ir/dist/types-CaVn_xxe.mjs
|
|
60
10
|
/**
|
|
61
11
|
* The `nodeKind` discriminant for each relational schema-diff leaf node.
|
|
62
12
|
* Each node carries a unique value; the differ pairs siblings by `id`, and
|
|
@@ -271,87 +221,17 @@ var SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {
|
|
|
271
221
|
return this.expression === node.expression;
|
|
272
222
|
}
|
|
273
223
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
* `columnDefaultsEqual` normalized branch: kinds must match; literal values are normalized (a
|
|
277
|
-
* value of a type with a canonical form, such as a date or time type or a 64-bit integer type, to
|
|
278
|
-
* that form through `toCanonicalForm`; a numeric native type's number to its decimal text, and when the type has
|
|
279
|
-
* a modifier, its decimal text to its digits without zeros that do not change the value; a list
|
|
280
|
-
* element by element under its element type) then compared canonically (JSON objects match their
|
|
281
|
-
* canonical string form); function expressions compare case- and whitespace-insensitively.
|
|
282
|
-
*
|
|
283
|
-
* `nativeType` provides the normalization context (the actual side's resolved native type in a diff
|
|
284
|
-
* comparison). `toCanonicalForm` is the canonical form of the column's values (ADR 254), from
|
|
285
|
-
* `canonicalFormOf`; a value it refuses compares as it is. A target that reads a raw
|
|
286
|
-
* expression as a literal does so before this comparison, through its `resolveDefault` hook.
|
|
287
|
-
*/
|
|
288
|
-
function resolvedDefaultsEqual(expected, actual, nativeType, toCanonicalForm) {
|
|
289
|
-
if (expected.kind !== actual.kind) return false;
|
|
290
|
-
if (expected.kind === "literal" && actual.kind === "literal") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType, toCanonicalForm), normalizeLiteralValue(actual.value, nativeType, toCanonicalForm));
|
|
291
|
-
if (expected.kind === "function" && actual.kind === "function") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);
|
|
292
|
-
return false;
|
|
224
|
+
function isList(value) {
|
|
225
|
+
return Array.isArray(value);
|
|
293
226
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const DECIMAL_NATIVE_TYPE = /^(?:numeric|decimal)(\(\d+(?:,\s*-?\d+)?\))?$/i;
|
|
303
|
-
const DECIMAL_NUMERAL = /^(-?)(\d+)(?:\.(\d+))?$/;
|
|
304
|
-
const EXPONENT_NUMERAL = /^(-?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/;
|
|
305
|
-
/**
|
|
306
|
-
* The plain decimal spelling of a value, so that a number JavaScript prints as `1e-7` or `1e+21`
|
|
307
|
-
* can be compared with the decimal text a numeric column stores. No digit is added or dropped;
|
|
308
|
-
* only the decimal point moves.
|
|
309
|
-
*/
|
|
310
|
-
function decimalText(value) {
|
|
311
|
-
const text = String(value);
|
|
312
|
-
const numeral = EXPONENT_NUMERAL.exec(text);
|
|
313
|
-
if (numeral === null) return text;
|
|
314
|
-
const [, sign = "", whole = "", fraction = "", exponent = "0"] = numeral;
|
|
315
|
-
const digits = `${whole}${fraction}`;
|
|
316
|
-
const point = whole.length + Number(exponent);
|
|
317
|
-
if (point <= 0) return `${sign}0.${"0".repeat(-point)}${digits}`;
|
|
318
|
-
if (point >= digits.length) return `${sign}${digits}${"0".repeat(point - digits.length)}`;
|
|
319
|
-
return `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;
|
|
320
|
-
}
|
|
321
|
-
function decimalDigits(value) {
|
|
322
|
-
const numeral = DECIMAL_NUMERAL.exec(decimalText(value));
|
|
323
|
-
if (numeral === null) return value;
|
|
324
|
-
const whole = (numeral[2] ?? "").replace(/^0+(?=\d)/, "");
|
|
325
|
-
const fraction = (numeral[3] ?? "").replace(/0+$/, "");
|
|
326
|
-
const digits = fraction === "" ? whole : `${whole}.${fraction}`;
|
|
327
|
-
return digits === "0" ? digits : `${numeral[1] ?? ""}${digits}`;
|
|
328
|
-
}
|
|
329
|
-
function normalizeLiteralValue(value, nativeType, toCanonicalForm) {
|
|
330
|
-
if (Array.isArray(value) && nativeType?.endsWith("[]")) {
|
|
331
|
-
const elementType = nativeType.slice(0, -2);
|
|
332
|
-
return value.map((element) => normalizeLiteralValue(element, elementType, toCanonicalForm));
|
|
333
|
-
}
|
|
334
|
-
const json = value instanceof Date ? value.toISOString() : value;
|
|
335
|
-
if (toCanonicalForm !== void 0) return defaultInCanonicalForm(json, toCanonicalForm, false).value;
|
|
336
|
-
if (value instanceof Date) return json;
|
|
337
|
-
const decimalType = nativeType === void 0 ? null : DECIMAL_NATIVE_TYPE.exec(nativeType);
|
|
338
|
-
if ((typeof value === "number" || typeof value === "string") && decimalType !== null) return decimalType[1] === void 0 ? decimalText(value) : decimalDigits(value);
|
|
339
|
-
return value;
|
|
340
|
-
}
|
|
341
|
-
function literalValuesEqual(a, b) {
|
|
342
|
-
if (a === b) return true;
|
|
343
|
-
if (typeof a === "object" && a !== null && typeof b === "object" && b !== null) return canonicalStringify(a) === canonicalStringify(b);
|
|
344
|
-
if (typeof a === "object" && a !== null && typeof b === "string") try {
|
|
345
|
-
return canonicalStringify(a) === canonicalStringify(JSON.parse(b));
|
|
346
|
-
} catch {
|
|
347
|
-
return false;
|
|
348
|
-
}
|
|
349
|
-
if (typeof a === "string" && typeof b === "object" && b !== null) try {
|
|
350
|
-
return canonicalStringify(JSON.parse(a)) === canonicalStringify(b);
|
|
351
|
-
} catch {
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
return false;
|
|
227
|
+
/** Whether two defaults are one value: the same type, parameters and value, element by element for a list. */
|
|
228
|
+
function sqlDefaultValuesEqual(a, b) {
|
|
229
|
+
if (!isList(a) || !isList(b)) return !isList(a) && !isList(b) && dataTypeValuesEqual(a, b);
|
|
230
|
+
return a.length === b.length && a.every((element, index) => {
|
|
231
|
+
const other = b[index];
|
|
232
|
+
if (element === null || other === null || other === void 0) return element === other;
|
|
233
|
+
return dataTypeValuesEqual(element, other);
|
|
234
|
+
});
|
|
355
235
|
}
|
|
356
236
|
/**
|
|
357
237
|
* Schema-diff node for a column's default value. The default is the one
|
|
@@ -372,12 +252,13 @@ var SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {
|
|
|
372
252
|
super();
|
|
373
253
|
if (input.resolved !== void 0) this.resolved = input.resolved;
|
|
374
254
|
if (input.raw !== void 0) this.raw = input.raw;
|
|
375
|
-
if (input.nativeTypeContext !== void 0) this.nativeTypeContext = input.nativeTypeContext;
|
|
376
255
|
defineNonEnumerable(this, "authored", input.authored);
|
|
256
|
+
defineNonEnumerable(this, "value", input.value);
|
|
257
|
+
defineNonEnumerable(this, "unreadable", input.unreadable);
|
|
258
|
+
defineNonEnumerable(this, "expressionValue", input.expressionValue);
|
|
377
259
|
defineNonEnumerable(this, "many", input.many);
|
|
378
260
|
defineNonEnumerable(this, "codecRef", input.codecRef);
|
|
379
261
|
defineNonEnumerable(this, "codecBaseNativeType", input.codecBaseNativeType);
|
|
380
|
-
defineNonEnumerable(this, "toCanonicalForm", input.toCanonicalForm);
|
|
381
262
|
freezeNode(this);
|
|
382
263
|
}
|
|
383
264
|
get id() {
|
|
@@ -390,28 +271,68 @@ var SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {
|
|
|
390
271
|
return node.nodeKind === RelationalSchemaNodeKind.columnDefault;
|
|
391
272
|
}
|
|
392
273
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
274
|
+
* Compares with `this` as the expected side. Two literals compare as values of the column's type
|
|
275
|
+
* when both sides hold one, and as canonical JSON otherwise; a `Date` the column's codec could not
|
|
276
|
+
* read into a value equals nothing. Two expressions compare as text, with
|
|
277
|
+
* case and whitespace ignored outside quotes. An expected expression that writes a literal, read by
|
|
278
|
+
* the column's codec during introspection, matches a reported literal when the two values are
|
|
279
|
+
* equal; when the codec could not read one of them, it compares with the reported text. A resolved
|
|
280
|
+
* side against a raw-only side is a mismatch; two raw-only nodes compare their text.
|
|
399
281
|
*/
|
|
400
282
|
isEqualTo(other) {
|
|
401
283
|
const node = blindCast(other);
|
|
402
284
|
assertNode(node, "SqlColumnDefaultIR", SqlColumnDefaultIR.is);
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
285
|
+
const expected = this.resolved;
|
|
286
|
+
const actual = node.resolved;
|
|
287
|
+
if (expected?.kind === "function" && actual === void 0) return node.raw !== void 0 && sameExpression(expected.expression, node.raw);
|
|
288
|
+
if (expected === void 0 || actual === void 0) return expected === actual && this.raw === node.raw;
|
|
289
|
+
if (expected.kind === "function") {
|
|
290
|
+
if (actual.kind === "function") return sameExpression(expected.expression, actual.expression);
|
|
291
|
+
if (node.value !== void 0 && node.expressionValue !== void 0) return sqlDefaultValuesEqual(node.expressionValue, node.value);
|
|
292
|
+
return node.raw !== void 0 && sameExpression(expected.expression, node.raw);
|
|
293
|
+
}
|
|
294
|
+
if (actual.kind !== "literal") return false;
|
|
295
|
+
if (this.value !== void 0 && node.value !== void 0) return sqlDefaultValuesEqual(this.value, node.value);
|
|
296
|
+
if (expected.value instanceof Date || actual.value instanceof Date) return false;
|
|
297
|
+
return canonicalStringify(expected.value) === canonicalStringify(actual.value);
|
|
298
|
+
}
|
|
299
|
+
/** Why the column's codec could not read the default the database reports, when it could not; otherwise the value each side holds. */
|
|
300
|
+
explainMismatch(actual) {
|
|
301
|
+
if (!(actual instanceof SqlColumnDefaultIR)) return void 0;
|
|
302
|
+
if (actual.unreadable !== void 0) return actual.unreadable;
|
|
303
|
+
return `The contract holds ${describeDefault(this)}, and the database holds ${describeDefault(actual)}.`;
|
|
413
304
|
}
|
|
414
305
|
};
|
|
306
|
+
/** A default as a person reads it: a literal as JSON, the value its type read when there is one, an expression as its text, and the text the database reports beside a value read from it. */
|
|
307
|
+
function describeDefault(node) {
|
|
308
|
+
const resolved = node.resolved;
|
|
309
|
+
if (resolved === void 0) return node.raw ?? "no default";
|
|
310
|
+
if (resolved.kind === "function") return resolved.expression;
|
|
311
|
+
const shown = JSON.stringify(node.value === void 0 ? resolved.value : jsonOfDefaultValue(node.value));
|
|
312
|
+
return node.raw === void 0 || node.raw === shown ? shown : `${shown} (${node.raw})`;
|
|
313
|
+
}
|
|
314
|
+
function isDefaultList(value) {
|
|
315
|
+
return Array.isArray(value);
|
|
316
|
+
}
|
|
317
|
+
function jsonOfDefaultValue(value) {
|
|
318
|
+
return isDefaultList(value) ? value.map((element) => element === null ? null : element.value) : value.value;
|
|
319
|
+
}
|
|
320
|
+
function sameExpression(a, b) {
|
|
321
|
+
return comparableExpression(a) === comparableExpression(b);
|
|
322
|
+
}
|
|
323
|
+
/** The expression with case and whitespace dropped outside quotes; a quoted literal or identifier keeps both, since they change what it means. */
|
|
324
|
+
function comparableExpression(expression) {
|
|
325
|
+
let result = "";
|
|
326
|
+
let quote;
|
|
327
|
+
for (const char of expression) if (quote !== void 0) {
|
|
328
|
+
result += char;
|
|
329
|
+
if (char === quote) quote = void 0;
|
|
330
|
+
} else if (char === "'" || char === "\"") {
|
|
331
|
+
quote = char;
|
|
332
|
+
result += char;
|
|
333
|
+
} else if (!/\s/.test(char)) result += char.toLowerCase();
|
|
334
|
+
return result;
|
|
335
|
+
}
|
|
415
336
|
/**
|
|
416
337
|
* Schema IR node for a single column on a table, as observed by
|
|
417
338
|
* introspection. Unlike the Contract IR `StorageColumn`, this carries
|
|
@@ -447,7 +368,9 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
|
|
|
447
368
|
defineNonEnumerable(this, "codecRef", input.codecRef);
|
|
448
369
|
defineNonEnumerable(this, "codecBaseNativeType", input.codecBaseNativeType);
|
|
449
370
|
defineNonEnumerable(this, "dataType", input.dataType);
|
|
450
|
-
defineNonEnumerable(this, "
|
|
371
|
+
defineNonEnumerable(this, "defaultValue", input.defaultValue);
|
|
372
|
+
defineNonEnumerable(this, "defaultUnreadable", input.defaultUnreadable);
|
|
373
|
+
defineNonEnumerable(this, "defaultExpressionValue", input.defaultExpressionValue);
|
|
451
374
|
defineNonEnumerable(this, "reportedType", input.reportedType);
|
|
452
375
|
freezeNode(this);
|
|
453
376
|
}
|
|
@@ -466,11 +389,12 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
|
|
|
466
389
|
...ifDefined("resolved", this.resolvedDefault),
|
|
467
390
|
...ifDefined("raw", this.default),
|
|
468
391
|
...ifDefined("authored", this.authoredDefault),
|
|
469
|
-
...ifDefined("
|
|
392
|
+
...ifDefined("value", this.defaultValue),
|
|
393
|
+
...ifDefined("unreadable", this.defaultUnreadable),
|
|
394
|
+
...ifDefined("expressionValue", this.defaultExpressionValue),
|
|
470
395
|
...ifDefined("many", this.many ?? this.codecRef?.many),
|
|
471
396
|
...ifDefined("codecRef", this.codecRef),
|
|
472
|
-
...ifDefined("codecBaseNativeType", this.codecBaseNativeType)
|
|
473
|
-
...ifDefined("toCanonicalForm", this.toCanonicalForm)
|
|
397
|
+
...ifDefined("codecBaseNativeType", this.codecBaseNativeType)
|
|
474
398
|
})];
|
|
475
399
|
}
|
|
476
400
|
static is(node) {
|
|
@@ -819,6 +743,6 @@ var SqlSchemaIR = class extends SqlSchemaIRNode {
|
|
|
819
743
|
}
|
|
820
744
|
};
|
|
821
745
|
//#endregion
|
|
822
|
-
export {
|
|
746
|
+
export { SqlColumnIR as a, SqlSchemaIR as c, SqlUniqueIR as d, assertNode as f, sqlDefaultValuesEqual as g, relationalNodeGranularity as h, SqlColumnDefaultIR as i, SqlSchemaIRNode as l, relationalNodeEntityKind as m, RelationalSchemaNodeKind as n, SqlForeignKeyIR as o, defineNonEnumerable as p, SqlCheckConstraintIR as r, SqlIndexIR as s, PrimaryKey as t, SqlTableIR as u };
|
|
823
747
|
|
|
824
|
-
//# sourceMappingURL=types-
|
|
748
|
+
//# sourceMappingURL=types-CaVn_xxe-D9WdU3Iy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CaVn_xxe-D9WdU3Iy.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-CaVn_xxe.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-bM5qm5PY.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { dataTypeValuesEqual } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/sql-default-value.ts\nfunction isList(value) {\n\treturn Array.isArray(value);\n}\n/** Whether two defaults are one value: the same type, parameters and value, element by element for a list. */\nfunction sqlDefaultValuesEqual(a, b) {\n\tif (!isList(a) || !isList(b)) return !isList(a) && !isList(b) && dataTypeValuesEqual(a, b);\n\treturn a.length === b.length && a.every((element, index) => {\n\t\tconst other = b[index];\n\t\tif (element === null || other === null || other === void 0) return element === other;\n\t\treturn dataTypeValuesEqual(element, other);\n\t});\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tdefineNonEnumerable(this, \"authored\", input.authored);\n\t\tdefineNonEnumerable(this, \"value\", input.value);\n\t\tdefineNonEnumerable(this, \"unreadable\", input.unreadable);\n\t\tdefineNonEnumerable(this, \"expressionValue\", input.expressionValue);\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Compares with `this` as the expected side. Two literals compare as values of the column's type\n\t* when both sides hold one, and as canonical JSON otherwise; a `Date` the column's codec could not\n\t* read into a value equals nothing. Two expressions compare as text, with\n\t* case and whitespace ignored outside quotes. An expected expression that writes a literal, read by\n\t* the column's codec during introspection, matches a reported literal when the two values are\n\t* equal; when the codec could not read one of them, it compares with the reported text. A resolved\n\t* side against a raw-only side is a mismatch; two raw-only nodes compare their text.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tconst expected = this.resolved;\n\t\tconst actual = node.resolved;\n\t\tif (expected?.kind === \"function\" && actual === void 0) return node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\tif (expected === void 0 || actual === void 0) return expected === actual && this.raw === node.raw;\n\t\tif (expected.kind === \"function\") {\n\t\t\tif (actual.kind === \"function\") return sameExpression(expected.expression, actual.expression);\n\t\t\tif (node.value !== void 0 && node.expressionValue !== void 0) return sqlDefaultValuesEqual(node.expressionValue, node.value);\n\t\t\treturn node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\t}\n\t\tif (actual.kind !== \"literal\") return false;\n\t\tif (this.value !== void 0 && node.value !== void 0) return sqlDefaultValuesEqual(this.value, node.value);\n\t\tif (expected.value instanceof Date || actual.value instanceof Date) return false;\n\t\treturn canonicalStringify(expected.value) === canonicalStringify(actual.value);\n\t}\n\t/** Why the column's codec could not read the default the database reports, when it could not; otherwise the value each side holds. */\n\texplainMismatch(actual) {\n\t\tif (!(actual instanceof SqlColumnDefaultIR)) return void 0;\n\t\tif (actual.unreadable !== void 0) return actual.unreadable;\n\t\treturn `The contract holds ${describeDefault(this)}, and the database holds ${describeDefault(actual)}.`;\n\t}\n};\n/** A default as a person reads it: a literal as JSON, the value its type read when there is one, an expression as its text, and the text the database reports beside a value read from it. */\nfunction describeDefault(node) {\n\tconst resolved = node.resolved;\n\tif (resolved === void 0) return node.raw ?? \"no default\";\n\tif (resolved.kind === \"function\") return resolved.expression;\n\tconst shown = JSON.stringify(node.value === void 0 ? resolved.value : jsonOfDefaultValue(node.value));\n\treturn node.raw === void 0 || node.raw === shown ? shown : `${shown} (${node.raw})`;\n}\nfunction isDefaultList(value) {\n\treturn Array.isArray(value);\n}\nfunction jsonOfDefaultValue(value) {\n\treturn isDefaultList(value) ? value.map((element) => element === null ? null : element.value) : value.value;\n}\nfunction sameExpression(a, b) {\n\treturn comparableExpression(a) === comparableExpression(b);\n}\n/** The expression with case and whitespace dropped outside quotes; a quoted literal or identifier keeps both, since they change what it means. */\nfunction comparableExpression(expression) {\n\tlet result = \"\";\n\tlet quote;\n\tfor (const char of expression) if (quote !== void 0) {\n\t\tresult += char;\n\t\tif (char === quote) quote = void 0;\n\t} else if (char === \"'\" || char === \"\\\"\") {\n\t\tquote = char;\n\t\tresult += char;\n\t} else if (!/\\s/.test(char)) result += char.toLowerCase();\n\treturn result;\n}\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"authoredDefault\", input.authoredDefault);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"dataType\", input.dataType);\n\t\tdefineNonEnumerable(this, \"defaultValue\", input.defaultValue);\n\t\tdefineNonEnumerable(this, \"defaultUnreadable\", input.defaultUnreadable);\n\t\tdefineNonEnumerable(this, \"defaultExpressionValue\", input.defaultExpressionValue);\n\t\tdefineNonEnumerable(this, \"reportedType\", input.reportedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"authored\", this.authoredDefault),\n\t\t\t...ifDefined(\"value\", this.defaultValue),\n\t\t\t...ifDefined(\"unreadable\", this.defaultUnreadable),\n\t\t\t...ifDefined(\"expressionValue\", this.defaultExpressionValue),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many),\n\t\t\t...ifDefined(\"codecRef\", this.codecRef),\n\t\t\t...ifDefined(\"codecBaseNativeType\", this.codecBaseNativeType)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, sqlDefaultValuesEqual as c, SqlSchemaIRNode as d, assertNode as f, relationalNodeGranularity as g, relationalNodeEntityKind as h, SqlIndexIR as i, SqlCheckConstraintIR as l, RelationalSchemaNodeKind as m, SqlTableIR as n, SqlColumnIR as o, defineNonEnumerable as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, PrimaryKey as u };\n\n//# sourceMappingURL=types-CaVn_xxe.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,SAAS;EAClC,yBAAyB,gBAAgB;EACzC,yBAAyB,aAAa;EACtC,yBAAyB,aAAa;EACtC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,QAAQ;AACnC;AACA,SAAS,2BAA2B,UAAU;CAC7C,OAAO,OAAO,OAAO,6BAA6B,QAAQ;AAC3D;;;;;;;AAOA,SAAS,0BAA0B,UAAU;CAC5C,IAAI,CAAC,2BAA2B,QAAQ,GAAG,MAAM,IAAI,cAAc,iEAAiE,SAAS,EAAE;CAC/I,OAAO,4BAA4B;AACpC;;;;;;;;AAQA,MAAM,8BAA8B,GAAG,yBAAyB,QAAQ,QAAQ;;;;;;;;AAQhF,SAAS,yBAAyB,UAAU;CAC3C,OAAO,2BAA2B,QAAQ,IAAI,4BAA4B,YAAY,KAAK;AAC5F;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI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