@prisma/orm-target-postgres 8.0.0-rc.2-dev.2 → 8.0.0-rc.20

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.
Files changed (501) hide show
  1. package/README.md +4 -6
  2. package/dist/adapter-5qylEP__.d.mts +403 -0
  3. package/dist/adapter-5qylEP__.d.mts.map +1 -0
  4. package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs → adapter-svGTIjA2-1p-Iw8D2.mjs} +24 -30
  5. package/dist/adapter-svGTIjA2-1p-Iw8D2.mjs.map +1 -0
  6. package/dist/adapter.d.mts +11 -13
  7. package/dist/adapter.mjs +7 -8
  8. package/dist/adapter__adapter.d.mts +2 -2
  9. package/dist/adapter__adapter.mjs +3 -2
  10. package/dist/adapter__column-types.d.mts +2 -2
  11. package/dist/adapter__column-types.mjs +2 -2
  12. package/dist/adapter__control.d.mts +4 -5
  13. package/dist/adapter__control.mjs +11 -423
  14. package/dist/adapter__control.mjs.map +1 -1
  15. package/dist/adapter__runtime.d.mts +1 -1
  16. package/dist/adapter__runtime.mjs +29 -19
  17. package/dist/adapter__runtime.mjs.map +1 -1
  18. package/dist/adapter__sql-renderer.d.mts +1 -1
  19. package/dist/adapter__sql-renderer.mjs +1 -1
  20. package/dist/adapter__types.d.mts +4 -3
  21. package/dist/aggregates-CEqqEg8k.d.mts +318 -0
  22. package/dist/aggregates-CEqqEg8k.d.mts.map +1 -0
  23. package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Dw-lAutX.mjs} +105 -40
  24. package/dist/aggregates-Dw-lAutX.mjs.map +1 -0
  25. package/dist/authoring-DWd5pnnV-BBX7P1wT.d.mts +52 -0
  26. package/dist/authoring-DWd5pnnV-BBX7P1wT.d.mts.map +1 -0
  27. package/dist/authoring-SbdvmVJh-nQ7YliD_.mjs +1342 -0
  28. package/dist/authoring-SbdvmVJh-nQ7YliD_.mjs.map +1 -0
  29. package/dist/autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs +58 -0
  30. package/dist/autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs.map +1 -0
  31. package/dist/{canonicalize-CQlxSR4D-MnrT5gtW.d.mts → canonicalize-B-xvDOdd-G3yUeKj4.d.mts} +7 -3
  32. package/dist/canonicalize-B-xvDOdd-G3yUeKj4.d.mts.map +1 -0
  33. package/dist/{canonicalize-CrN3u_xM-D4MrOqcB.mjs → canonicalize-RdxoUHao-FTTkizfe.mjs} +15 -3
  34. package/dist/canonicalize-RdxoUHao-FTTkizfe.mjs.map +1 -0
  35. package/dist/check-expressions-7uCCP01t-DtX2Vak9.mjs +48 -0
  36. package/dist/check-expressions-7uCCP01t-DtX2Vak9.mjs.map +1 -0
  37. package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-CtTzM58x-LloO-5Vf.d.mts} +14 -13
  38. package/dist/check-expressions-CtTzM58x-LloO-5Vf.d.mts.map +1 -0
  39. package/dist/{codec-descriptor-LT7BpQta-BaDM8UQQ.mjs → codec-descriptor-DoR-cTFZ-BlG5Gj-X.mjs} +12 -21
  40. package/dist/codec-descriptor-DoR-cTFZ-BlG5Gj-X.mjs.map +1 -0
  41. package/dist/codec-descriptor-Fb3UoQGb.d.mts +1 -0
  42. package/dist/codec-descriptor-d1ByNBEk-DhrtS_5y.d.mts +47 -0
  43. package/dist/codec-descriptor-d1ByNBEk-DhrtS_5y.d.mts.map +1 -0
  44. package/dist/codec-ids-BMhEpFwv-B8Zh0s_Q.mjs +41 -0
  45. package/dist/codec-ids-BMhEpFwv-B8Zh0s_Q.mjs.map +1 -0
  46. package/dist/codec-ids-C6II64Wy-CPYTqDTT.d.mts +41 -0
  47. package/dist/codec-ids-C6II64Wy-CPYTqDTT.d.mts.map +1 -0
  48. package/dist/codec-ids-CcB5uBNf.d.mts +1 -0
  49. package/dist/codec-registry-D7XslgPe-DTZnVB8W.mjs +61 -0
  50. package/dist/codec-registry-D7XslgPe-DTZnVB8W.mjs.map +1 -0
  51. package/dist/codec-type-map-Fj5xCgwT-BeCXgfuR.d.mts +53 -0
  52. package/dist/codec-type-map-Fj5xCgwT-BeCXgfuR.d.mts.map +1 -0
  53. package/dist/codec-types-BBACckHa.d.mts +2 -0
  54. package/dist/codec-types-Ct_4iTVc-3tFJcIBo.d.mts +84 -0
  55. package/dist/codec-types-Ct_4iTVc-3tFJcIBo.d.mts.map +1 -0
  56. package/dist/codecs-CADK7dCR-C8WToYQb.d.mts +724 -0
  57. package/dist/codecs-CADK7dCR-C8WToYQb.d.mts.map +1 -0
  58. package/dist/codecs-CRl9-i_r-Co-bgYl3.mjs +1743 -0
  59. package/dist/codecs-CRl9-i_r-Co-bgYl3.mjs.map +1 -0
  60. package/dist/codecs-CoEpEqjM.d.mts +31 -0
  61. package/dist/codecs-CoEpEqjM.d.mts.map +1 -0
  62. package/dist/column-types-B4zsV-u3.mjs +106 -0
  63. package/dist/column-types-B4zsV-u3.mjs.map +1 -0
  64. package/dist/column-types-Bs2V0j8T.d.mts +164 -0
  65. package/dist/column-types-Bs2V0j8T.d.mts.map +1 -0
  66. package/dist/{control-adapter-DFr4gS-r-DM3KcZdQ.mjs → contract-contributions-Xz2FpyfI-CeQZqHKf.mjs} +489 -292
  67. package/dist/contract-contributions-Xz2FpyfI-CeQZqHKf.mjs.map +1 -0
  68. package/dist/{contract-free-DzpGxLfb.d.mts → contract-free-B6-wuc6M.d.mts} +36 -6
  69. package/dist/contract-free-B6-wuc6M.d.mts.map +1 -0
  70. package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-o7olebm9.mjs} +13 -9
  71. package/dist/contract-free-o7olebm9.mjs.map +1 -0
  72. package/dist/control--HupSPoV.d.mts +847 -0
  73. package/dist/control--HupSPoV.d.mts.map +1 -0
  74. package/dist/{control-BaUpALVp.d.mts → control-CQEjh4P7.d.mts} +2 -2
  75. package/dist/control-CQEjh4P7.d.mts.map +1 -0
  76. package/dist/{control-DLTOAEHj.d.mts → control-D4cTcpcJ.d.mts} +22 -48
  77. package/dist/control-D4cTcpcJ.d.mts.map +1 -0
  78. package/dist/{control-Y6FxMu3o.mjs → control-DZQwENIP.mjs} +21 -9
  79. package/dist/control-DZQwENIP.mjs.map +1 -0
  80. package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-DtU5u9Dm-44r_OF94.mjs} +444 -218
  81. package/dist/control-policy-DtU5u9Dm-44r_OF94.mjs.map +1 -0
  82. package/dist/{data-transform-ChZzy2dP-CxVCat_8.mjs → data-transform-h9agBu_c-RlC5A7aY.mjs} +12 -5
  83. package/dist/data-transform-h9agBu_c-RlC5A7aY.mjs.map +1 -0
  84. package/dist/{data-transform-Ck5FbyNO-BNE7QlAo.d.mts → data-transform-nGy9rz87-CE3DGlgn.d.mts} +15 -4
  85. package/dist/data-transform-nGy9rz87-CE3DGlgn.d.mts.map +1 -0
  86. package/dist/data-transform-nqkqNIb8.d.mts +1 -0
  87. package/dist/data-type-entries-gQW3-KSb-BIl8vgus.mjs +128 -0
  88. package/dist/data-type-entries-gQW3-KSb-BIl8vgus.mjs.map +1 -0
  89. package/dist/data-types--7V9yY1G.d.mts +99 -0
  90. package/dist/data-types--7V9yY1G.d.mts.map +1 -0
  91. package/dist/data-types-Chx0mjTP-DczU4S9b.mjs +950 -0
  92. package/dist/data-types-Chx0mjTP-DczU4S9b.mjs.map +1 -0
  93. package/dist/date-time-now-generators-CMkXVbMG-C-GjhReE.d.mts +45 -0
  94. package/dist/date-time-now-generators-CMkXVbMG-C-GjhReE.d.mts.map +1 -0
  95. package/dist/ddl-B7Rqlz6D-B7dRDgYb.mjs +647 -0
  96. package/dist/ddl-B7Rqlz6D-B7dRDgYb.mjs.map +1 -0
  97. package/dist/ddl-B8nQZTWN.d.mts +1 -0
  98. package/dist/default-constraint-names-Cz9Yoeim-sUzOGvIm.mjs +18 -0
  99. package/dist/default-constraint-names-Cz9Yoeim-sUzOGvIm.mjs.map +1 -0
  100. package/dist/default-normalizer-BqK6XxdC-2OUb2ybG.mjs +311 -0
  101. package/dist/default-normalizer-BqK6XxdC-2OUb2ybG.mjs.map +1 -0
  102. package/dist/default-normalizer-DO-cH75Q.d.mts +25 -0
  103. package/dist/default-normalizer-DO-cH75Q.d.mts.map +1 -0
  104. package/dist/descriptor-meta-BkD3nXF_-CZaNqC6r.mjs +36 -0
  105. package/dist/descriptor-meta-BkD3nXF_-CZaNqC6r.mjs.map +1 -0
  106. package/dist/descriptor-meta-DaFDNnHQ-QjiiAEtC.mjs +64 -0
  107. package/dist/descriptor-meta-DaFDNnHQ-QjiiAEtC.mjs.map +1 -0
  108. package/dist/descriptor-meta-runtime-Dft1L7eE-D8vpOz_Z.mjs +15 -0
  109. package/dist/descriptor-meta-runtime-Dft1L7eE-D8vpOz_Z.mjs.map +1 -0
  110. package/dist/{diff-database-schema-DsoNznGC.d.mts → diff-database-schema-BxzhZaVN.d.mts} +12 -7
  111. package/dist/diff-database-schema-BxzhZaVN.d.mts.map +1 -0
  112. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-DAEzWtzU-DoyVgKqh.mjs} +38 -18
  113. package/dist/diff-database-schema-DAEzWtzU-DoyVgKqh.mjs.map +1 -0
  114. package/dist/driver.d.mts +3 -3
  115. package/dist/driver.mjs +3 -2
  116. package/dist/driver__control.d.mts +1 -1
  117. package/dist/driver__control.mjs +1 -1
  118. package/dist/driver__runtime.d.mts +2 -2
  119. package/dist/driver__runtime.mjs +2 -639
  120. package/dist/errors-BrhQYgdL-IvZHPjwL.mjs +103 -0
  121. package/dist/errors-BrhQYgdL-IvZHPjwL.mjs.map +1 -0
  122. package/dist/{errors-CU4xIwwk.d.mts → errors-D3Mj-x0o.d.mts} +3 -3
  123. package/dist/errors-D3Mj-x0o.d.mts.map +1 -0
  124. package/dist/full-text-BYg7EVX2.mjs +39 -0
  125. package/dist/full-text-BYg7EVX2.mjs.map +1 -0
  126. package/dist/full-text-SDbfxrE_.d.mts +26 -0
  127. package/dist/full-text-SDbfxrE_.d.mts.map +1 -0
  128. package/dist/full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts +27 -0
  129. package/dist/full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts.map +1 -0
  130. package/dist/full-text-index-authoring-CN1L9C1k.d.mts +7 -0
  131. package/dist/full-text-index-authoring-CN1L9C1k.d.mts.map +1 -0
  132. package/dist/full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs +195 -0
  133. package/dist/full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs.map +1 -0
  134. package/dist/full-text-index-definition-D5iBWLss-BEpqiucV.d.mts +71 -0
  135. package/dist/full-text-index-definition-D5iBWLss-BEpqiucV.d.mts.map +1 -0
  136. package/dist/full-text-parsers-CFFxiOrp-CrZ7VI1m.mjs +139 -0
  137. package/dist/full-text-parsers-CFFxiOrp-CrZ7VI1m.mjs.map +1 -0
  138. package/dist/full-text-search-document-Doy5TF7c-aMWM_1KB.mjs +54 -0
  139. package/dist/full-text-search-document-Doy5TF7c-aMWM_1KB.mjs.map +1 -0
  140. package/dist/index-types-BihjrAAq-C2VnfAyF.mjs +14 -0
  141. package/dist/index-types-BihjrAAq-C2VnfAyF.mjs.map +1 -0
  142. package/dist/indexes-BYf6nXVv-BXwLw7fO.d.mts +60 -0
  143. package/dist/indexes-BYf6nXVv-BXwLw7fO.d.mts.map +1 -0
  144. package/dist/infer-psl-contract-BSSHcuRi-ChdFSviw.mjs +1143 -0
  145. package/dist/infer-psl-contract-BSSHcuRi-ChdFSviw.mjs.map +1 -0
  146. package/dist/{issue-planner-Biq9Ls7e.d.mts → issue-planner-D-On52xP.d.mts} +39 -9
  147. package/dist/issue-planner-D-On52xP.d.mts.map +1 -0
  148. package/dist/list-decoder-BcrLExnx-DlCwavhu.d.mts +7 -0
  149. package/dist/list-decoder-BcrLExnx-DlCwavhu.d.mts.map +1 -0
  150. package/dist/marker-lock-BviIbusV.d.mts +11 -0
  151. package/dist/marker-lock-BviIbusV.d.mts.map +1 -0
  152. package/dist/marker-lock-DFc1Tfv5-BkBKBRE3.mjs +11 -0
  153. package/dist/marker-lock-DFc1Tfv5-BkBKBRE3.mjs.map +1 -0
  154. package/dist/{migration-PTHAY9Cv.mjs → migration-Be_iuIpn.mjs} +5 -4
  155. package/dist/migration-Be_iuIpn.mjs.map +1 -0
  156. package/dist/migration-D4lMmLVj.d.mts +26 -0
  157. package/dist/migration-D4lMmLVj.d.mts.map +1 -0
  158. package/dist/{namespace-ids-xtp_ZY86-Cpp8PTxD.mjs → namespace-ids-xtp_ZY86-Cxc0dBbO.mjs} +2 -2
  159. package/dist/namespace-ids-xtp_ZY86-Cxc0dBbO.mjs.map +1 -0
  160. package/dist/native-type-normalizer-BaGa9eeb.d.mts +30 -0
  161. package/dist/native-type-normalizer-BaGa9eeb.d.mts.map +1 -0
  162. package/dist/native-type-normalizer-Cn-RGt_E.mjs +24 -0
  163. package/dist/native-type-normalizer-Cn-RGt_E.mjs.map +1 -0
  164. package/dist/{nodes-DAvDJLvJ-BBdvFXNa.mjs → nodes-G8VTh4PM-DNvIhHag.mjs} +78 -7
  165. package/dist/nodes-G8VTh4PM-DNvIhHag.mjs.map +1 -0
  166. package/dist/{nodes-BU-V-aZA-RqwPH68u.d.mts → nodes-s0Oe37jT-Cw3BU2gL.d.mts} +82 -29
  167. package/dist/nodes-s0Oe37jT-Cw3BU2gL.d.mts.map +1 -0
  168. package/dist/op-factory-call-CRaVUOb_.d.mts +1 -0
  169. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-gGX-mZu--0QUG5xH4.mjs} +1014 -258
  170. package/dist/op-factory-call-gGX-mZu--0QUG5xH4.mjs.map +1 -0
  171. package/dist/{op-factory-call-BAeyLFYf-BAgG1h1C.d.mts → op-factory-call-nLHvNx0O-BTBhGbOF.d.mts} +169 -111
  172. package/dist/op-factory-call-nLHvNx0O-BTBhGbOF.d.mts.map +1 -0
  173. package/dist/operation-types--Wa_cv45-RoRnL1Dn.d.mts +192 -0
  174. package/dist/operation-types--Wa_cv45-RoRnL1Dn.d.mts.map +1 -0
  175. package/dist/operation-types-OXILTAOX.d.mts +1 -0
  176. package/dist/pack-2CYw2w-b.d.mts +1573 -0
  177. package/dist/pack-2CYw2w-b.d.mts.map +1 -0
  178. package/dist/{planner-CT-7zSfk.d.mts → planner-AD3Dt57t.d.mts} +23 -51
  179. package/dist/planner-AD3Dt57t.d.mts.map +1 -0
  180. package/dist/planner-VuR6URu3-CCUT2Osx.mjs +954 -0
  181. package/dist/planner-VuR6URu3-CCUT2Osx.mjs.map +1 -0
  182. package/dist/planner-ddl-builders-CPM3y7cQ.d.mts +16 -0
  183. package/dist/planner-ddl-builders-CPM3y7cQ.d.mts.map +1 -0
  184. package/dist/planner-ddl-builders-cYnH52gC-BWifb_M6.mjs +28 -0
  185. package/dist/planner-ddl-builders-cYnH52gC-BWifb_M6.mjs.map +1 -0
  186. package/dist/planner-identity-values-Dsq989Lh.d.mts +26 -0
  187. package/dist/planner-identity-values-Dsq989Lh.d.mts.map +1 -0
  188. package/dist/planner-identity-values-QstrMJ2U-CcpaRVPY.mjs +70 -0
  189. package/dist/planner-identity-values-QstrMJ2U-CcpaRVPY.mjs.map +1 -0
  190. package/dist/planner-produced-postgres-migration-BBUwtjA_.d.mts +1 -0
  191. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs} +5 -5
  192. package/dist/planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs.map +1 -0
  193. package/dist/{planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.d.mts → planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts} +4 -4
  194. package/dist/planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts.map +1 -0
  195. package/dist/{planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs → planner-schema-lookup-BbUY9oVy.mjs} +2 -2
  196. package/dist/planner-schema-lookup-BbUY9oVy.mjs.map +1 -0
  197. package/dist/{planner-schema-lookup-C4DHAddq.d.mts → planner-schema-lookup-ceCNOGFf.d.mts} +2 -2
  198. package/dist/planner-schema-lookup-ceCNOGFf.d.mts.map +1 -0
  199. package/dist/planner-sql-checks-D-K44J19-CzvrqzNB.mjs +151 -0
  200. package/dist/planner-sql-checks-D-K44J19-CzvrqzNB.mjs.map +1 -0
  201. package/dist/planner-sql-checks-Ed-WGtge-D9ByMrW4.d.mts +37 -0
  202. package/dist/planner-sql-checks-Ed-WGtge-D9ByMrW4.d.mts.map +1 -0
  203. package/dist/planner-sql-checks-rEjFx_Jv.d.mts +1 -0
  204. package/dist/planner-target-details-CUEF0s90-6g-mOgTI.mjs +14 -0
  205. package/dist/planner-target-details-CUEF0s90-6g-mOgTI.mjs.map +1 -0
  206. package/dist/{planner-target-details-HkP4RrRO-_xPQVPF0.d.mts → planner-target-details-HkP4RrRO-D6VtK0jY.d.mts} +2 -2
  207. package/dist/planner-target-details-HkP4RrRO-D6VtK0jY.d.mts.map +1 -0
  208. package/dist/postgres-codec-traits-CnP5Bjxp-Dxdgv0TI.mjs +11 -0
  209. package/dist/postgres-codec-traits-CnP5Bjxp-Dxdgv0TI.mjs.map +1 -0
  210. package/dist/{postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts → postgres-contract-view-BFzIDwwN-hL3QLe_b.d.mts} +2 -2
  211. package/dist/postgres-contract-view-BFzIDwwN-hL3QLe_b.d.mts.map +1 -0
  212. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-BO2elRMz-BqMBzJoJ.mjs} +27 -14
  213. package/dist/postgres-contract-view-BO2elRMz-BqMBzJoJ.mjs.map +1 -0
  214. package/dist/{postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts → postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts} +4 -4
  215. package/dist/postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts.map +1 -0
  216. package/dist/postgres-migration-BSWmeRLo-CUfVTUf0.mjs +1312 -0
  217. package/dist/postgres-migration-BSWmeRLo-CUfVTUf0.mjs.map +1 -0
  218. package/dist/{postgres-migration-BNsrwlxh-CwI5BqAu.d.mts → postgres-migration-C5deJ3Ne-C4Jxu-e6.d.mts} +135 -15
  219. package/dist/postgres-migration-C5deJ3Ne-C4Jxu-e6.d.mts.map +1 -0
  220. package/dist/{postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs → postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs} +2 -2
  221. package/dist/postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs.map +1 -0
  222. package/dist/postgres-object-name-FPikIvOw-B8FfJI7z.mjs +23 -0
  223. package/dist/postgres-object-name-FPikIvOw-B8FfJI7z.mjs.map +1 -0
  224. package/dist/{postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts → postgres-rls-policy-CnDxf3z9-BjpVyUnK.d.mts} +2 -2
  225. package/dist/postgres-rls-policy-CnDxf3z9-BjpVyUnK.d.mts.map +1 -0
  226. package/dist/{postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs → postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs} +3 -3
  227. package/dist/postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs.map +1 -0
  228. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-C6w1rzOF-D1fdwqRx.mjs} +14 -12
  229. package/dist/postgres-schema-C6w1rzOF-D1fdwqRx.mjs.map +1 -0
  230. package/dist/{postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts → postgres-schema-Xsjt3RKO-bis-SVSB.d.mts} +4 -4
  231. package/dist/postgres-schema-Xsjt3RKO-bis-SVSB.d.mts.map +1 -0
  232. package/dist/{postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs → postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs} +2 -2
  233. package/dist/postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs.map +1 -0
  234. package/dist/prisma7-binding-BjiLA9F7.mjs +307 -0
  235. package/dist/prisma7-binding-BjiLA9F7.mjs.map +1 -0
  236. package/dist/prisma7-binding-a56klfkc.d.mts +1651 -0
  237. package/dist/prisma7-binding-a56klfkc.d.mts.map +1 -0
  238. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-BgqtCw9Z-T8BPTX85.mjs} +17 -10
  239. package/dist/render-ops-BgqtCw9Z-T8BPTX85.mjs.map +1 -0
  240. package/dist/{render-ops-DPwhZt2W.d.mts → render-ops-Bl84i7ut.d.mts} +3 -3
  241. package/dist/render-ops-Bl84i7ut.d.mts.map +1 -0
  242. package/dist/{render-typescript-6sCFvMBh.d.mts → render-typescript-BysdXYpH.d.mts} +2 -2
  243. package/dist/render-typescript-BysdXYpH.d.mts.map +1 -0
  244. package/dist/{render-typescript-Dqp1Spgn-B128r1qw.mjs → render-typescript-Dqp1Spgn-B4mJhuVr.mjs} +2 -2
  245. package/dist/render-typescript-Dqp1Spgn-B4mJhuVr.mjs.map +1 -0
  246. package/dist/resolve-ddl-schema-D3VNPMSm-BuB6NyOI.mjs +34 -0
  247. package/dist/resolve-ddl-schema-D3VNPMSm-BuB6NyOI.mjs.map +1 -0
  248. package/dist/{runtime-lHBKgjB9.d.mts → runtime-C0VXuM0b.d.mts} +4 -3
  249. package/dist/runtime-C0VXuM0b.d.mts.map +1 -0
  250. package/dist/runtime-CXfxy5ED.mjs +660 -0
  251. package/dist/runtime-CXfxy5ED.mjs.map +1 -0
  252. package/dist/{runtime-_TfO66h5.d.mts → runtime-Ci_toEDZ.d.mts} +12 -4
  253. package/dist/runtime-Ci_toEDZ.d.mts.map +1 -0
  254. package/dist/{runtime-DOXznQe0.d.mts → runtime-DtjW0GP_.d.mts} +4 -4
  255. package/dist/runtime-DtjW0GP_.d.mts.map +1 -0
  256. package/dist/{schema-ir-annotations-DuuYh0gl.d.mts → schema-ir-annotations-BygaWBiC.d.mts} +2 -2
  257. package/dist/schema-ir-annotations-BygaWBiC.d.mts.map +1 -0
  258. package/dist/{schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts → schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts} +2 -2
  259. package/dist/schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts.map +1 -0
  260. package/dist/{normalize-error-CNjgVO71-CLlZ3CuJ.mjs → server-text-types-DeNPQpv5-DqX0h8WF.mjs} +45 -3
  261. package/dist/server-text-types-DeNPQpv5-DqX0h8WF.mjs.map +1 -0
  262. package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-BdWJPa5F-Ct0CPlXc.mjs} +113 -123
  263. package/dist/sql-renderer-BdWJPa5F-Ct0CPlXc.mjs.map +1 -0
  264. package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-BiBhge7D.d.mts} +9 -7
  265. package/dist/sql-renderer-BiBhge7D.d.mts.map +1 -0
  266. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-Bnw3JbWf-BN0gcjZB.mjs} +31 -8
  267. package/dist/sql-utils-Bnw3JbWf-BN0gcjZB.mjs.map +1 -0
  268. package/dist/{sql-utils-DW6fkczF.d.mts → sql-utils-CnnGiZBc.d.mts} +12 -4
  269. package/dist/sql-utils-CnnGiZBc.d.mts.map +1 -0
  270. package/dist/{table-source-ikHOZmhD-DriY1Lcr.d.mts → table-source-ikHOZmhD-vYcblBYv.d.mts} +2 -2
  271. package/dist/table-source-ikHOZmhD-vYcblBYv.d.mts.map +1 -0
  272. package/dist/target.d.mts +61 -49
  273. package/dist/target.mjs +45 -36
  274. package/dist/target__aggregates.d.mts +1 -1
  275. package/dist/target__aggregates.mjs +1 -1
  276. package/dist/target__codec-descriptor.d.mts +2 -2
  277. package/dist/target__codec-descriptor.mjs +1 -1
  278. package/dist/target__codec-ids.d.mts +3 -3
  279. package/dist/target__codec-ids.mjs +2 -2
  280. package/dist/target__codec-types.d.mts +4 -4
  281. package/dist/target__codecs.d.mts +4 -3
  282. package/dist/target__codecs.mjs +3 -3
  283. package/dist/target__contract-free.d.mts +3 -3
  284. package/dist/target__contract-free.mjs +4 -4
  285. package/dist/target__control.d.mts +4 -2
  286. package/dist/target__control.mjs +2501 -2
  287. package/dist/target__control.mjs.map +1 -0
  288. package/dist/target__data-transform.d.mts +2 -2
  289. package/dist/target__data-transform.mjs +1 -1
  290. package/dist/target__data-types.d.mts +2 -0
  291. package/dist/target__data-types.mjs +3 -0
  292. package/dist/target__ddl.d.mts +4 -4
  293. package/dist/target__ddl.mjs +2 -2
  294. package/dist/target__default-normalizer.d.mts +2 -2
  295. package/dist/target__default-normalizer.mjs +2 -2
  296. package/dist/target__diff-database-schema.d.mts +1 -1
  297. package/dist/target__diff-database-schema.mjs +1 -1
  298. package/dist/target__errors.d.mts +1 -1
  299. package/dist/target__errors.mjs +1 -1
  300. package/dist/target__full-text-index-authoring.d.mts +3 -0
  301. package/dist/target__full-text-index-authoring.mjs +3 -0
  302. package/dist/target__full-text.d.mts +4 -0
  303. package/dist/target__full-text.mjs +3 -0
  304. package/dist/target__issue-planner.d.mts +1 -1
  305. package/dist/target__issue-planner.mjs +1 -1
  306. package/dist/target__marker-lock.d.mts +2 -0
  307. package/dist/target__marker-lock.mjs +2 -0
  308. package/dist/target__migration.d.mts +4 -4
  309. package/dist/target__migration.mjs +5 -5
  310. package/dist/target__native-type-normalizer.d.mts +2 -2
  311. package/dist/target__native-type-normalizer.mjs +2 -2
  312. package/dist/target__op-factory-call.d.mts +3 -3
  313. package/dist/target__op-factory-call.mjs +2 -2
  314. package/dist/target__operation-types.d.mts +4 -0
  315. package/dist/target__pack.d.mts +3 -2
  316. package/dist/target__pack.mjs +1 -1
  317. package/dist/target__planner-ddl-builders.d.mts +2 -2
  318. package/dist/target__planner-ddl-builders.mjs +2 -2
  319. package/dist/target__planner-identity-values.d.mts +1 -1
  320. package/dist/target__planner-identity-values.mjs +1 -1
  321. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  322. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  323. package/dist/target__planner-schema-lookup.d.mts +1 -1
  324. package/dist/target__planner-schema-lookup.mjs +1 -1
  325. package/dist/target__planner-sql-checks.d.mts +3 -2
  326. package/dist/target__planner-sql-checks.mjs +2 -2
  327. package/dist/target__planner-target-details.d.mts +1 -1
  328. package/dist/target__planner.d.mts +1 -1
  329. package/dist/target__planner.mjs +2 -2
  330. package/dist/target__prisma7-binding.d.mts +2 -0
  331. package/dist/target__prisma7-binding.mjs +2 -0
  332. package/dist/target__render-ops.d.mts +1 -1
  333. package/dist/target__render-ops.mjs +1 -1
  334. package/dist/target__render-typescript.d.mts +1 -1
  335. package/dist/target__render-typescript.mjs +1 -1
  336. package/dist/target__rls-canonicalize.d.mts +2 -2
  337. package/dist/target__rls-canonicalize.mjs +2 -2
  338. package/dist/target__runtime.d.mts +6 -3
  339. package/dist/target__runtime.mjs +193 -4
  340. package/dist/target__runtime.mjs.map +1 -1
  341. package/dist/target__schema-ir-annotations.d.mts +1 -1
  342. package/dist/target__schema-ir-annotations.mjs +1 -1
  343. package/dist/target__sql-utils.d.mts +3 -2
  344. package/dist/target__sql-utils.mjs +4 -2
  345. package/dist/target__types.d.mts +7 -7
  346. package/dist/target__types.mjs +5 -5
  347. package/dist/types-AvjnIUna.d.mts +2 -0
  348. package/dist/types-D6lgKhE5-D1J9YJnd.d.mts +28 -0
  349. package/dist/types-D6lgKhE5-D1J9YJnd.d.mts.map +1 -0
  350. package/dist/{types-CjGjPLr5.d.mts → types-DOmgp_12.d.mts} +8 -8
  351. package/dist/types-DOmgp_12.d.mts.map +1 -0
  352. package/dist/{types-ue6jkJyF-BQJzjx1P.d.mts → types-ue6jkJyF-D79DmBTl.d.mts} +2 -2
  353. package/dist/types-ue6jkJyF-D79DmBTl.d.mts.map +1 -0
  354. package/package.json +22 -14
  355. package/dist/adapter-B0xsc80z-sYcF0RVF.mjs.map +0 -1
  356. package/dist/adapter-CPesdzv0.d.mts +0 -26
  357. package/dist/adapter-CPesdzv0.d.mts.map +0 -1
  358. package/dist/adapter__operation-types.d.mts +0 -2
  359. package/dist/aggregates-CgqNfj2O.d.mts +0 -10
  360. package/dist/aggregates-CgqNfj2O.d.mts.map +0 -1
  361. package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
  362. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs +0 -773
  363. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
  364. package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts.map +0 -1
  365. package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs.map +0 -1
  366. package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs +0 -41
  367. package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs.map +0 -1
  368. package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
  369. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts +0 -37
  370. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts.map +0 -1
  371. package/dist/codec-descriptor-Bg-_412t.d.mts +0 -1
  372. package/dist/codec-descriptor-LT7BpQta-BaDM8UQQ.mjs.map +0 -1
  373. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
  374. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
  375. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
  376. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
  377. package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
  378. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts +0 -84
  379. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
  380. package/dist/codec-types-bX63JRLf.d.mts +0 -2
  381. package/dist/codecs-B1HgsJZ2.mjs +0 -15
  382. package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
  383. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs +0 -1680
  384. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
  385. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts +0 -638
  386. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
  387. package/dist/codecs-DmCKO7dg.d.mts +0 -15
  388. package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
  389. package/dist/column-types-BH-MU6uU.d.mts +0 -108
  390. package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
  391. package/dist/column-types-Bh92dNjD.mjs +0 -126
  392. package/dist/column-types-Bh92dNjD.mjs.map +0 -1
  393. package/dist/contract-free-DzpGxLfb.d.mts.map +0 -1
  394. package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
  395. package/dist/control-2F195jJk.d.mts +0 -11
  396. package/dist/control-2F195jJk.d.mts.map +0 -1
  397. package/dist/control-BaUpALVp.d.mts.map +0 -1
  398. package/dist/control-DLTOAEHj.d.mts.map +0 -1
  399. package/dist/control-V7OkAC55.mjs +0 -1459
  400. package/dist/control-V7OkAC55.mjs.map +0 -1
  401. package/dist/control-Y6FxMu3o.mjs.map +0 -1
  402. package/dist/control-adapter-DFr4gS-r-DM3KcZdQ.mjs.map +0 -1
  403. package/dist/control-policy-B53lnBCT-B9K9Cj1x.mjs.map +0 -1
  404. package/dist/data-transform-BSM7TQpE.d.mts +0 -1
  405. package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs.map +0 -1
  406. package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts.map +0 -1
  407. package/dist/ddl-B4Rh8ntj.d.mts +0 -1
  408. package/dist/ddl-CNQJds-C-WfZ3y4y8.mjs +0 -395
  409. package/dist/ddl-CNQJds-C-WfZ3y4y8.mjs.map +0 -1
  410. package/dist/default-normalizer-B36TOul4.d.mts +0 -31
  411. package/dist/default-normalizer-B36TOul4.d.mts.map +0 -1
  412. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs +0 -253
  413. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs.map +0 -1
  414. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs +0 -354
  415. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
  416. package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs +0 -30
  417. package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map +0 -1
  418. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs +0 -13
  419. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs.map +0 -1
  420. package/dist/diff-database-schema-DKq76rCk-uehceHYz.mjs.map +0 -1
  421. package/dist/diff-database-schema-DsoNznGC.d.mts.map +0 -1
  422. package/dist/driver__runtime.mjs.map +0 -1
  423. package/dist/errors-CU4xIwwk.d.mts.map +0 -1
  424. package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
  425. package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
  426. package/dist/issue-planner-Biq9Ls7e.d.mts.map +0 -1
  427. package/dist/migration-PTHAY9Cv.mjs.map +0 -1
  428. package/dist/migration-aFeTWTOJ.d.mts +0 -25
  429. package/dist/migration-aFeTWTOJ.d.mts.map +0 -1
  430. package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs.map +0 -1
  431. package/dist/native-type-normalizer-DqJlOTeX.d.mts +0 -19
  432. package/dist/native-type-normalizer-DqJlOTeX.d.mts.map +0 -1
  433. package/dist/native-type-normalizer-yvd3tqv-.mjs +0 -38
  434. package/dist/native-type-normalizer-yvd3tqv-.mjs.map +0 -1
  435. package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts.map +0 -1
  436. package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs.map +0 -1
  437. package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs.map +0 -1
  438. package/dist/op-factory-call-BAeyLFYf-BAgG1h1C.d.mts.map +0 -1
  439. package/dist/op-factory-call-BTU8I_x0.d.mts +0 -1
  440. package/dist/op-factory-call-H6zeDGLe-_1pAftJk.mjs.map +0 -1
  441. package/dist/operation-types-BfRocNI8.d.mts +0 -22
  442. package/dist/operation-types-BfRocNI8.d.mts.map +0 -1
  443. package/dist/pack-CySS3DQU.d.mts +0 -626
  444. package/dist/pack-CySS3DQU.d.mts.map +0 -1
  445. package/dist/planner-CT-7zSfk.d.mts.map +0 -1
  446. package/dist/planner-D0uogzvT-1WyGIC5p.mjs +0 -671
  447. package/dist/planner-D0uogzvT-1WyGIC5p.mjs.map +0 -1
  448. package/dist/planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs +0 -102
  449. package/dist/planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map +0 -1
  450. package/dist/planner-ddl-builders-ijp60-JO.d.mts +0 -19
  451. package/dist/planner-ddl-builders-ijp60-JO.d.mts.map +0 -1
  452. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs +0 -90
  453. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs.map +0 -1
  454. package/dist/planner-identity-values-TfEhnoWa.d.mts +0 -25
  455. package/dist/planner-identity-values-TfEhnoWa.d.mts.map +0 -1
  456. package/dist/planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.d.mts.map +0 -1
  457. package/dist/planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map +0 -1
  458. package/dist/planner-produced-postgres-migration-D6C0T2xV.d.mts +0 -1
  459. package/dist/planner-schema-lookup-C4DHAddq.d.mts.map +0 -1
  460. package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map +0 -1
  461. package/dist/planner-sql-checks-CFgbRTJw.d.mts +0 -20
  462. package/dist/planner-sql-checks-CFgbRTJw.d.mts.map +0 -1
  463. package/dist/planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs +0 -152
  464. package/dist/planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map +0 -1
  465. package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts.map +0 -1
  466. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs +0 -15
  467. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs.map +0 -1
  468. package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts.map +0 -1
  469. package/dist/postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map +0 -1
  470. package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts.map +0 -1
  471. package/dist/postgres-migration-BNsrwlxh-CwI5BqAu.d.mts.map +0 -1
  472. package/dist/postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs +0 -205
  473. package/dist/postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map +0 -1
  474. package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs.map +0 -1
  475. package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts.map +0 -1
  476. package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs.map +0 -1
  477. package/dist/postgres-schema-CF0yHESb-D7n2X21R.mjs.map +0 -1
  478. package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts.map +0 -1
  479. package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs.map +0 -1
  480. package/dist/render-ops-DOsRP0Po-BKn_c_Ia.mjs.map +0 -1
  481. package/dist/render-ops-DPwhZt2W.d.mts.map +0 -1
  482. package/dist/render-typescript-6sCFvMBh.d.mts.map +0 -1
  483. package/dist/render-typescript-Dqp1Spgn-B128r1qw.mjs.map +0 -1
  484. package/dist/resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs +0 -22
  485. package/dist/resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map +0 -1
  486. package/dist/runtime-DOXznQe0.d.mts.map +0 -1
  487. package/dist/runtime-_TfO66h5.d.mts.map +0 -1
  488. package/dist/runtime-lHBKgjB9.d.mts.map +0 -1
  489. package/dist/schema-ir-annotations-DuuYh0gl.d.mts.map +0 -1
  490. package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts.map +0 -1
  491. package/dist/sql-renderer-BgC0ZgLS.d.mts.map +0 -1
  492. package/dist/sql-renderer-ComgusFq-BBlqM1fw.mjs.map +0 -1
  493. package/dist/sql-utils-DW6fkczF.d.mts.map +0 -1
  494. package/dist/sql-utils-DuzN3JZg-DiXy4Vah.mjs.map +0 -1
  495. package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts.map +0 -1
  496. package/dist/types-B-4d5_4a.d.mts +0 -1
  497. package/dist/types-CjGjPLr5.d.mts.map +0 -1
  498. package/dist/types-CkryN1AS-BcQRGsDn.d.mts +0 -27
  499. package/dist/types-CkryN1AS-BcQRGsDn.d.mts.map +0 -1
  500. package/dist/types-ue6jkJyF-BQJzjx1P.d.mts.map +0 -1
  501. /package/dist/{adapter__operation-types.mjs → target__operation-types.mjs} +0 -0
