@prisma/orm-target-postgres 8.0.0-rc.2-dev.3 → 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-VuR6URu3-CCUT2Osx.mjs","names":["#lowerer"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-VuR6URu3.mjs"],"sourcesContent":["import { i as quoteIdentifier } from \"./sql-utils-Bnw3JbWf.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { _ as PostgresRlsPolicy, r as isPostgresSchema } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as emissionSchemaForNamespace, r as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-D3VNPMSm.mjs\";\nimport { t as buildPostgresPlanDiff } from \"./diff-database-schema-DAEzWtzU.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-DtU5u9Dm.mjs\";\nimport { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from \"./default-constraint-names-Cz9Yoeim.mjs\";\nimport { C as DropNativeEnumTypeCall, D as DropTableCall, E as DropSchemaCall, N as RenamePostgresRlsPolicyCall, P as RenameSchemaCall, R as SetTableSchemaCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, j as RenameConstraintCall, k as RawSqlCall, l as AlterColumnTypeCall, m as CreateSchemaCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, y as DropColumnCall } from \"./op-factory-call-gGX-mZu-.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-BSWmeRLo.mjs\";\nimport { t as TypeScriptRenderablePostgresMigration } from \"./planner-produced-postgres-migration-BZclL_xO.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { namingOf, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { appliedStatementsInOrder, backfillOfDefaultedField, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, otherSpaceDeclaring, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planStatements, 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/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/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 DropColumnCall || call instanceof AlterColumnTypeCall) return target(locator, call.schemaName, call.tableName, call.columnName);\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/**\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(schemaName, tableName, policyName) {\n\treturn JSON.stringify([\n\t\tschemaName,\n\t\ttableName,\n\t\tparseWireName(policyName)?.prefix ?? policyName\n\t]);\n}\n/**\n* The policies the plan creates. A drop of one of them, by name or by generated-name prefix, is\n* half of a replacement, which leaves a policy in place, so it widens no access.\n*/\nfunction createdPolicies(calls) {\n\treturn new Set(calls.flatMap((call) => call instanceof CreatePostgresRlsPolicyCall ? [policyKey(call.schemaName, call.tableName, call.policy.name)] : []));\n}\n/**\n* Disabling row-level security widens access: every role with table privileges then reads and\n* writes every row. Dropping a policy changes access either way, since a permissive policy grants\n* access and a restrictive one limits it, unless the plan creates the policy again.\n*/\nfunction accessChangesOf(locator, call, replaced) {\n\tif (call instanceof DisableRowLevelSecurityCall) return [{\n\t\t...target(locator, call.schemaName, call.tableName, void 0),\n\t\twidens: true\n\t}];\n\tif (call instanceof DropPostgresRlsPolicyCall && !replaced.has(policyKey(call.schemaName, call.tableName, call.policyName))) return [{\n\t\t...target(locator, call.schemaName, call.tableName, void 0),\n\t\twidens: false\n\t}];\n\treturn [];\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 replaced = createdPolicies(calls);\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) => {\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: accessChangesOf(locator, call, replaced),\n\t\t\ttemporaryValues: call instanceof AddColumnWithTemporaryDefaultCall ? [{\n\t\t\t\ttable: call.tableName,\n\t\t\t\tcolumn: call.columnName,\n\t\t\t\tvalue: call.temporaryDefault\n\t\t\t}] : []\n\t\t};\n\t});\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\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});\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 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: [...postgresPlannerStrategies, dropRemovedSchemasStrategy(removedSchemas.filter((schemaName) => !keptSchema(options, schemaName)))]\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 ordered = movePolicyDropsBeforeBlockedDdl(withChecksAroundTypeChanges({\n\t\t\tcalls: result.value.calls,\n\t\t\texpected: expectedSchema,\n\t\t\tactual: schema,\n\t\t\tddlSchemaOf: (name) => name === UNBOUND_NAMESPACE_ID ? resolveDdlSchemaForNamespaceStorage(options.contract.storage, UNBOUND_NAMESPACE_ID) : name\n\t\t}), schemaDiffPartition.kept);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...ordered.structural,\n\t\t\t...renamePartition.kept,\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.appliedStatements),\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}), {\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\tbyHand: postgresTableRenameByHand(options.contract)\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\t...postgresTableRenameByHand(options.contract)\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/**\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\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* 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 { createPostgresMigrationPlanner as t };\n\n//# sourceMappingURL=planner-VuR6URu3.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,YAAY,MAAM,WAAW;CACrC,OAAO,UAAU,MAAM,SAAS,KAAK,OAAO,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAC5E;;;;AAIA,SAAS,sBAAsB,OAAO;CACrC,MAAM,EAAE,YAAY,MAAM,IAAI,UAAU,MAAM,2BAA2B;CACzE,MAAM,UAAU,MAAM,SAAS,WAAW,gBAAgB;EACzD,IAAI,cAAc,KAAK,KAAK,uBAAuB,IAAI,OAAO,GAAG,OAAO,CAAC;EACzE,MAAM,UAAU,UAAU,QAAQ;EAClC,OAAO,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,qBAAqB,YAAY,IAAI,MAAM,SAAS,OAAO,CAAC;CACpG;CACA,MAAM,aAAa,SAAS,eAAe,KAAK,IAAI,CAAC,IAAI,OAAO,cAAc,SAAS,WAAW,QAAQ,sBAAsB,IAAI,GAAG,YAAY,SAAS,YAAY,KAAK,eAAe,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,GAAG,sBAAsB,EAAE,CAAC;CACvP,MAAM,UAAU,SAAS,QAAQ,SAAS,WAAW,OAAO,UAAU,OAAO,QAAQ,kBAAkB,MAAM,OAAO,OAAO,GAAG,YAAY,QAAQ,KAAK,OAAO,GAAG,kBAAkB,IAAI,OAAO,OAAO,CAAC,CAAC;CACvM,MAAM,cAAc,SAAS,YAAY,SAAS,OAAO,OAAO,cAAc,GAAG,QAAQ,sBAAsB,MAAM,GAAG,OAAO,GAAG,YAAY,IAAI,KAAK,WAAW,GAAG,sBAAsB,IAAI,GAAG,OAAO,CAAC,CAAC;CAC3M,OAAO;EACN,GAAG;EACH,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UAAU,yBAAyB;CAC/E,MAAM,UAAU,wCAAwC,YAAY,MAAM,QAAQ;CAClF,MAAM,gBAAgB,uBAAuB,SAAS,SAAS,oBAAoB;CACnF,IAAI,kBAAkB,WAAW,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"}
@@ -0,0 +1,16 @@
1
+ import { TypeLookups } from "@prisma/orm-framework/components/codec";
2
+ import { StorageColumn } from "@prisma/orm-family-sql/contract/types";
3
+ //#region ../../../3-targets/postgres/1-target/dist/planner-ddl-builders.d.mts
4
+ //#region src/core/migrations/planner-ddl-builders.d.ts
5
+ /**
6
+ * Renders the SQL type for a column in DDL context: the name its codec's data type is written
7
+ * with, and its parameters.
8
+ *
9
+ * @param allowPseudoTypes - When true (default), autoincrement integer columns
10
+ * produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts
11
+ * like ALTER COLUMN TYPE where pseudo-types are invalid.
12
+ */
13
+ declare function buildColumnTypeSql(column: Pick<StorageColumn, 'codecId' | 'many' | 'typeParams' | 'default'>, types: TypeLookups, allowPseudoTypes?: boolean): string;
14
+ //#endregion
15
+ export { buildColumnTypeSql as t };
16
+ //# sourceMappingURL=planner-ddl-builders-CPM3y7cQ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-ddl-builders-CPM3y7cQ.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-ddl-builders.d.mts"],"mappings":";;;;;;;;;;;;iBAWiB,mBAAmB,QAAQ,KAAK,+DAA+D,OAAO,aAAa"}
@@ -0,0 +1,28 @@
1
+ import { n as autoincrementWidthOfDataType } from "./autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs";
2
+ import { dataTypeParams } from "@prisma/orm-framework/components/codec";
3
+ import { renderSqlTypeName, sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-ddl-builders-cYnH52gC.mjs
5
+ /**
6
+ * Renders the SQL type for a column in DDL context: the name its codec's data type is written
7
+ * with, and its parameters.
8
+ *
9
+ * @param allowPseudoTypes - When true (default), autoincrement integer columns
10
+ * produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts
11
+ * like ALTER COLUMN TYPE where pseudo-types are invalid.
12
+ */
13
+ function buildColumnTypeSql(column, types, allowPseudoTypes = true) {
14
+ const dataType = sqlDataTypeOfCodec(column.codecId, types);
15
+ if (allowPseudoTypes && isAutoincrement(column.default)) {
16
+ const width = autoincrementWidthOfDataType(dataType.id);
17
+ if (width !== void 0) return width.serialType;
18
+ }
19
+ const typeSql = renderSqlTypeName(dataType, dataTypeParams(dataType, column.typeParams));
20
+ return column.many ? `${typeSql}[]` : typeSql;
21
+ }
22
+ function isAutoincrement(columnDefault) {
23
+ return columnDefault?.kind === "function" && columnDefault.expression === "autoincrement()";
24
+ }
25
+ //#endregion
26
+ export { buildColumnTypeSql as t };
27
+
28
+ //# sourceMappingURL=planner-ddl-builders-cYnH52gC-BWifb_M6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-ddl-builders-cYnH52gC-BWifb_M6.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-ddl-builders-cYnH52gC.mjs"],"sourcesContent":["import { n as autoincrementWidthOfDataType } from \"./autoincrement-widths-DonNJgfS.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-cYnH52gC.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"}
@@ -0,0 +1,26 @@
1
+ import { TypeLookups } from "@prisma/orm-framework/components/codec";
2
+ import { StorageColumn } from "@prisma/orm-family-sql/contract/types";
3
+ import { CodecControlHooks } from "@prisma/orm-family-sql/family/control";
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-identity-values.d.mts
5
+ //#region src/core/migrations/planner-identity-values.d.ts
6
+ /**
7
+ * Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
8
+ * Checks codec hooks first (extensions can provide type-specific identity values),
9
+ * then falls back to the built-in map, keyed by the data type the column's codec represents.
10
+ */
11
+ declare function resolveIdentityValue(column: Pick<StorageColumn, 'codecId' | 'typeParams' | 'many'>, codecHooks: ReadonlyMap<string, CodecControlHooks>, types: TypeLookups): string | null;
12
+ /**
13
+ * Returns the built-in identity value (monoid neutral element) as a SQL literal for the given
14
+ * data type — e.g. 0 for integers, '' for text, false for booleans.
15
+ *
16
+ * This is the planner's fallback when no codec hook provides a type-specific identity value.
17
+ *
18
+ * Returns null for other types (for example enums and extension-owned types without a
19
+ * hook), which causes the planner to fall back to the empty-table precheck.
20
+ *
21
+ * @internal Exported for testing only.
22
+ */
23
+ declare function buildBuiltinIdentityValue(dataType: string, typeParams?: Record<string, unknown>): string | null;
24
+ //#endregion
25
+ export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
26
+ //# sourceMappingURL=planner-identity-values-Dsq989Lh.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-identity-values-Dsq989Lh.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-identity-values.d.mts"],"mappings":";;;;;;;;;;iBASiB,qBAAqB,QAAQ,KAAK,mDAAmD,YAAY,oBAAoB,oBAAoB,OAAO;;;;;;;;;;;;iBAYhJ,0BAA0B,kBAAkB,aAAa"}
@@ -0,0 +1,70 @@
1
+ import { A as pgJsonb, D as pgInterval, E as pgInt8, F as pgText, I as pgTextArray, J as pgVarchar, K as pgUuid, L as pgTime, M as pgNumeric, S as pgFloat8, T as pgInt4, U as pgTimetz, V as pgTimestamptz, _ as pgDate, d as pgBool, f as pgBytea, h as pgChar, k as pgJson, l as pgBit, q as pgVarbit, w as pgInt2, x as pgFloat4, z as pgTimestamp } from "./data-types-Chx0mjTP-DczU4S9b.mjs";
2
+ import { sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
3
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-identity-values-QstrMJ2U.mjs
5
+ /**
6
+ * Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
7
+ * Checks codec hooks first (extensions can provide type-specific identity values),
8
+ * then falls back to the built-in map, keyed by the data type the column's codec represents.
9
+ */
10
+ function resolveIdentityValue(column, codecHooks, types) {
11
+ const { codecId, typeParams } = column;
12
+ if (column.many) return "'{}'";
13
+ const dataType = sqlDataTypeOfCodec(codecId, types).id;
14
+ const hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({
15
+ dataType,
16
+ codecId,
17
+ ...ifDefined("typeParams", typeParams)
18
+ });
19
+ if (hookDefault !== void 0) return hookDefault;
20
+ return buildBuiltinIdentityValue(dataType, typeParams);
21
+ }
22
+ const IDENTITY_VALUES = /* @__PURE__ */ new Map([
23
+ [pgText.id, "''"],
24
+ [pgChar.id, "''"],
25
+ [pgVarchar.id, "''"],
26
+ [pgInt2.id, "0"],
27
+ [pgInt4.id, "0"],
28
+ [pgInt8.id, "0"],
29
+ [pgFloat4.id, "0"],
30
+ [pgFloat8.id, "0"],
31
+ [pgNumeric.id, "0"],
32
+ [pgBool.id, "false"],
33
+ [pgUuid.id, "'00000000-0000-0000-0000-000000000000'"],
34
+ [pgJson.id, "'{}'::json"],
35
+ [pgJsonb.id, "'{}'::jsonb"],
36
+ [pgDate.id, "'epoch'"],
37
+ [pgTimestamp.id, "'epoch'"],
38
+ [pgTimestamptz.id, "'epoch'"],
39
+ [pgTime.id, "'00:00:00'"],
40
+ [pgTimetz.id, "'00:00:00+00'"],
41
+ [pgInterval.id, "'0'"],
42
+ [pgBytea.id, "''::bytea"],
43
+ [pgVarbit.id, "B''"],
44
+ [pgTextArray.id, "'{}'"]
45
+ ]);
46
+ /**
47
+ * Returns the built-in identity value (monoid neutral element) as a SQL literal for the given
48
+ * data type — e.g. 0 for integers, '' for text, false for booleans.
49
+ *
50
+ * This is the planner's fallback when no codec hook provides a type-specific identity value.
51
+ *
52
+ * Returns null for other types (for example enums and extension-owned types without a
53
+ * hook), which causes the planner to fall back to the empty-table precheck.
54
+ *
55
+ * @internal Exported for testing only.
56
+ */
57
+ function buildBuiltinIdentityValue(dataType, typeParams) {
58
+ if (dataType === pgBit.id) return buildBitIdentityValue(typeParams);
59
+ return IDENTITY_VALUES.get(dataType) ?? null;
60
+ }
61
+ function buildBitIdentityValue(typeParams) {
62
+ const length = typeParams?.["length"];
63
+ if (length === void 0) return "B'0'";
64
+ if (typeof length !== "number" || !Number.isInteger(length) || length <= 0) return null;
65
+ return `B'${"0".repeat(length)}'`;
66
+ }
67
+ //#endregion
68
+ export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
69
+
70
+ //# sourceMappingURL=planner-identity-values-QstrMJ2U-CcpaRVPY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-identity-values-QstrMJ2U-CcpaRVPY.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-identity-values-QstrMJ2U.mjs"],"sourcesContent":["import { D as pgTime, E as pgTextArray, I as pgUuid, L as pgVarbit, N as pgTimetz, R as pgVarchar, S as pgNumeric, T as pgText, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, j as pgTimestamptz, k as pgTimestamp, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, y as pgJson } from \"./data-types-Chx0mjTP.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[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-QstrMJ2U.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,QAAQ,YAAY,OAAO;CACxD,MAAM,EAAE,SAAS,eAAe;CAChC,IAAI,OAAO,MAAM,OAAO;CACxB,MAAM,WAAW,mBAAmB,SAAS,KAAK,CAAC,CAAC;CACpD,MAAM,cAAc,WAAW,IAAI,OAAO,CAAC,EAAE,uBAAuB;EACnE;EACA;EACA,GAAG,UAAU,cAAc,UAAU;CACtC,CAAC;CACD,IAAI,gBAAgB,KAAK,GAAG,OAAO;CACnC,OAAO,0BAA0B,UAAU,UAAU;AACtD;AACA,MAAM,kCAAkC,IAAI,IAAI;CAC/C,CAAC,OAAO,IAAI,IAAI;CAChB,CAAC,OAAO,IAAI,IAAI;CAChB,CAAC,UAAU,IAAI,IAAI;CACnB,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,OAAO,IAAI,GAAG;CACf,CAAC,SAAS,IAAI,GAAG;CACjB,CAAC,SAAS,IAAI,GAAG;CACjB,CAAC,UAAU,IAAI,GAAG;CAClB,CAAC,OAAO,IAAI,OAAO;CACnB,CAAC,OAAO,IAAI,wCAAwC;CACpD,CAAC,OAAO,IAAI,YAAY;CACxB,CAAC,QAAQ,IAAI,aAAa;CAC1B,CAAC,OAAO,IAAI,SAAS;CACrB,CAAC,YAAY,IAAI,SAAS;CAC1B,CAAC,cAAc,IAAI,SAAS;CAC5B,CAAC,OAAO,IAAI,YAAY;CACxB,CAAC,SAAS,IAAI,eAAe;CAC7B,CAAC,WAAW,IAAI,KAAK;CACrB,CAAC,QAAQ,IAAI,WAAW;CACxB,CAAC,SAAS,IAAI,KAAK;CACnB,CAAC,YAAY,IAAI,MAAM;AACxB,CAAC;;;;;;;;;;;;AAYD,SAAS,0BAA0B,UAAU,YAAY;CACxD,IAAI,aAAa,MAAM,IAAI,OAAO,sBAAsB,UAAU;CAClE,OAAO,gBAAgB,IAAI,QAAQ,KAAK;AACzC;AACA,SAAS,sBAAsB,YAAY;CAC1C,MAAM,SAAS,aAAa;CAC5B,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"}
@@ -0,0 +1 @@
1
+ import "./planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.mjs";
@@ -1,7 +1,7 @@
1
- import { t as PostgresMigration } from "./postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs";
2
- import { t as renderOps } from "./render-ops-DOsRP0Po-BKn_c_Ia.mjs";
3
- import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-D5m8nK6s.mjs
1
+ import { t as PostgresMigration } from "./postgres-migration-BSWmeRLo-CUfVTUf0.mjs";
2
+ import { t as renderOps } from "./render-ops-BgqtCw9Z-T8BPTX85.mjs";
3
+ import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B4mJhuVr.mjs";
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-BZclL_xO.mjs
5
5
  var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
6
6
  #calls;
7
7
  #meta;
@@ -44,4 +44,4 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
44
44
  //#endregion
45
45
  export { TypeScriptRenderablePostgresMigration as t };
46
46
 
47
- //# sourceMappingURL=planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map
47
+ //# sourceMappingURL=planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-BZclL_xO.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-BSWmeRLo.mjs\";\nimport { t as renderOps } from \"./render-ops-BgqtCw9Z.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.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(resolveImportSpecifier) {\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\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BZclL_xO.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,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
@@ -1,11 +1,11 @@
1
- import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
2
- import { t as PostgresMigration } from "./postgres-migration-BNsrwlxh-CwI5BqAu.mjs";
1
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-D6VtK0jY.mjs";
2
+ import { t as PostgresMigration } from "./postgres-migration-C5deJ3Ne-C4Jxu-e6.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
6
  import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
7
7
  import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
8
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BaviT8KK.d.mts
8
+ //#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-DyIXJ3MR.d.mts
9
9
  //#region src/core/migrations/planner-produced-postgres-migration.d.ts
10
10
  declare class TypeScriptRenderablePostgresMigration extends PostgresMigration implements MigrationPlanWithAuthoringSurface {
11
11
  #private;
@@ -22,4 +22,4 @@ declare class TypeScriptRenderablePostgresMigration extends PostgresMigration im
22
22
  }
23
23
  //#endregion
24
24
  export { TypeScriptRenderablePostgresMigration as t };
25
- //# sourceMappingURL=planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.d.mts.map
25
+ //# sourceMappingURL=planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-DyIXJ3MR.d.mts"],"mappings":";;;;;;;;;cAQc,8CAA8C,6BAA6B;;EAEvF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,UAAU;MACtH,wBAAwB,0BAA0B,6BAA6B,QAAQ,0BAA0B;EACrH,YAAY;;;;;;MAMR;EACJ,iBAAiB,wBAAwB"}
@@ -1,5 +1,5 @@
1
1
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
2
- //#region ../../../3-targets/3-targets/postgres/dist/planner-schema-lookup-kMIVP2y-.mjs
2
+ //#region ../../../3-targets/postgres/1-target/dist/planner-schema-lookup.mjs
3
3
  function buildSchemaLookupMap(schema) {
4
4
  const map = /* @__PURE__ */ new Map();
5
5
  for (const [tableName, table] of Object.entries(schema.tables)) map.set(tableName, buildSchemaTableLookup(table));
@@ -54,4 +54,4 @@ function hasForeignKey(lookup, fk) {
54
54
  //#endregion
55
55
  export { hasUniqueConstraint as i, hasForeignKey as n, hasIndex as r, buildSchemaLookupMap as t };
56
56
 
57
- //# sourceMappingURL=planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map
57
+ //# sourceMappingURL=planner-schema-lookup-BbUY9oVy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-schema-lookup-BbUY9oVy.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-schema-lookup.mjs"],"sourcesContent":["import { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/planner-schema-lookup.ts\nfunction buildSchemaLookupMap(schema) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const [tableName, table] of Object.entries(schema.tables)) map.set(tableName, buildSchemaTableLookup(table));\n\treturn map;\n}\nfunction buildSchemaTableLookup(table) {\n\tconst uniqueKeys = new Set(table.uniques.map((u) => u.columns.join(\",\")));\n\tconst indexKeys = new Set(table.indexes.map((i) => (i.columns ?? []).join(\",\")));\n\tconst uniqueIndexKeys = new Set(table.indexes.filter((i) => i.unique).map((i) => (i.columns ?? []).join(\",\")));\n\tconst fkKeys = /* @__PURE__ */ new Set();\n\tfor (const fk of table.foreignKeys) {\n\t\tfkKeys.add(JSON.stringify([\n\t\t\tfk.columns,\n\t\t\tfk.referencedTable,\n\t\t\tfk.referencedColumns\n\t\t]));\n\t\tif (fk.referencedSchema !== void 0) fkKeys.add(JSON.stringify([\n\t\t\tfk.columns,\n\t\t\tfk.referencedSchema,\n\t\t\tfk.referencedTable,\n\t\t\tfk.referencedColumns\n\t\t]));\n\t}\n\treturn {\n\t\tuniqueKeys,\n\t\tindexKeys,\n\t\tuniqueIndexKeys,\n\t\tfkKeys\n\t};\n}\nfunction hasUniqueConstraint(lookup, columns) {\n\tconst key = columns.join(\",\");\n\treturn lookup.uniqueKeys.has(key) || lookup.uniqueIndexKeys.has(key);\n}\nfunction hasIndex(lookup, columns) {\n\tconst key = columns.join(\",\");\n\treturn lookup.indexKeys.has(key) || lookup.uniqueKeys.has(key);\n}\nfunction hasForeignKey(lookup, fk) {\n\tif (fk.target.namespaceId === UNBOUND_NAMESPACE_ID) return lookup.fkKeys.has(JSON.stringify([\n\t\tfk.source.columns,\n\t\tfk.target.tableName,\n\t\tfk.target.columns\n\t]));\n\treturn lookup.fkKeys.has(JSON.stringify([\n\t\tfk.source.columns,\n\t\tfk.target.namespaceId,\n\t\tfk.target.tableName,\n\t\tfk.target.columns\n\t]));\n}\n//#endregion\nexport { buildSchemaLookupMap, hasForeignKey, hasIndex, hasUniqueConstraint };\n\n//# sourceMappingURL=planner-schema-lookup.mjs.map"],"mappings":";;AAEA,SAAS,qBAAqB,QAAQ;CACrC,MAAM,sBAAsB,IAAI,IAAI;CACpC,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,GAAG,IAAI,IAAI,WAAW,uBAAuB,KAAK,CAAC;CAChH,OAAO;AACR;AACA,SAAS,uBAAuB,OAAO;CACtC,MAAM,aAAa,IAAI,IAAI,MAAM,QAAQ,KAAK,MAAM,EAAE,QAAQ,KAAK,GAAG,CAAC,CAAC;CACxE,MAAM,YAAY,IAAI,IAAI,MAAM,QAAQ,KAAK,OAAO,EAAE,WAAW,CAAC,EAAA,CAAG,KAAK,GAAG,CAAC,CAAC;CAC/E,MAAM,kBAAkB,IAAI,IAAI,MAAM,QAAQ,QAAQ,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,OAAO,EAAE,WAAW,CAAC,EAAA,CAAG,KAAK,GAAG,CAAC,CAAC;CAC7G,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,MAAM,MAAM,aAAa;EACnC,OAAO,IAAI,KAAK,UAAU;GACzB,GAAG;GACH,GAAG;GACH,GAAG;EACJ,CAAC,CAAC;EACF,IAAI,GAAG,qBAAqB,KAAK,GAAG,OAAO,IAAI,KAAK,UAAU;GAC7D,GAAG;GACH,GAAG;GACH,GAAG;GACH,GAAG;EACJ,CAAC,CAAC;CACH;CACA,OAAO;EACN;EACA;EACA;EACA;CACD;AACD;AACA,SAAS,oBAAoB,QAAQ,SAAS;CAC7C,MAAM,MAAM,QAAQ,KAAK,GAAG;CAC5B,OAAO,OAAO,WAAW,IAAI,GAAG,KAAK,OAAO,gBAAgB,IAAI,GAAG;AACpE;AACA,SAAS,SAAS,QAAQ,SAAS;CAClC,MAAM,MAAM,QAAQ,KAAK,GAAG;CAC5B,OAAO,OAAO,UAAU,IAAI,GAAG,KAAK,OAAO,WAAW,IAAI,GAAG;AAC9D;AACA,SAAS,cAAc,QAAQ,IAAI;CAClC,IAAI,GAAG,OAAO,gBAAgB,sBAAsB,OAAO,OAAO,OAAO,IAAI,KAAK,UAAU;EAC3F,GAAG,OAAO;EACV,GAAG,OAAO;EACV,GAAG,OAAO;CACX,CAAC,CAAC;CACF,OAAO,OAAO,OAAO,IAAI,KAAK,UAAU;EACvC,GAAG,OAAO;EACV,GAAG,OAAO;EACV,GAAG,OAAO;EACV,GAAG,OAAO;CACX,CAAC,CAAC;AACH"}
@@ -1,6 +1,6 @@
1
1
  import { ForeignKey } from "@prisma/orm-family-sql/contract/types";
2
2
  import { SqlSchemaIR } from "@prisma/orm-family-sql/schema-ir/types";
3
- //#region ../../../3-targets/3-targets/postgres/dist/planner-schema-lookup.d.mts
3
+ //#region ../../../3-targets/postgres/1-target/dist/planner-schema-lookup.d.mts
4
4
  //#region src/core/migrations/planner-schema-lookup.d.ts
5
5
  /**
6
6
  * Pre-computed lookup sets for a schema table's constraints.
@@ -18,4 +18,4 @@ declare function hasIndex(lookup: SchemaTableLookup, columns: readonly string[])
18
18
  declare function hasForeignKey(lookup: SchemaTableLookup, fk: ForeignKey): boolean;
19
19
  //#endregion
20
20
  export { hasUniqueConstraint as i, hasForeignKey as n, hasIndex as r, buildSchemaLookupMap as t };
21
- //# sourceMappingURL=planner-schema-lookup-C4DHAddq.d.mts.map
21
+ //# sourceMappingURL=planner-schema-lookup-ceCNOGFf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-schema-lookup-ceCNOGFf.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-schema-lookup.d.mts"],"mappings":";;;;;;;;UAOU;WACC,YAAY;WACZ,WAAW;WACX,iBAAiB;WACjB,QAAQ;;iBAEF,qBAAqB,QAAQ,cAAc,oBAAoB;iBAC/D,oBAAoB,QAAQ,mBAAmB;iBAC/C,SAAS,QAAQ,mBAAmB;iBACpC,cAAc,QAAQ,mBAAmB,IAAI"}
@@ -0,0 +1,151 @@
1
+ import { c as postgresError } from "./errors-BrhQYgdL-IvZHPjwL.mjs";
2
+ import { h as postgresCreateNamespace } from "./postgres-schema-C6w1rzOF-D1fdwqRx.mjs";
3
+ import { r as autoincrementWidthOfPseudoType } from "./autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs";
4
+ import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
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-D-K44J19.mjs
7
+ /**
8
+ * String-keyed entry points the migration ops use to render
9
+ * schema-qualified DDL and catalog checks. The `schema` argument is
10
+ * interpreted as a namespace coordinate: the framework `__unbound__`
11
+ * sentinel resolves to the late-bound `PostgresUnboundSchema` singleton
12
+ * (which elides the qualifier so `search_path` decides at runtime); any
13
+ * other id materialises a `PostgresSchema(id)` whose qualifier is the
14
+ * named schema. Helpers route through these `Namespace` concretions so
15
+ * the unbound branch lives in the polymorphic override, not the call
16
+ * site.
17
+ */
18
+ function qualifyTableName(schema, table) {
19
+ return postgresCreateNamespace({
20
+ id: schema,
21
+ entries: { table: {} }
22
+ }).qualifyTable(table);
23
+ }
24
+ /** The data types the components of a stack register. */
25
+ function stackDataTypes(frameworkComponents) {
26
+ return assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);
27
+ }
28
+ const ARRAY_SUFFIX = /^(.*?)(?:\s*\[\s*\])+$/s;
29
+ const QUOTED_SEGMENT = /^"((?:[^"]|"")+)"/;
30
+ /** The segments of a name written as one or two double-quoted identifiers, `"Mood"` or `"app"."status"`. */
31
+ function quotedName(text) {
32
+ const segments = [];
33
+ let rest = text;
34
+ while (rest !== "") {
35
+ const match = QUOTED_SEGMENT.exec(rest);
36
+ if (match === null) return void 0;
37
+ segments.push((match[1] ?? "").replaceAll("\"\"", "\""));
38
+ rest = rest.slice(match[0].length);
39
+ if (rest.startsWith(".")) rest = rest.slice(1);
40
+ else if (rest !== "") return void 0;
41
+ }
42
+ return segments.length === 1 || segments.length === 2 ? segments : void 0;
43
+ }
44
+ function columnTypeUnreadable(type, where, reason) {
45
+ throw postgresError("MIGRATION.COLUMN_TYPE_UNREADABLE", `${where}: ${reason}`, {
46
+ why: "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.",
47
+ fix: "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.",
48
+ meta: {
49
+ type,
50
+ where
51
+ }
52
+ });
53
+ }
54
+ /** 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. */
55
+ function columnTypeCheckText(check) {
56
+ return check.kind === "catalog-text" ? `"${check.text}"` : `${check.typeName}${check.many ? "[]" : ""}`;
57
+ }
58
+ function rawTypeCheckText(type, where) {
59
+ const trimmed = type.trim();
60
+ const array = ARRAY_SUFFIX.exec(trimmed);
61
+ const base = array?.[1] ?? trimmed;
62
+ const suffix = array === null ? "" : "[]";
63
+ const refused = checkRawTypeText(base);
64
+ return refused === void 0 ? `${base}${suffix}` : columnTypeUnreadable(type, where, `the raw type "${type}" is refused: ${refused}`);
65
+ }
66
+ /**
67
+ * 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.
68
+ */
69
+ function alterTypeCheck(type, dataTypes, where, raw = false) {
70
+ if (raw) return {
71
+ kind: "catalog-text",
72
+ text: rawTypeCheckText(type, where)
73
+ };
74
+ const read = readColumnTypeCheck(type, dataTypes);
75
+ return read.ok ? read.check : columnTypeUnreadable(type, where, read.reason);
76
+ }
77
+ /** 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. */
78
+ function columnTypeCheckIfReadable(type, dataTypes) {
79
+ const read = readColumnTypeCheck(type, dataTypes);
80
+ return read.ok ? read.check : void 0;
81
+ }
82
+ /**
83
+ * 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.
84
+ */
85
+ function writtenColumnType(type, dataTypes) {
86
+ const read = readWrittenType(type, dataTypes);
87
+ return read.ok ? {
88
+ storedType: read.type,
89
+ storedTypeParams: read.typeParams,
90
+ many: read.many
91
+ } : void 0;
92
+ }
93
+ function readWrittenType(type, dataTypes) {
94
+ const trimmed = autoincrementWidthOfPseudoType(type)?.sequenceType ?? type.trim();
95
+ const array = ARRAY_SUFFIX.exec(trimmed);
96
+ const base = array?.[1] ?? trimmed;
97
+ const sqlTypes = dataTypes.filter(isSqlDataType);
98
+ const byText = resolveWrittenSqlTypes(base, sqlTypes);
99
+ if (byText.length > 1) return {
100
+ ok: false,
101
+ reason: `more than one data type of the configured stack reads the type "${type}", as ${byText.map((resolved) => resolved.dataType.id).join(" and ")}`
102
+ };
103
+ const resolved = byText[0] ?? resolvedByKind(base, sqlTypes);
104
+ if (resolved === void 0) return {
105
+ ok: false,
106
+ reason: `no data type of the configured stack reads the type "${type}"`
107
+ };
108
+ return {
109
+ ok: true,
110
+ type: resolved.dataType,
111
+ typeParams: resolved.typeParams,
112
+ many: array !== null
113
+ };
114
+ }
115
+ function readColumnTypeCheck(type, dataTypes) {
116
+ const read = readWrittenType(type, dataTypes);
117
+ if (!read.ok) return read;
118
+ if (read.type.sql.claimsKind !== void 0) return {
119
+ ok: true,
120
+ check: {
121
+ kind: "identity",
122
+ typeName: renderSqlTypeName(read.type, read.typeParams),
123
+ many: read.many
124
+ }
125
+ };
126
+ return {
127
+ ok: true,
128
+ check: {
129
+ kind: "catalog-text",
130
+ text: `${renderSqlCatalogText(read.type, read.typeParams)}${read.many ? "[]" : ""}`
131
+ }
132
+ };
133
+ }
134
+ /** The type a quoted name names, read as the one data type that claims a kind reads a reported type of that kind. */
135
+ function resolvedByKind(base, dataTypes) {
136
+ const name = quotedName(base);
137
+ const kinds = dataTypes.flatMap(({ sql }) => sql.claimsKind ?? []);
138
+ const [kind] = kinds;
139
+ if (name === void 0 || kind === void 0 || kinds.length > 1) return void 0;
140
+ const [schema, typeName] = name.length === 2 ? name : [void 0, name[0]];
141
+ return resolveReportedSqlType({
142
+ text: base,
143
+ kind,
144
+ schema,
145
+ name: typeName
146
+ }, dataTypes);
147
+ }
148
+ //#endregion
149
+ export { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };
150
+
151
+ //# sourceMappingURL=planner-sql-checks-D-K44J19-CzvrqzNB.mjs.map