@prisma/orm-target-postgres 0.16.0-dev.36

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 (279) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/dist/adapter-CWvVo0PV.d.mts +22 -0
  4. package/dist/adapter-CWvVo0PV.d.mts.map +1 -0
  5. package/dist/adapter-DhqcO3YO-jzwDVcCv.mjs +70 -0
  6. package/dist/adapter-DhqcO3YO-jzwDVcCv.mjs.map +1 -0
  7. package/dist/adapter.d.mts +12 -0
  8. package/dist/adapter.mjs +7 -0
  9. package/dist/adapter__adapter.d.mts +2 -0
  10. package/dist/adapter__adapter.mjs +2 -0
  11. package/dist/adapter__column-types.d.mts +2 -0
  12. package/dist/adapter__column-types.mjs +2 -0
  13. package/dist/adapter__control.d.mts +5 -0
  14. package/dist/adapter__control.mjs +441 -0
  15. package/dist/adapter__control.mjs.map +1 -0
  16. package/dist/adapter__operation-types.d.mts +2 -0
  17. package/dist/adapter__operation-types.mjs +1 -0
  18. package/dist/adapter__runtime.d.mts +2 -0
  19. package/dist/adapter__runtime.mjs +38 -0
  20. package/dist/adapter__runtime.mjs.map +1 -0
  21. package/dist/adapter__types.d.mts +4 -0
  22. package/dist/adapter__types.mjs +1 -0
  23. package/dist/authoring-03FwIL2k-kPjZAp3s.mjs +757 -0
  24. package/dist/authoring-03FwIL2k-kPjZAp3s.mjs.map +1 -0
  25. package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts +34 -0
  26. package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts.map +1 -0
  27. package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs +59 -0
  28. package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs.map +1 -0
  29. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts +37 -0
  30. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts.map +1 -0
  31. package/dist/codec-descriptor-Bg-_412t.d.mts +1 -0
  32. package/dist/codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs +135 -0
  33. package/dist/codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs.map +1 -0
  34. package/dist/codec-ids-CsOU3xDv-mPI0INiF.d.mts +33 -0
  35. package/dist/codec-ids-CsOU3xDv-mPI0INiF.d.mts.map +1 -0
  36. package/dist/codec-ids-fgafMLR7.d.mts +1 -0
  37. package/dist/codec-ids-tX7Svtz--BuOfRaVU.mjs +33 -0
  38. package/dist/codec-ids-tX7Svtz--BuOfRaVU.mjs.map +1 -0
  39. package/dist/codec-types-BHwY9Ff-.d.mts +2 -0
  40. package/dist/codec-types-mWhnDEAf-CAQzGFnF.d.mts +82 -0
  41. package/dist/codec-types-mWhnDEAf-CAQzGFnF.d.mts.map +1 -0
  42. package/dist/codecs-CBl0nD44-CaWPc1bd.mjs +1486 -0
  43. package/dist/codecs-CBl0nD44-CaWPc1bd.mjs.map +1 -0
  44. package/dist/codecs-CHIVTNZs.mjs +15 -0
  45. package/dist/codecs-CHIVTNZs.mjs.map +1 -0
  46. package/dist/codecs-Cvqvb9pV-Cdc51FKY.d.mts +589 -0
  47. package/dist/codecs-Cvqvb9pV-Cdc51FKY.d.mts.map +1 -0
  48. package/dist/codecs-DBn-uIv-.d.mts +15 -0
  49. package/dist/codecs-DBn-uIv-.d.mts.map +1 -0
  50. package/dist/column-types-BH-MU6uU.d.mts +108 -0
  51. package/dist/column-types-BH-MU6uU.d.mts.map +1 -0
  52. package/dist/column-types-CwAyCgp2.mjs +126 -0
  53. package/dist/column-types-CwAyCgp2.mjs.map +1 -0
  54. package/dist/contract-free-BZUS18FU.mjs +118 -0
  55. package/dist/contract-free-BZUS18FU.mjs.map +1 -0
  56. package/dist/contract-free-DzpGxLfb.d.mts +258 -0
  57. package/dist/contract-free-DzpGxLfb.d.mts.map +1 -0
  58. package/dist/control-2F195jJk.d.mts +11 -0
  59. package/dist/control-2F195jJk.d.mts.map +1 -0
  60. package/dist/control-6WFTtLAM.mjs +60 -0
  61. package/dist/control-6WFTtLAM.mjs.map +1 -0
  62. package/dist/control-B-FTbEnE.d.mts +22 -0
  63. package/dist/control-B-FTbEnE.d.mts.map +1 -0
  64. package/dist/control-D85zv_aY.d.mts +199 -0
  65. package/dist/control-D85zv_aY.d.mts.map +1 -0
  66. package/dist/control-DRMWptiJ.mjs +1355 -0
  67. package/dist/control-DRMWptiJ.mjs.map +1 -0
  68. package/dist/control-adapter-B9t0g7Pf-HrCxlM65.mjs +1901 -0
  69. package/dist/control-adapter-B9t0g7Pf-HrCxlM65.mjs.map +1 -0
  70. package/dist/control-policy-Cl3RRSPg-CT3QGpR3.mjs +1257 -0
  71. package/dist/control-policy-Cl3RRSPg-CT3QGpR3.mjs.map +1 -0
  72. package/dist/data-transform-BSM7TQpE.d.mts +1 -0
  73. package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs +53 -0
  74. package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs.map +1 -0
  75. package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts +38 -0
  76. package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts.map +1 -0
  77. package/dist/ddl-B4Rh8ntj.d.mts +1 -0
  78. package/dist/ddl-BdP4q3KY-Duef4uHw.mjs +395 -0
  79. package/dist/ddl-BdP4q3KY-Duef4uHw.mjs.map +1 -0
  80. package/dist/default-normalizer-B36TOul4.d.mts +31 -0
  81. package/dist/default-normalizer-B36TOul4.d.mts.map +1 -0
  82. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs +253 -0
  83. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs.map +1 -0
  84. package/dist/descriptor-meta-2IlVC6_d-DnV00Qd_.mjs +351 -0
  85. package/dist/descriptor-meta-2IlVC6_d-DnV00Qd_.mjs.map +1 -0
  86. package/dist/descriptor-meta-DnHabAS3-C53XXPQw.mjs +28 -0
  87. package/dist/descriptor-meta-DnHabAS3-C53XXPQw.mjs.map +1 -0
  88. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs +13 -0
  89. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs.map +1 -0
  90. package/dist/diff-database-schema-BfRs2vrG-D2o4KII0.mjs +390 -0
  91. package/dist/diff-database-schema-BfRs2vrG-D2o4KII0.mjs.map +1 -0
  92. package/dist/diff-database-schema-DsoNznGC.d.mts +38 -0
  93. package/dist/diff-database-schema-DsoNznGC.d.mts.map +1 -0
  94. package/dist/driver.d.mts +3 -0
  95. package/dist/driver.mjs +2 -0
  96. package/dist/driver__control.d.mts +2 -0
  97. package/dist/driver__control.mjs +2 -0
  98. package/dist/driver__runtime.d.mts +2 -0
  99. package/dist/driver__runtime.mjs +597 -0
  100. package/dist/driver__runtime.mjs.map +1 -0
  101. package/dist/errors-DCcVX4j1.d.mts +32 -0
  102. package/dist/errors-DCcVX4j1.d.mts.map +1 -0
  103. package/dist/errors-kYxOQjdD-D4T3rbVp.mjs +39 -0
  104. package/dist/errors-kYxOQjdD-D4T3rbVp.mjs.map +1 -0
  105. package/dist/issue-planner-jkY6p-Ca.d.mts +105 -0
  106. package/dist/issue-planner-jkY6p-Ca.d.mts.map +1 -0
  107. package/dist/migration-CBSAPE8S.d.mts +25 -0
  108. package/dist/migration-CBSAPE8S.d.mts.map +1 -0
  109. package/dist/migration-PTHAY9Cv.mjs +21 -0
  110. package/dist/migration-PTHAY9Cv.mjs.map +1 -0
  111. package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs +7 -0
  112. package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs.map +1 -0
  113. package/dist/native-type-normalizer-DqJlOTeX.d.mts +19 -0
  114. package/dist/native-type-normalizer-DqJlOTeX.d.mts.map +1 -0
  115. package/dist/native-type-normalizer-yvd3tqv-.mjs +38 -0
  116. package/dist/native-type-normalizer-yvd3tqv-.mjs.map +1 -0
  117. package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts +235 -0
  118. package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts.map +1 -0
  119. package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs +255 -0
  120. package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs.map +1 -0
  121. package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs +121 -0
  122. package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs.map +1 -0
  123. package/dist/op-factory-call-DifL68KT-Bo6pxs-R.mjs +2009 -0
  124. package/dist/op-factory-call-DifL68KT-Bo6pxs-R.mjs.map +1 -0
  125. package/dist/op-factory-call-FEA5mnWH.d.mts +1 -0
  126. package/dist/op-factory-call-jd4cgfjA-CyNT4YVn.d.mts +521 -0
  127. package/dist/op-factory-call-jd4cgfjA-CyNT4YVn.d.mts.map +1 -0
  128. package/dist/operation-types-BfRocNI8.d.mts +22 -0
  129. package/dist/operation-types-BfRocNI8.d.mts.map +1 -0
  130. package/dist/pack-DFM4tmob.d.mts +610 -0
  131. package/dist/pack-DFM4tmob.d.mts.map +1 -0
  132. package/dist/planner-Bmje9ii8-B99fEsNM.mjs +588 -0
  133. package/dist/planner-Bmje9ii8-B99fEsNM.mjs.map +1 -0
  134. package/dist/planner-DL4Bh5Nk.d.mts +163 -0
  135. package/dist/planner-DL4Bh5Nk.d.mts.map +1 -0
  136. package/dist/planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs +102 -0
  137. package/dist/planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs.map +1 -0
  138. package/dist/planner-ddl-builders-ijp60-JO.d.mts +19 -0
  139. package/dist/planner-ddl-builders-ijp60-JO.d.mts.map +1 -0
  140. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs +90 -0
  141. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs.map +1 -0
  142. package/dist/planner-identity-values-TfEhnoWa.d.mts +25 -0
  143. package/dist/planner-identity-values-TfEhnoWa.d.mts.map +1 -0
  144. package/dist/planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts +25 -0
  145. package/dist/planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts.map +1 -0
  146. package/dist/planner-produced-postgres-migration-C3GPZWeC.d.mts +1 -0
  147. package/dist/planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs +47 -0
  148. package/dist/planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs.map +1 -0
  149. package/dist/planner-schema-lookup-C4DHAddq.d.mts +21 -0
  150. package/dist/planner-schema-lookup-C4DHAddq.d.mts.map +1 -0
  151. package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs +57 -0
  152. package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map +1 -0
  153. package/dist/planner-sql-checks-CFgbRTJw.d.mts +20 -0
  154. package/dist/planner-sql-checks-CFgbRTJw.d.mts.map +1 -0
  155. package/dist/planner-sql-checks-DRc_78n8-C9nHOrvU.mjs +152 -0
  156. package/dist/planner-sql-checks-DRc_78n8-C9nHOrvU.mjs.map +1 -0
  157. package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts +12 -0
  158. package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts.map +1 -0
  159. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs +15 -0
  160. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs.map +1 -0
  161. package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts +36 -0
  162. package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts.map +1 -0
  163. package/dist/postgres-contract-view-FdLX7dV9-Cat1VKV9.mjs +144 -0
  164. package/dist/postgres-contract-view-FdLX7dV9-Cat1VKV9.mjs.map +1 -0
  165. package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts +285 -0
  166. package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts.map +1 -0
  167. package/dist/postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts +260 -0
  168. package/dist/postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts.map +1 -0
  169. package/dist/postgres-migration-CJshdIZn-DYYjgdD0.mjs +201 -0
  170. package/dist/postgres-migration-CJshdIZn-DYYjgdD0.mjs.map +1 -0
  171. package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs +45 -0
  172. package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs.map +1 -0
  173. package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts +61 -0
  174. package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts.map +1 -0
  175. package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs +204 -0
  176. package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs.map +1 -0
  177. package/dist/postgres-schema-KSzLDONj-CsXGoY8b.mjs +421 -0
  178. package/dist/postgres-schema-KSzLDONj-CsXGoY8b.mjs.map +1 -0
  179. package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts +269 -0
  180. package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts.map +1 -0
  181. package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs +212 -0
  182. package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs.map +1 -0
  183. package/dist/render-ops-DPwhZt2W.d.mts +11 -0
  184. package/dist/render-ops-DPwhZt2W.d.mts.map +1 -0
  185. package/dist/render-ops-DxzTxSsv-Bz85uUHk.mjs +34 -0
  186. package/dist/render-ops-DxzTxSsv-Bz85uUHk.mjs.map +1 -0
  187. package/dist/render-typescript-6sCFvMBh.d.mts +21 -0
  188. package/dist/render-typescript-6sCFvMBh.d.mts.map +1 -0
  189. package/dist/render-typescript-Cw3lFO28-Cx0lXWmv.mjs +117 -0
  190. package/dist/render-typescript-Cw3lFO28-Cx0lXWmv.mjs.map +1 -0
  191. package/dist/resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs +22 -0
  192. package/dist/resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs.map +1 -0
  193. package/dist/runtime-BbSRVwdd.d.mts +12 -0
  194. package/dist/runtime-BbSRVwdd.d.mts.map +1 -0
  195. package/dist/runtime-CDewySU9.d.mts +55 -0
  196. package/dist/runtime-CDewySU9.d.mts.map +1 -0
  197. package/dist/runtime-_TfO66h5.d.mts +32 -0
  198. package/dist/runtime-_TfO66h5.d.mts.map +1 -0
  199. package/dist/schema-ir-annotations-DuuYh0gl.d.mts +15 -0
  200. package/dist/schema-ir-annotations-DuuYh0gl.d.mts.map +1 -0
  201. package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts +30 -0
  202. package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts.map +1 -0
  203. package/dist/sql-utils-BnBlQxyh-DaX9Nb7Z.mjs +90 -0
  204. package/dist/sql-utils-BnBlQxyh-DaX9Nb7Z.mjs.map +1 -0
  205. package/dist/sql-utils-DW6fkczF.d.mts +62 -0
  206. package/dist/sql-utils-DW6fkczF.d.mts.map +1 -0
  207. package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts +15 -0
  208. package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts.map +1 -0
  209. package/dist/target.d.mts +47 -0
  210. package/dist/target.mjs +34 -0
  211. package/dist/target__codec-descriptor.d.mts +3 -0
  212. package/dist/target__codec-descriptor.mjs +2 -0
  213. package/dist/target__codec-ids.d.mts +3 -0
  214. package/dist/target__codec-ids.mjs +2 -0
  215. package/dist/target__codec-types.d.mts +4 -0
  216. package/dist/target__codec-types.mjs +1 -0
  217. package/dist/target__codecs.d.mts +3 -0
  218. package/dist/target__codecs.mjs +3 -0
  219. package/dist/target__contract-free.d.mts +3 -0
  220. package/dist/target__contract-free.mjs +4 -0
  221. package/dist/target__control.d.mts +2 -0
  222. package/dist/target__control.mjs +2 -0
  223. package/dist/target__data-transform.d.mts +3 -0
  224. package/dist/target__data-transform.mjs +2 -0
  225. package/dist/target__ddl.d.mts +4 -0
  226. package/dist/target__ddl.mjs +2 -0
  227. package/dist/target__default-normalizer.d.mts +2 -0
  228. package/dist/target__default-normalizer.mjs +2 -0
  229. package/dist/target__diff-database-schema.d.mts +2 -0
  230. package/dist/target__diff-database-schema.mjs +2 -0
  231. package/dist/target__errors.d.mts +2 -0
  232. package/dist/target__errors.mjs +2 -0
  233. package/dist/target__issue-planner.d.mts +2 -0
  234. package/dist/target__issue-planner.mjs +2 -0
  235. package/dist/target__migration.d.mts +4 -0
  236. package/dist/target__migration.mjs +5 -0
  237. package/dist/target__native-type-normalizer.d.mts +2 -0
  238. package/dist/target__native-type-normalizer.mjs +2 -0
  239. package/dist/target__op-factory-call.d.mts +3 -0
  240. package/dist/target__op-factory-call.mjs +2 -0
  241. package/dist/target__pack.d.mts +2 -0
  242. package/dist/target__pack.mjs +2 -0
  243. package/dist/target__planner-ddl-builders.d.mts +2 -0
  244. package/dist/target__planner-ddl-builders.mjs +2 -0
  245. package/dist/target__planner-identity-values.d.mts +2 -0
  246. package/dist/target__planner-identity-values.mjs +2 -0
  247. package/dist/target__planner-produced-postgres-migration.d.mts +3 -0
  248. package/dist/target__planner-produced-postgres-migration.mjs +2 -0
  249. package/dist/target__planner-schema-lookup.d.mts +2 -0
  250. package/dist/target__planner-schema-lookup.mjs +2 -0
  251. package/dist/target__planner-sql-checks.d.mts +2 -0
  252. package/dist/target__planner-sql-checks.mjs +2 -0
  253. package/dist/target__planner-target-details.d.mts +2 -0
  254. package/dist/target__planner-target-details.mjs +1 -0
  255. package/dist/target__planner.d.mts +2 -0
  256. package/dist/target__planner.mjs +3 -0
  257. package/dist/target__render-ops.d.mts +2 -0
  258. package/dist/target__render-ops.mjs +2 -0
  259. package/dist/target__render-typescript.d.mts +2 -0
  260. package/dist/target__render-typescript.mjs +2 -0
  261. package/dist/target__rls-canonicalize.d.mts +2 -0
  262. package/dist/target__rls-canonicalize.mjs +2 -0
  263. package/dist/target__runtime.d.mts +3 -0
  264. package/dist/target__runtime.mjs +23 -0
  265. package/dist/target__runtime.mjs.map +1 -0
  266. package/dist/target__schema-ir-annotations.d.mts +2 -0
  267. package/dist/target__schema-ir-annotations.mjs +2 -0
  268. package/dist/target__sql-utils.d.mts +2 -0
  269. package/dist/target__sql-utils.mjs +2 -0
  270. package/dist/target__types.d.mts +7 -0
  271. package/dist/target__types.mjs +5 -0
  272. package/dist/types-CkryN1AS-6MNZLjLY.d.mts +27 -0
  273. package/dist/types-CkryN1AS-6MNZLjLY.d.mts.map +1 -0
  274. package/dist/types-Cp_Jf2tk.d.mts +1 -0
  275. package/dist/types-ue6jkJyF-BQJzjx1P.d.mts +10 -0
  276. package/dist/types-ue6jkJyF-BQJzjx1P.d.mts.map +1 -0
  277. package/dist/types-xa86TkcV.d.mts +32 -0
  278. package/dist/types-xa86TkcV.d.mts.map +1 -0
  279. package/package.json +95 -0