@@ -1,671 +0,0 @@
1
- import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { d as isPostgresSchema, i as PostgresRlsPolicy } from "./postgres-schema-CF0yHESb-D7n2X21R.mjs";
3
- import { n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
4
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs";
5
- import { A as RenameIndexCall, T as DropPostgresRlsPolicyCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, p as CreatePostgresRlsPolicyCall } from "./op-factory-call-H6zeDGLe-_1pAftJk.mjs";
6
- import { a as planIssues, c as renderPostgresSuppression, d as resolvePostgresNodeIssueControlPolicySubject, f as resolvePostgresNodeIssueCreationFactoryName, i as issueSchemaName, l as resolveNamespaceIdForDdlSchema, n as conflictForDisallowedCall, o as postgresNodeStorageCoordinate, r as issueNode, s as postgresPlannerStrategies, t as coalesceSubtreeIssues, u as resolvePostgresCallControlPolicySubject } from "./control-policy-B53lnBCT-B9K9Cj1x.mjs";
7
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-DKq76rCk-uehceHYz.mjs";
8
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs";
9
- import { blindCast } from "@prisma/orm-framework/utils/casts";
10
- import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
11
- import { ifDefined } from "@prisma/orm-framework/utils/defined";
12
- import { namingOf, parseWireName } from "@prisma/orm-family-sql/schema-ir/naming";
13
- import { issueOutcome } from "@prisma/orm-framework/components/control";
14
- import { controlPolicyForCall, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure } from "@prisma/orm-family-sql/family/control";
15
- import { SqlCheckConstraintIR, SqlIndexIR } from "@prisma/orm-family-sql/schema-ir/types";
16
- //#region ../../../3-targets/3-targets/postgres/dist/planner-D0uogzvT.mjs
17
- /**
18
- * Resolves the live-database schema name for a given namespace
19
- * coordinate. Mirrors `resolveDdlSchemaForNamespace` in
20
- * `planner-strategies.ts` so the verifier's projection and the
21
- * planner's projection always agree — Postgres-aware namespaces (the
22
- * production path) dispatch to `ddlSchemaName(storage)`, and bare
23
- * object payloads (used by some tests) fall back to the coordinate
24
- * itself.
25
- */
26
- function resolveDdlSchemaName(storage, namespaceId) {
27
- const namespace = storage.namespaces[namespaceId];
28
- if (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);
29
- return namespaceId;
30
- }
31
- /**
32
- * Reads the introspected list of schema names from the database-root schema
33
- * node. `existingSchemas` is database-level, so it lives on the
34
- * `PostgresDatabaseSchemaNode` root — not on the per-schema namespace nodes.
35
- *
36
- * Defaults to the always-present `public` schema when the node is not the
37
- * database root — a fresh Postgres database always carries `public` (unless an
38
- * operator dropped it manually), so any verifier path that runs without an
39
- * enriched introspection still suppresses the redundant `CREATE SCHEMA
40
- * "public"`.
41
- *
42
- * Production introspection (`PostgresControlAdapter.introspect`) is the
43
- * authoritative source: it queries `pg_namespace` and sets `existingSchemas`
44
- * on the returned root. Tests that want to assert against a richer initial
45
- * state construct a `PostgresDatabaseSchemaNode` explicitly.
46
- */
47
- function existingSchemasFromSchema(schema) {
48
- if (PostgresDatabaseSchemaNode.is(schema)) return schema.existingSchemas;
49
- return [DEFAULT_NAMESPACE_ID];
50
- }
51
- /**
52
- * Emits a `postgres-namespace` `not-found` diff issue for every
53
- * contract-declared Postgres namespace whose live container does not yet
54
- * exist. The planner prepends these (node-typed, synthesized) to the
55
- * relational diff issues so a multi-schema plan emits `CREATE SCHEMA`
56
- * before the tables that need it — a planner-only concern (verify already
57
- * rejects via the `not-found` table issues a missing schema already
58
- * produces), so this is not part of the shared diff.
59
- *
60
- * A namespace's live container is the schema returned by its
61
- * polymorphic `ddlSchemaName(storage)` method — named schemas resolve
62
- * to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`
63
- * and is skipped explicitly (late-bound namespaces have no fixed DDL
64
- * schema). Issues are emitted only when the resolved name is a real,
65
- * creatable schema (not the unbound sentinel) and is missing from the
66
- * introspected list. `public` is suppressed implicitly because the
67
- * introspection (or its sensible default) always carries it.
68
- *
69
- * Each emitted issue's path is `['database', ddlName]` — an ancestor of
70
- * every table path under that schema, so it must never be run through
71
- * `coalesceSubtreeIssues` alongside the table diff (it would swallow the
72
- * table-level `not-found` issues that drive `CREATE TABLE`); the planner
73
- * adds these AFTER coalescing the relational issues, and they are not
74
- * subject to sibling-space ownership scoping (mirrors the retired
75
- * coordinate walk, which prepended namespace issues after that filter).
76
- */
77
- function verifyPostgresNamespacePresence(input) {
78
- const { contract, schema } = input;
79
- const existing = new Set(existingSchemasFromSchema(schema));
80
- const issues = [];
81
- const namespaceIds = Object.keys(contract.storage.namespaces).sort();
82
- for (const namespaceId of namespaceIds) {
83
- if (namespaceId === UNBOUND_NAMESPACE_ID) continue;
84
- const ddlName = resolveDdlSchemaName(contract.storage, namespaceId);
85
- if (ddlName === UNBOUND_NAMESPACE_ID) continue;
86
- if (existing.has(ddlName)) continue;
87
- const namespace = new PostgresNamespaceSchemaNode({
88
- schemaName: ddlName,
89
- tables: {}
90
- });
91
- issues.push({
92
- path: ["database", ddlName],
93
- expected: namespace
94
- });
95
- }
96
- return issues;
97
- }
98
- function createPostgresMigrationPlanner(lowerer) {
99
- return new PostgresMigrationPlanner(lowerer);
100
- }
101
- /**
102
- * Postgres migration planner — a thin wrapper over `planIssues`.
103
- *
104
- * `plan()` diffs the target contract against the live schema via the one
105
- * differ (`buildPostgresPlanDiff`, producing node-typed `SchemaDiffIssue[]`)
106
- * and delegates to `planIssues` with the unified `postgresPlannerStrategies`
107
- * list: NOT-NULL backfill, type-change, nullable-tightening, codec-hook
108
- * storage types, component-declared dependency installs, and
109
- * shared-temp-default / empty-table-guarded NOT-NULL add-column. The same
110
- * strategy list runs for `migration plan`, `db update`, and `db init`;
111
- * behavior diverges purely on `policy.allowedOperationClasses` (the
112
- * data-safe strategies short-circuit when `'data'` is excluded). The issue
113
- * planner applies operation-class policy gates and emits a single
114
- * `PostgresOpFactoryCall[]` that drives both the runtime-ops view (via
115
- * `renderOps`) and the `renderTypeScript()` authoring surface. RLS policy
116
- * drift (the structural half of the same one-differ tree) is handled
117
- * separately via `planPostgresSchemaDiff`.
118
- */
119
- var PostgresMigrationPlanner = class {
120
- #lowerer;
121
- constructor(lowerer) {
122
- this.#lowerer = lowerer;
123
- }
124
- plan(options) {
125
- return this.planSql(options);
126
- }
127
- emptyMigration(context, spaceId) {
128
- return new TypeScriptRenderablePostgresMigration([], {
129
- from: context.fromHash,
130
- to: context.toHash
131
- }, spaceId, context.snapshotsImportPath, this.#lowerer);
132
- }
133
- planSql(options) {
134
- const schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;
135
- const policyResult = this.ensureAdditivePolicy(options.policy);
136
- if (policyResult) return policyResult;
137
- PostgresDatabaseSchemaNode.assert(options.schema);
138
- const { issues: rawIssues } = buildPostgresPlanDiff({
139
- contract: options.contract,
140
- actualSchema: options.schema,
141
- frameworkComponents: options.frameworkComponents
142
- });
143
- const policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue));
144
- const relationalDiffIssues = rawIssues.filter((issue) => !isPolicyDiffIssue(issue));
145
- const strict = options.policy.allowedOperationClasses.includes("widening") || options.policy.allowedOperationClasses.includes("destructive");
146
- const owned = retainUnownedExtras(coalesceSubtreeIssues(relationalDiffIssues), options.ownership, options.contract);
147
- const gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== "not-expected");
148
- const schemaIssues = [...verifyPostgresNamespacePresence({
149
- contract: options.contract,
150
- schema: options.schema
151
- }), ...gated];
152
- const indexRenames = this.pairIndexRenames(options, schemaIssues);
153
- const checkRenames = this.pairCheckRenames(options, schemaIssues);
154
- const renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);
155
- const plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));
156
- const codecHooks = extractCodecControlHooks(options.frameworkComponents);
157
- const storageTypes = options.contract.storage.types ?? {};
158
- const relationalSchema = relationalNamespaceNode(options.schema, schemaName);
159
- const issuePartition = partitionIssuesByControlPolicy({
160
- issues: plannableIssues,
161
- contract: options.contract,
162
- resolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),
163
- resolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName
164
- });
165
- const result = planIssues({
166
- issues: issuePartition.plannable,
167
- toContract: options.contract,
168
- fromContract: options.fromContract,
169
- schemaName,
170
- codecHooks,
171
- storageTypes,
172
- ...ifDefined("schema", relationalSchema),
173
- policy: options.policy,
174
- frameworkComponents: options.frameworkComponents,
175
- strategies: postgresPlannerStrategies
176
- });
177
- const schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);
178
- if (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);
179
- const indexRenamePartition = partitionCallsByControlPolicy({
180
- calls: [...indexRenames.calls, ...checkRenames.calls],
181
- contract: options.contract,
182
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
183
- resolveFactoryName: (call) => call.factoryName
184
- });
185
- const schemaDiffPartition = partitionCallsByControlPolicy({
186
- calls: schemaDiff.calls,
187
- contract: options.contract,
188
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
189
- resolveFactoryName: (call) => call.factoryName
190
- });
191
- const fieldEventPartition = partitionCallsByControlPolicy({
192
- calls: blindCast(planFieldEventOperations({
193
- priorContract: options.fromContract,
194
- newContract: options.contract,
195
- codecHooks
196
- })),
197
- contract: options.contract,
198
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
199
- resolveFactoryName: (call) => call.factoryName
200
- });
201
- const calls = [
202
- ...result.value.calls,
203
- ...indexRenamePartition.kept,
204
- ...schemaDiffPartition.kept,
205
- ...fieldEventPartition.kept
206
- ];
207
- const seenWarnings = /* @__PURE__ */ new Set();
208
- const warnings = [
209
- ...issuePartition.suppressions,
210
- ...indexRenamePartition.suppressions,
211
- ...schemaDiff.suppressions,
212
- ...schemaDiffPartition.suppressions,
213
- ...fieldEventPartition.suppressions
214
- ].map((record) => renderPostgresSuppression(record, options.contract)).filter((warning) => {
215
- const key = JSON.stringify(warning);
216
- if (seenWarnings.has(key)) return false;
217
- seenWarnings.add(key);
218
- return true;
219
- });
220
- return Object.freeze({
221
- kind: "success",
222
- plan: new TypeScriptRenderablePostgresMigration(calls, {
223
- from: options.fromContract?.storage.storageHash ?? null,
224
- to: options.contract.storage.storageHash
225
- }, options.spaceId, options.snapshotsImportPath, this.#lowerer),
226
- ...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}
227
- });
228
- }
229
- /**
230
- * Rename post-pass for indexes, per `(schema, table)`, widening-only,
231
- * deterministic by sorted names — the same structure as the policy pass
232
- * below (which stays untouched: policies pair by hash only).
233
- *
234
- * Hash pairing (prefix-only renames): extras whose live names parse as
235
- * wire names, grouped by `(schema, table, hash)`; missing nodes iterated
236
- * in sorted-name order consume the sorted-name-first candidate.
237
- *
238
- * Content pairing (exact→wire convergence), after hash pairing has
239
- * consumed its matches: the remaining wire-named-missing nodes
240
- * (`prefix` defined) against the remaining extras of any name shape,
241
- * paired iff content-equal (columns ordered-strict both-defined-or-
242
- * both-undefined, `unique`/`type` strict, `options` loose, bodies
243
- * byte-equal).
244
- *
245
- * Leftovers proceed as create/drop exactly as before; without the
246
- * widening allowance the pass is skipped and pairing degrades to the
247
- * additive half, like the policy pass.
248
- */
249
- pairIndexRenames(options, issues) {
250
- const consumed = /* @__PURE__ */ new Set();
251
- const calls = [];
252
- if (!options.policy.allowedOperationClasses.includes("widening")) return {
253
- calls,
254
- consumed
255
- };
256
- const missing = [];
257
- const extra = [];
258
- for (const issue of issues) {
259
- const node = issueNode(issue);
260
- if (node === void 0 || !SqlIndexIR.is(node)) continue;
261
- const ddlSchema = issue.path[1];
262
- const tableName = issue.path[2];
263
- if (ddlSchema === void 0 || tableName === void 0) continue;
264
- if (issueOutcome(issue) === "not-found") missing.push({
265
- issue,
266
- node,
267
- ddlSchema,
268
- tableName
269
- });
270
- else if (issueOutcome(issue) === "not-expected") extra.push({
271
- issue,
272
- node,
273
- ddlSchema,
274
- tableName
275
- });
276
- }
277
- if (missing.length === 0 || extra.length === 0) return {
278
- calls,
279
- consumed
280
- };
281
- const byName = (a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0;
282
- const emissionSchema = (ddlSchema) => resolveNamespaceIdForDdlSchema(options.contract, ddlSchema) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchema;
283
- const pairingKey = (finding, hash) => JSON.stringify([
284
- finding.ddlSchema,
285
- finding.tableName,
286
- hash
287
- ]);
288
- const rename = (missingFinding, candidate) => {
289
- consumed.add(missingFinding.issue);
290
- consumed.add(candidate.issue);
291
- calls.push(new RenameIndexCall(emissionSchema(missingFinding.ddlSchema), missingFinding.tableName, candidate.node.name, missingFinding.node.name));
292
- };
293
- const sortedMissing = [...missing].sort(byName);
294
- const extrasByHash = /* @__PURE__ */ new Map();
295
- for (const finding of extra) {
296
- const parsed = parseWireName(finding.node.name);
297
- if (parsed === void 0) continue;
298
- const key = pairingKey(finding, parsed.hash);
299
- const group = extrasByHash.get(key) ?? [];
300
- group.push(finding);
301
- extrasByHash.set(key, group);
302
- }
303
- for (const group of extrasByHash.values()) group.sort(byName);
304
- for (const missingFinding of sortedMissing) {
305
- const parsed = parseWireName(missingFinding.node.name);
306
- if (parsed === void 0) continue;
307
- const candidate = extrasByHash.get(pairingKey(missingFinding, parsed.hash))?.shift();
308
- if (candidate === void 0) continue;
309
- rename(missingFinding, candidate);
310
- }
311
- const sortedExtras = [...extra].sort(byName);
312
- for (const missingFinding of sortedMissing) {
313
- if (consumed.has(missingFinding.issue)) continue;
314
- if (missingFinding.node.prefix === void 0) continue;
315
- const candidate = sortedExtras.find((extraFinding) => !consumed.has(extraFinding.issue) && extraFinding.ddlSchema === missingFinding.ddlSchema && extraFinding.tableName === missingFinding.tableName && missingFinding.node.contentEquals(extraFinding.node, {
316
- columnPresence: "matching",
317
- bodies: "verbatim"
318
- }));
319
- if (candidate === void 0) continue;
320
- rename(missingFinding, candidate);
321
- }
322
- return {
323
- calls,
324
- consumed
325
- };
326
- }
327
- /**
328
- * Check-constraint rename post-pass: a `not-found` and a `not-expected`
329
- * check on the same table whose wire-name content hashes match but whose
330
- * prefixes differ is a prefix-only rename, and collapses into one
331
- * `ALTER TABLE … RENAME CONSTRAINT`.
332
- *
333
- * This is the index pass's hash-pairing phase and nothing else. There is
334
- * deliberately no content-pairing phase: a live check body is whatever
335
- * Postgres reprinted, so it never byte-matches the authored text, and
336
- * pairing an exact-named live check by content would bless whatever
337
- * predicate is actually live. Adoption of an old exact-named check stays
338
- * drop + add.
339
- *
340
- * Runs only when the policy allows `widening` (rename's class). Without it
341
- * the pass no-ops and the pair degrades to the slice-1 behavior: an add,
342
- * plus a drop when `destructive` is allowed too.
343
- */
344
- pairCheckRenames(options, issues) {
345
- const consumed = /* @__PURE__ */ new Set();
346
- const calls = [];
347
- if (!options.policy.allowedOperationClasses.includes("widening")) return {
348
- calls,
349
- consumed
350
- };
351
- const missing = [];
352
- const extra = [];
353
- for (const issue of issues) {
354
- const node = issueNode(issue);
355
- if (node === void 0 || !SqlCheckConstraintIR.is(node)) continue;
356
- const ddlSchema = issue.path[1];
357
- const tableName = issue.path[2];
358
- if (ddlSchema === void 0 || tableName === void 0) continue;
359
- if (issueOutcome(issue) === "not-found") missing.push({
360
- issue,
361
- node,
362
- ddlSchema,
363
- tableName
364
- });
365
- else if (issueOutcome(issue) === "not-expected") extra.push({
366
- issue,
367
- node,
368
- ddlSchema,
369
- tableName
370
- });
371
- }
372
- if (missing.length === 0 || extra.length === 0) return {
373
- calls,
374
- consumed
375
- };
376
- const byName = (a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0;
377
- const emissionSchema = (ddlSchema) => resolveNamespaceIdForDdlSchema(options.contract, ddlSchema) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchema;
378
- const pairingKey = (finding, hash) => JSON.stringify([
379
- finding.ddlSchema,
380
- finding.tableName,
381
- hash
382
- ]);
383
- const sortedMissing = [...missing].sort(byName);
384
- const extrasByHash = /* @__PURE__ */ new Map();
385
- for (const finding of extra) {
386
- const parsed = parseWireName(finding.node.name);
387
- if (parsed === void 0) continue;
388
- const key = pairingKey(finding, parsed.hash);
389
- const group = extrasByHash.get(key) ?? [];
390
- group.push(finding);
391
- extrasByHash.set(key, group);
392
- }
393
- for (const group of extrasByHash.values()) group.sort(byName);
394
- for (const missingFinding of sortedMissing) {
395
- const parsed = parseWireName(missingFinding.node.name);
396
- if (parsed === void 0) continue;
397
- const candidate = extrasByHash.get(pairingKey(missingFinding, parsed.hash))?.shift();
398
- if (candidate === void 0) continue;
399
- consumed.add(missingFinding.issue);
400
- consumed.add(candidate.issue);
401
- calls.push(new RenameCheckConstraintCall(emissionSchema(missingFinding.ddlSchema), missingFinding.tableName, candidate.node.name, missingFinding.node.name));
402
- }
403
- return {
404
- calls,
405
- consumed
406
- };
407
- }
408
- /**
409
- * Maps the RLS policy findings of the one combined tree diff
410
- * (`buildPostgresPlanDiff`, already ownership-filtered) into
411
- * `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a
412
- * `not-equal` finding (an exact-named policy whose content drifted)
413
- * becomes drop + create, or a disallowed-call conflict when the policy
414
- * forbids the destructive drop. It
415
- * does not re-diff — it consumes exactly the policy-node subset of the
416
- * shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE
417
- * ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`
418
- * attribute diff on the relational side.
419
- *
420
- * Rename post-pass (the index pass's structure): hash pairing pairs a
421
- * `not-found` and a `not-expected` policy on the SAME table whose
422
- * wire-name content hashes match but prefixes differ (prefix-only rename);
423
- * content pairing then pairs remaining wire-named-missing policies against remaining
424
- * extras of any name shape by verbatim content (the node-owned `contentEquals` —
425
- * exact→wire adoption). Multi-candidate groups pair deterministically
426
- * by sorted name; leftovers proceed as create/drop; an exact-named
427
- * missing policy never content-pairs.
428
- *
429
- * The pairing runs only when the policy allows `widening` (rename's
430
- * class). Without it (db-init's additive-only set), pairing degrades
431
- * deliberately to the additive half: the new name is CREATEd and the old
432
- * policy survives live until a widening/destructive-allowed plan runs —
433
- * emitting an ungated widening rename would only fail at the runner's
434
- * class re-enforcement.
435
- */
436
- planPostgresSchemaDiff(options, filteredDiffIssues) {
437
- const allowsDestructive = options.policy.allowedOperationClasses.includes("destructive");
438
- const allowsWidening = options.policy.allowedOperationClasses.includes("widening");
439
- const missing = [];
440
- const extra = [];
441
- const changed = [];
442
- for (const issue of filteredDiffIssues) if (issueOutcome(issue) === "not-equal") {
443
- const expected = issue.expected;
444
- PostgresPolicySchemaNode.assert(expected);
445
- changed.push({
446
- node: expected,
447
- schemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)
448
- });
449
- } else if (issueOutcome(issue) === "not-found") {
450
- const expected = issue.expected;
451
- PostgresPolicySchemaNode.assert(expected);
452
- missing.push({
453
- node: expected,
454
- schemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)
455
- });
456
- } else if (issueOutcome(issue) === "not-expected") {
457
- const actual = issue.actual;
458
- PostgresPolicySchemaNode.assert(actual);
459
- extra.push({
460
- node: actual,
461
- schemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, actual.namespaceId)
462
- });
463
- }
464
- const calls = [];
465
- const conflicts = [];
466
- const suppressions = [];
467
- const renamedExtras = /* @__PURE__ */ new Set();
468
- const renamedMissing = /* @__PURE__ */ new Set();
469
- const pairingKey = (finding, hash) => JSON.stringify([
470
- finding.schemaForTable,
471
- finding.node.tableName,
472
- hash
473
- ]);
474
- if (allowsWidening) {
475
- const extrasByGroup = /* @__PURE__ */ new Map();
476
- for (const finding of extra) {
477
- const parsed = parseWireName(finding.node.name);
478
- if (parsed === void 0) continue;
479
- const key = pairingKey(finding, parsed.hash);
480
- const group = extrasByGroup.get(key) ?? [];
481
- group.push(finding);
482
- extrasByGroup.set(key, group);
483
- }
484
- for (const group of extrasByGroup.values()) group.sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);
485
- const sortedMissing = [...missing].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);
486
- for (const missingFinding of sortedMissing) {
487
- const parsed = parseWireName(missingFinding.node.name);
488
- if (parsed === void 0) continue;
489
- const candidate = extrasByGroup.get(pairingKey(missingFinding, parsed.hash))?.shift();
490
- if (candidate === void 0) continue;
491
- renamedExtras.add(candidate);
492
- renamedMissing.add(missingFinding);
493
- calls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));
494
- }
495
- const sortedExtras = [...extra].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);
496
- for (const missingFinding of sortedMissing) {
497
- if (renamedMissing.has(missingFinding)) continue;
498
- if (missingFinding.node.prefix === void 0) continue;
499
- const candidate = sortedExtras.find((extraFinding) => !renamedExtras.has(extraFinding) && extraFinding.schemaForTable === missingFinding.schemaForTable && extraFinding.node.tableName === missingFinding.node.tableName && missingFinding.node.contentEquals(extraFinding.node));
500
- if (candidate === void 0) continue;
501
- renamedExtras.add(candidate);
502
- renamedMissing.add(missingFinding);
503
- calls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));
504
- }
505
- }
506
- for (const finding of changed) {
507
- const replacement = {
508
- drop: new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name),
509
- create: new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node))
510
- };
511
- const graded = gradePolicyReplacement(replacement, options.contract, options.policy.allowedOperationClasses);
512
- if (graded.disposition === "suppress") {
513
- suppressions.push(graded.record);
514
- continue;
515
- }
516
- if (graded.disposition === "conflict") {
517
- conflicts.push(graded.conflict);
518
- continue;
519
- }
520
- calls.push(replacement.drop);
521
- calls.push(replacement.create);
522
- }
523
- for (const finding of missing) {
524
- if (renamedMissing.has(finding)) continue;
525
- calls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));
526
- }
527
- if (allowsDestructive) for (const finding of extra) {
528
- if (renamedExtras.has(finding)) continue;
529
- calls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));
530
- }
531
- return {
532
- calls,
533
- conflicts,
534
- suppressions
535
- };
536
- }
537
- ensureAdditivePolicy(policy) {
538
- if (!policy.allowedOperationClasses.includes("additive")) return plannerFailure([{
539
- kind: "unsupportedOperation",
540
- summary: "Migration planner requires additive operations be allowed",
541
- why: "The planner requires the \"additive\" operation class to be allowed in the policy."
542
- }]);
543
- return null;
544
- }
545
- };
546
- /**
547
- * A diff issue whose node is an RLS policy — the structural half of the one
548
- * combined tree diff, routed to `planPostgresSchemaDiff` instead of
549
- * `planIssues`.
550
- */
551
- function isPolicyDiffIssue(issue) {
552
- const node = issue.expected ?? issue.actual;
553
- return node !== void 0 && PostgresPolicySchemaNode.is(node);
554
- }
555
- /**
556
- * Drops a `not-expected` issue when it is a whole extra storage entity (a table
557
- * or a native enum) that some space in the composition owns. Each such node
558
- * yields its own storage coordinate (see {@link postgresNodeStorageCoordinate}),
559
- * so `declaresEntity` answers over the whole composition on one uniform
560
- * coordinate: a positive answer means a sibling owns this entity here — leave
561
- * it; a negative answer means a genuine orphan — drop it. A node with no storage
562
- * coordinate (a namespace, or a deeper column/constraint drift on an owned
563
- * table) is this space's own and is always kept. No oracle ⇒ keep everything.
564
- */
565
- function retainUnownedExtras(issues, ownership, contract) {
566
- if (ownership === void 0) return issues;
567
- return issues.filter((issue) => {
568
- if (issueOutcome(issue) !== "not-expected") return true;
569
- const node = issueNode(issue);
570
- if (node === void 0) return true;
571
- const coordinate = postgresNodeStorageCoordinate(node);
572
- if (coordinate === void 0) return true;
573
- const ddlSchemaName = issueSchemaName(issue);
574
- if (ddlSchemaName === void 0) return true;
575
- const namespaceId = resolveNamespaceIdForDdlSchema(contract, ddlSchemaName);
576
- return !ownership.declaresEntity({
577
- namespaceId,
578
- ...coordinate
579
- });
580
- });
581
- }
582
- /**
583
- * Returns the one namespace node the relational strategy layer probes for
584
- * live-table existence and reads codec-hook context off — the namespace
585
- * matching the planner's resolved schema name, or the first namespace when
586
- * none matches. `undefined` when the tree has no namespaces, so the strategy
587
- * context uses its empty-schema default.
588
- *
589
- * The relational strategies key tables by bare name, so they can only probe one
590
- * namespace at a time; probing across every namespace at once is future work.
591
- *
592
- * Returns the real `PostgresNamespaceSchemaNode` reference rather than a
593
- * projection: `storageTypePlanCallStrategy` hands this same value to codec
594
- * `planTypeOperations` hooks as `schema`, and hooks read the Postgres-specific
595
- * `nativeEnums` field off it (via `PostgresNamespaceSchemaNode.is`) to decide
596
- * whether a native enum type already exists — a projection that only copies
597
- * `tables` would silently drop that signal. `StrategyContext.schema`'s
598
- * declared type (`SqlSchemaIR`, shared with SQLite's flat shape) doesn't
599
- * capture this, so the return is `blindCast` the same way `namespaceSchemaNodes`
600
- * in the family's relational walk already treats a namespace node as a
601
- * structurally-`SqlSchemaIR`-shaped value.
602
- */
603
- function relationalNamespaceNode(schema, schemaName) {
604
- const namespaceNodes = Object.values(schema.namespaces);
605
- const namespaceNode = namespaceNodes.find((node) => node.schemaName === schemaName) ?? namespaceNodes[0];
606
- if (namespaceNode === void 0) return void 0;
607
- return blindCast(namespaceNode);
608
- }
609
- /**
610
- * Grades a {@link PolicyReplacement} as one unit against the table's
611
- * control policy, BEFORE the pair becomes calls or a conflict. This runs
612
- * ahead of `partitionCallsByControlPolicy`, which later re-grades the
613
- * surviving calls per-call — a no-op here, since only managed units
614
- * survive this grading.
615
- *
616
- * A replacement is deliberately STRICTER than the shared
617
- * `callAllowedUnderControlPolicy` rule: `tolerated` permits whole-object
618
- * creation, but a replacement's create is the second half of a repair of
619
- * an existing object, not a new object — so ANY non-managed control
620
- * (external, observed, tolerated) suppresses the whole unit. Drift on an
621
- * object the plan does not manage is reported, never repaired; the
622
- * suppression subject names the drifted policy (`rlsPolicy`) so the
623
- * report says which policy drifted, matching the conflict path's
624
- * `location.rlsPolicy`.
625
- */
626
- function gradePolicyReplacement(replacement, contract, allowedOperationClasses) {
627
- const subject = resolvePostgresCallControlPolicySubject(replacement.drop, contract);
628
- const controlPolicy = controlPolicyForCall(subject, contract.defaultControlPolicy);
629
- if (controlPolicy !== "managed") return {
630
- disposition: "suppress",
631
- record: {
632
- subject: subject === void 0 ? void 0 : {
633
- ...subject,
634
- rlsPolicy: replacement.drop.policyName
635
- },
636
- policy: controlPolicy,
637
- factoryName: void 0,
638
- createsNewObject: false
639
- }
640
- };
641
- if (!allowedOperationClasses.includes("destructive")) return {
642
- disposition: "conflict",
643
- conflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)
644
- };
645
- return { disposition: "plan" };
646
- }
647
- /**
648
- * Rebuilds the `PostgresRlsPolicy` contract entity `CreatePostgresRlsPolicyCall`
649
- * carries (its `renderTypeScript`/`createRlsPolicy` paths serialize the whole
650
- * entity, `namespaceId` included). This reconstructs rather than looking the
651
- * original up in the contract on purpose: the diff node's `namespaceId` is the
652
- * *resolved DDL schema* (set when the expected tree was built), which is the
653
- * value the emitted op must carry; the contract-stored entity holds the raw,
654
- * pre-resolution coordinate, so a lookup would change the migration output.
655
- */
656
- function policyNodeToContractPolicy(node) {
657
- return new PostgresRlsPolicy({
658
- naming: namingOf(node.name, node.prefix),
659
- tableName: node.tableName,
660
- namespaceId: node.namespaceId,
661
- operation: node.operation,
662
- roles: [...node.roles],
663
- using: node.using,
664
- withCheck: node.withCheck,
665
- permissive: node.permissive
666
- });
667
- }
668
- //#endregion
669
- export { createPostgresMigrationPlanner as t };
670
-
671
- //# sourceMappingURL=planner-D0uogzvT-1WyGIC5p.mjs.map