@prisma/orm-target-postgres 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.30
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/README.md +2 -0
- package/dist/{adapter-B2zr93n1-DA67Xn-f.mjs → adapter-VDAs5CMq-OezO60C5.mjs} +6 -6
- package/dist/{adapter-B2zr93n1-DA67Xn-f.mjs.map → adapter-VDAs5CMq-OezO60C5.mjs.map} +1 -1
- package/dist/{adapter-BQExUKg6.d.mts → adapter-XucRgedT.d.mts} +13 -13
- package/dist/{adapter-BQExUKg6.d.mts.map → adapter-XucRgedT.d.mts.map} +1 -1
- package/dist/adapter.d.mts +5 -5
- package/dist/adapter.mjs +5 -5
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.d.mts +3 -3
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +5 -5
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates-C2c48ORM.d.mts → aggregates-CJGvlOCM.d.mts} +12 -12
- package/dist/{aggregates-C2c48ORM.d.mts.map → aggregates-CJGvlOCM.d.mts.map} +1 -1
- package/dist/{authoring-DPwc7x9U-BZkXpPSH.mjs → authoring-4dCWsSXg-DeIEoQWg.mjs} +7 -7
- package/dist/authoring-4dCWsSXg-DeIEoQWg.mjs.map +1 -0
- package/dist/{autoincrement-widths-PwZcc5Co-1O2WEMYq.mjs → autoincrement-widths-BZUr8bLa-Dqtjwcf-.mjs} +3 -3
- package/dist/{autoincrement-widths-PwZcc5Co-1O2WEMYq.mjs.map → autoincrement-widths-BZUr8bLa-Dqtjwcf-.mjs.map} +1 -1
- package/dist/{check-expressions-Ch-A_NJN-BscDa8xT.mjs → check-expressions-cvFP1EFS-CPLt6x-O.mjs} +3 -3
- package/dist/{check-expressions-Ch-A_NJN-BscDa8xT.mjs.map → check-expressions-cvFP1EFS-CPLt6x-O.mjs.map} +1 -1
- package/dist/{codec-registry-B0LsFn7Z-ej9yKwTq.mjs → codec-registry-FvoD6sJj-ClHgHbyf.mjs} +4 -4
- package/dist/{codec-registry-B0LsFn7Z-ej9yKwTq.mjs.map → codec-registry-FvoD6sJj-ClHgHbyf.mjs.map} +1 -1
- package/dist/{codec-type-map-C_5OBkHw-DZ0UDSJr.d.mts → codec-type-map-CE_EveiY-S4IH6WPx.d.mts} +3 -3
- package/dist/{codec-type-map-C_5OBkHw-DZ0UDSJr.d.mts.map → codec-type-map-CE_EveiY-S4IH6WPx.d.mts.map} +1 -1
- package/dist/{codec-types-xyW4TiJD-CRDK7QcS.d.mts → codec-types-B-OBDw_P-CBflZnmD.d.mts} +4 -4
- package/dist/{codec-types-xyW4TiJD-CRDK7QcS.d.mts.map → codec-types-B-OBDw_P-CBflZnmD.d.mts.map} +1 -1
- package/dist/codec-types-V7HlwAkU.d.mts +2 -0
- package/dist/{codecs-Bzj3M0Q3-C2oFSIGs.mjs → codecs-B2C2j2Un-Dc-aGN1s.mjs} +12 -11
- package/dist/codecs-B2C2j2Un-Dc-aGN1s.mjs.map +1 -0
- package/dist/{codecs-BZ74mlUI.d.mts → codecs-B6fSK4Rr.d.mts} +2 -2
- package/dist/{codecs-BZ74mlUI.d.mts.map → codecs-B6fSK4Rr.d.mts.map} +1 -1
- package/dist/{codecs-3AVVZDao-C0sUjmuO.d.mts → codecs-BttOxm7v-Bg7ybHIE.d.mts} +3 -3
- package/dist/{codecs-3AVVZDao-C0sUjmuO.d.mts.map → codecs-BttOxm7v-Bg7ybHIE.d.mts.map} +1 -1
- package/dist/{contract-contributions-Bc0_64Gr-KE0qggZv.mjs → contract-contributions-DG0aJRRu-31YCQkp-.mjs} +54 -39
- package/dist/contract-contributions-DG0aJRRu-31YCQkp-.mjs.map +1 -0
- package/dist/{contract-free-DiRem1nw.mjs → contract-free-dQ4A6kPg.mjs} +3 -3
- package/dist/{contract-free-DiRem1nw.mjs.map → contract-free-dQ4A6kPg.mjs.map} +1 -1
- package/dist/{control-B-0_CuJt.d.mts → control-Bbb6l2oc.d.mts} +3 -3
- package/dist/{control-B-0_CuJt.d.mts.map → control-Bbb6l2oc.d.mts.map} +1 -1
- package/dist/{control-j5GEV5-D.d.mts → control-BhtDvy9Z.d.mts} +2 -2
- package/dist/{control-j5GEV5-D.d.mts.map → control-BhtDvy9Z.d.mts.map} +1 -1
- package/dist/{control-policy-DKnVhEWD-xuJIvCy9.mjs → control-policy-Crcjg7Vz-39_fO8yR.mjs} +11 -11
- package/dist/{control-policy-DKnVhEWD-xuJIvCy9.mjs.map → control-policy-Crcjg7Vz-39_fO8yR.mjs.map} +1 -1
- package/dist/{data-transform-2o0tpMs8-DADYIvEZ.d.mts → data-transform-BZ6kzJY4-DZBRydhx.d.mts} +3 -3
- package/dist/{data-transform-2o0tpMs8-DADYIvEZ.d.mts.map → data-transform-BZ6kzJY4-DZBRydhx.d.mts.map} +1 -1
- package/dist/data-transform-Cg3syfOe.d.mts +1 -0
- package/dist/{data-type-entries-CVxsfjF3-Bd0cSfuG.mjs → data-type-entries-CKHtbfmn-DBNF36FF.mjs} +3 -3
- package/dist/{data-type-entries-CVxsfjF3-Bd0cSfuG.mjs.map → data-type-entries-CKHtbfmn-DBNF36FF.mjs.map} +1 -1
- package/dist/{data-types-DWfwErIu-DF85cgmu.mjs → data-types-DgYRia-g-B_BFlAC3.mjs} +8 -9
- package/dist/data-types-DgYRia-g-B_BFlAC3.mjs.map +1 -0
- package/dist/{date-time-now-generators-BORO1_nc-BdCe3ppq.mjs → date-time-now-generators-DylEKfQR-CYbXE0y0.mjs} +5 -8
- package/dist/date-time-now-generators-DylEKfQR-CYbXE0y0.mjs.map +1 -0
- package/dist/{ddl-DCQLfg18-BgWGYC7L.mjs → ddl-Cy_8QS23-D9EVihrI.mjs} +3 -3
- package/dist/{ddl-DCQLfg18-BgWGYC7L.mjs.map → ddl-Cy_8QS23-D9EVihrI.mjs.map} +1 -1
- package/dist/{descriptor-meta-46EhsECb-C5EGe36u.mjs → descriptor-meta-CakMYWwZ-DSQNCwWB.mjs} +13 -12
- package/dist/descriptor-meta-CakMYWwZ-DSQNCwWB.mjs.map +1 -0
- package/dist/{descriptor-meta-DUDk-DLN-B_WUfFf7.mjs → descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs} +8 -7
- package/dist/descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs.map +1 -0
- package/dist/{diff-database-schema-BJKAfPAG-LCJmdiQq.mjs → diff-database-schema-CVmwyjFf-DSWPpd4M.mjs} +10 -10
- package/dist/{diff-database-schema-BJKAfPAG-LCJmdiQq.mjs.map → diff-database-schema-CVmwyjFf-DSWPpd4M.mjs.map} +1 -1
- package/dist/{diff-database-schema-rhLkiByE.d.mts → diff-database-schema-NiGuGt9b.d.mts} +2 -2
- package/dist/{diff-database-schema-rhLkiByE.d.mts.map → diff-database-schema-NiGuGt9b.d.mts.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{errors-C4-Dp3gI-B5jY5eJj.mjs → errors-DxWL0CMX-BQe7Wfvt.mjs} +8 -7
- package/dist/{errors-C4-Dp3gI-B5jY5eJj.mjs.map → errors-DxWL0CMX-BQe7Wfvt.mjs.map} +1 -1
- package/dist/{full-text-oDBhUHI5.mjs → full-text-Bu_qI2ue.mjs} +3 -3
- package/dist/{full-text-oDBhUHI5.mjs.map → full-text-Bu_qI2ue.mjs.map} +1 -1
- package/dist/{full-text-collection-method-CtUV9NT0-CQuFZ4aH.d.mts → full-text-collection-method-Dc6I12lP-BFkF4drB.d.mts} +4 -4
- package/dist/full-text-collection-method-Dc6I12lP-BFkF4drB.d.mts.map +1 -0
- package/dist/{full-text-index-definition-DzRCaPjb-0USKN1ZI.mjs → full-text-index-definition-MMcQF3_0-wRCz2FDP.mjs} +3 -3
- package/dist/{full-text-index-definition-DzRCaPjb-0USKN1ZI.mjs.map → full-text-index-definition-MMcQF3_0-wRCz2FDP.mjs.map} +1 -1
- package/dist/{full-text-DGueFVx9.d.mts → full-text-pZNF76pS.d.mts} +3 -3
- package/dist/{full-text-DGueFVx9.d.mts.map → full-text-pZNF76pS.d.mts.map} +1 -1
- package/dist/{full-text-parsers-BZV74MUg-TfQ8rvPW.mjs → full-text-parsers-m8GS0pst-C6RPRehL.mjs} +4 -4
- package/dist/{full-text-parsers-BZV74MUg-TfQ8rvPW.mjs.map → full-text-parsers-m8GS0pst-C6RPRehL.mjs.map} +1 -1
- package/dist/{full-text-search-document-BqqvjJoC-HaoeMaM5.mjs → full-text-search-document-B5VCeQFz-D4hKtj-M.mjs} +5 -5
- package/dist/{full-text-search-document-BqqvjJoC-HaoeMaM5.mjs.map → full-text-search-document-B5VCeQFz-D4hKtj-M.mjs.map} +1 -1
- package/dist/{index-types-DGrgbAd4-DuGWdvol.mjs → index-types-CiM75RsF-DhmXdi38.mjs} +3 -3
- package/dist/{index-types-DGrgbAd4-DuGWdvol.mjs.map → index-types-CiM75RsF-DhmXdi38.mjs.map} +1 -1
- package/dist/{indexes-ooG0J-V8-CTm1QvmZ.d.mts → indexes-pfYKpulO-BWj-l1W3.d.mts} +8 -4
- package/dist/indexes-pfYKpulO-BWj-l1W3.d.mts.map +1 -0
- package/dist/{infer-psl-contract-DqtogWJ8-CUXUG-wF.mjs → infer-psl-contract-DgQutzGt-C1wN72ZC.mjs} +9 -9
- package/dist/{infer-psl-contract-DqtogWJ8-CUXUG-wF.mjs.map → infer-psl-contract-DgQutzGt-C1wN72ZC.mjs.map} +1 -1
- package/dist/{issue-planner-BlN8mK4E.d.mts → issue-planner-GkMubzHu.d.mts} +7 -6
- package/dist/issue-planner-GkMubzHu.d.mts.map +1 -0
- package/dist/{migration-CovfYOjm.d.mts → migration-BRcETuO-.d.mts} +4 -4
- package/dist/migration-BRcETuO-.d.mts.map +1 -0
- package/dist/migration-Be_iuIpn.mjs.map +1 -1
- package/dist/{native-type-normalizer-PGvExTgu.mjs → native-type-normalizer-DY__fyaa.mjs} +2 -2
- package/dist/{native-type-normalizer-PGvExTgu.mjs.map → native-type-normalizer-DY__fyaa.mjs.map} +1 -1
- package/dist/{op-factory-call-CG80t74g-D9tjd13N.d.mts → op-factory-call-Bz6ft8sk-JjpSUMTb.d.mts} +22 -6
- package/dist/op-factory-call-Bz6ft8sk-JjpSUMTb.d.mts.map +1 -0
- package/dist/op-factory-call-COB28WBr.d.mts +1 -0
- package/dist/{op-factory-call-THEIwT0J-DQM3Y94S.mjs → op-factory-call-DvezqqJx-KBDyNT08.mjs} +239 -182
- package/dist/op-factory-call-DvezqqJx-KBDyNT08.mjs.map +1 -0
- package/dist/operation-types-CaLyyiOR.d.mts +1 -0
- package/dist/{operation-types-Cnw0XvnJ-BZax8w1C.d.mts → operation-types-Da5h_iSt-Dqe_QrW_.d.mts} +3 -3
- package/dist/{operation-types-Cnw0XvnJ-BZax8w1C.d.mts.map → operation-types-Da5h_iSt-Dqe_QrW_.d.mts.map} +1 -1
- package/dist/{pack-ReYuY9t5.d.mts → pack-DshiZKVJ.d.mts} +6 -7
- package/dist/{pack-ReYuY9t5.d.mts.map → pack-DshiZKVJ.d.mts.map} +1 -1
- package/dist/{planner-Bw0tlQWK.d.mts → planner-CTwe5ozf.d.mts} +6 -5
- package/dist/{planner-Bw0tlQWK.d.mts.map → planner-CTwe5ozf.d.mts.map} +1 -1
- package/dist/{planner-BHH46ndt-Q6-LPhnL.mjs → planner-D2T46plG-BChGUTOA.mjs} +189 -54
- package/dist/planner-D2T46plG-BChGUTOA.mjs.map +1 -0
- package/dist/{planner-ddl-builders-Ds3Xcsg7-5-bR7xgo.mjs → planner-ddl-builders-Blf3qKKf-BopCSwrT.mjs} +3 -3
- package/dist/{planner-ddl-builders-Ds3Xcsg7-5-bR7xgo.mjs.map → planner-ddl-builders-Blf3qKKf-BopCSwrT.mjs.map} +1 -1
- package/dist/{planner-identity-values-CQZbvcx0-BpAvjtip.mjs → planner-identity-values-CX3J2pLA-CjCpOnue.mjs} +3 -3
- package/dist/{planner-identity-values-CQZbvcx0-BpAvjtip.mjs.map → planner-identity-values-CX3J2pLA-CjCpOnue.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-FtUIqqVg-ouPTcZ8X.mjs → planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs} +7 -7
- package/dist/planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs.map +1 -0
- package/dist/planner-produced-postgres-migration-CDE9JowN.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-exqzWlvW-DGLu2dQ7.d.mts → planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.d.mts} +5 -6
- package/dist/planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.d.mts.map +1 -0
- package/dist/{planner-sql-checks-BOdYkh9L-hXxekxJX.mjs → planner-sql-checks-CzxowQml-moHPNh20.mjs} +5 -5
- package/dist/{planner-sql-checks-BOdYkh9L-hXxekxJX.mjs.map → planner-sql-checks-CzxowQml-moHPNh20.mjs.map} +1 -1
- package/dist/{planner-target-details-boDXR2s7-CExrk6rf.d.mts → planner-target-details-DywkQKS4-lZEm-EiF.d.mts} +3 -3
- package/dist/planner-target-details-DywkQKS4-lZEm-EiF.d.mts.map +1 -0
- package/dist/{postgres-codec-traits-D9YEvK6F-BsKaAhCA.mjs → postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs} +3 -3
- package/dist/{postgres-codec-traits-D9YEvK6F-BsKaAhCA.mjs.map → postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs.map} +1 -1
- package/dist/{postgres-contract-view-DtsmkyFX-Bas8oQiN.mjs → postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs} +10 -10
- package/dist/postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs.map +1 -0
- package/dist/{postgres-migration-DEkPcs8x-CLxAKfHm.d.mts → postgres-migration-6nN7HQlZ-Ca0thLBy.d.mts} +5 -5
- package/dist/{postgres-migration-DEkPcs8x-CLxAKfHm.d.mts.map → postgres-migration-6nN7HQlZ-Ca0thLBy.d.mts.map} +1 -1
- package/dist/{postgres-migration-D5lRerLT-DyYh8UPS.mjs → postgres-migration-DEa-g6j1-CoG3QOV3.mjs} +18 -16
- package/dist/postgres-migration-DEa-g6j1-CoG3QOV3.mjs.map +1 -0
- package/dist/{postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs → postgres-schema-CIfq1AjC-CGiMjtSX.mjs} +4 -4
- package/dist/{postgres-schema-zd_p5Lg2-BdJlG7Cg.mjs.map → postgres-schema-CIfq1AjC-CGiMjtSX.mjs.map} +1 -1
- package/dist/{prisma7-binding-BGEW0R_9.mjs → prisma7-binding-BRPindAK.mjs} +7 -7
- package/dist/{prisma7-binding-BGEW0R_9.mjs.map → prisma7-binding-BRPindAK.mjs.map} +1 -1
- package/dist/{prisma7-binding-DSQpvEBe.d.mts → prisma7-binding-BqClsmwa.d.mts} +6 -7
- package/dist/{prisma7-binding-DSQpvEBe.d.mts.map → prisma7-binding-BqClsmwa.d.mts.map} +1 -1
- package/dist/{registry-D4AyYsXr-CgiiMuFS.mjs → registry-CWgvB0Fj-Czwmfmzd.mjs} +3 -3
- package/dist/{registry-D4AyYsXr-CgiiMuFS.mjs.map → registry-CWgvB0Fj-Czwmfmzd.mjs.map} +1 -1
- package/dist/{render-ops-B5Mh0MpJ-Dc_dH1Sk.mjs → render-ops-Bl1R5cz0-CFshOROt.mjs} +4 -4
- package/dist/{render-ops-B5Mh0MpJ-Dc_dH1Sk.mjs.map → render-ops-Bl1R5cz0-CFshOROt.mjs.map} +1 -1
- package/dist/{render-ops-CEwI8Iyf.d.mts → render-ops-oYwF1MRN.d.mts} +2 -2
- package/dist/{render-ops-CEwI8Iyf.d.mts.map → render-ops-oYwF1MRN.d.mts.map} +1 -1
- package/dist/{render-typescript-Dqp1Spgn-B4mJhuVr.mjs → render-typescript-B-Igkk6D-CQ-WlBmb.mjs} +9 -24
- package/dist/render-typescript-B-Igkk6D-CQ-WlBmb.mjs.map +1 -0
- package/dist/{render-typescript-BysdXYpH.d.mts → render-typescript-dgxcyEaj.d.mts} +2 -9
- package/dist/render-typescript-dgxcyEaj.d.mts.map +1 -0
- package/dist/{resolve-ddl-schema-BwKuzGm--BVgPhp86.mjs → resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs} +3 -3
- package/dist/{resolve-ddl-schema-BwKuzGm--BVgPhp86.mjs.map → resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs.map} +1 -1
- package/dist/{runtime-DPhbi9_3.mjs → runtime-BArZXVRj.mjs} +7 -7
- package/dist/{runtime-DPhbi9_3.mjs.map → runtime-BArZXVRj.mjs.map} +1 -1
- package/dist/{runtime-BMG3ddkQ.d.mts → runtime-DhK5uy8-.d.mts} +2 -2
- package/dist/{runtime-BMG3ddkQ.d.mts.map → runtime-DhK5uy8-.d.mts.map} +1 -1
- package/dist/{runtime-Cnam1N0o.mjs → runtime-IkvlhDl7.mjs} +2 -2
- package/dist/{runtime-Cnam1N0o.mjs.map → runtime-IkvlhDl7.mjs.map} +1 -1
- package/dist/{sql-renderer-Bj41PrUl-Jbs8Ojfr.mjs → sql-renderer-Bj41PrUl-BDN4jKm9.mjs} +3 -3
- package/dist/{sql-renderer-Bj41PrUl-Jbs8Ojfr.mjs.map → sql-renderer-Bj41PrUl-BDN4jKm9.mjs.map} +1 -1
- package/dist/{sql-utils-Bq4nuPvy.d.mts → sql-utils-CHtt-prW.d.mts} +6 -2
- package/dist/{sql-utils-Bq4nuPvy.d.mts.map → sql-utils-CHtt-prW.d.mts.map} +1 -1
- package/dist/{sql-utils-CRPhDLp1-wbgQW5TM.mjs → sql-utils-ClKAaUlZ-BdjnkJvV.mjs} +8 -4
- package/dist/{sql-utils-CRPhDLp1-wbgQW5TM.mjs.map → sql-utils-ClKAaUlZ-BdjnkJvV.mjs.map} +1 -1
- package/dist/target.d.mts +29 -29
- package/dist/target.mjs +35 -35
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +3 -3
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +24 -16
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-transform.d.mts +2 -2
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__diff-database-schema.d.mts +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__full-text-index-authoring.mjs +2 -2
- package/dist/target__full-text.d.mts +3 -3
- package/dist/target__full-text.mjs +2 -2
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +3 -3
- package/dist/target__migration.mjs +1 -1
- package/dist/target__native-type-normalizer.mjs +1 -1
- package/dist/target__op-factory-call.d.mts +3 -3
- package/dist/target__op-factory-call.mjs +2 -2
- package/dist/target__operation-types.d.mts +2 -2
- package/dist/target__pack.d.mts +2 -2
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +1 -1
- package/dist/target__planner-target-details.d.mts +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.d.mts +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__render-typescript.d.mts +1 -1
- package/dist/target__render-typescript.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.d.mts +2 -2
- package/dist/target__sql-utils.mjs +4 -4
- package/dist/target__types.mjs +2 -2
- package/dist/{types-B_HaL8V4.d.mts → types-BxgDP3d4.d.mts} +1 -1
- package/package.json +16 -16
- package/dist/authoring-DPwc7x9U-BZkXpPSH.mjs.map +0 -1
- package/dist/codec-types-FPJG3oQH.d.mts +0 -2
- package/dist/codecs-Bzj3M0Q3-C2oFSIGs.mjs.map +0 -1
- package/dist/contract-contributions-Bc0_64Gr-KE0qggZv.mjs.map +0 -1
- package/dist/data-transform-DX9I716A.d.mts +0 -1
- package/dist/data-types-DWfwErIu-DF85cgmu.mjs.map +0 -1
- package/dist/date-time-now-generators-BORO1_nc-BdCe3ppq.mjs.map +0 -1
- package/dist/descriptor-meta-46EhsECb-C5EGe36u.mjs.map +0 -1
- package/dist/descriptor-meta-DUDk-DLN-B_WUfFf7.mjs.map +0 -1
- package/dist/full-text-collection-method-CtUV9NT0-CQuFZ4aH.d.mts.map +0 -1
- package/dist/indexes-ooG0J-V8-CTm1QvmZ.d.mts.map +0 -1
- package/dist/issue-planner-BlN8mK4E.d.mts.map +0 -1
- package/dist/migration-CovfYOjm.d.mts.map +0 -1
- package/dist/op-factory-call-CG80t74g-D9tjd13N.d.mts.map +0 -1
- package/dist/op-factory-call-DRapuFEI.d.mts +0 -1
- package/dist/op-factory-call-THEIwT0J-DQM3Y94S.mjs.map +0 -1
- package/dist/operation-types-D1F7DwdI.d.mts +0 -1
- package/dist/planner-BHH46ndt-Q6-LPhnL.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-CulnCxu2.d.mts +0 -1
- package/dist/planner-produced-postgres-migration-FtUIqqVg-ouPTcZ8X.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-exqzWlvW-DGLu2dQ7.d.mts.map +0 -1
- package/dist/planner-target-details-boDXR2s7-CExrk6rf.d.mts.map +0 -1
- package/dist/postgres-contract-view-DtsmkyFX-Bas8oQiN.mjs.map +0 -1
- package/dist/postgres-migration-D5lRerLT-DyYh8UPS.mjs.map +0 -1
- package/dist/render-typescript-BysdXYpH.d.mts.map +0 -1
- package/dist/render-typescript-Dqp1Spgn-B4mJhuVr.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-D2T46plG-BChGUTOA.mjs","names":["#lowerer"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-D2T46plG.mjs"],"sourcesContent":["import { o as quoteIdentifier } from \"./sql-utils-ClKAaUlZ.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema, y as PostgresRlsPolicy } from \"./postgres-schema-CIfq1AjC.mjs\";\nimport { B as RenameSchemaCall, D as DropPostgresRlsPolicyCall, F as RemoveStoredValueCall, L as RenameConstraintCall, N as RawSqlCall, O as DropSchemaCall, P as RemoveStoredKeyCall, R as RenameIndexCall, T as DropNativeEnumTypeCall, U as ReplaceStoredValueCall, V as RenameStoredKeyCall, X as isPostgresOpFactoryCall, _ as DeleteRowsCall, b as DropColumnCall, ct as dropRlsPolicyIdentity, j as FillStoredKeyCall, k as DropTableCall, l as AlterColumnTypeCall, lt as renameRlsPolicyIdentity, m as CreateSchemaCall, ot as createRlsPolicyIdentity, p as CreatePostgresRlsPolicyCall, q as SetTableSchemaCall, r as AddColumnWithTemporaryDefaultCall, st as disableRowLevelSecurityIdentity, t as AddCheckConstraintCall, w as DropIndexCall, x as DropConstraintCall, y as DropCheckConstraintCall, z as RenamePostgresRlsPolicyCall } from \"./op-factory-call-DvezqqJx.mjs\";\nimport { o as PostgresSchemaNodeKind, r as PostgresExtensionSchemaNode, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-OQRI_GIM.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode } from \"./postgres-role-schema-node-yFPLQ6U0.mjs\";\nimport { n as emissionSchemaForNamespace, r as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-C2KTxEX3.mjs\";\nimport { t as buildPostgresPlanDiff } from \"./diff-database-schema-CVmwyjFf.mjs\";\nimport { a as resolvePostgresNodeIssueCreationFactoryName, c as issueNode, d as postgresPlannerStrategies, f as tableAt, i as resolvePostgresNodeIssueControlPolicySubject, l as issueSchemaName, n as resolveNamespaceIdForDdlSchema, o as coalesceSubtreeIssues, p as postgresNodeStorageCoordinate, r as resolvePostgresCallControlPolicySubject, s as conflictForDisallowedCall, t as renderPostgresSuppression, u as planIssues } from \"./control-policy-Crcjg7Vz.mjs\";\nimport { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from \"./default-constraint-names-Cz9Yoeim.mjs\";\nimport { a as renameTableByHandStatements, c as postgresSchemaTables, d as postgresContractToSchema, i as postgresTableRenameCall, l as pairCheckRenames, n as postgresColumnRenameCall, o as renderRenameTableCall, r as postgresTableRenameByHand, s as createWorkingSchema, u as pairIndexRenames } from \"./postgres-migration-DEa-g6j1.mjs\";\nimport { t as TypeScriptRenderablePostgresMigration } from \"./planner-produced-postgres-migration-BLKk9Vaz.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { enumValueCoordinateJson, isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { UNBOUND_PSL_NAMESPACE_NAME } from \"@internal/framework-components/psl-ast\";\nimport { namingOf, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { UnfilledValue, appliedStatementsInOrder, backfillOfDefaultedField, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, otherSpaceDeclaring, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planStatements, planStoredRewrites, plannerFailure, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from \"@internal/family-sql/control\";\nimport { ok } from \"@internal/utils/result\";\nimport { governingControlPolicy } from \"@internal/contract/types\";\n//#region src/core/migrations/access-changes.ts\nconst RowLevelSecurityTarget = type({ details: {\n\tschema: \"string\",\n\tobjectType: \"'rowLevelSecurity'\",\n\tname: \"string\"\n} });\nconst RlsPolicyTarget = type({ details: {\n\tschema: \"string\",\n\tobjectType: \"'rlsPolicy'\",\n\tname: \"string\",\n\ttable: \"string\"\n} });\nconst sameId = (identity, expected) => identity.id === expected.id;\nconst sameIdAndClass = (identity, expected) => sameId(identity, expected) && identity.operationClass === expected.operationClass;\n/** The table whose row-level security `identity` disables, when it is the operation `disableRowLevelSecurity` builds. */\nfunction disabledTable(identity) {\n\tconst target = RowLevelSecurityTarget(identity.target);\n\tif (target instanceof type.errors) return void 0;\n\tconst { schema, name } = target.details;\n\treturn sameId(identity, disableRowLevelSecurityIdentity(schema, name)) ? {\n\t\tschema,\n\t\ttable: name\n\t} : void 0;\n}\nfunction policyOf(identity, identityOf, same) {\n\tconst target = RlsPolicyTarget(identity.target);\n\tif (target instanceof type.errors) return void 0;\n\tconst { schema, table, name } = target.details;\n\treturn same(identity, identityOf(schema, table, name)) ? {\n\t\tschema,\n\t\ttable,\n\t\tname\n\t} : void 0;\n}\n/** The policy `identity` renames and what it becomes, when it is the operation `renameRlsPolicy` builds. */\nfunction renamedPolicy(identity) {\n\tconst target = RlsPolicyTarget(identity.target);\n\tif (target instanceof type.errors) return void 0;\n\tconst { schema, table, name } = target.details;\n\tconst prefix = `rlsPolicy.${schema}.${table}.`;\n\tif (!identity.id.startsWith(prefix) || !identity.id.endsWith(\".rename\")) return void 0;\n\tconst from = identity.id.slice(prefix.length, -7);\n\treturn sameIdAndClass(identity, renameRlsPolicyIdentity(schema, table, from, name)) ? {\n\t\tfrom: {\n\t\t\tschema,\n\t\t\ttable,\n\t\t\tname: from\n\t\t},\n\t\tto: {\n\t\t\tschema,\n\t\t\ttable,\n\t\t\tname\n\t\t}\n\t} : void 0;\n}\n/**\n* A policy's identity across a replacement: its name, or the prefix of a generated (wire) name,\n* whose hash changes with the policy's body.\n*/\nfunction policyKey({ schema, table, name }) {\n\treturn JSON.stringify([\n\t\tschema,\n\t\ttable,\n\t\tparseWireName(name)?.prefix ?? name\n\t]);\n}\n/**\n* The operations of one migration that change who can read or write rows. Disabling row-level\n* security widens access: every role with table privileges then reads and writes every row.\n* Dropping a policy changes access either way, since a permissive policy grants access and a\n* restrictive one limits it, unless a policy the same migration creates, under the same name or\n* generated-name prefix, is still there when the migration ends. Each operation is recognised from\n* its target and the id its operation factory builds; an operation with neither, such as raw SQL,\n* is not read. A rename to the old name followed by `.rename` has the id and target of creating a\n* policy of that name, so a create and a rename are also recognised by their operation class.\n*/\nfunction accessChangesOfIdentities(identities) {\n\tconst createdAndKept = /* @__PURE__ */ new Map();\n\tconst disabled = [];\n\tconst droppedFromBefore = [];\n\tidentities.forEach((identity, index) => {\n\t\tif (identity === void 0) return;\n\t\tconst table = disabledTable(identity);\n\t\tif (table !== void 0) {\n\t\t\tdisabled.push({\n\t\t\t\tindex,\n\t\t\t\t...table,\n\t\t\t\twidens: true\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst renamed = renamedPolicy(identity);\n\t\tif (renamed !== void 0) {\n\t\t\tif (createdAndKept.get(policyKey(renamed.from))?.delete(renamed.from.name)) {\n\t\t\t\tconst key = policyKey(renamed.to);\n\t\t\t\tcreatedAndKept.set(key, (createdAndKept.get(key) ?? /* @__PURE__ */ new Set()).add(renamed.to.name));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst created = policyOf(identity, createRlsPolicyIdentity, sameIdAndClass);\n\t\tif (created !== void 0) {\n\t\t\tconst key = policyKey(created);\n\t\t\tcreatedAndKept.set(key, (createdAndKept.get(key) ?? /* @__PURE__ */ new Set()).add(created.name));\n\t\t\treturn;\n\t\t}\n\t\tconst dropped = policyOf(identity, dropRlsPolicyIdentity, sameId);\n\t\tif (dropped === void 0) return;\n\t\tconst key = policyKey(dropped);\n\t\tif (createdAndKept.get(key)?.delete(dropped.name)) return;\n\t\tdroppedFromBefore.push({\n\t\t\tindex,\n\t\t\tschema: dropped.schema,\n\t\t\ttable: dropped.table,\n\t\t\twidens: false,\n\t\t\tkey\n\t\t});\n\t});\n\treturn [...disabled, ...droppedFromBefore.filter(({ key }) => (createdAndKept.get(key)?.size ?? 0) === 0).map(({ key: _key, ...change }) => change)].sort((a, b) => a.index - b.index);\n}\n/** The operations of a recorded Postgres migration that change who can read or write rows. */\nfunction recordedAccessChangesOf(operations) {\n\treturn accessChangesOfIdentities(operations.map((operation) => ({\n\t\tid: operation.id,\n\t\toperationClass: operation.operationClass,\n\t\ttarget: Reflect.get(operation, \"target\")\n\t}))).map(({ index, schema, table, widens }) => ({\n\t\toperationIndex: index,\n\t\tsubject: {\n\t\t\tkind: \"storage\",\n\t\t\tname: schema === UNBOUND_NAMESPACE_ID ? table : `${schema}.${table}`\n\t\t},\n\t\twidens\n\t}));\n}\n//#endregion\n//#region src/core/migrations/constraint-name-renames.ts\n/** The constraint of `nextNodes` the diff pairs with `node` and finds unchanged. */\nfunction unchangedIn(node, nextNodes) {\n\treturn nextNodes.find((next) => next.id === node.id && next.isEqualTo(node));\n}\n/**\n* The renames of the primary key, unique constraints and foreign keys of one table that the end tree keeps otherwise unchanged but names differently. A constraint's name is its stated name, or the one the planner derives from its table; a start tree read from the database states every name. A constraint whose start and end names differ is renamed to the end name. The diff never compares constraint names, so without these the database keeps the old name. A database may already have the new name, as when Prisma 7 created it and the contract only now states it; the rename's postcheck then holds before it runs, and the runner skips it.\n*/\nfunction constraintNameRenames(input) {\n\tconst { schemaName, from, to, previous, next, droppedConstraintNames } = input;\n\tconst rename = (kind, oldName, unchanged, derivedName) => {\n\t\tif (unchanged === void 0 || droppedConstraintNames.has(oldName)) return [];\n\t\tconst newName = unchanged.name ?? derivedName;\n\t\treturn oldName === newName ? [] : [new RenameConstraintCall(schemaName, to, kind, oldName, newName)];\n\t};\n\tconst primaryKey = previous.primaryKey === void 0 ? [] : rename(\"primaryKey\", previous.primaryKey.name ?? defaultPrimaryKeyName(from), unchangedIn(previous.primaryKey, next.primaryKey === void 0 ? [] : [next.primaryKey]), defaultPrimaryKeyName(to));\n\tconst uniques = previous.uniques.flatMap((unique) => rename(\"unique\", unique.name ?? defaultUniqueName(from, unique.columns), unchangedIn(unique, next.uniques), defaultUniqueName(to, unique.columns)));\n\tconst foreignKeys = previous.foreignKeys.flatMap((fk) => rename(\"foreignKey\", fk.name ?? defaultForeignKeyName(from, fk.columns), unchangedIn(fk, next.foreignKeys), defaultForeignKeyName(to, fk.columns)));\n\treturn [\n\t\t...primaryKey,\n\t\t...uniques,\n\t\t...foreignKeys\n\t];\n}\n/**\n* The constraint renames of a plan: {@link constraintNameRenames} for every table the start tree and the end contract both have, with the start tree as the plan's rename statements left it. The start tree comes from the start contract for `migration plan` and from the database for `db update`, so a database Prisma 8 created under derived names is renamed too once the contract states other names. A constraint one of `plannedCalls` drops is skipped: the plan adds it back under its end name, or not at all.\n*/\nfunction plannedConstraintNameRenames(options, plannedCalls) {\n\tif (!options.policy.allowedOperationClasses.includes(\"widening\")) return [];\n\tPostgresDatabaseSchemaNode.assert(options.schema);\n\tconst startTablesBySchema = new Map(Object.values(options.schema.namespaces).map((namespace) => [namespace.schemaName, namespace.tables]));\n\tconst contract = options.contract;\n\tconst end = postgresContractToSchema(contract, options.frameworkComponents);\n\treturn Object.values(end.namespaces).flatMap((namespace) => {\n\t\tconst startTables = startTablesBySchema.get(namespace.schemaName) ?? {};\n\t\tconst schemaName = resolveNamespaceIdForDdlSchema(contract, namespace.schemaName) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : namespace.schemaName;\n\t\treturn Object.entries(namespace.tables).flatMap(([tableName, next]) => {\n\t\t\tconst previous = startTables[tableName];\n\t\t\tconst droppedConstraintNames = new Set(plannedCalls.flatMap((call) => call.factoryName === \"dropConstraint\" && call.schemaName === schemaName && call.tableName === tableName ? [call.constraintName] : []));\n\t\t\treturn previous === void 0 ? [] : constraintNameRenames({\n\t\t\t\tschemaName,\n\t\t\t\tfrom: tableName,\n\t\t\t\tto: tableName,\n\t\t\t\tprevious,\n\t\t\t\tnext,\n\t\t\t\tdroppedConstraintNames\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\n//#region src/core/migrations/dropped-relation-names.ts\nfunction constraintAndIndexNames(table) {\n\treturn [\n\t\ttable.primaryKey?.name,\n\t\t...table.uniques.map(({ name }) => name),\n\t\t...table.indexes.map(({ name }) => name),\n\t\t...table.foreignKeys.map(({ name }) => name),\n\t\t...(table.checks ?? []).map(({ name }) => name)\n\t].filter((name) => name !== void 0);\n}\n/**\n* Whether one of `calls` drops a constraint or index named `name` in schema `schemaName`, by\n* dropping it or the table it is on in `schema`. Schema names go through `ddlSchemaOf`, as calls\n* name the unbound namespace by its id.\n*/\nfunction droppedRelationNames(calls, schema, ddlSchemaOf) {\n\tconst key = (schemaName, name) => JSON.stringify([ddlSchemaOf(schemaName), name]);\n\tconst dropped = /* @__PURE__ */ new Set();\n\tfor (const call of calls) if (call instanceof DropTableCall) {\n\t\tconst table = Object.values(schema.namespaces).find((namespace) => namespace.schemaName === ddlSchemaOf(call.schemaName))?.tables[call.tableName];\n\t\tfor (const name of table === void 0 ? [] : constraintAndIndexNames(table)) dropped.add(key(call.schemaName, name));\n\t} else if (call instanceof DropIndexCall) dropped.add(key(call.schemaName, call.indexName));\n\telse if (call instanceof DropConstraintCall) dropped.add(key(call.schemaName, call.constraintName));\n\treturn (schemaName, name) => dropped.has(key(schemaName, name));\n}\n//#endregion\n//#region src/core/migrations/operation-subjects.ts\n/**\n* The namespace a schema stands for in the locator's contract, or, for a schema that contract does\n* not declare, such as the new name of a renamed namespace, the schema's own name: a named Postgres\n* namespace's schema is its id.\n*/\nfunction storageNamespaceId(locator, schemaName) {\n\tif (schemaName === UNBOUND_NAMESPACE_ID) return UNBOUND_NAMESPACE_ID;\n\tconst namespaceId = resolveNamespaceIdForDdlSchema(locator.contract, schemaName);\n\treturn namespaceId === UNBOUND_NAMESPACE_ID && schemaName !== \"public\" ? schemaName : namespaceId;\n}\nfunction qualified(schemaName, name) {\n\treturn schemaName === UNBOUND_NAMESPACE_ID ? name : `${schemaName}.${name}`;\n}\nfunction target(locator, schemaName, table, column) {\n\treturn {\n\t\tstorageName: qualified(schemaName, column === void 0 ? table : `${table}.${column}`),\n\t\ttable: {\n\t\t\tnamespaceId: storageNamespaceId(locator, schemaName),\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction rawSqlTarget(locator, call) {\n\tconst details = call.op.target.details;\n\tif (details === void 0) return {\n\t\tstorageName: call.op.id,\n\t\ttable: void 0\n\t};\n\tif (details.objectType === \"table\") return target(locator, details.schema, details.name, void 0);\n\tif (details.objectType === \"column\" && details.table !== void 0) return target(locator, details.schema, details.table, details.name);\n\treturn {\n\t\tstorageName: storageNameOfOperation(call.op),\n\t\ttable: void 0\n\t};\n}\nfunction knownTarget(locator, call) {\n\tif (call instanceof DropTableCall) return target(locator, call.schemaName, call.tableName, void 0);\n\tif (call instanceof DeleteRowsCall) return {\n\t\t...target(locator, call.schemaName, call.tableName, void 0),\n\t\t...ifDefined(\"model\", locator.variantRows?.get(call))\n\t};\n\tif (call instanceof DropColumnCall || call instanceof AlterColumnTypeCall) return target(locator, call.schemaName, call.tableName, call.columnName);\n\tif (call instanceof RemoveStoredKeyCall) return {\n\t\t...target(locator, call.schemaName, call.tableName, call.columnName),\n\t\t...ifDefined(\"valueObjectField\", locator.storedKeys?.get(call))\n\t};\n\tif (call instanceof RemoveStoredValueCall) {\n\t\tconst enumValue = locator.storedValues?.get(call)?.enumValue;\n\t\treturn {\n\t\t\t...target(locator, call.schemaName, call.tableName, call.columnName),\n\t\t\t...ifDefined(\"enumValue\", enumValue)\n\t\t};\n\t}\n\tif (call instanceof RawSqlCall) return rawSqlTarget(locator, call);\n\tconst fieldEvent = locator.fieldEvents.get(call);\n\treturn fieldEvent === void 0 ? void 0 : fieldEventStorage(fieldEvent);\n}\n/** The temporary values a call writes: a new required column's, or a planner-written fill's of a value object field. */\nfunction temporaryValuesOf(locator, call) {\n\tif (call instanceof AddColumnWithTemporaryDefaultCall) return [{\n\t\ttable: call.tableName,\n\t\tcolumn: call.columnName,\n\t\tvalue: call.temporaryDefault\n\t}];\n\tconst valueObjectField = locator.storedKeys?.get(call);\n\tif (!(call instanceof FillStoredKeyCall) || call.value instanceof UnfilledValue || valueObjectField === void 0) return [];\n\treturn [{\n\t\ttable: call.tableName,\n\t\tcolumn: call.columnName,\n\t\tvalue: JSON.stringify(call.value),\n\t\tvalueObjectField\n\t}];\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/** What each call of a Postgres plan loses, and whose access it changes. */\nfunction postgresCallSubjects(calls, locator) {\n\tconst accessChanges = new Map(accessChangesOfIdentities(calls.map((call) => isPostgresOpFactoryCall(call) ? call.rlsIdentity() : void 0)).map((change) => [change.index, change]));\n\tconst destructive = calls.filter((call) => call.operationClass === \"destructive\");\n\tconst known = new Map(destructive.map((call) => [call, knownTarget(locator, call)]));\n\tconst unknownNames = unknownCallNames(destructive.filter((call) => known.get(call) === void 0));\n\treturn calls.map((call, callIndex) => {\n\t\tconst accessChange = accessChanges.get(callIndex);\n\t\tconst lossTarget = known.get(call);\n\t\tconst unknownName = unknownNames.get(call);\n\t\tconst loss = call instanceof AlterColumnTypeCall ? \"typeChange\" : \"drop\";\n\t\treturn {\n\t\t\toperationCount: operationCountOf(call),\n\t\t\tlabel: call.label,\n\t\t\tdataLoss: lossTarget !== void 0 ? [{\n\t\t\t\t...lossTarget,\n\t\t\t\tloss\n\t\t\t}] : unknownName !== void 0 ? [{\n\t\t\t\tstorageName: unknownName,\n\t\t\t\ttable: void 0,\n\t\t\t\tloss\n\t\t\t}] : [],\n\t\t\taccessChanges: accessChange === void 0 ? [] : [{\n\t\t\t\t...target(locator, accessChange.schema, accessChange.table, void 0),\n\t\t\t\twidens: accessChange.widens\n\t\t\t}],\n\t\t\ttemporaryValues: temporaryValuesOf(locator, call)\n\t\t};\n\t});\n}\n//#endregion\n//#region src/core/migrations/stored-value-calls.ts\n/** The calls that carry out a plan's stored value rewrites, each with the rewrite it carries out. */\nfunction postgresStoredValueCalls(rewrites, contract, codecs) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst schemaName = emissionSchemaForNamespace(contract, rewrite.namespaceId);\n\t\tconst codec = rewrite.codecRef === void 0 ? void 0 : {\n\t\t\tcodecRef: rewrite.codecRef,\n\t\t\tcodecs\n\t\t};\n\t\tconst { member } = rewrite;\n\t\treturn [rewrite.to === void 0 ? new RemoveStoredValueCall(schemaName, rewrite.table, rewrite.column, rewrite.from, rewrite.many, codec, enumValueCoordinateJson(rewrite.enumValue), member?.path, member?.nullable === true ? true : void 0) : new ReplaceStoredValueCall(schemaName, rewrite.table, rewrite.column, rewrite.from, rewrite.to, rewrite.many, codec, member?.path), rewrite];\n\t}));\n}\n/** The calls that carry out a plan's key rewrites of value object fields, each with the rewrite it carries out. */\nfunction postgresStoredKeyCalls(rewrites, contract) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst schemaName = emissionSchemaForNamespace(contract, rewrite.namespaceId);\n\t\treturn [rewrite.to === void 0 ? new RemoveStoredKeyCall(schemaName, rewrite.table, rewrite.column, rewrite.path) : new RenameStoredKeyCall(schemaName, rewrite.table, rewrite.column, rewrite.path, rewrite.to), rewrite];\n\t}));\n}\n/** The calls that carry out a plan's fills of value object fields, each with the fill it carries out. */\nfunction postgresStoredKeyFillCalls(fills, contract) {\n\treturn new Map(fills.map((fill) => [new FillStoredKeyCall(emissionSchemaForNamespace(contract, fill.namespaceId), fill.table, fill.column, fill.path, fill.value, {\n\t\ttext: fill.field,\n\t\tcheck: void 0\n\t}), fill]));\n}\n/** The calls that carry out a plan's row rewrites of variants, each with the rewrite it carries out. */\nfunction postgresVariantRowCalls(rewrites, contract, codecs) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst schemaName = emissionSchemaForNamespace(contract, rewrite.namespaceId);\n\t\tconst codec = {\n\t\t\tcodecRef: rewrite.codecRef,\n\t\t\tcodecs\n\t\t};\n\t\treturn [rewrite.to === void 0 ? new DeleteRowsCall(schemaName, rewrite.table, rewrite.column, rewrite.from, codec) : new ReplaceStoredValueCall(schemaName, rewrite.table, rewrite.column, rewrite.from, rewrite.to, false, codec), rewrite];\n\t}));\n}\n/** Puts the stored value calls among the calls the diff plans, which order them. */\nfunction storedValueCallsStrategy(calls) {\n\treturn (issues) => calls.length === 0 ? { kind: \"no_match\" } : {\n\t\tkind: \"match\",\n\t\tissues,\n\t\tcalls\n\t};\n}\n/** How the family's stored value code tells Postgres removals apart and builds replacements. */\nconst postgresStoredValueCallClasses = {\n\tisRemoval: (call) => call instanceof RemoveStoredValueCall,\n\treplacementOf: (removal, { from, to }) => new ReplaceStoredValueCall(removal.schemaName, removal.tableName, removal.columnName, from, to, removal.many, removal.codec, removal.path?.text)\n};\nconst RENDER_ONLY_CODECS = { descriptorFor: () => void 0 };\n/** The removal a failed check's mark describes, in the schema its operation names, as `migration.ts` writes it. */\nfunction postgresMarkedRemoval(schema, mark) {\n\tconst codec = mark.codecRef === void 0 ? void 0 : {\n\t\tcodecRef: mark.codecRef,\n\t\tcodecs: RENDER_ONLY_CODECS\n\t};\n\treturn new RemoveStoredValueCall(schema, mark.table, mark.column, mark.value, false, codec, mark.enumValue, mark.path);\n}\n//#endregion\n//#region src/core/migrations/type-change-checks.ts\nfunction tableIn(tree, ddlSchemaName, tableName) {\n\treturn Object.values(tree.namespaces).find((node) => node.schemaName === ddlSchemaName)?.tables[tableName];\n}\nfunction escapedForPattern(text) {\n\treturn text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/**\n* Whether a check's predicate names the column, quoted or bare. The predicate is opaque SQL, so this\n* reads its text, and may name a check that does not depend on the column: dropping and adding\n* such a check again changes nothing.\n*/\nfunction mentionsColumn(check, column) {\n\tconst quoted = escapedForPattern(quoteIdentifier(column));\n\tconst bare = escapedForPattern(column);\n\treturn new RegExp(`${quoted}|(?<![\\\\w$\"])${bare}(?![\\\\w$\"])`, \"i\").test(check.expression);\n}\n/**\n* Puts a drop of each check that names a column a type change alters before the first such type\n* change, and the check back after the last. Postgres stores a check bound to the column's old type,\n* such as `array_position(tags, NULL::integer)`, and re-checks it while it alters the type, so a\n* check left in place can fail the alter; a check that names two retyped columns can only be added\n* back once both have their new types. Only checks the plan keeps unchanged are moved: one the plan\n* drops or adds is already planned around the alter. The check is added back as the destination\n* contract writes it.\n*/\nfunction withChecksAroundTypeChanges(input) {\n\tconst moved = /* @__PURE__ */ new Map();\n\tinput.calls.forEach((call, index) => {\n\t\tif (!(call instanceof AlterColumnTypeCall)) return;\n\t\tconst ddlSchemaName = input.ddlSchemaOf(call.schemaName);\n\t\tconst kept = tableIn(input.actual, ddlSchemaName, call.tableName)?.checks ?? [];\n\t\tfor (const check of tableIn(input.expected, ddlSchemaName, call.tableName)?.checks ?? []) {\n\t\t\tif (!mentionsColumn(check, call.columnName)) continue;\n\t\t\tif (!kept.some(({ name }) => name === check.name)) continue;\n\t\t\tconst key = JSON.stringify([\n\t\t\t\tddlSchemaName,\n\t\t\t\tcall.tableName,\n\t\t\t\tcheck.name\n\t\t\t]);\n\t\t\tconst entry = moved.get(key);\n\t\t\tif (entry === void 0) moved.set(key, {\n\t\t\t\tschemaName: call.schemaName,\n\t\t\t\ttableName: call.tableName,\n\t\t\t\tcheck,\n\t\t\t\tfirst: index,\n\t\t\t\tlast: index\n\t\t\t});\n\t\t\telse entry.last = index;\n\t\t}\n\t});\n\tconst entries = [...moved.values()];\n\treturn input.calls.flatMap((call, index) => [\n\t\t...entries.filter(({ first }) => first === index).map(({ schemaName, tableName, check }) => new DropCheckConstraintCall(schemaName, tableName, check.name)),\n\t\tcall,\n\t\t...entries.filter(({ last }) => last === index).map(({ schemaName, tableName, check }) => new AddCheckConstraintCall(schemaName, tableName, check.name, check.expression))\n\t]);\n}\n//#endregion\n//#region src/core/migrations/verify-postgres-namespaces.ts\n/**\n* Resolves the live-database schema name for a given namespace\n* coordinate. Mirrors `resolveDdlSchemaForNamespace` in\n* `planner-strategies.ts` so the verifier's projection and the\n* planner's projection always agree — Postgres-aware namespaces (the\n* production path) dispatch to `ddlSchemaName(storage)`, and bare\n* object payloads (used by some tests) fall back to the coordinate\n* itself.\n*/\nfunction resolveDdlSchemaName(storage, namespaceId) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n/**\n* Reads the introspected list of schema names from the database-root schema\n* node. `existingSchemas` is database-level, so it lives on the\n* `PostgresDatabaseSchemaNode` root — not on the per-schema namespace nodes.\n*\n* Defaults to the always-present `public` schema when the node is not the\n* database root — a fresh Postgres database always carries `public` (unless an\n* operator dropped it manually), so any verifier path that runs without an\n* enriched introspection still suppresses the redundant `CREATE SCHEMA\n* \"public\"`.\n*\n* Production introspection (`PostgresControlAdapter.introspect`) is the\n* authoritative source: it queries `pg_namespace` and sets `existingSchemas`\n* on the returned root. Tests that want to assert against a richer initial\n* state construct a `PostgresDatabaseSchemaNode` explicitly.\n*/\nfunction existingSchemasFromSchema(schema) {\n\tif (PostgresDatabaseSchemaNode.is(schema)) return schema.existingSchemas;\n\treturn [DEFAULT_NAMESPACE_ID];\n}\n/**\n* Emits a `postgres-namespace` `not-found` diff issue for every\n* contract-declared Postgres namespace whose live container does not yet\n* exist. The planner prepends these (node-typed, synthesized) to the\n* relational diff issues so a multi-schema plan emits `CREATE SCHEMA`\n* before the tables that need it — a planner-only concern (verify already\n* rejects via the `not-found` table issues a missing schema already\n* produces), so this is not part of the shared diff.\n*\n* A namespace's live container is the schema returned by its\n* polymorphic `ddlSchemaName(storage)` method — named schemas resolve\n* to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`\n* and is skipped explicitly (late-bound namespaces have no fixed DDL\n* schema). Issues are emitted only when the resolved name is a real,\n* creatable schema (not the unbound sentinel) and is missing from the\n* introspected list. `public` is suppressed implicitly because the\n* introspection (or its sensible default) always carries it.\n*\n* Each emitted issue's path is `['database', ddlName]` — an ancestor of\n* every table path under that schema, so it must never be run through\n* `coalesceSubtreeIssues` alongside the table diff (it would swallow the\n* table-level `not-found` issues that drive `CREATE TABLE`); the planner\n* adds these AFTER coalescing the relational issues, and they are not\n* subject to sibling-space ownership scoping (mirrors the retired\n* coordinate walk, which prepended namespace issues after that filter).\n*/\nfunction verifyPostgresNamespacePresence(input) {\n\tconst { contract, schema } = input;\n\tconst existing = new Set(existingSchemasFromSchema(schema));\n\tconst issues = [];\n\tconst namespaceIds = Object.keys(contract.storage.namespaces).sort();\n\tfor (const namespaceId of namespaceIds) {\n\t\tif (namespaceId === UNBOUND_NAMESPACE_ID) continue;\n\t\tconst ddlName = resolveDdlSchemaName(contract.storage, namespaceId);\n\t\tif (ddlName === UNBOUND_NAMESPACE_ID) continue;\n\t\tif (existing.has(ddlName)) continue;\n\t\tconst namespace = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlName,\n\t\t\ttables: {}\n\t\t});\n\t\tissues.push({\n\t\t\tpath: [\"database\", ddlName],\n\t\t\texpected: namespace\n\t\t});\n\t}\n\treturn issues;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction partitionPostgresCallsByControlPolicy(calls, contract) {\n\treturn partitionCallsByControlPolicy({\n\t\tcalls,\n\t\tcontract,\n\t\tresolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, contract),\n\t\tresolveFactoryName: (call) => call.factoryName\n\t});\n}\nfunction createPostgresMigrationPlanner(lowerer) {\n\treturn new PostgresMigrationPlanner(lowerer);\n}\n/**\n* Postgres migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the target contract against the live schema via the one\n* differ (`buildPostgresPlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the unified `postgresPlannerStrategies`\n* list: NOT-NULL backfill, type-change, nullable-tightening, codec-hook\n* storage types, component-declared dependency installs, and\n* shared-temp-default / empty-table-guarded NOT-NULL add-column. The same\n* strategy list runs for `migration plan`, `db update`, and `db init`;\n* behavior diverges purely on `policy.allowedOperationClasses` (the\n* data-safe strategies short-circuit when `'data'` is excluded). The issue\n* planner applies operation-class policy gates and emits a single\n* `PostgresOpFactoryCall[]` that drives both the runtime-ops view (via\n* `renderOps`) and the `renderTypeScript()` authoring surface. RLS policy\n* drift (the structural half of the same one-differ tree) is handled\n* separately via `planPostgresSchemaDiff`.\n*/\nvar PostgresMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(blindCast(options));\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderablePostgresMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tconst packExtensions = extensionsDeclaredByPacks(options);\n\t\tif (packExtensions.length > 0) return plannerFailure(packExtensions);\n\t\tPostgresDatabaseSchemaNode.assert(options.schema);\n\t\tconst statements = this.planStatements(options, options.schema);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { schema } = statements.value;\n\t\tconst removedSchemas = removedNamespaceSchemas(options, schema);\n\t\tconst { issues: rawIssues, expected: expectedSchema } = buildPostgresPlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: schema,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\toriginSchemas: originSchemaNames(options.fromContract),\n\t\t\toriginExtensions: originExtensionNames(options.fromContract)\n\t\t});\n\t\tconst droppedTables = rawIssues.filter((issue) => issueOutcome(issue) === \"not-expected\" && issueNode(issue)?.nodeKind === PostgresSchemaNodeKind.table);\n\t\tconst policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue) && !droppedTables.some((table) => isWithin(issue.path, table.path)));\n\t\tconst relationalDiffIssues = rawIssues.filter((issue) => !isPolicyDiffIssue(issue));\n\t\tconst strict = options.policy.allowedOperationClasses.includes(\"widening\") || options.policy.allowedOperationClasses.includes(\"destructive\");\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(relationalDiffIssues.filter((issue) => !isOriginNamespaceIssue(issue, originSchemaNames(options.fromContract)))), options.ownership, (ddlSchemaName) => namespaceIdOfSchema(options, ddlSchemaName));\n\t\tconst gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\");\n\t\tconst schemaIssues = [...verifyPostgresNamespacePresence({\n\t\t\tcontract: options.contract,\n\t\t\tschema\n\t\t}), ...gated];\n\t\tconst indexRenames = pairIndexRenames(options, schemaIssues);\n\t\tconst checkRenames = pairCheckRenames(options, schemaIssues);\n\t\tconst renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);\n\t\tconst plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst types = sqlTypeLookupsOf(options.frameworkComponents);\n\t\tconst storedRewrites = planStoredRewrites({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\ttables: postgresSchemaTables(schema, options.contract),\n\t\t\ttypes,\n\t\t\tpolicy: options.policy,\n\t\t\tcalls: {\n\t\t\t\tstoredKeyCalls: (rewrites) => postgresStoredKeyCalls(rewrites, options.contract),\n\t\t\t\tstoredKeyFillCalls: (fills) => postgresStoredKeyFillCalls(fills, options.contract),\n\t\t\t\tstoredValueCalls: (rewrites) => postgresStoredValueCalls(rewrites, options.contract, types.codecLookup),\n\t\t\t\tvariantRowCalls: (rewrites) => postgresVariantRowCalls(rewrites, options.contract, types.codecLookup),\n\t\t\t\tstoredValueClasses: postgresStoredValueCallClasses\n\t\t\t}\n\t\t});\n\t\tif (!storedRewrites.ok) return plannerFailure([storedRewrites.failure]);\n\t\tconst relationalSchema = relationalNamespaceNode(schema, schemaName);\n\t\tconst issuePartition = partitionIssuesByControlPolicy({\n\t\t\tissues: plannableIssues,\n\t\t\tcontract: options.contract,\n\t\t\tresolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),\n\t\t\tresolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName\n\t\t});\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),\n\t\t\trenameByHandStatements: (rename) => renameTableByHandStatements(options.contract, rename),\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\n\t\tconst result = planIssues({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttoContract: options.contract,\n\t\t\tfromContract: options.fromContract,\n\t\t\tschemaName,\n\t\t\tcodecHooks,\n\t\t\ttypes,\n\t\t\t...ifDefined(\"schema\", relationalSchema),\n\t\t\tstartTree: schema,\n\t\t\tendTree: expectedSchema,\n\t\t\tforeignKeyDropAuthority: (ddlSchemaName, tableName, foreignKey) => {\n\t\t\t\tconst namespaceId = resolveNamespaceIdForDdlSchema(options.contract, ddlSchemaName);\n\t\t\t\tif ((tableAt(options.contract.storage, namespaceId, tableName) === void 0 && options.ownership?.declaresEntity({\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: tableName\n\t\t\t\t})) === true) return \"otherSpace\";\n\t\t\t\tconst { plannable } = partitionIssuesByControlPolicy({\n\t\t\t\t\tissues: [{\n\t\t\t\t\t\tpath: [\n\t\t\t\t\t\t\t\"database\",\n\t\t\t\t\t\t\tddlSchemaName,\n\t\t\t\t\t\t\ttableName,\n\t\t\t\t\t\t\tforeignKey.id\n\t\t\t\t\t\t],\n\t\t\t\t\t\tactual: foreignKey\n\t\t\t\t\t}],\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\tresolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),\n\t\t\t\t\tresolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName\n\t\t\t\t});\n\t\t\t\treturn plannable.length === 1 ? \"allowed\" : \"controlPolicy\";\n\t\t\t},\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\tstrategies: [\n\t\t\t\t...postgresPlannerStrategies,\n\t\t\t\tdropRemovedSchemasStrategy(removedSchemas.filter((schemaName) => !keptSchema(options, schemaName))),\n\t\t\t\tstoredValueCallsStrategy(storedRewrites.value.calls)\n\t\t\t]\n\t\t});\n\t\tconst schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);\n\t\tif (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);\n\t\tconst renamePartition = partitionPostgresCallsByControlPolicy([\n\t\t\t...indexRenames.calls,\n\t\t\t...checkRenames.calls,\n\t\t\t...plannedConstraintNameRenames({\n\t\t\t\t...options,\n\t\t\t\tschema\n\t\t\t}, result.value.calls)\n\t\t], options.contract);\n\t\tconst schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames,\n\t\t\tdataTypes: types.dataTypeLookup\n\t\t});\n\t\tconst fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(fieldEventCalls.map(({ call }) => call)), options.contract);\n\t\tconst ddlSchemaOf = (name) => name === UNBOUND_NAMESPACE_ID ? resolveDdlSchemaForNamespaceStorage(options.contract.storage, UNBOUND_NAMESPACE_ID) : name;\n\t\tconst ordered = movePolicyDropsBeforeBlockedDdl(withChecksAroundTypeChanges({\n\t\t\tcalls: result.value.calls,\n\t\t\texpected: expectedSchema,\n\t\t\tactual: schema,\n\t\t\tddlSchemaOf\n\t\t}), schemaDiffPartition.kept);\n\t\tconst droppedByStructural = droppedRelationNames(ordered.structural, schema, ddlSchemaOf);\n\t\tconst beforeStructural = (call) => {\n\t\t\tif (!(call instanceof RenameConstraintCall || call instanceof RenameIndexCall)) return false;\n\t\t\tconst renamedTo = call instanceof RenameConstraintCall ? call.newConstraintName : call.newIndexName;\n\t\t\treturn !droppedByStructural(call.schemaName, renamedTo) && statements.value.alreadyRenamedTables.some((table) => call.schemaName === emissionSchemaForNamespace(options.contract, table.namespaceId) && call.tableName === table.table);\n\t\t};\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...renamePartition.kept.filter(beforeStructural),\n\t\t\t...ordered.structural,\n\t\t\t...renamePartition.kept.filter((call) => !beforeStructural(call)),\n\t\t\t...ordered.policyCalls,\n\t\t\t...fieldEventPartition.kept\n\t\t];\n\t\tconst seenWarnings = /* @__PURE__ */ new Set();\n\t\tconst warnings = [\n\t\t\t...issuePartition.suppressions,\n\t\t\t...renamePartition.suppressions,\n\t\t\t...schemaDiff.suppressions,\n\t\t\t...schemaDiffPartition.suppressions,\n\t\t\t...fieldEventPartition.suppressions\n\t\t].map((record) => renderPostgresSuppression(record, options.contract)).filter((warning) => {\n\t\t\tconst key = JSON.stringify(warning);\n\t\t\tif (seenWarnings.has(key)) return false;\n\t\t\tseenWarnings.add(key);\n\t\t\treturn true;\n\t\t});\n\t\treturn Object.freeze({\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderablePostgresMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, this.#lowerer),\n\t\t\tappliedStatements: appliedStatementsInOrder(options.statements, statements.value.plannedStatements, (statement) => storedRewrites.value.operationIndexes(calls, statement)),\n\t\t\t...subjectsOfCalls(postgresCallSubjects(calls, {\n\t\t\t\tcontract: options.fromContract ?? options.contract,\n\t\t\t\tfieldEvents: new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent])),\n\t\t\t\tstoredValues: storedRewrites.value.storedValues,\n\t\t\t\tstoredKeys: storedRewrites.value.storedKeys,\n\t\t\t\tvariantRows: storedRewrites.value.variantRows\n\t\t\t}), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\torigins: statements.value.origins,\n\t\t\t\tstorageRenames: statements.value.storageRenames,\n\t\t\t\tbyHand: postgresTableRenameByHand(options.contract),\n\t\t\t\tremovedVariants: storedRewrites.value.removedVariants\n\t\t\t}),\n\t\t\tnamespaces: {\n\t\t\t\tremoved: removedSchemas.map((schemaName) => namespaceIdOfSchema(options, schemaName)),\n\t\t\t\tadded: addedNamespaceIds(options)\n\t\t\t},\n\t\t\t...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}\n\t\t});\n\t}\n\t/**\n\t* Maps the RLS policy findings of the one combined tree diff\n\t* (`buildPostgresPlanDiff`, already ownership-filtered) into\n\t* `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a\n\t* `not-equal` finding (an exact-named policy whose content drifted)\n\t* becomes drop + create, or a disallowed-call conflict when the policy\n\t* forbids the drop, which is `widening`. It\n\t* does not re-diff — it consumes exactly the policy-node subset of the\n\t* shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE\n\t* ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`\n\t* attribute diff on the relational side.\n\t*\n\t* Rename post-pass (the index pass's structure): hash pairing pairs a\n\t* `not-found` and a `not-expected` policy on the SAME table whose\n\t* wire-name content hashes match but prefixes differ (prefix-only rename);\n\t* content pairing then pairs remaining wire-named-missing policies against remaining\n\t* extras of any name shape by verbatim content (the node-owned `contentEquals` —\n\t* exact→wire adoption). Multi-candidate groups pair deterministically\n\t* by sorted name; leftovers proceed as create/drop; an exact-named\n\t* missing policy never content-pairs.\n\t*\n\t* The pairing runs only when the policy allows `widening` (rename's\n\t* class). Without it (db-init's additive-only set), pairing degrades\n\t* deliberately to the additive half: the new name is CREATEd and the old\n\t* policy survives live until a plan that allows `widening` runs —\n\t* emitting an ungated widening rename would only fail at the runner's\n\t* class re-enforcement.\n\t*/\n\tplanPostgresSchemaDiff(options, filteredDiffIssues) {\n\t\tconst allowsWidening = options.policy.allowedOperationClasses.includes(\"widening\");\n\t\tconst missing = [];\n\t\tconst extra = [];\n\t\tconst changed = [];\n\t\tfor (const issue of filteredDiffIssues) if (issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tchanged.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-found\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tmissing.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-expected\") {\n\t\t\tconst actual = issue.actual;\n\t\t\tPostgresPolicySchemaNode.assert(actual);\n\t\t\textra.push({\n\t\t\t\tnode: actual,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, actual.namespaceId)\n\t\t\t});\n\t\t}\n\t\tconst calls = [];\n\t\tconst conflicts = [];\n\t\tconst suppressions = [];\n\t\tconst renamedExtras = /* @__PURE__ */ new Set();\n\t\tconst renamedMissing = /* @__PURE__ */ new Set();\n\t\tconst pairingKey = (finding, hash) => JSON.stringify([\n\t\t\tfinding.schemaForTable,\n\t\t\tfinding.node.tableName,\n\t\t\thash\n\t\t]);\n\t\tif (allowsWidening) {\n\t\t\tconst extrasByGroup = /* @__PURE__ */ new Map();\n\t\t\tfor (const finding of extra) {\n\t\t\t\tconst parsed = parseWireName(finding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst key = pairingKey(finding, parsed.hash);\n\t\t\t\tconst group = extrasByGroup.get(key) ?? [];\n\t\t\t\tgroup.push(finding);\n\t\t\t\textrasByGroup.set(key, group);\n\t\t\t}\n\t\t\tfor (const group of extrasByGroup.values()) group.sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tconst sortedMissing = [...missing].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tconst parsed = parseWireName(missingFinding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst candidate = extrasByGroup.get(pairingKey(missingFinding, parsed.hash))?.shift();\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t\tconst sortedExtras = [...extra].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tif (renamedMissing.has(missingFinding)) continue;\n\t\t\t\tif (missingFinding.node.prefix === void 0) continue;\n\t\t\t\tconst candidate = sortedExtras.find((extraFinding) => !renamedExtras.has(extraFinding) && extraFinding.schemaForTable === missingFinding.schemaForTable && extraFinding.node.tableName === missingFinding.node.tableName && missingFinding.node.contentEquals(extraFinding.node));\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t}\n\t\tfor (const finding of changed) {\n\t\t\tconst replacement = {\n\t\t\t\tdrop: new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name),\n\t\t\t\tcreate: new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node))\n\t\t\t};\n\t\t\tconst graded = gradePolicyReplacement(replacement, options.contract, options.policy.allowedOperationClasses);\n\t\t\tif (graded.disposition === \"suppress\") {\n\t\t\t\tsuppressions.push(graded.record);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (graded.disposition === \"conflict\") {\n\t\t\t\tconflicts.push(graded.conflict);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcalls.push(replacement.drop);\n\t\t\tcalls.push(replacement.create);\n\t\t}\n\t\tfor (const finding of missing) {\n\t\t\tif (renamedMissing.has(finding)) continue;\n\t\t\tcalls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));\n\t\t}\n\t\tif (allowsWidening) for (const finding of extra) {\n\t\t\tif (renamedExtras.has(finding)) continue;\n\t\t\tcalls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));\n\t\t}\n\t\treturn {\n\t\t\tcalls,\n\t\t\tconflicts,\n\t\t\tsuppressions\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of `schema`, in order, so each rename's companions\n\t* are computed against the schema the earlier statements left. The diff then runs on that schema.\n\t*/\n\tplanStatements(options, schema) {\n\t\tconst working = createWorkingSchema(schema);\n\t\tconst ddlSchemaOf = (namespaceId) => resolveDdlSchemaForNamespaceStorage(options.contract.storage, namespaceId);\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\townership: {\n\t\t\t\toracle: options.ownership,\n\t\t\t\tspaceId: options.spaceId\n\t\t\t},\n\t\t\ttarget: {\n\t\t\t\ttables: () => postgresSchemaTables(working.current, options.contract),\n\t\t\t\tnamespaces: {\n\t\t\t\t\tcreateNamespaceCalls: (namespaceId) => {\n\t\t\t\t\t\tconst schemaName = ddlSchemaOf(namespaceId);\n\t\t\t\t\t\treturn working.current.existingSchemas.includes(schemaName) ? [] : [new CreateSchemaCall(schemaName)];\n\t\t\t\t\t},\n\t\t\t\t\tmoveTableCall: (move) => {\n\t\t\t\t\t\tif (options.fromContract === null) throw new InternalError(\"A table move is planned only from an origin contract\");\n\t\t\t\t\t\treturn new SetTableSchemaCall(emissionSchemaForNamespace(options.contract.storage.namespaces[move.from] === void 0 ? options.fromContract : options.contract, move.from), move.table, ddlSchemaOf(move.to));\n\t\t\t\t\t},\n\t\t\t\t\tnamespaceRenameRefusal: postgresNamespaceRenameRefusal,\n\t\t\t\t\trenameNamespaceCall: (rename) => {\n\t\t\t\t\t\tif (options.fromContract === null) throw new InternalError(\"A namespace rename is planned only from an origin contract\");\n\t\t\t\t\t\treturn new RenameSchemaCall(resolveDdlSchemaForNamespaceStorage(options.fromContract.storage, rename.from), ddlSchemaOf(rename.to));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trenameTableCall: (rename) => postgresTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => postgresColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call)\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\n\t\t});\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n};\n/** Whether `path` lies under `ancestor`: a dropped table's policies go with it. */\nfunction isWithin(path, ancestor) {\n\treturn path.length > ancestor.length && ancestor.every((segment, index) => path[index] === segment);\n}\n/**\n* The DDL schemas in which the origin contract declares tables; none without an origin contract.\n* A namespace with no tables, such as the `public` the target always adds, owns nothing.\n*/\nfunction originSchemaNames(fromContract) {\n\tif (fromContract === null) return [];\n\treturn Object.entries(fromContract.storage.namespaces).filter(([namespaceId, namespace]) => namespaceId !== UNBOUND_NAMESPACE_ID && Object.keys(namespace.entries.table ?? {}).length > 0).map(([namespaceId]) => resolveDdlSchemaForNamespaceStorage(fromContract.storage, namespaceId));\n}\n/** The extensions the origin contract declares, in any namespace; none without an origin contract. */\nfunction originExtensionNames(fromContract) {\n\tif (fromContract === null) return [];\n\treturn Object.values(fromContract.storage.namespaces).flatMap((namespace) => Object.keys(namespace.entries[\"extension\"] ?? {}));\n}\n/**\n* The namespaces the destination declares and the origin does not, other than `public` and those a\n* statement renames a namespace to: the new names a rename of a removed namespace may give it.\n*/\nfunction addedNamespaceIds(options) {\n\tconst { fromContract } = options;\n\tif (fromContract === null) return [];\n\tconst renamedTo = new Set(options.statements.flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"namespace\" ? [statement.to] : []));\n\treturn Object.keys(options.contract.storage.namespaces).filter((namespaceId) => namespaceId !== UNBOUND_NAMESPACE_ID && namespaceId !== \"public\" && !renamedTo.has(namespaceId) && !Object.hasOwn(fromContract.storage.namespaces, namespaceId));\n}\n/** Every DDL schema the contract declares, with or without tables. */\nfunction declaredSchemaNames(contract) {\n\treturn new Set(Object.keys(contract.storage.namespaces).filter((namespaceId) => namespaceId !== UNBOUND_NAMESPACE_ID).map((namespaceId) => resolveDdlSchemaForNamespaceStorage(contract.storage, namespaceId)));\n}\n/**\n* The live schemas the origin contract declares and the destination does not: each is dropped,\n* its tables first, each table a data-loss question.\n*/\nfunction removedNamespaceSchemas(options, schema) {\n\tconst destination = declaredSchemaNames(options.contract);\n\treturn originSchemaNames(options.fromContract).filter((schemaName) => schemaName !== \"public\" && !destination.has(schemaName) && schema.namespaces[schemaName] !== void 0);\n}\n/**\n* The issue a schema of the origin contract raises for itself when the destination declares no\n* tables there, which would cover the issues of its tables: they are kept instead, so each table is\n* dropped and asked about on its own, and a removed schema is dropped after them.\n*/\nfunction isOriginNamespaceIssue(issue, originSchemas) {\n\tconst node = issueNode(issue);\n\treturn node !== void 0 && node.nodeKind === PostgresSchemaNodeKind.namespace && originSchemas.includes(issue.path[1] ?? \"\");\n}\n/** A removed schema that stays because another contract space declares it. */\nfunction keptSchema(options, schemaName) {\n\tif (options.fromContract === null) return true;\n\tconst namespaceId = resolveNamespaceIdForDdlSchema(options.fromContract, schemaName);\n\treturn otherSpaceDeclaring({\n\t\toracle: options.ownership,\n\t\tspaceId: options.spaceId\n\t}, namespaceId) !== void 0;\n}\nfunction dropRemovedSchemasStrategy(schemaNames) {\n\treturn (issues) => schemaNames.length === 0 ? { kind: \"no_match\" } : {\n\t\tkind: \"match\",\n\t\tissues,\n\t\tcalls: schemaNames.map((name) => new DropSchemaCall(name))\n\t};\n}\n/**\n* Why a namespace cannot be renamed: `public` is the default schema Prisma owns and Postgres puts\n* on every search path, and a schema another contract space declares would be renamed for it too.\n*/\nfunction postgresNamespaceRenameRefusal(rename) {\n\tconst reason = `\"${DEFAULT_NAMESPACE_ID}\" is the default schema of every Postgres database`;\n\tif (rename.from === \"public\") return {\n\t\treason,\n\t\tfix: `Prisma owns schema \"${rename.from}\", and Postgres puts it on every search path, so a migration does not rename it. Move each model to the new namespace with --rename <Model>:${rename.to}.<Model> instead.`\n\t};\n\tif (rename.to === \"public\") return {\n\t\treason,\n\t\tfix: `Every Postgres database already has schema \"${rename.to}\", so no schema can be renamed to it. Move each model with --rename ${rename.from}.<Model>:<Model> instead.`\n\t};\n}\n/**\n* A diff issue whose node is an RLS policy — the structural half of the one\n* combined tree diff, routed to `planPostgresSchemaDiff` instead of\n* `planIssues`.\n*/\nfunction isPolicyDiffIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && PostgresPolicySchemaNode.is(node);\n}\n/**\n* Postgres refuses these statements while a policy uses the object they touch:\n* - dropping a column (2BP01) or changing its type (0A000);\n* - dropping a table that a policy on another table uses (2BP01); a table's own policies go with it;\n* - dropping a native enum type (2BP01);\n* - a destructive codec type operation (a `RawSqlCall` on a type), such as dropping or rebuilding\n* the type (2BP01) or changing a composite type's attribute type (0A000). Additive and widening\n* type operations, such as adding an enum value or renaming the type, go through.\n*\n* So every policy drop moves to just before the first structural call that a policy can block.\n* Without such a call, the policy calls keep their place after the structural calls.\n*/\nfunction movePolicyDropsBeforeBlockedDdl(structural, policyCalls) {\n\tconst firstBlockable = structural.findIndex(policyCanBlock);\n\tif (firstBlockable === -1) return {\n\t\tstructural,\n\t\tpolicyCalls\n\t};\n\tconst isPolicyDrop = (call) => call instanceof DropPostgresRlsPolicyCall;\n\treturn {\n\t\tstructural: [\n\t\t\t...structural.slice(0, firstBlockable),\n\t\t\t...policyCalls.filter(isPolicyDrop),\n\t\t\t...structural.slice(firstBlockable)\n\t\t],\n\t\tpolicyCalls: policyCalls.filter((call) => !isPolicyDrop(call))\n\t};\n}\nfunction policyCanBlock(call) {\n\tif (call instanceof RawSqlCall) return call.operationClass === \"destructive\" && call.op.target.details?.objectType === \"type\";\n\treturn call instanceof DropColumnCall || call instanceof AlterColumnTypeCall || call instanceof DropTableCall || call instanceof DropNativeEnumTypeCall;\n}\n/**\n* Drops a `not-expected` issue when it is a whole extra storage entity (a table\n* or a native enum) that some space in the composition owns. Each such node\n* yields its own storage coordinate (see {@link postgresNodeStorageCoordinate}),\n* so `declaresEntity` answers over the whole composition on one uniform\n* coordinate: a positive answer means a sibling owns this entity here — leave\n* it; a negative answer means a genuine orphan — drop it. A node with no storage\n* coordinate (a namespace, or a deeper column/constraint drift on an owned\n* table) is this space's own and is always kept. No oracle ⇒ keep everything.\n*/\n/**\n* The namespace a live schema stands for: the destination's, or, for a schema only the origin\n* declares, such as one the destination removed, the origin's.\n*/\nfunction namespaceIdOfSchema(options, ddlSchemaName) {\n\tconst namespaceId = resolveNamespaceIdForDdlSchema(options.contract, ddlSchemaName);\n\tif (namespaceId !== UNBOUND_NAMESPACE_ID || ddlSchemaName === \"public\" || options.fromContract === null) return namespaceId;\n\treturn resolveNamespaceIdForDdlSchema(options.fromContract, ddlSchemaName);\n}\nfunction retainUnownedExtras(issues, ownership, namespaceIdOf) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0) return true;\n\t\tconst coordinate = postgresNodeStorageCoordinate(node);\n\t\tif (coordinate === void 0) return true;\n\t\tif (PostgresExtensionSchemaNode.is(node)) {\n\t\t\tif (ownership.declaresEntity({\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\t\t...coordinate\n\t\t\t})) return false;\n\t\t\tif (node.location.kind === \"searchPath\") return true;\n\t\t\treturn !ownership.declaresEntity({\n\t\t\t\tnamespaceId: namespaceIdOf(node.location.schemaName),\n\t\t\t\t...coordinate\n\t\t\t});\n\t\t}\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tif (ddlSchemaName === void 0) return true;\n\t\treturn !ownership.declaresEntity({\n\t\t\tnamespaceId: namespaceIdOf(ddlSchemaName),\n\t\t\t...coordinate\n\t\t});\n\t});\n}\n/**\n* Refuses each extension this contract declares in a named namespace that another contract space declares in the unbound namespace: an extension is declared once, and the pack that declares it installs it.\n*/\nfunction extensionsDeclaredByPacks(options) {\n\tconst { ownership } = options;\n\tif (ownership === void 0) return [];\n\treturn Object.values(options.contract.storage.namespaces).flatMap((namespace) => namespace.id === UNBOUND_NAMESPACE_ID ? [] : Object.keys(namespace.entries[\"extension\"] ?? {}).filter((name) => ownership.declaresEntity({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"extension\",\n\t\tentityName: name\n\t})).map((name) => ({\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Extension \"${name}\" is declared in namespace \"${namespace.id}\" by this contract, and an extension pack declares it in namespace \"${UNBOUND_PSL_NAMESPACE_NAME}\".`,\n\t\twhy: \"Remove this declaration from the contract; the pack installs the extension.\"\n\t})));\n}\n/**\n* Returns the one namespace node the relational strategy layer probes for\n* live-table existence and reads codec-hook context off — the namespace\n* matching the planner's resolved schema name, or the first namespace when\n* none matches. `undefined` when the tree has no namespaces, so the strategy\n* context uses its empty-schema default.\n*\n* The relational strategies key tables by bare name, so they can only probe one\n* namespace at a time; probing across every namespace at once is future work.\n*\n* Returns the real `PostgresNamespaceSchemaNode` reference rather than a\n* projection: `storageTypePlanCallStrategy` hands this same value to codec\n* `planTypeOperations` hooks as `schema`, and hooks read the Postgres-specific\n* `nativeEnums` field off it (via `PostgresNamespaceSchemaNode.is`) to decide\n* whether a native enum type already exists — a projection that only copies\n* `tables` would silently drop that signal. `StrategyContext.schema`'s\n* declared type (`SqlSchemaIR`, shared with SQLite's flat shape) doesn't\n* capture this, so the return is `blindCast` the same way `namespaceSchemaNodes`\n* in the family's relational walk already treats a namespace node as a\n* structurally-`SqlSchemaIR`-shaped value.\n*/\nfunction relationalNamespaceNode(schema, schemaName) {\n\tconst namespaceNodes = Object.values(schema.namespaces);\n\tconst namespaceNode = namespaceNodes.find((node) => node.schemaName === schemaName) ?? namespaceNodes[0];\n\tif (namespaceNode === void 0) return void 0;\n\treturn blindCast(namespaceNode);\n}\n/**\n* Grades a {@link PolicyReplacement} as one unit against the table's\n* control policy, BEFORE the pair becomes calls or a conflict. This runs\n* ahead of `partitionCallsByControlPolicy`, which later re-grades the\n* surviving calls per-call — a no-op here, since only managed units\n* survive this grading.\n*\n* A replacement is deliberately STRICTER than the shared\n* `callAllowedUnderControlPolicy` rule: `tolerated` permits whole-object\n* creation, but a replacement's create is the second half of a repair of\n* an existing object, not a new object — so ANY non-managed control\n* (external, observed, tolerated) suppresses the whole unit. Drift on an\n* object the plan does not manage is reported, never repaired; the\n* suppression subject names the drifted policy (`rlsPolicy`) so the\n* report says which policy drifted, matching the conflict path's\n* `location.rlsPolicy`.\n*/\nfunction gradePolicyReplacement(replacement, contract, allowedOperationClasses) {\n\tconst subject = resolvePostgresCallControlPolicySubject(replacement.drop, contract);\n\tconst controlPolicy = governingControlPolicy(subject, contract.defaultControlPolicy);\n\tif (controlPolicy !== \"managed\") return {\n\t\tdisposition: \"suppress\",\n\t\trecord: {\n\t\t\tsubject: subject === void 0 ? void 0 : {\n\t\t\t\t...subject,\n\t\t\t\trlsPolicy: replacement.drop.policyName\n\t\t\t},\n\t\t\tpolicy: controlPolicy,\n\t\t\tfactoryName: void 0,\n\t\t\tcreatesNewObject: false\n\t\t}\n\t};\n\tif (!allowedOperationClasses.includes(\"widening\")) return {\n\t\tdisposition: \"conflict\",\n\t\tconflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)\n\t};\n\treturn { disposition: \"plan\" };\n}\n/**\n* Rebuilds the `PostgresRlsPolicy` contract entity `CreatePostgresRlsPolicyCall`\n* carries (its `renderTypeScript`/`createRlsPolicy` paths serialize the whole\n* entity, `namespaceId` included). This reconstructs rather than looking the\n* original up in the contract on purpose: the diff node's `namespaceId` is the\n* *resolved DDL schema* (set when the expected tree was built), which is the\n* value the emitted op must carry; the contract-stored entity holds the raw,\n* pre-resolution coordinate, so a lookup would change the migration output.\n*/\nfunction policyNodeToContractPolicy(node) {\n\treturn new PostgresRlsPolicy({\n\t\tnaming: namingOf(node.name, node.prefix),\n\t\ttableName: node.tableName,\n\t\tnamespaceId: node.namespaceId,\n\t\toperation: node.operation,\n\t\troles: [...node.roles],\n\t\tusing: node.using,\n\t\twithCheck: node.withCheck,\n\t\tpermissive: node.permissive\n\t});\n}\n//#endregion\nexport { recordedAccessChangesOf as i, postgresMarkedRemoval as n, postgresStoredValueCallClasses as r, createPostgresMigrationPlanner as t };\n\n//# sourceMappingURL=planner-D2T46plG.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,yBAAyB,KAAK,EAAE,SAAS;CAC9C,QAAQ;CACR,YAAY;CACZ,MAAM;AACP,EAAE,CAAC;AACH,MAAM,kBAAkB,KAAK,EAAE,SAAS;CACvC,QAAQ;CACR,YAAY;CACZ,MAAM;CACN,OAAO;AACR,EAAE,CAAC;AACH,MAAM,UAAU,UAAU,aAAa,SAA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,OAAO;EACvC,aAAa;EACb,QAAQ;GACP,SAAS,YAAY,KAAK,IAAI,KAAK,IAAI;IACtC,GAAG;IACH,WAAW,YAAY,KAAK;GAC7B;GACA,QAAQ;GACR,aAAa,KAAK;GAClB,kBAAkB;EACnB;CACD;CACA,IAAI,CAAC,wBAAwB,SAAS,UAAU,GAAG,OAAO;EACzD,aAAa;EACb,UAAU,0BAA0B,YAAY,MAAM,uBAAuB;CAC9E;CACA,OAAO,EAAE,aAAa,OAAO;AAC9B;;;;;;;;;;AAUA,SAAS,2BAA2B,MAAM;CACzC,OAAO,IAAI,kBAAkB;EAC5B,QAAQ,SAAS,KAAK,MAAM,KAAK,MAAM;EACvC,WAAW,KAAK;EAChB,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,OAAO,CAAC,GAAG,KAAK,KAAK;EACrB,OAAO,KAAK;EACZ,WAAW,KAAK;EAChB,YAAY,KAAK;CAClB,CAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as autoincrementWidthOfDataType } from "./autoincrement-widths-
|
|
1
|
+
import { n as autoincrementWidthOfDataType } from "./autoincrement-widths-BZUr8bLa-Dqtjwcf-.mjs";
|
|
2
2
|
import { dataTypeParams } from "@prisma/orm-framework/components/codec";
|
|
3
3
|
import { renderSqlTypeName, sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
|
|
4
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-ddl-builders-
|
|
4
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-ddl-builders-Blf3qKKf.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Renders the SQL type for a column in DDL context: the name its codec's data type is written
|
|
7
7
|
* with, and its parameters.
|
|
@@ -25,4 +25,4 @@ function isAutoincrement(columnDefault) {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
export { buildColumnTypeSql as t };
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=planner-ddl-builders-
|
|
28
|
+
//# sourceMappingURL=planner-ddl-builders-Blf3qKKf-BopCSwrT.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-ddl-builders-
|
|
1
|
+
{"version":3,"file":"planner-ddl-builders-Blf3qKKf-BopCSwrT.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-ddl-builders-Blf3qKKf.mjs"],"sourcesContent":["import { n as autoincrementWidthOfDataType } from \"./autoincrement-widths-BZUr8bLa.mjs\";\nimport { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { renderSqlTypeName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-ddl-builders.ts\n/**\n* Renders the SQL type for a column in DDL context: the name its codec's data type is written\n* with, and its parameters.\n*\n* @param allowPseudoTypes - When true (default), autoincrement integer columns\n* produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts\n* like ALTER COLUMN TYPE where pseudo-types are invalid.\n*/\nfunction buildColumnTypeSql(column, types, allowPseudoTypes = true) {\n\tconst dataType = sqlDataTypeOfCodec(column.codecId, types);\n\tif (allowPseudoTypes && isAutoincrement(column.default)) {\n\t\tconst width = autoincrementWidthOfDataType(dataType.id);\n\t\tif (width !== void 0) return width.serialType;\n\t}\n\tconst typeSql = renderSqlTypeName(dataType, dataTypeParams(dataType, column.typeParams));\n\treturn column.many ? `${typeSql}[]` : typeSql;\n}\nfunction isAutoincrement(columnDefault) {\n\treturn columnDefault?.kind === \"function\" && columnDefault.expression === \"autoincrement()\";\n}\n//#endregion\nexport { buildColumnTypeSql as t };\n\n//# sourceMappingURL=planner-ddl-builders-Blf3qKKf.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,mBAAmB,QAAQ,OAAO,mBAAmB,MAAM;CACnE,MAAM,WAAW,mBAAmB,OAAO,SAAS,KAAK;CACzD,IAAI,oBAAoB,gBAAgB,OAAO,OAAO,GAAG;EACxD,MAAM,QAAQ,6BAA6B,SAAS,EAAE;EACtD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACpC;CACA,MAAM,UAAU,kBAAkB,UAAU,eAAe,UAAU,OAAO,UAAU,CAAC;CACvF,OAAO,OAAO,OAAO,GAAG,QAAQ,MAAM;AACvC;AACA,SAAS,gBAAgB,eAAe;CACvC,OAAO,eAAe,SAAS,cAAc,cAAc,eAAe;AAC3E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as pgJson, B as pgTextArray, C as pgFloat8, D as pgInt8, E as pgInt4, F as pgNumeric, G as pgTimestamptz, L as pgOid, N as pgMoney, O as pgInterval, Q as pgVarchar, S as pgFloat4, T as pgInt2, U as pgTimestamp, V as pgTime, X as pgUuid, Z as pgVarbit, f as pgBool, g as pgChar, j as pgJsonb, p as pgBytea, q as pgTimetz, u as pgBit, v as pgDate, z as pgText } from "./data-types-
|
|
1
|
+
import { A as pgJson, B as pgTextArray, C as pgFloat8, D as pgInt8, E as pgInt4, F as pgNumeric, G as pgTimestamptz, L as pgOid, N as pgMoney, O as pgInterval, Q as pgVarchar, S as pgFloat4, T as pgInt2, U as pgTimestamp, V as pgTime, X as pgUuid, Z as pgVarbit, f as pgBool, g as pgChar, j as pgJsonb, p as pgBytea, q as pgTimetz, u as pgBit, v as pgDate, z as pgText } from "./data-types-DgYRia-g-B_BFlAC3.mjs";
|
|
2
2
|
import { sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
|
|
3
3
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
4
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-identity-values-
|
|
4
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-identity-values-CX3J2pLA.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
|
|
7
7
|
* Checks codec hooks first (extensions can provide type-specific identity values),
|
|
@@ -69,4 +69,4 @@ function buildBitIdentityValue(typeParams) {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
|
|
71
71
|
|
|
72
|
-
//# sourceMappingURL=planner-identity-values-
|
|
72
|
+
//# sourceMappingURL=planner-identity-values-CX3J2pLA-CjCpOnue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-identity-values-
|
|
1
|
+
{"version":3,"file":"planner-identity-values-CX3J2pLA-CjCpOnue.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-identity-values-CX3J2pLA.mjs"],"sourcesContent":["import { A as pgText, E as pgNumeric, H as pgVarbit, I as pgTimestamptz, M as pgTime, O as pgOid, P as pgTimestamp, R as pgTimetz, S as pgJsonb, U as pgVarchar, V as pgUuid, _ as pgInt2, b as pgInterval, c as pgChar, h as pgFloat8, i as pgBit, j as pgTextArray, m as pgFloat4, o as pgBool, s as pgBytea, u as pgDate, v as pgInt4, w as pgMoney, x as pgJson, y as pgInt8 } from \"./data-types-DgYRia-g.mjs\";\nimport { sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-identity-values.ts\n/**\n* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.\n* Checks codec hooks first (extensions can provide type-specific identity values),\n* then falls back to the built-in map, keyed by the data type the column's codec represents.\n*/\nfunction resolveIdentityValue(column, codecHooks, types) {\n\tconst { codecId, typeParams } = column;\n\tif (column.many) return \"'{}'\";\n\tconst dataType = sqlDataTypeOfCodec(codecId, types).id;\n\tconst hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t});\n\tif (hookDefault !== void 0) return hookDefault;\n\treturn buildBuiltinIdentityValue(dataType, typeParams);\n}\nconst IDENTITY_VALUES = /* @__PURE__ */ new Map([\n\t[pgText.id, \"''\"],\n\t[pgChar.id, \"''\"],\n\t[pgVarchar.id, \"''\"],\n\t[pgInt2.id, \"0\"],\n\t[pgInt4.id, \"0\"],\n\t[pgInt8.id, \"0\"],\n\t[pgFloat4.id, \"0\"],\n\t[pgFloat8.id, \"0\"],\n\t[pgNumeric.id, \"0\"],\n\t[pgOid.id, \"0\"],\n\t[pgMoney.id, \"'0'\"],\n\t[pgBool.id, \"false\"],\n\t[pgUuid.id, \"'00000000-0000-0000-0000-000000000000'\"],\n\t[pgJson.id, \"'{}'::json\"],\n\t[pgJsonb.id, \"'{}'::jsonb\"],\n\t[pgDate.id, \"'epoch'\"],\n\t[pgTimestamp.id, \"'epoch'\"],\n\t[pgTimestamptz.id, \"'epoch'\"],\n\t[pgTime.id, \"'00:00:00'\"],\n\t[pgTimetz.id, \"'00:00:00+00'\"],\n\t[pgInterval.id, \"'0'\"],\n\t[pgBytea.id, \"''::bytea\"],\n\t[pgVarbit.id, \"B''\"],\n\t[pgTextArray.id, \"'{}'\"]\n]);\n/**\n* Returns the built-in identity value (monoid neutral element) as a SQL literal for the given\n* data type — e.g. 0 for integers, '' for text, false for booleans.\n*\n* This is the planner's fallback when no codec hook provides a type-specific identity value.\n*\n* Returns null for other types (for example enums and extension-owned types without a\n* hook), which causes the planner to fall back to the empty-table precheck.\n*\n* @internal Exported for testing only.\n*/\nfunction buildBuiltinIdentityValue(dataType, typeParams) {\n\tif (dataType === pgBit.id) return buildBitIdentityValue(typeParams);\n\treturn IDENTITY_VALUES.get(dataType) ?? null;\n}\nfunction buildBitIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (length === void 0) return \"B'0'\";\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `B'${\"0\".repeat(length)}'`;\n}\n//#endregion\nexport { resolveIdentityValue as n, buildBuiltinIdentityValue as t };\n\n//# sourceMappingURL=planner-identity-values-CX3J2pLA.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,QAAQ,YAAY,OAAO;CACxD,MAAM,EAAE,SAAS,eAAe;C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5B,IAAI,WAAW,KAAK,GAAG,OAAO;CAC9B,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,UAAU,MAAM,KAAK,UAAU,GAAG,OAAO;CACnF,OAAO,KAAK,IAAI,OAAO,MAAM,EAAE;AAChC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
2
|
-
import { t as renderOps } from "./render-ops-
|
|
3
|
-
import { t as renderCallsToTypeScript } from "./render-typescript-
|
|
4
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-
|
|
1
|
+
import { t as PostgresMigration } from "./postgres-migration-DEa-g6j1-CoG3QOV3.mjs";
|
|
2
|
+
import { t as renderOps } from "./render-ops-Bl1R5cz0-CFshOROt.mjs";
|
|
3
|
+
import { t as renderCallsToTypeScript } from "./render-typescript-B-Igkk6D-CQ-WlBmb.mjs";
|
|
4
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-BLKk9Vaz.mjs
|
|
5
5
|
var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
|
|
6
6
|
#calls;
|
|
7
7
|
#meta;
|
|
@@ -32,16 +32,16 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
|
|
|
32
32
|
get spaceId() {
|
|
33
33
|
return this.#spaceId;
|
|
34
34
|
}
|
|
35
|
-
renderTypeScript(
|
|
35
|
+
renderTypeScript(migrationModule) {
|
|
36
36
|
return renderCallsToTypeScript(this.#calls, {
|
|
37
37
|
from: this.#meta.from,
|
|
38
38
|
to: this.#meta.to,
|
|
39
39
|
snapshotsImportPath: this.#snapshotsImportPath,
|
|
40
|
-
|
|
40
|
+
migrationModule
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
//#endregion
|
|
45
45
|
export { TypeScriptRenderablePostgresMigration as t };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=planner-produced-postgres-migration-
|
|
47
|
+
//# sourceMappingURL=planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-BLKk9Vaz.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DEa-g6j1.mjs\";\nimport { t as renderOps } from \"./render-ops-Bl1R5cz0.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-B-Igkk6D.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(migrationModule) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tmigrationModule\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BLKk9Vaz.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,iBAAiB;EACjC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.mjs";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as PostgresMigration } from "./postgres-migration-
|
|
1
|
+
import { n as PostgresPlanTargetDetails } from "./planner-target-details-DywkQKS4-lZEm-EiF.mjs";
|
|
2
|
+
import { t as PostgresMigration } from "./postgres-migration-6nN7HQlZ-Ca0thLBy.mjs";
|
|
3
3
|
import { MigrationPlanWithAuthoringSurface, OpFactoryCall } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
5
5
|
import { MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
6
|
-
import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
|
|
7
6
|
import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
|
|
8
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-
|
|
7
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-Jizp3q0s.d.mts
|
|
9
8
|
//#region src/core/migrations/planner-produced-postgres-migration.d.ts
|
|
10
9
|
declare class TypeScriptRenderablePostgresMigration extends PostgresMigration implements MigrationPlanWithAuthoringSurface {
|
|
11
10
|
#private;
|
|
@@ -18,8 +17,8 @@ declare class TypeScriptRenderablePostgresMigration extends PostgresMigration im
|
|
|
18
17
|
* the right space when executing the plan.
|
|
19
18
|
*/
|
|
20
19
|
get spaceId(): string;
|
|
21
|
-
renderTypeScript(
|
|
20
|
+
renderTypeScript(migrationModule: string): string;
|
|
22
21
|
}
|
|
23
22
|
//#endregion
|
|
24
23
|
export { TypeScriptRenderablePostgresMigration as t };
|
|
25
|
-
//# sourceMappingURL=planner-produced-postgres-migration-
|
|
24
|
+
//# sourceMappingURL=planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-produced-postgres-migration-Jizp3q0s-D_Sq7rld.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-Jizp3q0s.d.mts"],"mappings":";;;;;;;;cAOc,8CAA8C,6BAA6B;;EAEvF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,UAAU;MACtH,wBAAwB,0BAA0B,6BAA6B,QAAQ,0BAA0B;EACrH,YAAY;;;;;;MAMR;EACJ,iBAAiB"}
|
package/dist/{planner-sql-checks-BOdYkh9L-hXxekxJX.mjs → planner-sql-checks-CzxowQml-moHPNh20.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as postgresError } from "./errors-
|
|
2
|
-
import { v as postgresCreateNamespace } from "./postgres-schema-
|
|
3
|
-
import { r as autoincrementWidthOfPseudoType } from "./autoincrement-widths-
|
|
1
|
+
import { u as postgresError } from "./errors-DxWL0CMX-BQe7Wfvt.mjs";
|
|
2
|
+
import { v as postgresCreateNamespace } from "./postgres-schema-CIfq1AjC-CGiMjtSX.mjs";
|
|
3
|
+
import { r as autoincrementWidthOfPseudoType } from "./autoincrement-widths-BZUr8bLa-Dqtjwcf-.mjs";
|
|
4
4
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from "@prisma/orm-family-sql/contract/data-type";
|
|
6
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-sql-checks-
|
|
6
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-sql-checks-CzxowQml.mjs
|
|
7
7
|
/**
|
|
8
8
|
* String-keyed entry points the migration ops use to render
|
|
9
9
|
* schema-qualified DDL and catalog checks. The `schema` argument is
|
|
@@ -157,4 +157,4 @@ function resolvedByKind(base, dataTypes) {
|
|
|
157
157
|
//#endregion
|
|
158
158
|
export { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };
|
|
159
159
|
|
|
160
|
-
//# sourceMappingURL=planner-sql-checks-
|
|
160
|
+
//# sourceMappingURL=planner-sql-checks-CzxowQml-moHPNh20.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-sql-checks-BOdYkh9L-hXxekxJX.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-sql-checks-BOdYkh9L.mjs"],"sourcesContent":["import { u as postgresError } from \"./errors-C4-Dp3gI.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-zd_p5Lg2.mjs\";\nimport { r as autoincrementWidthOfPseudoType } from \"./autoincrement-widths-PwZcc5Co.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** The data types the components of a stack register. */\nfunction stackDataTypes(frameworkComponents) {\n\treturn assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);\n}\nconst ARRAY_SUFFIX = /^(.*?)(?:\\s*\\[\\s*\\])+$/s;\nconst QUOTED_SEGMENT = /^\"((?:[^\"]|\"\")+)\"/;\n/** The segments of a name written as one or two double-quoted identifiers, `\"Mood\"` or `\"app\".\"status\"`. */\nfunction quotedName(text) {\n\tconst segments = [];\n\tlet rest = text;\n\twhile (rest !== \"\") {\n\t\tconst match = QUOTED_SEGMENT.exec(rest);\n\t\tif (match === null) return void 0;\n\t\tsegments.push((match[1] ?? \"\").replaceAll(\"\\\"\\\"\", \"\\\"\"));\n\t\trest = rest.slice(match[0].length);\n\t\tif (rest.startsWith(\".\")) rest = rest.slice(1);\n\t\telse if (rest !== \"\") return void 0;\n\t}\n\treturn segments.length === 1 || segments.length === 2 ? segments : void 0;\n}\nfunction columnTypeUnreadable(type, where, reason) {\n\tthrow postgresError(\"MIGRATION.COLUMN_TYPE_UNREADABLE\", `${where}: ${reason}`, {\n\t\twhy: \"A column type change checks afterwards that the column has the new type, and finds the type through the data types the configured stack registers.\",\n\t\tfix: \"Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \\\"Mood\\\". If the type comes from an extension, add that extension to the configuration.\",\n\t\tmeta: {\n\t\t\ttype,\n\t\t\twhere\n\t\t}\n\t});\n}\n/** How a postcheck's description names the type it checks: catalog text in double quotes, and an enum by its quoted name, which carries its own quotes. */\nfunction columnTypeCheckText(check) {\n\treturn check.kind === \"catalog-text\" ? `\"${check.text}\"` : `${check.typeName}${check.many ? \"[]\" : \"\"}`;\n}\nfunction rawTypeCheckText(type, where) {\n\tconst trimmed = type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst suffix = array === null ? \"\" : \"[]\";\n\tconst refused = checkRawTypeText(base);\n\treturn refused === void 0 ? `${base}${suffix}` : columnTypeUnreadable(type, where, `the raw type \"${type}\" is refused: ${refused}`);\n}\n/**\n* The postcheck for a column altered to `type`, written as a migration writes it: for a raw type, which the call marks with `raw` (ADR 273), the text as written, compared with the catalog text; otherwise read through the one data type of `dataTypes` that reads it. The planner and the `alterColumnType` facade both check the alter with it, so re-running a migration reproduces its operations. `where` names the call in the error a type no data type reads raises.\n*/\nfunction alterTypeCheck(type, dataTypes, where, raw = false) {\n\tif (raw) return {\n\t\tkind: \"catalog-text\",\n\t\ttext: rawTypeCheckText(type, where)\n\t};\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : columnTypeUnreadable(type, where, read.reason);\n}\n/** The postcheck for a column of `type`, read as {@link alterTypeCheck} reads it, or `undefined` when the stack's data types do not read `type`, as for a raw column. */\nfunction columnTypeCheckIfReadable(type, dataTypes) {\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : void 0;\n}\n/**\n* The column type a migration's `type` names, as {@link alterTypeCheck} reads it: the one data type of `dataTypes` that reads it, or for an enum named by its quoted name, the type that claims enums, with the name as introspection would report it. `undefined` when no data type, or more than one, reads it.\n*/\nfunction writtenColumnType(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\treturn read.ok ? {\n\t\tstoredType: read.type,\n\t\tstoredTypeParams: read.typeParams,\n\t\tmany: read.many\n\t} : void 0;\n}\nfunction readWrittenType(type, dataTypes) {\n\tconst trimmed = autoincrementWidthOfPseudoType(type)?.sequenceType ?? type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tconst byText = resolveWrittenSqlTypes(base, sqlTypes);\n\tif (byText.length > 1) return {\n\t\tok: false,\n\t\treason: `more than one data type of the configured stack reads the type \"${type}\", as ${byText.map((resolved) => resolved.dataType.id).join(\" and \")}`\n\t};\n\tconst [written] = byText;\n\tif (written !== void 0) return {\n\t\tok: true,\n\t\ttype: written.dataType,\n\t\ttypeParams: written.typeParams,\n\t\twrittenTypeParams: written.writtenTypeParams,\n\t\tmany: array !== null\n\t};\n\tconst byKind = resolvedByKind(base, sqlTypes);\n\tif (byKind === void 0) return {\n\t\tok: false,\n\t\treason: `no data type of the configured stack reads the type \"${type}\"`\n\t};\n\treturn {\n\t\tok: true,\n\t\ttype: byKind.dataType,\n\t\ttypeParams: byKind.typeParams,\n\t\twrittenTypeParams: byKind.typeParams,\n\t\tmany: array !== null\n\t};\n}\nfunction readColumnTypeCheck(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\tif (!read.ok) return read;\n\tif (read.type.sql.claimsKind !== void 0) return {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"identity\",\n\t\t\ttypeName: renderSqlTypeName(read.type, read.typeParams),\n\t\t\tmany: read.many\n\t\t}\n\t};\n\treturn {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"catalog-text\",\n\t\t\ttext: `${renderSqlCatalogText(read.type, read.writtenTypeParams)}${read.many ? \"[]\" : \"\"}`\n\t\t}\n\t};\n}\n/** The type a quoted name names, read as the one data type that claims a kind reads a reported type of that kind. */\nfunction resolvedByKind(base, dataTypes) {\n\tconst name = quotedName(base);\n\tconst kinds = dataTypes.flatMap(({ sql }) => sql.claimsKind ?? []);\n\tconst [kind] = kinds;\n\tif (name === void 0 || kind === void 0 || kinds.length > 1) return void 0;\n\tconst [schema, typeName] = name.length === 2 ? name : [void 0, name[0]];\n\treturn resolveReportedSqlType({\n\t\ttext: base,\n\t\tkind,\n\t\tschema,\n\t\tname: typeName\n\t}, dataTypes);\n}\n//#endregion\nexport { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };\n\n//# sourceMappingURL=planner-sql-checks-BOdYkh9L.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,SAAS,eAAe,qBAAqB;CAC5C,OAAO,kBAAkB,mBAAmB,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI;AAC9E;AACA,MAAM,eAAe;AACrB,MAAM,iBAAiB;;AAEvB,SAAS,WAAW,MAAM;CACzB,MAAM,WAAW,CAAC;CAClB,IAAI,OAAO;CACX,OAAO,SAAS,IAAI;EACnB,MAAM,QAAQ,eAAe,KAAK,IAAI;EACtC,IAAI,UAAU,MAAM,OAAO,KAAK;EAChC,SAAS,MAAM,MAAM,MAAM,GAAA,CAAI,WAAW,QAAQ,IAAI,CAAC;EACvD,OAAO,KAAK,MAAM,MAAM,EAAE,CAAC,MAAM;EACjC,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO,KAAK,MAAM,CAAC;OACxC,IAAI,SAAS,IAAI,OAAO,KAAK;CACnC;CACA,OAAO,SAAS,WAAW,KAAK,SAAS,WAAW,IAAI,WAAW,KAAK;AACzE;AACA,SAAS,qBAAqB,MAAM,OAAO,QAAQ;CAClD,MAAM,cAAc,oCAAoC,GAAG,MAAM,IAAI,UAAU;EAC9E,KAAK;EACL,KAAK;EACL,MAAM;G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AI,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE;CACtE,OAAO,uBAAuB;EAC7B,MAAM;EACN;EACA;EACA,MAAM;CACP,GAAG,SAAS;AACb"}
|
|
1
|
+
{"version":3,"file":"planner-sql-checks-CzxowQml-moHPNh20.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-sql-checks-CzxowQml.mjs"],"sourcesContent":["import { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-CIfq1AjC.mjs\";\nimport { r as autoincrementWidthOfPseudoType } from \"./autoincrement-widths-BZUr8bLa.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** The data types the components of a stack register. */\nfunction stackDataTypes(frameworkComponents) {\n\treturn assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);\n}\nconst ARRAY_SUFFIX = /^(.*?)(?:\\s*\\[\\s*\\])+$/s;\nconst QUOTED_SEGMENT = /^\"((?:[^\"]|\"\")+)\"/;\n/** The segments of a name written as one or two double-quoted identifiers, `\"Mood\"` or `\"app\".\"status\"`. */\nfunction quotedName(text) {\n\tconst segments = [];\n\tlet rest = text;\n\twhile (rest !== \"\") {\n\t\tconst match = QUOTED_SEGMENT.exec(rest);\n\t\tif (match === null) return void 0;\n\t\tsegments.push((match[1] ?? \"\").replaceAll(\"\\\"\\\"\", \"\\\"\"));\n\t\trest = rest.slice(match[0].length);\n\t\tif (rest.startsWith(\".\")) rest = rest.slice(1);\n\t\telse if (rest !== \"\") return void 0;\n\t}\n\treturn segments.length === 1 || segments.length === 2 ? segments : void 0;\n}\nfunction columnTypeUnreadable(type, where, reason) {\n\tthrow postgresError(\"MIGRATION.COLUMN_TYPE_UNREADABLE\", `${where}: ${reason}`, {\n\t\twhy: \"A column type change checks afterwards that the column has the new type, and finds the type through the data types the configured stack registers.\",\n\t\tfix: \"Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \\\"Mood\\\". If the type comes from an extension, add that extension to the configuration.\",\n\t\tmeta: {\n\t\t\ttype,\n\t\t\twhere\n\t\t}\n\t});\n}\n/** How a postcheck's description names the type it checks: catalog text in double quotes, and an enum by its quoted name, which carries its own quotes. */\nfunction columnTypeCheckText(check) {\n\treturn check.kind === \"catalog-text\" ? `\"${check.text}\"` : `${check.typeName}${check.many ? \"[]\" : \"\"}`;\n}\nfunction rawTypeCheckText(type, where) {\n\tconst trimmed = type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst suffix = array === null ? \"\" : \"[]\";\n\tconst refused = checkRawTypeText(base);\n\treturn refused === void 0 ? `${base}${suffix}` : columnTypeUnreadable(type, where, `the raw type \"${type}\" is refused: ${refused}`);\n}\n/**\n* The postcheck for a column altered to `type`, written as a migration writes it: for a raw type, which the call marks with `raw` (ADR 273), the text as written, compared with the catalog text; otherwise read through the one data type of `dataTypes` that reads it. The planner and the `alterColumnType` facade both check the alter with it, so re-running a migration reproduces its operations. `where` names the call in the error a type no data type reads raises.\n*/\nfunction alterTypeCheck(type, dataTypes, where, raw = false) {\n\tif (raw) return {\n\t\tkind: \"catalog-text\",\n\t\ttext: rawTypeCheckText(type, where)\n\t};\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : columnTypeUnreadable(type, where, read.reason);\n}\n/** The postcheck for a column of `type`, read as {@link alterTypeCheck} reads it, or `undefined` when the stack's data types do not read `type`, as for a raw column. */\nfunction columnTypeCheckIfReadable(type, dataTypes) {\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : void 0;\n}\n/**\n* The column type a migration's `type` names, as {@link alterTypeCheck} reads it: the one data type of `dataTypes` that reads it, or for an enum named by its quoted name, the type that claims enums, with the name as introspection would report it. `undefined` when no data type, or more than one, reads it.\n*/\nfunction writtenColumnType(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\treturn read.ok ? {\n\t\tstoredType: read.type,\n\t\tstoredTypeParams: read.typeParams,\n\t\tmany: read.many\n\t} : void 0;\n}\nfunction readWrittenType(type, dataTypes) {\n\tconst trimmed = autoincrementWidthOfPseudoType(type)?.sequenceType ?? type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tconst byText = resolveWrittenSqlTypes(base, sqlTypes);\n\tif (byText.length > 1) return {\n\t\tok: false,\n\t\treason: `more than one data type of the configured stack reads the type \"${type}\", as ${byText.map((resolved) => resolved.dataType.id).join(\" and \")}`\n\t};\n\tconst [written] = byText;\n\tif (written !== void 0) return {\n\t\tok: true,\n\t\ttype: written.dataType,\n\t\ttypeParams: written.typeParams,\n\t\twrittenTypeParams: written.writtenTypeParams,\n\t\tmany: array !== null\n\t};\n\tconst byKind = resolvedByKind(base, sqlTypes);\n\tif (byKind === void 0) return {\n\t\tok: false,\n\t\treason: `no data type of the configured stack reads the type \"${type}\"`\n\t};\n\treturn {\n\t\tok: true,\n\t\ttype: byKind.dataType,\n\t\ttypeParams: byKind.typeParams,\n\t\twrittenTypeParams: byKind.typeParams,\n\t\tmany: array !== null\n\t};\n}\nfunction readColumnTypeCheck(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\tif (!read.ok) return read;\n\tif (read.type.sql.claimsKind !== void 0) return {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"identity\",\n\t\t\ttypeName: renderSqlTypeName(read.type, read.typeParams),\n\t\t\tmany: read.many\n\t\t}\n\t};\n\treturn {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"catalog-text\",\n\t\t\ttext: `${renderSqlCatalogText(read.type, read.writtenTypeParams)}${read.many ? \"[]\" : \"\"}`\n\t\t}\n\t};\n}\n/** The type a quoted name names, read as the one data type that claims a kind reads a reported type of that kind. */\nfunction resolvedByKind(base, dataTypes) {\n\tconst name = quotedName(base);\n\tconst kinds = dataTypes.flatMap(({ sql }) => sql.claimsKind ?? []);\n\tconst [kind] = kinds;\n\tif (name === void 0 || kind === void 0 || kinds.length > 1) return void 0;\n\tconst [schema, typeName] = name.length === 2 ? name : [void 0, name[0]];\n\treturn resolveReportedSqlType({\n\t\ttext: base,\n\t\tkind,\n\t\tschema,\n\t\tname: typeName\n\t}, dataTypes);\n}\n//#endregion\nexport { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };\n\n//# sourceMappingURL=planner-sql-checks-CzxowQml.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,SAAS,eAAe,qBAAqB;CAC5C,OAAO,kBAAkB,mBAAmB,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI;AAC9E;AACA,MAAM,eAAe;AACrB,MAAM,iBAAiB;;AAEvB,SAAS,WAAW,MAAM;CACzB,MAAM,WAAW,CAAC;CAClB,IAAI,OA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ACJ,OAAO;GACN,MAAM;GACN,UAAU,kBAAkB,KAAK,MAAM,KAAK,UAAU;GACtD,MAAM,KAAK;EACZ;CACD;CACA,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,MAAM,GAAG,qBAAqB,KAAK,MAAM,KAAK,iBAAiB,IAAI,KAAK,OAAO,OAAO;EACvF;CACD;AACD;;AAEA,SAAS,eAAe,MAAM,WAAW;CACxC,MAAM,OAAO,WAAW,IAAI;CAC5B,MAAM,QAAQ,UAAU,SAAS,EAAE,UAAU,IAAI,cAAc,CAAC,CAAC;CACjE,MAAM,CAAC,QAAQ;CACf,IAAI,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,MAAM,SAAS,GAAG,OAAO,KAAK;CACxE,MAAM,CAAC,QAAQ,YAAY,KAAK,WAAW,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE;CACtE,OAAO,uBAAuB;EAC7B,MAAM;EACN;EACA;EACA,MAAM;CACP,GAAG,SAAS;AACb"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../../3-targets/postgres/1-target/dist/planner-target-details-
|
|
1
|
+
//#region ../../../3-targets/postgres/1-target/dist/planner-target-details-DywkQKS4.d.mts
|
|
2
2
|
//#region src/core/migrations/planner-target-details.d.ts
|
|
3
3
|
type OperationClass = 'dependency' | 'type' | 'table' | 'column' | 'primaryKey' | 'unique' | 'index' | 'foreignKey' | 'checkConstraint' | 'rlsPolicy' | 'rowLevelSecurity';
|
|
4
4
|
/** The target of an operation that names its schema: every operation except creating or dropping an extension the contract leaves to the search path. */
|
|
@@ -17,5 +17,5 @@ interface PostgresSearchPathExtensionTargetDetails {
|
|
|
17
17
|
}
|
|
18
18
|
type PostgresPlanTargetDetails = PostgresSchemaTargetDetails | PostgresSearchPathExtensionTargetDetails;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { PostgresPlanTargetDetails as t };
|
|
21
|
-
//# sourceMappingURL=planner-target-details-
|
|
20
|
+
export { PostgresPlanTargetDetails as n, OperationClass as t };
|
|
21
|
+
//# sourceMappingURL=planner-target-details-DywkQKS4-lZEm-EiF.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-target-details-DywkQKS4-lZEm-EiF.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-target-details-DywkQKS4.d.mts"],"mappings":";;KACK;;UAEK;WACC;WACA,YAAY;WACZ;WACA;;;UAGD;WACC;WACA;WACA;WACA;;KAEN,4BAA4B,8BAA8B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as codecDescriptors } from "./codecs-
|
|
2
|
-
//#region ../../../3-targets/postgres/1-target/dist/postgres-codec-traits-
|
|
1
|
+
import { s as codecDescriptors } from "./codecs-B2C2j2Un-Dc-aGN1s.mjs";
|
|
2
|
+
//#region ../../../3-targets/postgres/1-target/dist/postgres-codec-traits-YxSb5di3.mjs
|
|
3
3
|
const TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));
|
|
4
4
|
/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */
|
|
5
5
|
function postgresCodecTraitsOf(codecId) {
|
|
@@ -8,4 +8,4 @@ function postgresCodecTraitsOf(codecId) {
|
|
|
8
8
|
//#endregion
|
|
9
9
|
export { postgresCodecTraitsOf as t };
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=postgres-codec-traits-
|
|
11
|
+
//# sourceMappingURL=postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-codec-traits-
|
|
1
|
+
{"version":3,"file":"postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-codec-traits-YxSb5di3.mjs"],"sourcesContent":["import { t as codecDescriptors } from \"./codecs-B2C2j2Un.mjs\";\n//#region src/core/postgres-codec-traits.ts\nconst TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));\n/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */\nfunction postgresCodecTraitsOf(codecId) {\n\treturn TRAITS_BY_CODEC_ID.get(codecId);\n}\n//#endregion\nexport { postgresCodecTraitsOf as t };\n\n//# sourceMappingURL=postgres-codec-traits-YxSb5di3.mjs.map"],"mappings":";;AAEA,MAAM,qBAAqB,IAAI,IAAI,iBAAiB,KAAK,eAAe,CAAC,WAAW,SAAS,WAAW,MAAM,CAAC,CAAC;;AAEhH,SAAS,sBAAsB,SAAS;CACvC,OAAO,mBAAmB,IAAI,OAAO;AACtC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { T as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from "./codec-ids-2htdtS66-CJPMZv1t.mjs";
|
|
2
|
-
import { u as postgresError } from "./errors-
|
|
3
|
-
import { nt as postgresTextDataTypes, r as createPostgresBuiltinDataTypeLookup } from "./data-types-
|
|
4
|
-
import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-
|
|
5
|
-
import { a as assertFullTextIndexes } from "./full-text-index-definition-
|
|
6
|
-
import { b as roleEntityKind, g as policyEntityKind, h as nativeEnumEntityKind, p as extensionEntityKind, u as PostgresSchema, y as rlsEnablementEntityKind } from "./postgres-schema-
|
|
7
|
-
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-
|
|
8
|
-
import { n as postgresAuthoringEntityTypes } from "./authoring-
|
|
2
|
+
import { u as postgresError } from "./errors-DxWL0CMX-BQe7Wfvt.mjs";
|
|
3
|
+
import { nt as postgresTextDataTypes, r as createPostgresBuiltinDataTypeLookup } from "./data-types-DgYRia-g-B_BFlAC3.mjs";
|
|
4
|
+
import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-FvoD6sJj-ClHgHbyf.mjs";
|
|
5
|
+
import { a as assertFullTextIndexes } from "./full-text-index-definition-MMcQF3_0-wRCz2FDP.mjs";
|
|
6
|
+
import { b as roleEntityKind, g as policyEntityKind, h as nativeEnumEntityKind, p as extensionEntityKind, u as PostgresSchema, v as postgresCreateNamespace, y as rlsEnablementEntityKind } from "./postgres-schema-CIfq1AjC-CGiMjtSX.mjs";
|
|
7
|
+
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-YxSb5di3-9F5ofwnG.mjs";
|
|
8
|
+
import { n as postgresAuthoringEntityTypes } from "./authoring-4dCWsSXg-DeIEoQWg.mjs";
|
|
9
9
|
import { requiredSchemaKeys } from "@prisma/orm-framework/components/codec";
|
|
10
10
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
11
11
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
@@ -15,7 +15,7 @@ import { buildSqlSchemaQualifiedView } from "@prisma/orm-family-sql/contract/con
|
|
|
15
15
|
import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing-utils";
|
|
16
16
|
import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
|
|
17
17
|
import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
|
|
18
|
-
//#region ../../../3-targets/postgres/1-target/dist/postgres-contract-view-
|
|
18
|
+
//#region ../../../3-targets/postgres/1-target/dist/postgres-contract-view-DhDzWNCN.mjs
|
|
19
19
|
const POSTGRES_CODEC_LOOKUP = createPostgresBuiltinCodecLookup();
|
|
20
20
|
/** The context entity hydration runs in. Hydration reads stored contract JSON and never a written value, so its data types carry no authoring entries, which keeps the PSL readers out of the runtime. */
|
|
21
21
|
const POSTGRES_AUTHORING_CTX = {
|
|
@@ -106,7 +106,7 @@ var PostgresContractSerializer = class extends SqlContractSerializerBase {
|
|
|
106
106
|
if (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;
|
|
107
107
|
const valueSetSlot = entries["valueSet"];
|
|
108
108
|
const hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;
|
|
109
|
-
const schema =
|
|
109
|
+
const schema = postgresCreateNamespace({
|
|
110
110
|
id,
|
|
111
111
|
entries: {
|
|
112
112
|
...entries,
|
|
@@ -180,4 +180,4 @@ const PostgresContractView = {
|
|
|
180
180
|
//#endregion
|
|
181
181
|
export { PostgresContractView as n, PostgresContractSerializer as t };
|
|
182
182
|
|
|
183
|
-
//# sourceMappingURL=postgres-contract-view-
|
|
183
|
+
//# sourceMappingURL=postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-contract-view-DhDzWNCN.mjs"],"sourcesContent":["import { T as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { K as postgresTextDataTypes, t as createPostgresBuiltinDataTypeLookup } from \"./data-types-DgYRia-g.mjs\";\nimport { r as createPostgresBuiltinCodecLookup } from \"./codec-registry-FvoD6sJj.mjs\";\nimport { n as assertFullTextIndexes } from \"./full-text-index-definition-MMcQF3_0.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-YxSb5di3.mjs\";\nimport { a as extensionEntityKind, c as rlsEnablementEntityKind, i as postgresCreateNamespace, l as roleEntityKind, o as nativeEnumEntityKind, s as policyEntityKind, t as PostgresSchema } from \"./postgres-schema-CIfq1AjC.mjs\";\nimport { n as postgresAuthoringEntityTypes } from \"./authoring-4dCWsSXg.mjs\";\nimport { requiredSchemaKeys } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_CODEC_LOOKUP = createPostgresBuiltinCodecLookup();\n/** The context entity hydration runs in. Hydration reads stored contract JSON and never a written value, so its data types carry no authoring entries, which keeps the PSL readers out of the runtime. */\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tcodecLookup: POSTGRES_CODEC_LOOKUP,\n\tdataTypes: {\n\t\tentries: {},\n\t\tlookup: createPostgresBuiltinDataTypeLookup(),\n\t\tdataTypeOfCodec: (codecId) => POSTGRES_CODEC_LOOKUP.descriptorFor(codecId)?.dataType,\n\t\ttextDataTypes: postgresTextDataTypes\n\t},\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction requiredKeysOf(schema) {\n\tconst keys = requiredSchemaKeys(schema);\n\tif (keys === void 0) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn keys;\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\textensionEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\tconst schema = postgresCreateNamespace({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t\tfor (const table of Object.values(schema.table)) assertFullTextIndexes(table, postgresCodecTraitsOf);\n\t\treturn schema;\n\t}\n\thydrateSqlStorage(validated) {\n\t\tconst hydrated = super.hydrateSqlStorage(validated);\n\t\tassertExtensionsInOneNamespace(hydrated.storage);\n\t\treturn hydrated;\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\nfunction assertExtensionsInOneNamespace(storage) {\n\tconst namespacesByExtension = /* @__PURE__ */ new Map();\n\tfor (const namespace of Object.values(storage.namespaces)) {\n\t\tif (!(namespace instanceof PostgresSchema)) continue;\n\t\tfor (const name of Object.keys(namespace.extension)) namespacesByExtension.set(name, [...namespacesByExtension.get(name) ?? [], namespace.id]);\n\t}\n\tfor (const [name, namespaceIds] of namespacesByExtension) {\n\t\tif (namespaceIds.length < 2) continue;\n\t\tconst namespaces = [...namespaceIds].sort();\n\t\tthrow postgresError(\"CONTRACT.NAME_DUPLICATE\", `Extension \"${name}\" is declared in namespaces ${namespaces.map((id) => `\"${id}\"`).join(\" and \")}. An extension's name is unique in the database, so a contract declares it in one namespace only.`, {\n\t\t\tfix: \"Re-emit the contract from its source, which refuses one extension declared in two namespaces.\",\n\t\t\tmeta: {\n\t\t\t\tkind: \"extension\",\n\t\t\t\tname,\n\t\t\t\tnamespaces\n\t\t\t}\n\t\t});\n\t}\n}\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-DhDzWNCN.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,wBAAwB,iCAAiC;;AAE/D,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,WAAW;EACV,SAAS,CAAC;EACV,QAAQ,oCAAoC;EAC5C,kBAAkB,YAAY,sBAAsB,cAAc,OAAO,CAAC,EAAE;EAC5E,eAAe;CAChB;CACA,qBAAqB;EACpB,MAAM;EACN,KAAK;CACN;AACD;AACA,SAAS,mCAAmC,QAAQ;CACnD,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY;AAC1G;;;;;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