@@ -0,0 +1,117 @@
1
+ import { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from "@prisma/orm-framework/components/control";
2
+ import { renderImports } from "@prisma/orm-framework/ts-render";
3
+ import { resolveRequirementSpecifiers } from "@prisma/orm-framework/components/emission";
4
+ import { detectScaffoldRuntime, shebangLineFor } from "@prisma/orm-toolchain/migration-tools/migration-ts";
5
+ //#region ../../../3-targets/3-targets/postgres/dist/render-typescript-Cw3lFO28.mjs
6
+ /**
7
+ * Polymorphic TypeScript emitter for the Postgres migration IR.
8
+ *
9
+ * Each `OpFactoryCall` renders itself via `renderTypeScript()` and
10
+ * declares its own `importRequirements()`; this file just composes the module
11
+ * source around those contributions. The design mirrors the Mongo target's
12
+ * `render-typescript.ts` deliberately — byte-for-byte alignment isn't required
13
+ * (different factory module specifiers, different base-class name) but the
14
+ * shape is, so future consolidation to a framework-level helper is mechanical.
15
+ */
16
+ /**
17
+ * Always-present base imports for the rendered scaffold. Both come from
18
+ * `@internal/postgres/migration` so an authored Postgres
19
+ * `migration.ts` only needs a single dependency for its base class and
20
+ * its CLI entrypoint:
21
+ *
22
+ * - `Migration` — the facade re-export fixes the `SqlMigration`
23
+ * generic to `PostgresPlanTargetDetails` and the abstract `targetId`
24
+ * to `'postgres'`, so user-authored migrations don't need to thread
25
+ * target-details or redeclare `targetId`.
26
+ * - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from
27
+ * `@internal/cli/migration-cli`. Loads `prisma-next.config.ts`,
28
+ * assembles a `ControlStack`, and instantiates the migration class.
29
+ * The migration file owns this dependency directly: pulling CLI
30
+ * machinery in at script run time is acceptable because the script's
31
+ * whole purpose is to be invoked from the project that owns the
32
+ * config.
33
+ */
34
+ const BASE_IMPORTS = [{
35
+ moduleSpecifier: "@internal/postgres/migration",
36
+ symbol: "Migration"
37
+ }, {
38
+ moduleSpecifier: "@internal/postgres/migration",
39
+ symbol: "MigrationCLI"
40
+ }];
41
+ function renderCallsToTypeScript(calls, meta) {
42
+ const imports = buildImports(calls, meta);
43
+ const operationsBody = calls.map((c) => renderCall(c)).join(",\n");
44
+ const hasStart = meta.from !== null;
45
+ const startField = hasStart ? [" override readonly startContractJson = startContract;"] : [];
46
+ return [
47
+ shebangLineFor(detectScaffoldRuntime()),
48
+ imports,
49
+ "",
50
+ `export default class M extends Migration<${hasStart ? "Start" : "never"}, End> {`,
51
+ ...startField,
52
+ " override readonly endContractJson = endContract;",
53
+ "",
54
+ " override get operations() {",
55
+ " return [",
56
+ indent(operationsBody, 6),
57
+ " ];",
58
+ " }",
59
+ "}",
60
+ "",
61
+ "MigrationCLI.run(import.meta.url, M);",
62
+ ""
63
+ ].join("\n");
64
+ }
65
+ function renderCall(call) {
66
+ return call.renderTypeScript();
67
+ }
68
+ function buildImports(calls, meta) {
69
+ const requirements = [...BASE_IMPORTS, ...contractImports(meta)];
70
+ for (const call of calls) for (const req of call.importRequirements()) requirements.push(req);
71
+ return renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));
72
+ }
73
+ /**
74
+ * The committed contract-JSON imports the scaffold reads its from/to identity
75
+ * from, resolved to the deduplicated snapshot store under
76
+ * `meta.snapshotsImportPath`. The end snapshot is always present; the start
77
+ * snapshot is added only for a non-baseline migration (`meta.from !== null`).
78
+ * The matching `Contract` type imports (aliased `Start`/`End`) feed the
79
+ * `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with
80
+ * no start imports — `never` is the honest "no prior contract" Start.
81
+ */
82
+ function contractImports(meta) {
83
+ const reqs = [{
84
+ moduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),
85
+ symbol: "endContract",
86
+ kind: "default",
87
+ attributes: { type: "json" }
88
+ }, {
89
+ moduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),
90
+ symbol: "Contract",
91
+ alias: "End",
92
+ typeOnly: true
93
+ }];
94
+ if (meta.from !== null) {
95
+ reqs.push({
96
+ moduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),
97
+ symbol: "startContract",
98
+ kind: "default",
99
+ attributes: { type: "json" }
100
+ });
101
+ reqs.push({
102
+ moduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),
103
+ symbol: "Contract",
104
+ alias: "Start",
105
+ typeOnly: true
106
+ });
107
+ }
108
+ return reqs;
109
+ }
110
+ function indent(text, spaces) {
111
+ const pad = " ".repeat(spaces);
112
+ return text.split("\n").map((line) => line.trim() ? `${pad}${line}` : line).join("\n");
113
+ }
114
+ //#endregion
115
+ export { renderCallsToTypeScript as t };
116
+
117
+ //# sourceMappingURL=render-typescript-Cw3lFO28-Cx0lXWmv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-typescript-Cw3lFO28-Cx0lXWmv.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/render-typescript-Cw3lFO28.mjs"],"sourcesContent":["import { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from \"@internal/framework-components/control\";\nimport { renderImports } from \"@internal/ts-render\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\n//#region src/core/migrations/render-typescript.ts\n/**\n* Polymorphic TypeScript emitter for the Postgres migration IR.\n*\n* Each `OpFactoryCall` renders itself via `renderTypeScript()` and\n* declares its own `importRequirements()`; this file just composes the module\n* source around those contributions. The design mirrors the Mongo target's\n* `render-typescript.ts` deliberately — byte-for-byte alignment isn't required\n* (different factory module specifiers, different base-class name) but the\n* shape is, so future consolidation to a framework-level helper is mechanical.\n*/\n/**\n* Always-present base imports for the rendered scaffold. Both come from\n* `@internal/postgres/migration` so an authored Postgres\n* `migration.ts` only needs a single dependency for its base class and\n* its CLI entrypoint:\n*\n* - `Migration` — the facade re-export fixes the `SqlMigration`\n* generic to `PostgresPlanTargetDetails` and the abstract `targetId`\n* to `'postgres'`, so user-authored migrations don't need to thread\n* target-details or redeclare `targetId`.\n* - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n* `@internal/cli/migration-cli`. Loads `prisma-next.config.ts`,\n* assembles a `ControlStack`, and instantiates the migration class.\n* The migration file owns this dependency directly: pulling CLI\n* machinery in at script run time is acceptable because the script's\n* whole purpose is to be invoked from the project that owns the\n* config.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: \"@internal/postgres/migration\",\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: \"@internal/postgres/migration\",\n\tsymbol: \"MigrationCLI\"\n}];\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => renderCall(c)).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`export default class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction renderCall(call) {\n\treturn call.renderTypeScript();\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\nexport { renderCallsToTypeScript as t };\n\n//# sourceMappingURL=render-typescript-Cw3lFO28.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,eAAe,CAAC;CACrB,iBAAiB;CACjB,QAAQ;AACT,GAAG;CACF,iBAAiB;CACjB,QAAQ;AACT,CAAC;AACD,SAAS,wBAAwB,OAAO,MAAM;CAC7C,MAAM,UAAU,aAAa,OAAO,IAAI;CACxC,MAAM,iBAAiB,MAAM,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK;CACjE,MAAM,WAAW,KAAK,SAAS;CAC/B,MAAM,aAAa,WAAW,CAAC,wDAAwD,IAAI,CAAC;CAC5F,OAAO;EACN,eAAe,sBAAsB,CAAC;EACtC;EACA;EACA,4CAA4C,WAAW,UAAU,QAAQ;EACzE,GAAG;EACH;EACA;EACA;EACA;EACA,OAAO,gBAAgB,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;CACD,CAAC,CAAC,KAAK,IAAI;AACZ;AACA,SAAS,WAAW,MAAM;CACzB,OAAO,KAAK,iBAAiB;AAC9B;AACA,SAAS,aAAa,OAAO,MAAM;CAClC,MAAM,eAAe,CAAC,GAAG,cAAc,GAAG,gBAAgB,IAAI,CAAC;CAC/D,KAAK,MAAM,QAAQ,OAAO,KAAK,MAAM,OAAO,KAAK,mBAAmB,GAAG,aAAa,KAAK,GAAG;CAC5F,OAAO,cAAc,6BAA6B,cAAc,KAAK,sBAAsB,CAAC;AAC7F;;;;;;;;;;AAUA,SAAS,gBAAgB,MAAM;CAC9B,MAAM,OAAO,CAAC;EACb,iBAAiB,8BAA8B,KAAK,qBAAqB,KAAK,EAAE;EAChF,QAAQ;EACR,MAAM;EACN,YAAY,EAAE,MAAM,OAAO;CAC5B,GAAG;EACF,iBAAiB,+BAA+B,KAAK,qBAAqB,KAAK,EAAE;EACjF,QAAQ;EACR,OAAO;EACP,UAAU;CACX,CAAC;CACD,IAAI,KAAK,SAAS,MAAM;EACvB,KAAK,KAAK;GACT,iBAAiB,8BAA8B,KAAK,qBAAqB,KAAK,IAAI;GAClF,QAAQ;GACR,MAAM;GACN,YAAY,EAAE,MAAM,OAAO;EAC5B,CAAC;EACD,KAAK,KAAK;GACT,iBAAiB,+BAA+B,KAAK,qBAAqB,KAAK,IAAI;GACnF,QAAQ;GACR,OAAO;GACP,UAAU;EACX,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,OAAO,MAAM,QAAQ;CAC7B,MAAM,MAAM,IAAI,OAAO,MAAM;CAC7B,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC,KAAK,IAAI;AACtF"}
@@ -0,0 +1,22 @@
1
+ import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
+ import { d as isPostgresSchema } from "./postgres-schema-KSzLDONj-CsXGoY8b.mjs";
3
+ import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
+ //#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-CxqlLW47.mjs
5
+ /**
6
+ * Given the contract's storage and a namespace id, returns the live Postgres
7
+ * DDL schema name that namespace maps to. A named Postgres namespace dispatches
8
+ * to its `ddlSchemaName(storage)`; the unbound sentinel resolves to
9
+ * `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a
10
+ * bare object payload (used by some tests) falls back to the namespace id
11
+ * itself.
12
+ */
13
+ function resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {
14
+ if (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;
15
+ const namespace = storage.namespaces[namespaceId];
16
+ if (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);
17
+ return namespaceId;
18
+ }
19
+ //#endregion
20
+ export { resolveDdlSchemaForNamespaceStorage as t };
21
+
22
+ //# sourceMappingURL=resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-CxqlLW47.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-KSzLDONj.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-CxqlLW47.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
@@ -0,0 +1,12 @@
1
+ import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
2
+ import { l as PostgresLoweredStatement } from "./types-CkryN1AS-6MNZLjLY.mjs";
3
+ import { Adapter, AnyQueryAst } from "@prisma/orm-family-sql/relational-core/ast";
4
+ import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
5
+ import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
6
+ //#region ../../../3-targets/6-adapters/postgres/dist/runtime.d.mts
7
+ //#region src/exports/runtime.d.ts
8
+ interface SqlRuntimeAdapter extends RuntimeAdapterInstance<'sql', 'postgres'>, Adapter<AnyQueryAst, PostgresContract, PostgresLoweredStatement> {}
9
+ declare const postgresRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'postgres', SqlRuntimeAdapter>;
10
+ //#endregion
11
+ export { postgresRuntimeAdapterDescriptor as n, SqlRuntimeAdapter as t };
12
+ //# sourceMappingURL=runtime-BbSRVwdd.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-BbSRVwdd.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;UAKU,0BAA0B,2CAA2C,QAAQ,aAAa,kBAAkB;cACxG,kCAAkC,wCAAwC"}
@@ -0,0 +1,55 @@
1
+ import { SqlDriver } from "@prisma/orm-family-sql/relational-core/ast";
2
+ import { Client, Pool, QueryResult, QueryResultRow } from "pg";
3
+ import { RuntimeDriverDescriptor, RuntimeDriverInstance } from "@prisma/orm-framework/components/execution";
4
+ //#region ../../../3-targets/7-drivers/postgres/dist/runtime.d.mts
5
+ //#region src/postgres-driver.d.ts
6
+ type QueryResult$1<T extends QueryResultRow = QueryResultRow> = QueryResult<T>;
7
+ /**
8
+ * Concurrency contract: the driver serializes queries per physical client, so
9
+ * overlapping calls on a `pgClient` binding, a pinned connection, or a
10
+ * transaction handle run strictly sequentially in FIFO order. Pool bindings
11
+ * run each driver-level call on its own pool client and are unaffected.
12
+ *
13
+ * Lock lifetime: buffered execution (cursors disabled) locks the client only
14
+ * while fetching; row iteration is lock-free, so a nested query on the same
15
+ * client inside `for await` works. Cursor-enabled streams hold the lock for
16
+ * the stream's entire lifetime — a nested query on the same client inside
17
+ * stream iteration deadlocks, exactly as under pg@8's queue.
18
+ */
19
+ type PostgresBinding = {
20
+ readonly kind: 'url';
21
+ readonly url: string;
22
+ } | {
23
+ readonly kind: 'pgPool';
24
+ readonly pool: Pool;
25
+ } | {
26
+ readonly kind: 'pgClient';
27
+ readonly client: Client;
28
+ };
29
+ interface PostgresCursorOptions {
30
+ readonly batchSize?: number;
31
+ readonly disabled?: boolean;
32
+ }
33
+ interface PostgresDriverOptions {
34
+ readonly connect: {
35
+ client: Client;
36
+ } | {
37
+ pool: Pool;
38
+ };
39
+ readonly cursor?: PostgresCursorOptions | undefined;
40
+ /**
41
+ * Use server-side prepared statements for `executePrepared`. Default
42
+ * `true`. Set `false` when running behind a transaction-mode pooler that
43
+ * does not support session-scoped prepared statements (e.g. PgBouncer
44
+ * transaction mode).
45
+ */
46
+ readonly preparedStatements?: boolean | undefined;
47
+ }
48
+ type PostgresDriverCreateOptions = Omit<PostgresDriverOptions, 'connect'>;
49
+ //#endregion
50
+ //#region src/exports/runtime.d.ts
51
+ type PostgresRuntimeDriver = RuntimeDriverInstance<'sql', 'postgres'> & SqlDriver<PostgresBinding>;
52
+ declare const postgresRuntimeDriverDescriptor: RuntimeDriverDescriptor<'sql', 'postgres', PostgresDriverCreateOptions, PostgresRuntimeDriver>;
53
+ //#endregion
54
+ export { postgresRuntimeDriverDescriptor as a, QueryResult$1 as i, PostgresDriverCreateOptions as n, PostgresRuntimeDriver as r, PostgresBinding as t };
55
+ //# sourceMappingURL=runtime-CDewySU9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-CDewySU9.d.mts","names":[],"sources":["../../../../3-targets/7-drivers/postgres/dist/runtime.d.mts"],"mappings":";;;;;KAIK,cAAY,UAAU,iBAAiB,kBAAkB,YAAc;;;;;;;;;;;;;KAavE;WACM;WACA;;WAEA;WACA,MAAM;;WAEN;WACA,QAAQ;;UAET;WACC;WACA;;UAED;WACC;IACP,QAAQ;;IAER,MAAM;;WAEC,SAAS;;;;;;;WAOT;;KAEN,8BAA8B,KAAK;;;KAGnC,wBAAwB,2CAA2C,UAAU;cACpE,iCAAiC,2CAA2C,6BAA6B"}
@@ -0,0 +1,32 @@
1
+ import "./postgres-contract-view-2OP5JnXl-D2fpy4-8.mjs";
2
+ import { AnyCodecDescriptor } from "@prisma/orm-framework/components/codec";
3
+ import { AnyEntityKindDescriptor, Namespace } from "@prisma/orm-framework/components/ir";
4
+ import { SqlNamespaceInput, SqlStorage } from "@prisma/orm-family-sql/contract/types";
5
+ import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
6
+ import { Contract } from "@prisma/orm-framework/contract/types";
7
+ import { RuntimeTargetDescriptor, RuntimeTargetInstance } from "@prisma/orm-framework/components/execution";
8
+ import { PreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing";
9
+ import { JsonObject } from "@prisma/orm-framework/utils/json";
10
+ //#region ../../../3-targets/3-targets/postgres/dist/runtime.d.mts
11
+ //#region src/core/postgres-contract-serializer.d.ts
12
+ declare class PostgresContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {
13
+ shouldPreserveEmpty: PreserveEmptyPredicate;
14
+ constructor(extraPackEntityKinds?: readonly AnyEntityKindDescriptor[]);
15
+ protected hydrateSqlNamespaceEntry(nsId: string, raw: Record<string, unknown>): Namespace | SqlNamespaceInput;
16
+ serializeContract(contract: Contract<SqlStorage>): JsonObject;
17
+ }
18
+ //#endregion
19
+ //#region src/exports/runtime.d.ts
20
+ interface PostgresRuntimeTargetInstance extends RuntimeTargetInstance<'sql', 'postgres'> {}
21
+ /**
22
+ * Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that
23
+ * `@internal/sql-runtime` consumers narrow to at composition time.
24
+ *
25
+ * The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).
26
+ */
27
+ declare const postgresRuntimeTargetDescriptor: RuntimeTargetDescriptor<'sql', 'postgres', PostgresRuntimeTargetInstance> & {
28
+ readonly codecs: () => readonly AnyCodecDescriptor[];
29
+ };
30
+ //#endregion
31
+ export { PostgresRuntimeTargetInstance as n, postgresRuntimeTargetDescriptor as r, PostgresContractSerializer as t };
32
+ //# sourceMappingURL=runtime-_TfO66h5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-_TfO66h5.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;cAUc,mCAAmC,0BAA0B,SAAS;EAClF,qBAAqB;EACrB,YAAY,gCAAgC;YAClC,yBAAyB,cAAc,KAAK,0BAA0B,YAAY;EAC5F,kBAAkB,UAAU,SAAS,cAAc;;;;UAI3C,sCAAsC;;;;;;;cAOlC,iCAAiC,2CAA2C;WAC/E,uBAAuB"}
@@ -0,0 +1,15 @@
1
+ import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/schema-ir-annotations.d.mts
3
+ //#region src/core/migrations/resolve-ddl-schema.d.ts
4
+ /**
5
+ * Given the contract's storage and a namespace id, returns the live Postgres
6
+ * DDL schema name that namespace maps to. A named Postgres namespace dispatches
7
+ * to its `ddlSchemaName(storage)`; the unbound sentinel resolves to
8
+ * `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a
9
+ * bare object payload (used by some tests) falls back to the namespace id
10
+ * itself.
11
+ */
12
+ declare function resolveDdlSchemaForNamespaceStorage(storage: SqlStorage, namespaceId: string): string;
13
+ //#endregion
14
+ export { resolveDdlSchemaForNamespaceStorage as t };
15
+ //# sourceMappingURL=schema-ir-annotations-DuuYh0gl.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-ir-annotations-DuuYh0gl.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/schema-ir-annotations.d.mts"],"mappings":";;;;;;;;;;;iBAUiB,oCAAoC,SAAS,YAAY"}
@@ -0,0 +1,30 @@
1
+ import { DiffableNode } from "@prisma/orm-framework/components/control";
2
+ import { SqlSchemaIRNode } from "@prisma/orm-family-sql/schema-ir/types";
3
+ //#region ../../../3-targets/3-targets/postgres/dist/schema-node-kinds-qlnURWJy.d.mts
4
+ //#region src/core/schema-ir/schema-node-kinds.d.ts
5
+ /**
6
+ * A Postgres schema-diff-tree node: a `SqlSchemaIRNode` that also implements
7
+ * `DiffableNode` (the five `Postgres*SchemaNode` classes). `SqlSchemaIRNode`
8
+ * alone is not a `DiffableNode` — its relational subclasses (`SqlColumnIR`, …)
9
+ * carry no `id`/`isEqualTo`/`children` — so this intersection is the honest node
10
+ * type the differ produces and the planner consumes (`SchemaDiff<SqlSchemaDiffNode>`).
11
+ */
12
+ type SqlSchemaDiffNode = SqlSchemaIRNode & DiffableNode;
13
+ /**
14
+ * The `nodeKind` discriminant for each Postgres schema-diff node. Each node
15
+ * carries a unique value; the static `is`/`assert` guards compare against these
16
+ * identifiers rather than spelling the string inline or using `instanceof`. The
17
+ * field is an enumerable own property carried on every node instance.
18
+ */
19
+ declare const PostgresSchemaNodeKind: {
20
+ readonly database: "postgres-database";
21
+ readonly namespace: "postgres-namespace";
22
+ readonly table: "postgres-table";
23
+ readonly policy: "postgres-policy";
24
+ readonly role: "postgres-role";
25
+ readonly nativeEnum: "postgres-native-enum";
26
+ };
27
+ type PostgresSchemaNodeKind = (typeof PostgresSchemaNodeKind)[keyof typeof PostgresSchemaNodeKind];
28
+ //#endregion
29
+ export { SqlSchemaDiffNode as n, PostgresSchemaNodeKind as t };
30
+ //# sourceMappingURL=schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/schema-node-kinds-qlnURWJy.d.mts"],"mappings":";;;;;;;;;;;KAUK,oBAAoB,kBAAkB;;;;;;;cAO7B;WACH;WACA;WACA;WACA;WACA;WACA;;KAEN,iCAAiC,qCAAqC"}
@@ -0,0 +1,90 @@
1
+ import { n as postgresError } from "./errors-kYxOQjdD-D4T3rbVp.mjs";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/sql-utils-BnBlQxyh.mjs
3
+ /**
4
+ * Shared SQL utility functions for the Postgres target.
5
+ *
6
+ * These functions handle safe SQL identifier and literal escaping
7
+ * with security validations to prevent injection and encoding issues.
8
+ *
9
+ * They live in `target-postgres` because both the control adapter (used at
10
+ * emit time) and the runtime adapter (used at execute time) need the same
11
+ * escaping/validation behavior, and the target package is the natural shared
12
+ * home that both adapters can depend on without crossing planes.
13
+ */
14
+ const MAX_IDENTIFIER_LENGTH = 63;
15
+ /**
16
+ * Validates and quotes a PostgreSQL identifier (table, column, type, schema names).
17
+ *
18
+ * Security validations:
19
+ * - Rejects null bytes which could cause truncation or unexpected behavior
20
+ * - Rejects empty identifiers
21
+ * - Warns on identifiers exceeding PostgreSQL's 63-character limit
22
+ *
23
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the identifier contains null bytes or is empty
24
+ */
25
+ function quoteIdentifier(identifier) {
26
+ if (identifier.length === 0) throw postgresError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot be empty", { meta: {
27
+ value: identifier,
28
+ context: "identifier"
29
+ } });
30
+ if (identifier.includes("\0")) throw postgresError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot contain null bytes", { meta: {
31
+ value: identifier.replace(/\0/g, "\\0"),
32
+ context: "identifier"
33
+ } });
34
+ if (identifier.length > MAX_IDENTIFIER_LENGTH) console.warn(`Identifier "${identifier.slice(0, 20)}..." exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-character limit and will be truncated`);
35
+ return `"${identifier.replace(/"/g, "\"\"")}"`;
36
+ }
37
+ /**
38
+ * Escapes a string literal for safe use in SQL statements.
39
+ *
40
+ * Security validations:
41
+ * - Rejects null bytes which could cause truncation or unexpected behavior
42
+ *
43
+ * Note: This assumes PostgreSQL's `standard_conforming_strings` is ON (default since PG 9.1).
44
+ * Backslashes are treated as literal characters, not escape sequences.
45
+ *
46
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value contains null bytes
47
+ */
48
+ function escapeLiteral(value) {
49
+ if (value.includes("\0")) throw postgresError("CONTRACT.IDENTIFIER_INVALID", "Literal value cannot contain null bytes", { meta: {
50
+ value: value.replace(/\0/g, "\\0"),
51
+ context: "literal"
52
+ } });
53
+ return value.replace(/'/g, "''");
54
+ }
55
+ /**
56
+ * Builds a qualified name (schema.object) with proper quoting.
57
+ */
58
+ function qualifyName(schemaName, objectName) {
59
+ return `${quoteIdentifier(schemaName)}.${quoteIdentifier(objectName)}`;
60
+ }
61
+ /**
62
+ * Quotes a possibly dot-qualified name segment-by-segment:
63
+ * `order_status` -> `"order_status"`, `auth.aal_level` -> `"auth"."aal_level"`.
64
+ * A single-segment name round-trips to exactly {@link quoteIdentifier}; whole-
65
+ * string quoting (`"auth.aal_level"`) would be one wrong identifier.
66
+ */
67
+ function quoteQualifiedName(name) {
68
+ return name.split(".").map((segment) => quoteIdentifier(segment)).join(".");
69
+ }
70
+ /**
71
+ * Validates that an enum value doesn't exceed PostgreSQL's label length limit.
72
+ *
73
+ * PostgreSQL enum labels have a maximum length of NAMEDATALEN-1 (63 bytes by default).
74
+ * Unlike identifiers, enum labels that exceed this limit cause an error rather than
75
+ * silent truncation.
76
+ *
77
+ * @param value - The enum value to validate
78
+ * @param enumTypeName - Name of the enum type (for error messages)
79
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value exceeds the maximum length
80
+ */
81
+ function validateEnumValueLength(value, enumTypeName) {
82
+ if (new TextEncoder().encode(value).length > MAX_IDENTIFIER_LENGTH) throw postgresError("CONTRACT.IDENTIFIER_INVALID", `Enum value "${value.slice(0, 20)}..." for type "${enumTypeName}" exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-byte label limit`, { meta: {
83
+ value,
84
+ context: "enum-label"
85
+ } });
86
+ }
87
+ //#endregion
88
+ export { validateEnumValueLength as a, quoteQualifiedName as i, qualifyName as n, quoteIdentifier as r, escapeLiteral as t };
89
+
90
+ //# sourceMappingURL=sql-utils-BnBlQxyh-DaX9Nb7Z.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-utils-BnBlQxyh-DaX9Nb7Z.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/sql-utils-BnBlQxyh.mjs"],"sourcesContent":["import { n as postgresError } from \"./errors-kYxOQjdD.mjs\";\n//#region src/core/sql-utils.ts\n/**\n* Shared SQL utility functions for the Postgres target.\n*\n* These functions handle safe SQL identifier and literal escaping\n* with security validations to prevent injection and encoding issues.\n*\n* They live in `target-postgres` because both the control adapter (used at\n* emit time) and the runtime adapter (used at execute time) need the same\n* escaping/validation behavior, and the target package is the natural shared\n* home that both adapters can depend on without crossing planes.\n*/\nconst MAX_IDENTIFIER_LENGTH = 63;\n/**\n* Validates and quotes a PostgreSQL identifier (table, column, type, schema names).\n*\n* Security validations:\n* - Rejects null bytes which could cause truncation or unexpected behavior\n* - Rejects empty identifiers\n* - Warns on identifiers exceeding PostgreSQL's 63-character limit\n*\n* @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the identifier contains null bytes or is empty\n*/\nfunction quoteIdentifier(identifier) {\n\tif (identifier.length === 0) throw postgresError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot be empty\", { meta: {\n\t\tvalue: identifier,\n\t\tcontext: \"identifier\"\n\t} });\n\tif (identifier.includes(\"\\0\")) throw postgresError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot contain null bytes\", { meta: {\n\t\tvalue: identifier.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"identifier\"\n\t} });\n\tif (identifier.length > MAX_IDENTIFIER_LENGTH) console.warn(`Identifier \"${identifier.slice(0, 20)}...\" exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-character limit and will be truncated`);\n\treturn `\"${identifier.replace(/\"/g, \"\\\"\\\"\")}\"`;\n}\n/**\n* Escapes a string literal for safe use in SQL statements.\n*\n* Security validations:\n* - Rejects null bytes which could cause truncation or unexpected behavior\n*\n* Note: This assumes PostgreSQL's `standard_conforming_strings` is ON (default since PG 9.1).\n* Backslashes are treated as literal characters, not escape sequences.\n*\n* @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value contains null bytes\n*/\nfunction escapeLiteral(value) {\n\tif (value.includes(\"\\0\")) throw postgresError(\"CONTRACT.IDENTIFIER_INVALID\", \"Literal value cannot contain null bytes\", { meta: {\n\t\tvalue: value.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"literal\"\n\t} });\n\treturn value.replace(/'/g, \"''\");\n}\n/**\n* Builds a qualified name (schema.object) with proper quoting.\n*/\nfunction qualifyName(schemaName, objectName) {\n\treturn `${quoteIdentifier(schemaName)}.${quoteIdentifier(objectName)}`;\n}\n/**\n* Quotes a possibly dot-qualified name segment-by-segment:\n* `order_status` -> `\"order_status\"`, `auth.aal_level` -> `\"auth\".\"aal_level\"`.\n* A single-segment name round-trips to exactly {@link quoteIdentifier}; whole-\n* string quoting (`\"auth.aal_level\"`) would be one wrong identifier.\n*/\nfunction quoteQualifiedName(name) {\n\treturn name.split(\".\").map((segment) => quoteIdentifier(segment)).join(\".\");\n}\n/**\n* Validates that an enum value doesn't exceed PostgreSQL's label length limit.\n*\n* PostgreSQL enum labels have a maximum length of NAMEDATALEN-1 (63 bytes by default).\n* Unlike identifiers, enum labels that exceed this limit cause an error rather than\n* silent truncation.\n*\n* @param value - The enum value to validate\n* @param enumTypeName - Name of the enum type (for error messages)\n* @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value exceeds the maximum length\n*/\nfunction validateEnumValueLength(value, enumTypeName) {\n\tif (new TextEncoder().encode(value).length > MAX_IDENTIFIER_LENGTH) throw postgresError(\"CONTRACT.IDENTIFIER_INVALID\", `Enum value \"${value.slice(0, 20)}...\" for type \"${enumTypeName}\" exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-byte label limit`, { meta: {\n\t\tvalue,\n\t\tcontext: \"enum-label\"\n\t} });\n}\n//#endregion\nexport { validateEnumValueLength as a, quoteQualifiedName as i, qualifyName as n, quoteIdentifier as r, escapeLiteral as t };\n\n//# sourceMappingURL=sql-utils-BnBlQxyh.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,wBAAwB;;;;;;;;;;;AAW9B,SAAS,gBAAgB,YAAY;CACpC,IAAI,WAAW,WAAW,GAAG,MAAM,cAAc,+BAA+B,8BAA8B,EAAE,MAAM;EACrH,OAAO;EACP,SAAS;CACV,EAAE,CAAC;CACH,IAAI,WAAW,SAAS,IAAI,GAAG,MAAM,cAAc,+BAA+B,wCAAwC,EAAE,MAAM;EACjI,OAAO,WAAW,QAAQ,OAAO,KAAK;EACtC,SAAS;CACV,EAAE,CAAC;CACH,IAAI,WAAW,SAAS,uBAAuB,QAAQ,KAAK,eAAe,WAAW,MAAM,GAAG,EAAE,EAAE,4BAA4B,sBAAsB,uCAAuC;CAC5L,OAAO,IAAI,WAAW,QAAQ,MAAM,MAAM,EAAE;AAC7C;;;;;;;;;;;;AAYA,SAAS,cAAc,OAAO;CAC7B,IAAI,MAAM,SAAS,IAAI,GAAG,MAAM,cAAc,+BAA+B,2CAA2C,EAAE,MAAM;EAC/H,OAAO,MAAM,QAAQ,OAAO,KAAK;EACjC,SAAS;CACV,EAAE,CAAC;CACH,OAAO,MAAM,QAAQ,MAAM,IAAI;AAChC;;;;AAIA,SAAS,YAAY,YAAY,YAAY;CAC5C,OAAO,GAAG,gBAAgB,UAAU,EAAE,GAAG,gBAAgB,UAAU;AACpE;;;;;;;AAOA,SAAS,mBAAmB,MAAM;CACjC,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,YAAY,gBAAgB,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG;AAC3E;;;;;;;;;;;;AAYA,SAAS,wBAAwB,OAAO,cAAc;CACrD,IAAI,IAAI,YAAY,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,SAAS,uBAAuB,MAAM,cAAc,+BAA+B,eAAe,MAAM,MAAM,GAAG,EAAE,EAAE,iBAAiB,aAAa,yBAAyB,sBAAsB,oBAAoB,EAAE,MAAM;EACjQ;EACA,SAAS;CACV,EAAE,CAAC;AACJ"}
@@ -0,0 +1,62 @@
1
+ //#region ../../../3-targets/3-targets/postgres/dist/sql-utils.d.mts
2
+ //#region src/core/sql-utils.d.ts
3
+ /**
4
+ * Shared SQL utility functions for the Postgres target.
5
+ *
6
+ * These functions handle safe SQL identifier and literal escaping
7
+ * with security validations to prevent injection and encoding issues.
8
+ *
9
+ * They live in `target-postgres` because both the control adapter (used at
10
+ * emit time) and the runtime adapter (used at execute time) need the same
11
+ * escaping/validation behavior, and the target package is the natural shared
12
+ * home that both adapters can depend on without crossing planes.
13
+ */
14
+ /**
15
+ * Validates and quotes a PostgreSQL identifier (table, column, type, schema names).
16
+ *
17
+ * Security validations:
18
+ * - Rejects null bytes which could cause truncation or unexpected behavior
19
+ * - Rejects empty identifiers
20
+ * - Warns on identifiers exceeding PostgreSQL's 63-character limit
21
+ *
22
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the identifier contains null bytes or is empty
23
+ */
24
+ declare function quoteIdentifier(identifier: string): string;
25
+ /**
26
+ * Escapes a string literal for safe use in SQL statements.
27
+ *
28
+ * Security validations:
29
+ * - Rejects null bytes which could cause truncation or unexpected behavior
30
+ *
31
+ * Note: This assumes PostgreSQL's `standard_conforming_strings` is ON (default since PG 9.1).
32
+ * Backslashes are treated as literal characters, not escape sequences.
33
+ *
34
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value contains null bytes
35
+ */
36
+ declare function escapeLiteral(value: string): string;
37
+ /**
38
+ * Builds a qualified name (schema.object) with proper quoting.
39
+ */
40
+ declare function qualifyName(schemaName: string, objectName: string): string;
41
+ /**
42
+ * Quotes a possibly dot-qualified name segment-by-segment:
43
+ * `order_status` -> `"order_status"`, `auth.aal_level` -> `"auth"."aal_level"`.
44
+ * A single-segment name round-trips to exactly {@link quoteIdentifier}; whole-
45
+ * string quoting (`"auth.aal_level"`) would be one wrong identifier.
46
+ */
47
+ declare function quoteQualifiedName(name: string): string;
48
+ /**
49
+ * Validates that an enum value doesn't exceed PostgreSQL's label length limit.
50
+ *
51
+ * PostgreSQL enum labels have a maximum length of NAMEDATALEN-1 (63 bytes by default).
52
+ * Unlike identifiers, enum labels that exceed this limit cause an error rather than
53
+ * silent truncation.
54
+ *
55
+ * @param value - The enum value to validate
56
+ * @param enumTypeName - Name of the enum type (for error messages)
57
+ * @throws `CONTRACT.IDENTIFIER_INVALID` structured error If the value exceeds the maximum length
58
+ */
59
+ declare function validateEnumValueLength(value: string, enumTypeName: string): void;
60
+ //#endregion
61
+ export { validateEnumValueLength as a, quoteQualifiedName as i, qualifyName as n, quoteIdentifier as r, escapeLiteral as t };
62
+ //# sourceMappingURL=sql-utils-DW6fkczF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-utils-DW6fkczF.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/sql-utils.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAsBiB,gBAAgB;;;;;;;;;;;;iBAYhB,cAAc;;;;iBAId,YAAY,oBAAoB;;;;;;;iBAOhC,mBAAmB;;;;;;;;;;;;iBAYnB,wBAAwB,eAAe"}
@@ -0,0 +1,15 @@
1
+ import { AnyFromSource, AstRewriter, TableSource } from "@prisma/orm-family-sql/relational-core/ast";
2
+ //#region ../../../3-targets/3-targets/postgres/dist/table-source-ikHOZmhD.d.mts
3
+ //#region src/core/ast/table-source.d.ts
4
+ declare class PostgresTableSource extends TableSource {
5
+ readonly schema: string | undefined;
6
+ constructor(options: {
7
+ readonly name: string;
8
+ readonly schema?: string;
9
+ readonly alias?: string;
10
+ });
11
+ rewrite(rewriter: AstRewriter): AnyFromSource;
12
+ }
13
+ //#endregion
14
+ export { PostgresTableSource as t };
15
+ //# sourceMappingURL=table-source-ikHOZmhD-DriY1Lcr.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-source-ikHOZmhD-DriY1Lcr.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/table-source-ikHOZmhD.d.mts"],"mappings":";;;cAEc,4BAA4B;WAC/B;EACT,YAAY;aACD;aACA;aACA;;EAEX,QAAQ,UAAU,cAAc"}
@@ -0,0 +1,47 @@
1
+ import { a as PostgresCodecOptions, c as isPostgresCodecDescriptor, i as PostgresCodecDescriptorRegistry, l as postgresCodec, n as AnyPostgresCodecDescriptor, o as buildPostgresCodecDescriptorRegistry, r as PostgresCodecDescriptor, s as definePostgresCodecs, t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-Bec_zukr-BfvtUqhm.mjs";
2
+ import "./codec-descriptor-Bg-_412t.mjs";
3
+ import { n as PostgresRlsPolicyInput, r as RenderedRlsPolicyLiteral, t as PostgresRlsPolicy } from "./postgres-rls-policy-CnDxf3z9-C3LIHAIG.mjs";
4
+ import { a as PostgresNativeEnumSchemaNode, c as PostgresPolicySchemaNodeInput, d as PostgresTableSchemaNode, f as PostgresTableSchemaNodeInput, i as PostgresNamespaceSchemaNodeInput, l as PostgresRoleSchemaNode, n as PostgresDatabaseSchemaNodeInput, o as PostgresNativeEnumSchemaNodeInput, r as PostgresNamespaceSchemaNode, s as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode, u as PostgresRoleSchemaNodeInput } from "./postgres-database-schema-node-CyfpHXDr-BqyozkQE.mjs";
5
+ import { t as PostgresSchemaNodeKind } from "./schema-node-kinds-qlnURWJy-Bo30pwTM.mjs";
6
+ import { t as PostgresColumnDefault } from "./types-ue6jkJyF-BQJzjx1P.mjs";
7
+ import { t as PostgresTableSource } from "./table-source-ikHOZmhD-DriY1Lcr.mjs";
8
+ import { a as PostgresRlsEnablementInput, c as PostgresSchema, d as postgresCreateNamespace, i as PostgresRlsEnablement, l as PostgresUnboundSchema, n as PostgresNativeEnum, o as PostgresRole, r as PostgresNativeEnumInput, s as PostgresRoleInput, t as PostgresContract, u as isPostgresSchema } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
9
+ import { n as policyInputFromSerialized, t as SerializedRlsPolicy } from "./types-xa86TkcV.mjs";
10
+ import { i as computeContentHash, n as POLICY_OPERATION_PREDICATES, r as RlsPolicyOperation, t as ContentHashParts } from "./canonicalize-CQlxSR4D-MnrT5gtW.mjs";
11
+ import { _ as PostgresDisableRowLevelSecurity, a as DdlIndexElements, b as PostgresDropType, c as PostgresAlterPolicyRename, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDdlVisitor, h as PostgresDdlNode, i as AnyPostgresDdlNode, l as PostgresAlterTable, m as PostgresCreateType, n as AlterTableActionVisitor, o as DropDefaultAction, p as PostgresCreateTable, r as AnyAlterTableAction, s as PostgresAlterIndexRename, t as AddColumnAction, u as PostgresCreateIndex, v as PostgresDropIndex, y as PostgresDropPolicy } from "./nodes-BU-V-aZA-RqwPH68u.mjs";
12
+ import "./ddl-B4Rh8ntj.mjs";
13
+ import { n as postgresResolveDefault, t as parsePostgresDefault } from "./default-normalizer-B36TOul4.mjs";
14
+ import { t as normalizeSchemaNativeType } from "./native-type-normalizer-DqJlOTeX.mjs";
15
+ import { a as validateEnumValueLength, i as quoteQualifiedName, n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DW6fkczF.mjs";
16
+ import { A as SQL_INT_CODEC_ID, C as PG_TIMETZ_CODEC_ID, D as PG_VARCHAR_CODEC_ID, E as PG_VARBIT_CODEC_ID, M as SQL_TIMESTAMP_CODEC_ID, N as SQL_VARCHAR_CODEC_ID, O as SQL_CHAR_CODEC_ID, S as PG_TIMESTAMP_CODEC_ID, T as PG_UUID_CODEC_ID, _ as PG_JSON_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_JSONB_CODEC_ID, h as PG_INT_CODEC_ID, i as PG_CHAR_CODEC_ID, j as SQL_TEXT_CODEC_ID, k as SQL_FLOAT_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INTERVAL_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_ENUM_CODEC_ID, p as PG_INT8_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT4_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_NUMERIC_CODEC_ID, w as PG_TIME_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-CsOU3xDv-mPI0INiF.mjs";
17
+ import "./codec-ids-fgafMLR7.mjs";
18
+ import { $ as pgUuidColumn, A as isPgEnumParams, B as pgInt2Column, C as PgTimeDescriptor, D as PgUuidDescriptor, E as PgTimetzDescriptor, F as pgEnumDescriptor, G as pgJsonColumn, H as pgInt8Column, I as pgFloat4Column, J as pgTextColumn, K as pgJsonbColumn, L as pgFloat8Column, M as pgBoolColumn, N as pgCharColumn, O as PgVarbitDescriptor, P as pgDateColumn, Q as pgTimetzColumn, R as pgFloatColumn, S as PgTextDescriptor, T as PgTimestamptzDescriptor, U as pgIntColumn, V as pgInt4Column, W as pgIntervalColumn, X as pgTimestampColumn, Y as pgTimeColumn, Z as pgTimestamptzColumn, _ as PgInterval, a as PgDateDescriptor, b as PgJsonbDescriptor, c as PgEnumParams, d as PgFloatDescriptor, et as pgVarbitColumn, f as PgInetDescriptor, g as PgIntDescriptor, h as PgInt8Descriptor, i as PgCharDescriptor, j as pgBitColumn, k as PgVarcharDescriptor, l as PgFloat4Descriptor, m as PgInt4Descriptor, n as PgBoolDescriptor, o as PgEnumCodec, p as PgInt2Descriptor, q as pgNumericColumn, s as PgEnumDescriptor, t as PgBitDescriptor, tt as pgVarcharColumn, u as PgFloat8Descriptor, v as PgIntervalDescriptor, w as PgTimestampDescriptor, x as PgNumericDescriptor, y as PgJsonDescriptor, z as pgInetColumn } from "./codecs-Cvqvb9pV-Cdc51FKY.mjs";
19
+ import { a as JsonValue$1, c as Timestamp, d as VarBit, f as Varchar, i as Interval, l as Timestamptz, n as Char, o as Numeric, r as CodecTypes, s as Time, t as Bit, u as Timetz } from "./codec-types-mWhnDEAf-CAQzGFnF.mjs";
20
+ import "./codec-types-BHwY9Ff-.mjs";
21
+ import { n as postgresCodecRegistry, t as postgresCodecDescriptorRegistry } from "./codecs-DBn-uIv-.mjs";
22
+ import { A as rlsPolicyExistsAst, C as indexExistsAst, D as noNullValuesAst, E as jsonb, F as textArray, I as timestamptz, L as toRegclass, M as tableIsEmptyAst, N as tablePrimaryKeyAst, O as pgTable, P as text, S as extensionExistsAst, T as int8, _ as columnTypeAst, a as IndexExistsCheckBuilder, b as createTable, c as TableExistsCheckBuilder, d as alterTable, f as buildControlTableBootstrapQueries, g as columnNullabilityAst, h as columnExistsAst, i as ExtensionExistsCheckBuilder, j as tableExistsAst, k as rlsEnabledAst, l as TablePrimaryKeyCheckBuilder, m as columnDefaultAst, n as ColumnExistsCheckBuilder, o as RlsEnabledCheckBuilder, p as buildSignMarkerBootstrapQueries, r as ConstraintExistsCheckBuilder, s as RlsPolicyExistsCheckBuilder, t as ColumnDefaultCheckBuilder, u as addColumnAction, v as constraintExistsAst, w as int4, x as dropDefaultAction, y as createSchema } from "./contract-free-DzpGxLfb.mjs";
23
+ import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
24
+ import { t as postgresRenderDefault } from "./control-2F195jJk.mjs";
25
+ import { n as DataTransformOptions, r as dataTransform, t as DataTransformClosure } from "./data-transform-Ck5FbyNO-BNE7QlAo.mjs";
26
+ import "./data-transform-BSM7TQpE.mjs";
27
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-DsoNznGC.mjs";
28
+ import { n as postgresError, t as errorPostgresMigrationStackMissing } from "./errors-DCcVX4j1.mjs";
29
+ import { C as DropIndexCall, D as DropTableCall, E as DropPostgresRlsPolicyCall, F as SetDefaultCall, I as SetNotNullCall, M as RawSqlCall, N as RenameIndexCall, O as EnableRowLevelSecurityCall, P as RenamePostgresRlsPolicyCall, S as DropDefaultCall, T as DropNotNullCall, _ as DataTransformCall, a as AddNotNullColumnWithTempDefaultCall, b as DropColumnCall, c as AlterColumnTypeCall, d as CreateIndexCall, g as CreateTableCall, h as CreateSchemaCall, i as AddNativeEnumValueCall, m as CreatePostgresRlsPolicyCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreateNativeEnumTypeCall, r as AddForeignKeyCall, s as AddUniqueCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropNativeEnumTypeCall, x as DropConstraintCall, y as DropCheckConstraintCall } from "./op-factory-call-jd4cgfjA-CyNT4YVn.mjs";
30
+ import { n as planIssues, t as coalesceSubtreeIssues } from "./issue-planner-jkY6p-Ca.mjs";
31
+ import { t as PostgresContractView } from "./postgres-contract-view-2OP5JnXl-D2fpy4-8.mjs";
32
+ import { t as PostgresMigration } from "./postgres-migration-CDJj7CvD-Bsqs_fVo.mjs";
33
+ import { a as fn, c as placeholder, d as unique, i as createExtension, l as primaryKey, n as checkExpression, o as foreignKey, r as col, s as lit, t as MigrationCLI, u as rawSql } from "./migration-CBSAPE8S.mjs";
34
+ import "./op-factory-call-FEA5mnWH.mjs";
35
+ import "./pack-DFM4tmob.mjs";
36
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.mjs";
37
+ import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-DL4Bh5Nk.mjs";
38
+ import { n as buildColumnTypeSql, r as renderDefaultLiteral, t as buildColumnDefaultSql } from "./planner-ddl-builders-ijp60-JO.mjs";
39
+ import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-TfEhnoWa.mjs";
40
+ import "./planner-produced-postgres-migration-C3GPZWeC.mjs";
41
+ import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-C4DHAddq.mjs";
42
+ import { n as qualifyTableName, t as buildExpectedFormatType } from "./planner-sql-checks-CFgbRTJw.mjs";
43
+ import { t as renderOps } from "./render-ops-DPwhZt2W.mjs";
44
+ import { t as renderCallsToTypeScript } from "./render-typescript-6sCFvMBh.mjs";
45
+ import { n as PostgresRuntimeTargetInstance, t as PostgresContractSerializer } from "./runtime-_TfO66h5.mjs";
46
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./schema-ir-annotations-DuuYh0gl.mjs";
47
+ export { type AdaptedPostgresCodecDescriptor, AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, type AlterTableActionVisitor, type AnyAlterTableAction, type AnyPostgresCodecDescriptor, type AnyPostgresDdlNode, Bit, Char, CodecTypes, type ColumnDefaultCheckBuilder, type ColumnExistsCheckBuilder, type ConstraintExistsCheckBuilder, type ContentHashParts, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, type DataTransformClosure, type DataTransformOptions, type DdlIndexElements, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, type ExtensionExistsCheckBuilder, type IndexExistsCheckBuilder, Interval, type JsonValue$1 as JsonValue, PostgresMigration as Migration, MigrationCLI, Numeric, PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_ARRAY_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, POLICY_OPERATION_PREDICATES, type PgBitDescriptor, type PgBoolDescriptor, type PgCharDescriptor, type PgDateDescriptor, type PgEnumCodec, type PgEnumDescriptor, type PgEnumParams, type PgFloat4Descriptor, type PgFloat8Descriptor, type PgFloatDescriptor, type PgInetDescriptor, type PgInt2Descriptor, type PgInt4Descriptor, type PgInt8Descriptor, type PgIntDescriptor, type PgInterval, type PgIntervalDescriptor, type PgJsonDescriptor, type PgJsonbDescriptor, type PgNumericDescriptor, type PgTextDescriptor, type PgTimeDescriptor, type PgTimestampDescriptor, type PgTimestamptzDescriptor, type PgTimetzDescriptor, type PgUuidDescriptor, type PgVarbitDescriptor, type PgVarcharDescriptor, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterTable, PostgresCodecDescriptor, type PostgresCodecDescriptorRegistry, type PostgresCodecOptions, type PostgresColumnDefault, type PostgresContract, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, type PostgresDatabaseSchemaNodeInput, PostgresDdlNode, type PostgresDdlVisitor, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropType, PostgresNamespaceSchemaNode, type PostgresNamespaceSchemaNodeInput, PostgresNativeEnum, type PostgresNativeEnumInput, PostgresNativeEnumSchemaNode, type PostgresNativeEnumSchemaNodeInput, type PostgresPlanTargetDetails, PostgresPolicySchemaNode, type PostgresPolicySchemaNodeInput, PostgresRlsEnablement, type PostgresRlsEnablementInput, PostgresRlsPolicy, type PostgresRlsPolicyInput, PostgresRole, type PostgresRoleInput, PostgresRoleSchemaNode, type PostgresRoleSchemaNodeInput, PostgresRuntimeTargetInstance, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, type PostgresTableSchemaNodeInput, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RenameIndexCall, RenamePostgresRlsPolicyCall, type RenderedRlsPolicyLiteral, type RlsEnabledCheckBuilder, type RlsPolicyExistsCheckBuilder, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID, type SerializedRlsPolicy, SetDefaultCall, SetNotNullCall, type TableExistsCheckBuilder, type TablePrimaryKeyCheckBuilder, Time, Timestamp, Timestamptz, Timetz, TypeScriptRenderablePostgresMigration, VarBit, Varchar, addColumnAction, alterTable, buildBuiltinIdentityValue, buildColumnDefaultSql, buildColumnTypeSql, buildControlTableBootstrapQueries, buildExpectedFormatType, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createExtension, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, definePostgresCodecs, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, fn, foreignKey, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, int4, int8, isPgEnumParams, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, noNullValuesAst, normalizeSchemaNativeType, parsePostgresDefault, pgBitColumn, pgBoolColumn, pgCharColumn, pgDateColumn, pgEnumDescriptor, pgFloat4Column, pgFloat8Column, pgFloatColumn, pgInetColumn, pgInt2Column, pgInt4Column, pgInt8Column, pgIntColumn, pgIntervalColumn, pgJsonColumn, pgJsonbColumn, pgNumericColumn, pgTable, pgTextColumn, pgTimeColumn, pgTimestampColumn, pgTimestamptzColumn, pgTimetzColumn, pgUuidColumn, pgVarbitColumn, pgVarcharColumn, placeholder, planIssues, policyInputFromSerialized, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCreateNamespace, postgresError, postgresRenderDefault, postgresResolveDefault, primaryKey, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, renderCallsToTypeScript, renderDefaultLiteral, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, toRegclass, unique, validateEnumValueLength };