@prisma/orm-target-postgres 8.0.0-rc.21-dev.11 → 8.0.0-rc.21-dev.12

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 (195) hide show
  1. package/dist/{adapter-CGBZvb_8.d.mts → adapter-BdL6nOY0.d.mts} +15 -4
  2. package/dist/{adapter-CGBZvb_8.d.mts.map → adapter-BdL6nOY0.d.mts.map} +1 -1
  3. package/dist/{adapter-B84yJpi7-8wwdWq5R.mjs → adapter-t3IEEEbY-BKJyNGtz.mjs} +6 -6
  4. package/dist/{adapter-B84yJpi7-8wwdWq5R.mjs.map → adapter-t3IEEEbY-BKJyNGtz.mjs.map} +1 -1
  5. package/dist/adapter.d.mts +5 -5
  6. package/dist/adapter.mjs +6 -6
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__column-types.d.mts +1 -1
  10. package/dist/adapter__column-types.mjs +1 -1
  11. package/dist/adapter__control.d.mts +2 -2
  12. package/dist/adapter__control.mjs +4 -4
  13. package/dist/adapter__control.mjs.map +1 -1
  14. package/dist/adapter__runtime.mjs +4 -4
  15. package/dist/adapter__runtime.mjs.map +1 -1
  16. package/dist/adapter__sql-renderer.mjs +1 -1
  17. package/dist/adapter__types.d.mts +2 -2
  18. package/dist/{aggregates-xBA2jH0c.mjs → aggregates-BNste-08.mjs} +9 -3
  19. package/dist/aggregates-BNste-08.mjs.map +1 -0
  20. package/dist/{aggregates-D3Gq0n_e.d.mts → aggregates-CCEULCRK.d.mts} +14 -3
  21. package/dist/{aggregates-D3Gq0n_e.d.mts.map → aggregates-CCEULCRK.d.mts.map} +1 -1
  22. package/dist/{authoring-Bm8PD9ls-clXbYDiN.mjs → authoring-D7EAP1iG-DlpkOeVt.mjs} +25 -7
  23. package/dist/authoring-D7EAP1iG-DlpkOeVt.mjs.map +1 -0
  24. package/dist/{autoincrement-widths-DkD24r-C-D4O96GJZ.mjs → autoincrement-widths-Cy5o21bQ-DKg9UXXV.mjs} +3 -3
  25. package/dist/{autoincrement-widths-DkD24r-C-D4O96GJZ.mjs.map → autoincrement-widths-Cy5o21bQ-DKg9UXXV.mjs.map} +1 -1
  26. package/dist/{check-expressions-C_lM7sSK-Dtv6p3hg.mjs → check-expressions-DL9WtMO5-CUcbN2JG.mjs} +3 -3
  27. package/dist/{check-expressions-C_lM7sSK-Dtv6p3hg.mjs.map → check-expressions-DL9WtMO5-CUcbN2JG.mjs.map} +1 -1
  28. package/dist/{codec-ids-D0wjQdEW-EypD_iZj.mjs → codec-ids-2htdtS66-CJPMZv1t.mjs} +6 -3
  29. package/dist/codec-ids-2htdtS66-CJPMZv1t.mjs.map +1 -0
  30. package/dist/{codec-ids-CNEv5CTR-g_wnSmnu.d.mts → codec-ids-5MgmfzkI-C5V1rph6.d.mts} +6 -3
  31. package/dist/{codec-ids-CNEv5CTR-g_wnSmnu.d.mts.map → codec-ids-5MgmfzkI-C5V1rph6.d.mts.map} +1 -1
  32. package/dist/codec-ids-JTQCwgBI.d.mts +1 -0
  33. package/dist/{codec-registry-DVjibYBY-BeOUp5fk.mjs → codec-registry-D-bD-lFp-BCSmwfrE.mjs} +4 -4
  34. package/dist/{codec-registry-DVjibYBY-BeOUp5fk.mjs.map → codec-registry-D-bD-lFp-BCSmwfrE.mjs.map} +1 -1
  35. package/dist/{codec-type-map-DSuWVp-n-Cp4c9JWN.d.mts → codec-type-map-C_5OBkHw-DZ0UDSJr.d.mts} +6 -3
  36. package/dist/{codec-type-map-DSuWVp-n-Cp4c9JWN.d.mts.map → codec-type-map-C_5OBkHw-DZ0UDSJr.d.mts.map} +1 -1
  37. package/dist/codec-types-FPJG3oQH.d.mts +2 -0
  38. package/dist/{codec-types-xBRj9sIm-atN8rfl1.d.mts → codec-types-xyW4TiJD-CRDK7QcS.d.mts} +4 -4
  39. package/dist/{codec-types-xBRj9sIm-atN8rfl1.d.mts.map → codec-types-xyW4TiJD-CRDK7QcS.d.mts.map} +1 -1
  40. package/dist/{codecs-qCAX5T6T-sg3NIKfN.d.mts → codecs-3AVVZDao-C0sUjmuO.d.mts} +58 -4
  41. package/dist/{codecs-qCAX5T6T-sg3NIKfN.d.mts.map → codecs-3AVVZDao-C0sUjmuO.d.mts.map} +1 -1
  42. package/dist/{codecs-DCtBjmAW.d.mts → codecs-BZ74mlUI.d.mts} +2 -2
  43. package/dist/{codecs-DCtBjmAW.d.mts.map → codecs-BZ74mlUI.d.mts.map} +1 -1
  44. package/dist/{codecs-BqCmavY8-CC-ZbbTA.mjs → codecs-BtalD4yQ-BVQxal3w.mjs} +137 -6
  45. package/dist/codecs-BtalD4yQ-BVQxal3w.mjs.map +1 -0
  46. package/dist/{column-types-DtpCrZt4.d.mts → column-types-0CjA9Eri.d.mts} +3 -3
  47. package/dist/{column-types-DtpCrZt4.d.mts.map → column-types-0CjA9Eri.d.mts.map} +1 -1
  48. package/dist/{column-types-DW38xCZG.mjs → column-types-B11Mxo9V.mjs} +2 -2
  49. package/dist/{column-types-DW38xCZG.mjs.map → column-types-B11Mxo9V.mjs.map} +1 -1
  50. package/dist/{contract-contributions-rxCSM_1W-d9oohAzB.mjs → contract-contributions-CbLCF8jV-BOZHg83r.mjs} +11 -11
  51. package/dist/{contract-contributions-rxCSM_1W-d9oohAzB.mjs.map → contract-contributions-CbLCF8jV-BOZHg83r.mjs.map} +1 -1
  52. package/dist/{contract-free-BrY8qnvY.mjs → contract-free-DtJ1gJxN.mjs} +4 -4
  53. package/dist/{contract-free-BrY8qnvY.mjs.map → contract-free-DtJ1gJxN.mjs.map} +1 -1
  54. package/dist/{control-s1_5W_8t.d.mts → control-B4I64eEl.d.mts} +49 -1
  55. package/dist/control-B4I64eEl.d.mts.map +1 -0
  56. package/dist/{control-CCetIiFG.d.mts → control-DKpIWFg_.d.mts} +2 -2
  57. package/dist/{control-CCetIiFG.d.mts.map → control-DKpIWFg_.d.mts.map} +1 -1
  58. package/dist/{control-policy-BncmQ6LO-B8SXRfP_.mjs → control-policy-DZzwyc3L-_Bf4iEaW.mjs} +9 -9
  59. package/dist/{control-policy-BncmQ6LO-B8SXRfP_.mjs.map → control-policy-DZzwyc3L-_Bf4iEaW.mjs.map} +1 -1
  60. package/dist/{data-type-entries-ZHPz2h_f-CNUmPGgf.mjs → data-type-entries-Df5SOplt-DHEaXqF0.mjs} +3 -3
  61. package/dist/data-type-entries-Df5SOplt-DHEaXqF0.mjs.map +1 -0
  62. package/dist/{data-types--7V9yY1G.d.mts → data-types-Ct7TIZq3.d.mts} +11 -2
  63. package/dist/{data-types--7V9yY1G.d.mts.map → data-types-Ct7TIZq3.d.mts.map} +1 -1
  64. package/dist/{data-types-DklKHVmp-Bl-nwUa-.mjs → data-types-DHpMs3mz-BllVpLs5.mjs} +83 -5
  65. package/dist/{data-types-DklKHVmp-Bl-nwUa-.mjs.map → data-types-DHpMs3mz-BllVpLs5.mjs.map} +1 -1
  66. package/dist/{date-time-now-generators-Cc4PvFeB-XQWJz_4f.mjs → date-time-now-generators-CEqbD2GP-B95xid7h.mjs} +8 -5
  67. package/dist/date-time-now-generators-CEqbD2GP-B95xid7h.mjs.map +1 -0
  68. package/dist/{ddl-LpR9foVX-YBmyKx74.mjs → ddl-URS0VlHr--s2jpN6c.mjs} +4 -4
  69. package/dist/{ddl-LpR9foVX-YBmyKx74.mjs.map → ddl-URS0VlHr--s2jpN6c.mjs.map} +1 -1
  70. package/dist/{descriptor-meta-C2YuDfV8-B_u19j25.mjs → descriptor-meta-BPjw5dIw-DSlWgzbV.mjs} +4 -4
  71. package/dist/{descriptor-meta-C2YuDfV8-B_u19j25.mjs.map → descriptor-meta-BPjw5dIw-DSlWgzbV.mjs.map} +1 -1
  72. package/dist/{descriptor-meta-C2F_xt0P-D7gfqNS0.mjs → descriptor-meta-DokyxrzY-D2S-BLI0.mjs} +11 -11
  73. package/dist/{descriptor-meta-C2F_xt0P-D7gfqNS0.mjs.map → descriptor-meta-DokyxrzY-D2S-BLI0.mjs.map} +1 -1
  74. package/dist/{diff-database-schema-CcR7BN-A-BuftnIR2.mjs → diff-database-schema-DrOE5ahI-BfrNtMDu.mjs} +9 -9
  75. package/dist/{diff-database-schema-CcR7BN-A-BuftnIR2.mjs.map → diff-database-schema-DrOE5ahI-BfrNtMDu.mjs.map} +1 -1
  76. package/dist/{errors-CaVvV9Mj.d.mts → errors-BmsTgN1e.d.mts} +2 -2
  77. package/dist/{errors-CaVvV9Mj.d.mts.map → errors-BmsTgN1e.d.mts.map} +1 -1
  78. package/dist/{errors-DG6xgXgr-Cb1XcPcb.mjs → errors-DpdPXR_L-DailcY-X.mjs} +14 -3
  79. package/dist/{errors-DG6xgXgr-Cb1XcPcb.mjs.map → errors-DpdPXR_L-DailcY-X.mjs.map} +1 -1
  80. package/dist/{full-text-k_9J-JPd.d.mts → full-text-B1-jMF4Z.d.mts} +3 -3
  81. package/dist/{full-text-k_9J-JPd.d.mts.map → full-text-B1-jMF4Z.d.mts.map} +1 -1
  82. package/dist/{full-text-7szWl7EC.mjs → full-text-B9mXDcsJ.mjs} +3 -3
  83. package/dist/{full-text-7szWl7EC.mjs.map → full-text-B9mXDcsJ.mjs.map} +1 -1
  84. package/dist/{full-text-collection-method-DvmPrdZL-B1FlBM0E.d.mts → full-text-collection-method-BRDY-2p_-ihxqGzh-.d.mts} +4 -4
  85. package/dist/full-text-collection-method-BRDY-2p_-ihxqGzh-.d.mts.map +1 -0
  86. package/dist/{full-text-index-definition-BRNRSgZK-l_2TBarg.mjs → full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs} +3 -3
  87. package/dist/{full-text-index-definition-BRNRSgZK-l_2TBarg.mjs.map → full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs.map} +1 -1
  88. package/dist/{full-text-parsers-Dd5DOdBA-BTeOSzUj.mjs → full-text-parsers-DIfNR9AQ-tVmTju-Y.mjs} +5 -5
  89. package/dist/{full-text-parsers-Dd5DOdBA-BTeOSzUj.mjs.map → full-text-parsers-DIfNR9AQ-tVmTju-Y.mjs.map} +1 -1
  90. package/dist/{full-text-search-document-DWzECXD--BqrLGXsX.mjs → full-text-search-document-Ceg9d2K0-DJ4MklAU.mjs} +5 -5
  91. package/dist/{full-text-search-document-DWzECXD--BqrLGXsX.mjs.map → full-text-search-document-Ceg9d2K0-DJ4MklAU.mjs.map} +1 -1
  92. package/dist/{index-types-5g7gXoWK-CBvkTIbr.mjs → index-types-B5sQ5Vw0-DfXKO9-v.mjs} +3 -3
  93. package/dist/{index-types-5g7gXoWK-CBvkTIbr.mjs.map → index-types-B5sQ5Vw0-DfXKO9-v.mjs.map} +1 -1
  94. package/dist/{infer-psl-contract-CT9H9Xnw-l2pNPAyO.mjs → infer-psl-contract-Du026CJo-sRmqBsId.mjs} +9 -9
  95. package/dist/{infer-psl-contract-CT9H9Xnw-l2pNPAyO.mjs.map → infer-psl-contract-Du026CJo-sRmqBsId.mjs.map} +1 -1
  96. package/dist/migration-Be_iuIpn.mjs.map +1 -1
  97. package/dist/{native-type-normalizer-DgHcQkwl.mjs → native-type-normalizer-CY4mkU_2.mjs} +2 -2
  98. package/dist/{native-type-normalizer-DgHcQkwl.mjs.map → native-type-normalizer-CY4mkU_2.mjs.map} +1 -1
  99. package/dist/{op-factory-call-BRaCqnFh-avSVdAgI.mjs → op-factory-call-DsQATX-o-BHcqPXrs.mjs} +8 -8
  100. package/dist/{op-factory-call-BRaCqnFh-avSVdAgI.mjs.map → op-factory-call-DsQATX-o-BHcqPXrs.mjs.map} +1 -1
  101. package/dist/operation-types-DExfW5kG.d.mts +1 -0
  102. package/dist/{operation-types-DfWYI0Cn-fXs3p9mN.d.mts → operation-types-DxFsD0qF-Cu43r84y.d.mts} +4 -4
  103. package/dist/{operation-types-DfWYI0Cn-fXs3p9mN.d.mts.map → operation-types-DxFsD0qF-Cu43r84y.d.mts.map} +1 -1
  104. package/dist/{pack-BBK-zf0s.d.mts → pack-CjVhjxir.d.mts} +30 -5
  105. package/dist/{pack-BBK-zf0s.d.mts.map → pack-CjVhjxir.d.mts.map} +1 -1
  106. package/dist/{planner-BsLpyYHC-IEpACcdS.mjs → planner-CNoNH9bo-3g7WX476.mjs} +10 -10
  107. package/dist/{planner-BsLpyYHC-IEpACcdS.mjs.map → planner-CNoNH9bo-3g7WX476.mjs.map} +1 -1
  108. package/dist/{planner-ddl-builders-Dmr6ph8i-5FWxE6Wu.mjs → planner-ddl-builders-C_7XNgLd-Ddc_tlvW.mjs} +3 -3
  109. package/dist/{planner-ddl-builders-Dmr6ph8i-5FWxE6Wu.mjs.map → planner-ddl-builders-C_7XNgLd-Ddc_tlvW.mjs.map} +1 -1
  110. package/dist/{planner-identity-values-BwYhwYeo-CaSwyXgC.mjs → planner-identity-values-CfyHM25P-DYnKZgOb.mjs} +5 -3
  111. package/dist/planner-identity-values-CfyHM25P-DYnKZgOb.mjs.map +1 -0
  112. package/dist/{planner-produced-postgres-migration-CU7D_5IE-Cv-o4-Hh.mjs → planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs} +4 -4
  113. package/dist/{planner-produced-postgres-migration-CU7D_5IE-Cv-o4-Hh.mjs.map → planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs.map} +1 -1
  114. package/dist/{planner-sql-checks-DOGD6v7y-BWkRMsXt.mjs → planner-sql-checks-CvI80tt0-B5bKCucD.mjs} +5 -5
  115. package/dist/{planner-sql-checks-DOGD6v7y-BWkRMsXt.mjs.map → planner-sql-checks-CvI80tt0-B5bKCucD.mjs.map} +1 -1
  116. package/dist/{postgres-codec-traits-BhLP9ipO-D5kVsAxr.mjs → postgres-codec-traits-CAzQDLh0-BiKmrtXk.mjs} +3 -3
  117. package/dist/{postgres-codec-traits-BhLP9ipO-D5kVsAxr.mjs.map → postgres-codec-traits-CAzQDLh0-BiKmrtXk.mjs.map} +1 -1
  118. package/dist/{postgres-contract-view-DBmVHV5m-DDZR3cBh.mjs → postgres-contract-view-CRy_3BMc-60fosJRZ.mjs} +9 -9
  119. package/dist/{postgres-contract-view-DBmVHV5m-DDZR3cBh.mjs.map → postgres-contract-view-CRy_3BMc-60fosJRZ.mjs.map} +1 -1
  120. package/dist/{postgres-migration-DrLpuKus-DOU9Rbkb.mjs → postgres-migration-CSU_fUlQ-C5TNpgq4.mjs} +11 -11
  121. package/dist/{postgres-migration-DrLpuKus-DOU9Rbkb.mjs.map → postgres-migration-CSU_fUlQ-C5TNpgq4.mjs.map} +1 -1
  122. package/dist/{postgres-schema-CEGf780E-cyGo2Sii.mjs → postgres-schema-osNZNX0D-BpKJDg4M.mjs} +5 -5
  123. package/dist/{postgres-schema-CEGf780E-cyGo2Sii.mjs.map → postgres-schema-osNZNX0D-BpKJDg4M.mjs.map} +1 -1
  124. package/dist/{prisma7-binding-BvvPWMwt.mjs → prisma7-binding-CPcA6N3v.mjs} +16 -11
  125. package/dist/prisma7-binding-CPcA6N3v.mjs.map +1 -0
  126. package/dist/{prisma7-binding-8sNmqdF6.d.mts → prisma7-binding-DiHnmsNq.d.mts} +30 -5
  127. package/dist/{prisma7-binding-8sNmqdF6.d.mts.map → prisma7-binding-DiHnmsNq.d.mts.map} +1 -1
  128. package/dist/{render-ops-CbRkpwwx-C6wSWcTl.mjs → render-ops-Cj7mog0v-DPzODjA0.mjs} +4 -4
  129. package/dist/{render-ops-CbRkpwwx-C6wSWcTl.mjs.map → render-ops-Cj7mog0v-DPzODjA0.mjs.map} +1 -1
  130. package/dist/{resolve-ddl-schema-BhOYD95_-DhUQYNLi.mjs → resolve-ddl-schema-uDXEVepU-COWNfVPC.mjs} +3 -3
  131. package/dist/{resolve-ddl-schema-BhOYD95_-DhUQYNLi.mjs.map → resolve-ddl-schema-uDXEVepU-COWNfVPC.mjs.map} +1 -1
  132. package/dist/{runtime-BbPgK4gH.d.mts → runtime-DMle_B4T.d.mts} +2 -2
  133. package/dist/{runtime-BbPgK4gH.d.mts.map → runtime-DMle_B4T.d.mts.map} +1 -1
  134. package/dist/{sql-renderer-BdWJPa5F-B8cdiqmK.mjs → sql-renderer-DrSed-6w-Ckp99B2a.mjs} +13 -5
  135. package/dist/sql-renderer-DrSed-6w-Ckp99B2a.mjs.map +1 -0
  136. package/dist/{sql-utils-ylvfJ1RJ-03xGdSLI.mjs → sql-utils-VXrIh8dJ-DVxo_Ygp.mjs} +3 -3
  137. package/dist/{sql-utils-ylvfJ1RJ-03xGdSLI.mjs.map → sql-utils-VXrIh8dJ-DVxo_Ygp.mjs.map} +1 -1
  138. package/dist/target.d.mts +18 -18
  139. package/dist/target.mjs +34 -34
  140. package/dist/target__aggregates.d.mts +1 -1
  141. package/dist/target__aggregates.mjs +1 -1
  142. package/dist/target__codec-ids.d.mts +3 -3
  143. package/dist/target__codec-ids.mjs +2 -2
  144. package/dist/target__codec-types.d.mts +3 -3
  145. package/dist/target__codecs.d.mts +3 -3
  146. package/dist/target__codecs.mjs +3 -3
  147. package/dist/target__contract-free.mjs +3 -3
  148. package/dist/target__control.d.mts +1 -1
  149. package/dist/target__control.mjs +17 -17
  150. package/dist/target__control.mjs.map +1 -1
  151. package/dist/target__data-types.d.mts +2 -2
  152. package/dist/target__data-types.mjs +3 -3
  153. package/dist/target__diff-database-schema.mjs +1 -1
  154. package/dist/target__errors.d.mts +1 -1
  155. package/dist/target__errors.mjs +1 -1
  156. package/dist/target__full-text-index-authoring.mjs +2 -2
  157. package/dist/target__full-text.d.mts +3 -3
  158. package/dist/target__full-text.mjs +2 -2
  159. package/dist/target__issue-planner.mjs +1 -1
  160. package/dist/target__migration.mjs +2 -2
  161. package/dist/target__native-type-normalizer.mjs +1 -1
  162. package/dist/target__op-factory-call.mjs +1 -1
  163. package/dist/target__operation-types.d.mts +2 -2
  164. package/dist/target__pack.d.mts +2 -2
  165. package/dist/target__pack.mjs +1 -1
  166. package/dist/target__planner-ddl-builders.mjs +1 -1
  167. package/dist/target__planner-identity-values.mjs +1 -1
  168. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  169. package/dist/target__planner-sql-checks.mjs +1 -1
  170. package/dist/target__planner.mjs +2 -2
  171. package/dist/target__prisma7-binding.d.mts +1 -1
  172. package/dist/target__prisma7-binding.mjs +1 -1
  173. package/dist/target__render-ops.mjs +1 -1
  174. package/dist/target__runtime.d.mts +2 -2
  175. package/dist/target__runtime.mjs +8 -8
  176. package/dist/target__runtime.mjs.map +1 -1
  177. package/dist/target__schema-ir-annotations.mjs +1 -1
  178. package/dist/target__sql-utils.mjs +3 -3
  179. package/dist/target__types.mjs +2 -2
  180. package/dist/{types-CuFeRfUn.d.mts → types-DNbQLBpx.d.mts} +1 -1
  181. package/package.json +9 -9
  182. package/dist/aggregates-xBA2jH0c.mjs.map +0 -1
  183. package/dist/authoring-Bm8PD9ls-clXbYDiN.mjs.map +0 -1
  184. package/dist/codec-ids-Bt6JuEam.d.mts +0 -1
  185. package/dist/codec-ids-D0wjQdEW-EypD_iZj.mjs.map +0 -1
  186. package/dist/codec-types-BioRVnRb.d.mts +0 -2
  187. package/dist/codecs-BqCmavY8-CC-ZbbTA.mjs.map +0 -1
  188. package/dist/control-s1_5W_8t.d.mts.map +0 -1
  189. package/dist/data-type-entries-ZHPz2h_f-CNUmPGgf.mjs.map +0 -1
  190. package/dist/date-time-now-generators-Cc4PvFeB-XQWJz_4f.mjs.map +0 -1
  191. package/dist/full-text-collection-method-DvmPrdZL-B1FlBM0E.d.mts.map +0 -1
  192. package/dist/operation-types-ByVoHU_s.d.mts +0 -1
  193. package/dist/planner-identity-values-BwYhwYeo-CaSwyXgC.mjs.map +0 -1
  194. package/dist/prisma7-binding-BvvPWMwt.mjs.map +0 -1
  195. package/dist/sql-renderer-BdWJPa5F-B8cdiqmK.mjs.map +0 -1
@@ -1,7 +1,7 @@
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-DklKHVmp-Bl-nwUa-.mjs";
1
+ import { $ as pgVarchar, B as pgText, C as pgFloat4, D as pgInt4, E as pgInt2, H as pgTime, I as pgNumeric, J as pgTimetz, K as pgTimestamptz, M as pgJsonb, O as pgInt8, P as pgMoney, Q as pgVarbit, R as pgOid, V as pgTextArray, W as pgTimestamp, Z as pgUuid, _ as pgChar, d as pgBit, j as pgJson, k as pgInterval, m as pgBytea, p as pgBool, w as pgFloat8, y as pgDate } from "./data-types-DHpMs3mz-BllVpLs5.mjs";
2
2
  import { sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
- //#region ../../../3-targets/postgres/1-target/dist/planner-identity-values-BwYhwYeo.mjs
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-identity-values-CfyHM25P.mjs
5
5
  /**
6
6
  * Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
7
7
  * Checks codec hooks first (extensions can provide type-specific identity values),
@@ -29,6 +29,8 @@ const IDENTITY_VALUES = /* @__PURE__ */ new Map([
29
29
  [pgFloat4.id, "0"],
30
30
  [pgFloat8.id, "0"],
31
31
  [pgNumeric.id, "0"],
32
+ [pgOid.id, "0"],
33
+ [pgMoney.id, "'0'"],
32
34
  [pgBool.id, "false"],
33
35
  [pgUuid.id, "'00000000-0000-0000-0000-000000000000'"],
34
36
  [pgJson.id, "'{}'::json"],
@@ -67,4 +69,4 @@ function buildBitIdentityValue(typeParams) {
67
69
  //#endregion
68
70
  export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
69
71
 
70
- //# sourceMappingURL=planner-identity-values-BwYhwYeo-CaSwyXgC.mjs.map
72
+ //# sourceMappingURL=planner-identity-values-CfyHM25P-DYnKZgOb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-identity-values-CfyHM25P-DYnKZgOb.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-identity-values-CfyHM25P.mjs"],"sourcesContent":["import { A as pgText, E as pgNumeric, H as pgVarbit, I as pgTimestamptz, M as pgTime, O as pgOid, P as pgTimestamp, R as pgTimetz, S as pgJsonb, U as pgVarchar, V as pgUuid, _ as pgInt2, b as pgInterval, c as pgChar, h as pgFloat8, i as pgBit, j as pgTextArray, m as pgFloat4, o as pgBool, s as pgBytea, u as pgDate, v as pgInt4, w as pgMoney, x as pgJson, y as pgInt8 } from \"./data-types-DHpMs3mz.mjs\";\nimport { sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-identity-values.ts\n/**\n* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.\n* Checks codec hooks first (extensions can provide type-specific identity values),\n* then falls back to the built-in map, keyed by the data type the column's codec represents.\n*/\nfunction resolveIdentityValue(column, codecHooks, types) {\n\tconst { codecId, typeParams } = column;\n\tif (column.many) return \"'{}'\";\n\tconst dataType = sqlDataTypeOfCodec(codecId, types).id;\n\tconst hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t});\n\tif (hookDefault !== void 0) return hookDefault;\n\treturn buildBuiltinIdentityValue(dataType, typeParams);\n}\nconst IDENTITY_VALUES = /* @__PURE__ */ new Map([\n\t[pgText.id, \"''\"],\n\t[pgChar.id, \"''\"],\n\t[pgVarchar.id, \"''\"],\n\t[pgInt2.id, \"0\"],\n\t[pgInt4.id, \"0\"],\n\t[pgInt8.id, \"0\"],\n\t[pgFloat4.id, \"0\"],\n\t[pgFloat8.id, \"0\"],\n\t[pgNumeric.id, \"0\"],\n\t[pgOid.id, \"0\"],\n\t[pgMoney.id, \"'0'\"],\n\t[pgBool.id, \"false\"],\n\t[pgUuid.id, \"'00000000-0000-0000-0000-000000000000'\"],\n\t[pgJson.id, \"'{}'::json\"],\n\t[pgJsonb.id, \"'{}'::jsonb\"],\n\t[pgDate.id, \"'epoch'\"],\n\t[pgTimestamp.id, \"'epoch'\"],\n\t[pgTimestamptz.id, \"'epoch'\"],\n\t[pgTime.id, \"'00:00:00'\"],\n\t[pgTimetz.id, \"'00:00:00+00'\"],\n\t[pgInterval.id, \"'0'\"],\n\t[pgBytea.id, \"''::bytea\"],\n\t[pgVarbit.id, \"B''\"],\n\t[pgTextArray.id, \"'{}'\"]\n]);\n/**\n* Returns the built-in identity value (monoid neutral element) as a SQL literal for the given\n* data type — e.g. 0 for integers, '' for text, false for booleans.\n*\n* This is the planner's fallback when no codec hook provides a type-specific identity value.\n*\n* Returns null for other types (for example enums and extension-owned types without a\n* hook), which causes the planner to fall back to the empty-table precheck.\n*\n* @internal Exported for testing only.\n*/\nfunction buildBuiltinIdentityValue(dataType, typeParams) {\n\tif (dataType === pgBit.id) return buildBitIdentityValue(typeParams);\n\treturn IDENTITY_VALUES.get(dataType) ?? null;\n}\nfunction buildBitIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (length === void 0) return \"B'0'\";\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `B'${\"0\".repeat(length)}'`;\n}\n//#endregion\nexport { resolveIdentityValue as n, buildBuiltinIdentityValue as t };\n\n//# sourceMappingURL=planner-identity-values-CfyHM25P.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,MAAM,IAAI,GAAG;CACd,CAAC,QAAQ,IAAI,KAAK;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"}
@@ -1,7 +1,7 @@
1
- import { t as PostgresMigration } from "./postgres-migration-DrLpuKus-DOU9Rbkb.mjs";
2
- import { t as renderOps } from "./render-ops-CbRkpwwx-C6wSWcTl.mjs";
1
+ import { t as PostgresMigration } from "./postgres-migration-CSU_fUlQ-C5TNpgq4.mjs";
2
+ import { t as renderOps } from "./render-ops-Cj7mog0v-DPzODjA0.mjs";
3
3
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B4mJhuVr.mjs";
4
- //#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-CU7D_5IE.mjs
4
+ //#region ../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-DnAk6KxF.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-CU7D_5IE-Cv-o4-Hh.mjs.map
47
+ //# sourceMappingURL=planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-produced-postgres-migration-CU7D_5IE-Cv-o4-Hh.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-CU7D_5IE.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DrLpuKus.mjs\";\nimport { t as renderOps } from \"./render-ops-CbRkpwwx.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-CU7D_5IE.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
+ {"version":3,"file":"planner-produced-postgres-migration-DnAk6KxF-Vj31eyEf.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/postgres/1-target/dist/planner-produced-postgres-migration-DnAk6KxF.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-CSU_fUlQ.mjs\";\nimport { t as renderOps } from \"./render-ops-Cj7mog0v.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-DnAk6KxF.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,9 +1,9 @@
1
- import { l as postgresError } from "./errors-DG6xgXgr-Cb1XcPcb.mjs";
2
- import { h as postgresCreateNamespace } from "./postgres-schema-CEGf780E-cyGo2Sii.mjs";
3
- import { r as autoincrementWidthOfPseudoType } from "./autoincrement-widths-DkD24r-C-D4O96GJZ.mjs";
1
+ import { u as postgresError } from "./errors-DpdPXR_L-DailcY-X.mjs";
2
+ import { h as postgresCreateNamespace } from "./postgres-schema-osNZNX0D-BpKJDg4M.mjs";
3
+ import { r as autoincrementWidthOfPseudoType } from "./autoincrement-widths-Cy5o21bQ-DKg9UXXV.mjs";
4
4
  import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
5
5
  import { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from "@prisma/orm-family-sql/contract/data-type";
6
- //#region ../../../3-targets/postgres/1-target/dist/planner-sql-checks-DOGD6v7y.mjs
6
+ //#region ../../../3-targets/postgres/1-target/dist/planner-sql-checks-CvI80tt0.mjs
7
7
  /**
8
8
  * String-keyed entry points the migration ops use to render
9
9
  * schema-qualified DDL and catalog checks. The `schema` argument is
@@ -157,4 +157,4 @@ function resolvedByKind(base, dataTypes) {
157
157
  //#endregion
158
158
  export { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };
159
159
 
160
- //# sourceMappingURL=planner-sql-checks-DOGD6v7y-BWkRMsXt.mjs.map
160
+ //# sourceMappingURL=planner-sql-checks-CvI80tt0-B5bKCucD.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-sql-checks-DOGD6v7y-BWkRMsXt.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-sql-checks-DOGD6v7y.mjs"],"sourcesContent":["import { l as postgresError } from \"./errors-DG6xgXgr.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-CEGf780E.mjs\";\nimport { r as autoincrementWidthOfPseudoType } from \"./autoincrement-widths-DkD24r-C.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** The data types the components of a stack register. */\nfunction stackDataTypes(frameworkComponents) {\n\treturn assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);\n}\nconst ARRAY_SUFFIX = /^(.*?)(?:\\s*\\[\\s*\\])+$/s;\nconst QUOTED_SEGMENT = /^\"((?:[^\"]|\"\")+)\"/;\n/** The segments of a name written as one or two double-quoted identifiers, `\"Mood\"` or `\"app\".\"status\"`. */\nfunction quotedName(text) {\n\tconst segments = [];\n\tlet rest = text;\n\twhile (rest !== \"\") {\n\t\tconst match = QUOTED_SEGMENT.exec(rest);\n\t\tif (match === null) return void 0;\n\t\tsegments.push((match[1] ?? \"\").replaceAll(\"\\\"\\\"\", \"\\\"\"));\n\t\trest = rest.slice(match[0].length);\n\t\tif (rest.startsWith(\".\")) rest = rest.slice(1);\n\t\telse if (rest !== \"\") return void 0;\n\t}\n\treturn segments.length === 1 || segments.length === 2 ? segments : void 0;\n}\nfunction columnTypeUnreadable(type, where, reason) {\n\tthrow postgresError(\"MIGRATION.COLUMN_TYPE_UNREADABLE\", `${where}: ${reason}`, {\n\t\twhy: \"A column type change checks afterwards that the column has the new type, and finds the type through the data types the configured stack registers.\",\n\t\tfix: \"Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \\\"Mood\\\". If the type comes from an extension, add that extension to the configuration.\",\n\t\tmeta: {\n\t\t\ttype,\n\t\t\twhere\n\t\t}\n\t});\n}\n/** How a postcheck's description names the type it checks: catalog text in double quotes, and an enum by its quoted name, which carries its own quotes. */\nfunction columnTypeCheckText(check) {\n\treturn check.kind === \"catalog-text\" ? `\"${check.text}\"` : `${check.typeName}${check.many ? \"[]\" : \"\"}`;\n}\nfunction rawTypeCheckText(type, where) {\n\tconst trimmed = type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst suffix = array === null ? \"\" : \"[]\";\n\tconst refused = checkRawTypeText(base);\n\treturn refused === void 0 ? `${base}${suffix}` : columnTypeUnreadable(type, where, `the raw type \"${type}\" is refused: ${refused}`);\n}\n/**\n* The postcheck for a column altered to `type`, written as a migration writes it: for a raw type, which the call marks with `raw` (ADR 273), the text as written, compared with the catalog text; otherwise read through the one data type of `dataTypes` that reads it. The planner and the `alterColumnType` facade both check the alter with it, so re-running a migration reproduces its operations. `where` names the call in the error a type no data type reads raises.\n*/\nfunction alterTypeCheck(type, dataTypes, where, raw = false) {\n\tif (raw) return {\n\t\tkind: \"catalog-text\",\n\t\ttext: rawTypeCheckText(type, where)\n\t};\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : columnTypeUnreadable(type, where, read.reason);\n}\n/** The postcheck for a column of `type`, read as {@link alterTypeCheck} reads it, or `undefined` when the stack's data types do not read `type`, as for a raw column. */\nfunction columnTypeCheckIfReadable(type, dataTypes) {\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : void 0;\n}\n/**\n* The column type a migration's `type` names, as {@link alterTypeCheck} reads it: the one data type of `dataTypes` that reads it, or for an enum named by its quoted name, the type that claims enums, with the name as introspection would report it. `undefined` when no data type, or more than one, reads it.\n*/\nfunction writtenColumnType(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\treturn read.ok ? {\n\t\tstoredType: read.type,\n\t\tstoredTypeParams: read.typeParams,\n\t\tmany: read.many\n\t} : void 0;\n}\nfunction readWrittenType(type, dataTypes) {\n\tconst trimmed = autoincrementWidthOfPseudoType(type)?.sequenceType ?? type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tconst byText = resolveWrittenSqlTypes(base, sqlTypes);\n\tif (byText.length > 1) return {\n\t\tok: false,\n\t\treason: `more than one data type of the configured stack reads the type \"${type}\", as ${byText.map((resolved) => resolved.dataType.id).join(\" and \")}`\n\t};\n\tconst [written] = byText;\n\tif (written !== void 0) return {\n\t\tok: true,\n\t\ttype: written.dataType,\n\t\ttypeParams: written.typeParams,\n\t\twrittenTypeParams: written.writtenTypeParams,\n\t\tmany: array !== null\n\t};\n\tconst byKind = resolvedByKind(base, sqlTypes);\n\tif (byKind === void 0) return {\n\t\tok: false,\n\t\treason: `no data type of the configured stack reads the type \"${type}\"`\n\t};\n\treturn {\n\t\tok: true,\n\t\ttype: byKind.dataType,\n\t\ttypeParams: byKind.typeParams,\n\t\twrittenTypeParams: byKind.typeParams,\n\t\tmany: array !== null\n\t};\n}\nfunction readColumnTypeCheck(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\tif (!read.ok) return read;\n\tif (read.type.sql.claimsKind !== void 0) return {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"identity\",\n\t\t\ttypeName: renderSqlTypeName(read.type, read.typeParams),\n\t\t\tmany: read.many\n\t\t}\n\t};\n\treturn {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"catalog-text\",\n\t\t\ttext: `${renderSqlCatalogText(read.type, read.writtenTypeParams)}${read.many ? \"[]\" : \"\"}`\n\t\t}\n\t};\n}\n/** The type a quoted name names, read as the one data type that claims a kind reads a reported type of that kind. */\nfunction resolvedByKind(base, dataTypes) {\n\tconst name = quotedName(base);\n\tconst kinds = dataTypes.flatMap(({ sql }) => sql.claimsKind ?? []);\n\tconst [kind] = kinds;\n\tif (name === void 0 || kind === void 0 || kinds.length > 1) return void 0;\n\tconst [schema, typeName] = name.length === 2 ? name : [void 0, name[0]];\n\treturn resolveReportedSqlType({\n\t\ttext: base,\n\t\tkind,\n\t\tschema,\n\t\tname: typeName\n\t}, dataTypes);\n}\n//#endregion\nexport { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };\n\n//# sourceMappingURL=planner-sql-checks-DOGD6v7y.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,SAAS,eAAe,qBAAqB;CAC5C,OAAO,kBAAkB,mBAAmB,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI;AAC9E;AACA,MAAM,eAAe;AACrB,MAAM,iBAA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CACrB,IAAI,KAAK,KAAK,IAAI,eAAe,KAAK,GAAG,OAAO;EAC/C,IAAI;EACJ,OAAO;GACN,MAAM;GACN,UAAU,kBAAkB,KAAK,MAAM,KAAK,UAAU;GACtD,MAAM,KAAK;EACZ;CACD;CACA,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,MAAM,GAAG,qBAAqB,KAAK,MAAM,KAAK,iBAAiB,IAAI,KAAK,OAAO,OAAO;EACvF;CACD;AACD;;AAEA,SAAS,eAAe,MAAM,WAAW;CACxC,MAAM,OAAO,WAAW,IAAI;CAC5B,MAAM,QAAQ,UAAU,SAAS,EAAE,UAAU,IAAI,cAAc,CAAC,CAAC;CACjE,MAAM,CAAC,QAAQ;CACf,IAAI,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,MAAM,SAAS,GAAG,OAAO,KAAK;CACxE,MAAM,CAAC,QAAQ,YAAY,KAAK,WAAW,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE;CACtE,OAAO,uBAAuB;EAC7B,MAAM;EACN;EACA;EACA,MAAM;CACP,GAAG,SAAS;AACb"}
1
+ {"version":3,"file":"planner-sql-checks-CvI80tt0-B5bKCucD.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/planner-sql-checks-CvI80tt0.mjs"],"sourcesContent":["import { u as postgresError } from \"./errors-DpdPXR_L.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-osNZNX0D.mjs\";\nimport { r as autoincrementWidthOfPseudoType } from \"./autoincrement-widths-Cy5o21bQ.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { checkRawTypeText, isSqlDataType, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** The data types the components of a stack register. */\nfunction stackDataTypes(frameworkComponents) {\n\treturn assembleDataTypes(frameworkComponents).declared.map(({ type }) => type);\n}\nconst ARRAY_SUFFIX = /^(.*?)(?:\\s*\\[\\s*\\])+$/s;\nconst QUOTED_SEGMENT = /^\"((?:[^\"]|\"\")+)\"/;\n/** The segments of a name written as one or two double-quoted identifiers, `\"Mood\"` or `\"app\".\"status\"`. */\nfunction quotedName(text) {\n\tconst segments = [];\n\tlet rest = text;\n\twhile (rest !== \"\") {\n\t\tconst match = QUOTED_SEGMENT.exec(rest);\n\t\tif (match === null) return void 0;\n\t\tsegments.push((match[1] ?? \"\").replaceAll(\"\\\"\\\"\", \"\\\"\"));\n\t\trest = rest.slice(match[0].length);\n\t\tif (rest.startsWith(\".\")) rest = rest.slice(1);\n\t\telse if (rest !== \"\") return void 0;\n\t}\n\treturn segments.length === 1 || segments.length === 2 ? segments : void 0;\n}\nfunction columnTypeUnreadable(type, where, reason) {\n\tthrow postgresError(\"MIGRATION.COLUMN_TYPE_UNREADABLE\", `${where}: ${reason}`, {\n\t\twhy: \"A column type change checks afterwards that the column has the new type, and finds the type through the data types the configured stack registers.\",\n\t\tfix: \"Write the type as a migration writes it, for example int4 or varchar(20), or an enum by its quoted name, such as \\\"Mood\\\". If the type comes from an extension, add that extension to the configuration.\",\n\t\tmeta: {\n\t\t\ttype,\n\t\t\twhere\n\t\t}\n\t});\n}\n/** How a postcheck's description names the type it checks: catalog text in double quotes, and an enum by its quoted name, which carries its own quotes. */\nfunction columnTypeCheckText(check) {\n\treturn check.kind === \"catalog-text\" ? `\"${check.text}\"` : `${check.typeName}${check.many ? \"[]\" : \"\"}`;\n}\nfunction rawTypeCheckText(type, where) {\n\tconst trimmed = type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst suffix = array === null ? \"\" : \"[]\";\n\tconst refused = checkRawTypeText(base);\n\treturn refused === void 0 ? `${base}${suffix}` : columnTypeUnreadable(type, where, `the raw type \"${type}\" is refused: ${refused}`);\n}\n/**\n* The postcheck for a column altered to `type`, written as a migration writes it: for a raw type, which the call marks with `raw` (ADR 273), the text as written, compared with the catalog text; otherwise read through the one data type of `dataTypes` that reads it. The planner and the `alterColumnType` facade both check the alter with it, so re-running a migration reproduces its operations. `where` names the call in the error a type no data type reads raises.\n*/\nfunction alterTypeCheck(type, dataTypes, where, raw = false) {\n\tif (raw) return {\n\t\tkind: \"catalog-text\",\n\t\ttext: rawTypeCheckText(type, where)\n\t};\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : columnTypeUnreadable(type, where, read.reason);\n}\n/** The postcheck for a column of `type`, read as {@link alterTypeCheck} reads it, or `undefined` when the stack's data types do not read `type`, as for a raw column. */\nfunction columnTypeCheckIfReadable(type, dataTypes) {\n\tconst read = readColumnTypeCheck(type, dataTypes);\n\treturn read.ok ? read.check : void 0;\n}\n/**\n* The column type a migration's `type` names, as {@link alterTypeCheck} reads it: the one data type of `dataTypes` that reads it, or for an enum named by its quoted name, the type that claims enums, with the name as introspection would report it. `undefined` when no data type, or more than one, reads it.\n*/\nfunction writtenColumnType(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\treturn read.ok ? {\n\t\tstoredType: read.type,\n\t\tstoredTypeParams: read.typeParams,\n\t\tmany: read.many\n\t} : void 0;\n}\nfunction readWrittenType(type, dataTypes) {\n\tconst trimmed = autoincrementWidthOfPseudoType(type)?.sequenceType ?? type.trim();\n\tconst array = ARRAY_SUFFIX.exec(trimmed);\n\tconst base = array?.[1] ?? trimmed;\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tconst byText = resolveWrittenSqlTypes(base, sqlTypes);\n\tif (byText.length > 1) return {\n\t\tok: false,\n\t\treason: `more than one data type of the configured stack reads the type \"${type}\", as ${byText.map((resolved) => resolved.dataType.id).join(\" and \")}`\n\t};\n\tconst [written] = byText;\n\tif (written !== void 0) return {\n\t\tok: true,\n\t\ttype: written.dataType,\n\t\ttypeParams: written.typeParams,\n\t\twrittenTypeParams: written.writtenTypeParams,\n\t\tmany: array !== null\n\t};\n\tconst byKind = resolvedByKind(base, sqlTypes);\n\tif (byKind === void 0) return {\n\t\tok: false,\n\t\treason: `no data type of the configured stack reads the type \"${type}\"`\n\t};\n\treturn {\n\t\tok: true,\n\t\ttype: byKind.dataType,\n\t\ttypeParams: byKind.typeParams,\n\t\twrittenTypeParams: byKind.typeParams,\n\t\tmany: array !== null\n\t};\n}\nfunction readColumnTypeCheck(type, dataTypes) {\n\tconst read = readWrittenType(type, dataTypes);\n\tif (!read.ok) return read;\n\tif (read.type.sql.claimsKind !== void 0) return {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"identity\",\n\t\t\ttypeName: renderSqlTypeName(read.type, read.typeParams),\n\t\t\tmany: read.many\n\t\t}\n\t};\n\treturn {\n\t\tok: true,\n\t\tcheck: {\n\t\t\tkind: \"catalog-text\",\n\t\t\ttext: `${renderSqlCatalogText(read.type, read.writtenTypeParams)}${read.many ? \"[]\" : \"\"}`\n\t\t}\n\t};\n}\n/** The type a quoted name names, read as the one data type that claims a kind reads a reported type of that kind. */\nfunction resolvedByKind(base, dataTypes) {\n\tconst name = quotedName(base);\n\tconst kinds = dataTypes.flatMap(({ sql }) => sql.claimsKind ?? []);\n\tconst [kind] = kinds;\n\tif (name === void 0 || kind === void 0 || kinds.length > 1) return void 0;\n\tconst [schema, typeName] = name.length === 2 ? name : [void 0, name[0]];\n\treturn resolveReportedSqlType({\n\t\ttext: base,\n\t\tkind,\n\t\tschema,\n\t\tname: typeName\n\t}, dataTypes);\n}\n//#endregion\nexport { stackDataTypes as a, qualifyTableName as i, columnTypeCheckIfReadable as n, writtenColumnType as o, columnTypeCheckText as r, alterTypeCheck as t };\n\n//# sourceMappingURL=planner-sql-checks-CvI80tt0.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,SAAS,eAAe,qBAAqB;CAC5C,OAAO,kBAAkB,mBAAmB,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI;AAC9E;AACA,MAAM,eAAe;AACrB,MAAM,iBAAiB;;AAEvB,SAAS,WAAW,MAAM;CACzB,MAAM,WAAW,CAAC;CAClB,IAAI,OAAO;CACX,OAAO,SAAS,IAAI;EACnB,MAAM,QAAQ,eAAe,KAAK,IAAI;EACtC,IAAI,UAAU,MAAM,OAAO,KAAK;EAChC,SAAS,MAAM,MAAM,MAAM,GAAA,CAAI,WAAW,QAAQ,IAAI,CAAC;EACvD,OAAO,KAAK,MAAM,MAAM,EAAE,CAAC,MAAM;EACjC,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO,KAAK,MAAM,CAAC;OACxC,IAAI,SAAS,IAAI,OAAO,KAAK;CACnC;CACA,OAAO,SAAS,WAAW,KAAK,SAAS,WAAW,IAAI,WAAW,KAAK;AACzE;AACA,SAAS,qBAAqB,MAAM,OAAO,QAAQ;CAClD,MAAM,cAAc,oCAAoC,GAAG,MAAM,IAAI,UAAU;EAC9E,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,MAAM,SAAS,iBAAiB,IAAI,MAAM,KAAK,KAAK,GAAG,MAAM,WAAW,MAAM,OAAO,OAAO;A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riptors } from "./codecs-BqCmavY8-CC-ZbbTA.mjs";
2
- //#region ../../../3-targets/postgres/1-target/dist/postgres-codec-traits-BhLP9ipO.mjs
1
+ import { s as codecDescriptors } from "./codecs-BtalD4yQ-BVQxal3w.mjs";
2
+ //#region ../../../3-targets/postgres/1-target/dist/postgres-codec-traits-CAzQDLh0.mjs
3
3
  const TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));
4
4
  /** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */
5
5
  function postgresCodecTraitsOf(codecId) {
@@ -8,4 +8,4 @@ function postgresCodecTraitsOf(codecId) {
8
8
  //#endregion
9
9
  export { postgresCodecTraitsOf as t };
10
10
 
11
- //# sourceMappingURL=postgres-codec-traits-BhLP9ipO-D5kVsAxr.mjs.map
11
+ //# sourceMappingURL=postgres-codec-traits-CAzQDLh0-BiKmrtXk.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-codec-traits-BhLP9ipO-D5kVsAxr.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-codec-traits-BhLP9ipO.mjs"],"sourcesContent":["import { t as codecDescriptors } from \"./codecs-BqCmavY8.mjs\";\n//#region src/core/postgres-codec-traits.ts\nconst TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));\n/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */\nfunction postgresCodecTraitsOf(codecId) {\n\treturn TRAITS_BY_CODEC_ID.get(codecId);\n}\n//#endregion\nexport { postgresCodecTraitsOf as t };\n\n//# sourceMappingURL=postgres-codec-traits-BhLP9ipO.mjs.map"],"mappings":";;AAEA,MAAM,qBAAqB,IAAI,IAAI,iBAAiB,KAAK,eAAe,CAAC,WAAW,SAAS,WAAW,MAAM,CAAC,CAAC;;AAEhH,SAAS,sBAAsB,SAAS;CACvC,OAAO,mBAAmB,IAAI,OAAO;AACtC"}
1
+ {"version":3,"file":"postgres-codec-traits-CAzQDLh0-BiKmrtXk.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-codec-traits-CAzQDLh0.mjs"],"sourcesContent":["import { t as codecDescriptors } from \"./codecs-BtalD4yQ.mjs\";\n//#region src/core/postgres-codec-traits.ts\nconst TRAITS_BY_CODEC_ID = new Map(codecDescriptors.map((descriptor) => [descriptor.codecId, descriptor.traits]));\n/** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */\nfunction postgresCodecTraitsOf(codecId) {\n\treturn TRAITS_BY_CODEC_ID.get(codecId);\n}\n//#endregion\nexport { postgresCodecTraitsOf as t };\n\n//# sourceMappingURL=postgres-codec-traits-CAzQDLh0.mjs.map"],"mappings":";;AAEA,MAAM,qBAAqB,IAAI,IAAI,iBAAiB,KAAK,eAAe,CAAC,WAAW,SAAS,WAAW,MAAM,CAAC,CAAC;;AAEhH,SAAS,sBAAsB,SAAS;CACvC,OAAO,mBAAmB,IAAI,OAAO;AACtC"}
@@ -1,10 +1,10 @@
1
- import { C as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from "./codec-ids-D0wjQdEW-EypD_iZj.mjs";
2
- import { Z as postgresTextDataTypes, i as createPostgresBuiltinDataTypeLookup } from "./data-types-DklKHVmp-Bl-nwUa-.mjs";
3
- import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-DVjibYBY-BeOUp5fk.mjs";
4
- import { a as assertFullTextIndexes } from "./full-text-index-definition-BRNRSgZK-l_2TBarg.mjs";
5
- import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-CEGf780E-cyGo2Sii.mjs";
6
- import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-BhLP9ipO-D5kVsAxr.mjs";
7
- import { n as postgresAuthoringEntityTypes } from "./authoring-Bm8PD9ls-clXbYDiN.mjs";
1
+ import { T as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from "./codec-ids-2htdtS66-CJPMZv1t.mjs";
2
+ import { i as createPostgresBuiltinDataTypeLookup, rt as postgresTextDataTypes } from "./data-types-DHpMs3mz-BllVpLs5.mjs";
3
+ import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-D-bD-lFp-BCSmwfrE.mjs";
4
+ import { a as assertFullTextIndexes } from "./full-text-index-definition-MfjtL-x7-ImaTAFMs.mjs";
5
+ import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-osNZNX0D-BpKJDg4M.mjs";
6
+ import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-CAzQDLh0-BiKmrtXk.mjs";
7
+ import { n as postgresAuthoringEntityTypes } from "./authoring-D7EAP1iG-DlpkOeVt.mjs";
8
8
  import { requiredSchemaKeys } from "@prisma/orm-framework/components/codec";
9
9
  import { blindCast } from "@prisma/orm-framework/utils/casts";
10
10
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -14,7 +14,7 @@ import { buildSqlSchemaQualifiedView } from "@prisma/orm-family-sql/contract/con
14
14
  import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing-utils";
15
15
  import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
16
16
  import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
17
- //#region ../../../3-targets/postgres/1-target/dist/postgres-contract-view-DBmVHV5m.mjs
17
+ //#region ../../../3-targets/postgres/1-target/dist/postgres-contract-view-CRy_3BMc.mjs
18
18
  const POSTGRES_CODEC_LOOKUP = createPostgresBuiltinCodecLookup();
19
19
  /** The context entity hydration runs in. Hydration reads stored contract JSON and never a written value, so its data types carry no authoring entries, which keeps the PSL readers out of the runtime. */
20
20
  const POSTGRES_AUTHORING_CTX = {
@@ -154,4 +154,4 @@ const PostgresContractView = {
154
154
  //#endregion
155
155
  export { PostgresContractView as n, PostgresContractSerializer as t };
156
156
 
157
- //# sourceMappingURL=postgres-contract-view-DBmVHV5m-DDZR3cBh.mjs.map
157
+ //# sourceMappingURL=postgres-contract-view-CRy_3BMc-60fosJRZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-contract-view-DBmVHV5m-DDZR3cBh.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-contract-view-DBmVHV5m.mjs"],"sourcesContent":["import { C as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from \"./codec-ids-D0wjQdEW.mjs\";\nimport { B as postgresTextDataTypes, t as createPostgresBuiltinDataTypeLookup } from \"./data-types-DklKHVmp.mjs\";\nimport { r as createPostgresBuiltinCodecLookup } from \"./codec-registry-DVjibYBY.mjs\";\nimport { n as assertFullTextIndexes } from \"./full-text-index-definition-BRNRSgZK.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-BhLP9ipO.mjs\";\nimport { a as nativeEnumEntityKind, c as roleEntityKind, o as policyEntityKind, s as rlsEnablementEntityKind, t as PostgresSchema } from \"./postgres-schema-CEGf780E.mjs\";\nimport { n as postgresAuthoringEntityTypes } from \"./authoring-Bm8PD9ls.mjs\";\nimport { requiredSchemaKeys } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_CODEC_LOOKUP = createPostgresBuiltinCodecLookup();\n/** The context entity hydration runs in. Hydration reads stored contract JSON and never a written value, so its data types carry no authoring entries, which keeps the PSL readers out of the runtime. */\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tcodecLookup: POSTGRES_CODEC_LOOKUP,\n\tdataTypes: {\n\t\tentries: {},\n\t\tlookup: createPostgresBuiltinDataTypeLookup(),\n\t\tdataTypeOfCodec: (codecId) => POSTGRES_CODEC_LOOKUP.descriptorFor(codecId)?.dataType,\n\t\ttextDataTypes: postgresTextDataTypes\n\t},\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction requiredKeysOf(schema) {\n\tconst keys = requiredSchemaKeys(schema);\n\tif (keys === void 0) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn keys;\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\tconst schema = new PostgresSchema({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t\tfor (const table of Object.values(schema.table)) assertFullTextIndexes(table, postgresCodecTraitsOf);\n\t\treturn schema;\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-DBmVHV5m.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,wBAAwB,iCAAiC;;AAE/D,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,WAAW;EACV,SAAS,CAAC;EACV,QAAQ,oCAAoC;EAC5C,kBAAkB,YAAY,sBAAsB,cAAc,OAAO,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M,uBAAuB;;CAE5B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,2BAA2B,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC9F;AACD"}
1
+ {"version":3,"file":"postgres-contract-view-CRy_3BMc-60fosJRZ.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/postgres-contract-view-CRy_3BMc.mjs"],"sourcesContent":["import { T as PG_TEXT_CODEC_ID, v as PG_INT_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { K as postgresTextDataTypes, t as createPostgresBuiltinDataTypeLookup } from \"./data-types-DHpMs3mz.mjs\";\nimport { r as createPostgresBuiltinCodecLookup } from \"./codec-registry-D-bD-lFp.mjs\";\nimport { n as assertFullTextIndexes } from \"./full-text-index-definition-MfjtL-x7.mjs\";\nimport { t as postgresCodecTraitsOf } from \"./postgres-codec-traits-CAzQDLh0.mjs\";\nimport { a as nativeEnumEntityKind, c as roleEntityKind, o as policyEntityKind, s as rlsEnablementEntityKind, t as PostgresSchema } from \"./postgres-schema-osNZNX0D.mjs\";\nimport { n as postgresAuthoringEntityTypes } from \"./authoring-D7EAP1iG.mjs\";\nimport { requiredSchemaKeys } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { buildSqlSchemaQualifiedView } from \"@internal/sql-contract/contract-view\";\nimport { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\n//#region src/core/postgres-contract-serializer.ts\nconst POSTGRES_CODEC_LOOKUP = createPostgresBuiltinCodecLookup();\n/** The context entity hydration runs in. Hydration reads stored contract JSON and never a written value, so its data types carry no authoring entries, which keeps the PSL readers out of the runtime. */\nconst POSTGRES_AUTHORING_CTX = {\n\tfamily: \"sql\",\n\ttarget: \"postgres\",\n\tcodecLookup: POSTGRES_CODEC_LOOKUP,\n\tdataTypes: {\n\t\tentries: {},\n\t\tlookup: createPostgresBuiltinDataTypeLookup(),\n\t\tdataTypeOfCodec: (codecId) => POSTGRES_CODEC_LOOKUP.descriptorFor(codecId)?.dataType,\n\t\ttextDataTypes: postgresTextDataTypes\n\t},\n\tenumInferenceCodecs: {\n\t\ttext: PG_TEXT_CODEC_ID,\n\t\tint: PG_INT_CODEC_ID\n\t}\n};\nfunction isAuthoringEntityTypeFactoryOutput(output) {\n\treturn typeof output === \"object\" && output !== null && \"factory\" in output && typeof output.factory === \"function\";\n}\n/**\n* Walks a pack's entity-type namespace tree and emits hydration factories\n* keyed by the descriptor's `discriminator`. Used for `storage.types`\n* (codec-triple hydration). Namespace entries hydration dispatches by\n* entries key, not discriminator — handled by `hydrateNamespaceEntities`.\n*/\nfunction collectStorageTypesHydrators(namespace) {\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) {\n\t\t\tif (isAuthoringEntityTypeDescriptor(value)) {\n\t\t\t\tif (isAuthoringEntityTypeFactoryOutput(value.output)) {\n\t\t\t\t\tconst { factory } = value.output;\n\t\t\t\t\tregistry.set(value.discriminator, (raw) => factory(raw, POSTGRES_AUTHORING_CTX));\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (typeof value === \"object\" && value !== null) walk(value);\n\t\t}\n\t};\n\twalk(namespace);\n\treturn registry;\n}\n/**\n* The canonicalization walk drops a field whose value equals its type's\n* default, which for a required field of an entity kind means the emitted\n* contract fails that kind's own schema on the next read (a RESTRICTIVE\n* policy's `permissive: false` is the live case). The set of fields that must\n* survive is therefore the required keys of the registered entity kinds —\n* read off the schemas rather than listed by hand, so a kind that gains a\n* required field is covered the day it gains one.\n*/\nfunction requiredEntityFieldsSurviveDefaults(kinds) {\n\treturn createPreserveEmptyPredicate(kinds.flatMap((kind) => requiredKeysOf(kind.schema).map((key) => [\n\t\t\"storage\",\n\t\t\"namespaces\",\n\t\t\"*\",\n\t\t\"entries\",\n\t\tkind.kind,\n\t\t\"*\",\n\t\tkey\n\t])));\n}\nfunction requiredKeysOf(schema) {\n\tconst keys = requiredSchemaKeys(schema);\n\tif (keys === void 0) throw new InternalError(\"entity-kind schema does not expose arktype object props; the required-field preserve set cannot be derived\");\n\treturn keys;\n}\nvar PostgresContractSerializer = class extends SqlContractSerializerBase {\n\tshouldPreserveEmpty;\n\tconstructor(extraPackEntityKinds = []) {\n\t\tconst storageTypesHydrators = collectStorageTypesHydrators(postgresAuthoringEntityTypes);\n\t\tconst entityKinds = [\n\t\t\tpolicyEntityKind,\n\t\t\troleEntityKind,\n\t\t\trlsEnablementEntityKind,\n\t\t\tnativeEnumEntityKind,\n\t\t\t...extraPackEntityKinds\n\t\t];\n\t\tsuper(storageTypesHydrators, entityKinds);\n\t\tconst preserveRequired = requiredEntityFieldsSurviveDefaults(entityKinds);\n\t\tthis.shouldPreserveEmpty = (path) => preserveRequired(path) || sqlContractCanonicalizationHooks.shouldPreserveEmpty(path);\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\tconst { id, entries } = blindCast(super.hydrateSqlNamespaceEntry(nsId, raw));\n\t\tconst allSlotsEmpty = Object.values(entries).every((slot) => slot === void 0 || Object.keys(slot).length === 0);\n\t\tif (id === UNBOUND_NAMESPACE_ID && allSlotsEmpty) return PostgresSchema.unbound;\n\t\tconst valueSetSlot = entries[\"valueSet\"];\n\t\tconst hasValueSets = valueSetSlot !== void 0 && Object.keys(valueSetSlot).length > 0;\n\t\tconst schema = new PostgresSchema({\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\t...entries,\n\t\t\t\ttable: entries[\"table\"] ?? {},\n\t\t\t\t...hasValueSets ? { valueSet: valueSetSlot } : {}\n\t\t\t}\n\t\t});\n\t\tfor (const table of Object.values(schema.table)) assertFullTextIndexes(table, postgresCodecTraitsOf);\n\t\treturn schema;\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst isUnboundSlot = ns.id === UNBOUND_NAMESPACE_ID;\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: isUnboundSlot ? \"postgres-unbound-schema\" : \"postgres-schema\",\n\t\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t\t};\n\t\t}\n\t\tconst storageOut = {\n\t\t\tstorageHash: String(storage.storageHash),\n\t\t\tnamespaces: namespacesJson\n\t\t};\n\t\tif (storage.types !== void 0) {\n\t\t\tconst typesOut = {};\n\t\t\tfor (const [name, entry] of Object.entries(storage.types)) typesOut[name] = this.serializeJsonObject(entry);\n\t\t\tstorageOut[\"types\"] = typesOut;\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: storageOut\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/postgres-contract-view.ts\nconst PostgresContractView = {\n\t/** Wrap an already-deserialized Postgres contract in a schema-qualified view. */\n\tfrom(contract) {\n\t\treturn buildSqlSchemaQualifiedView(contract);\n\t},\n\t/** Deserialize a Postgres contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSchemaQualifiedView(new PostgresContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { PostgresContractSerializer as n, PostgresContractView as t };\n\n//# sourceMappingURL=postgres-contract-view-CRy_3BMc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,wBAAwB,iCAAiC;;AAE/D,MAAM,yBAAyB;CAC9B,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,WAAW;EACV,SAAS,CAAC;EACV,QAAQ,o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B,GAAG;GACH,SAAS;EACV,CAAC;CACF;AACD;AAGA,MAAM,uBAAuB;;CAE5B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,2BAA2B,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC9F;AACD"}
@@ -1,16 +1,16 @@
1
- import { l as postgresError, n as errorPostgresMigrationStackMissing } from "./errors-DG6xgXgr-Cb1XcPcb.mjs";
2
- import { i as PostgresRlsPolicy } from "./postgres-schema-CEGf780E-cyGo2Sii.mjs";
1
+ import { r as errorPostgresMigrationStackMissing, u as postgresError } from "./errors-DpdPXR_L-DailcY-X.mjs";
2
+ import { i as PostgresRlsPolicy } from "./postgres-schema-osNZNX0D-BpKJDg4M.mjs";
3
3
  import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode } from "./postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs";
4
4
  import { n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs";
5
5
  import { t as postgresResolveDefault } from "./default-normalizer-BqK6XxdC-2OUb2ybG.mjs";
6
- import { n as emissionSchemaForNamespace, r as resolveDdlSchemaForNamespaceStorage, t as ddlSchemaOfCallSchema } from "./resolve-ddl-schema-BhOYD95_-DhUQYNLi.mjs";
6
+ import { n as emissionSchemaForNamespace, r as resolveDdlSchemaForNamespaceStorage, t as ddlSchemaOfCallSchema } from "./resolve-ddl-schema-uDXEVepU-COWNfVPC.mjs";
7
7
  import { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from "./default-constraint-names-Cz9Yoeim-sUzOGvIm.mjs";
8
- import { i as hasAutoincrementDefault } from "./autoincrement-widths-DkD24r-C-D4O96GJZ.mjs";
9
- import { a as stackDataTypes, o as writtenColumnType } from "./planner-sql-checks-DOGD6v7y-BWkRMsXt.mjs";
10
- import { A as RemoveStoredValueCall, B as SetNotNullCall, C as DropNativeEnumTypeCall, D as DropTableCall, E as DropSchemaCall, F as RenameSchemaCall, H as alterColumnTypeCallText, I as RenameTableCall, K as installExtension, L as ReplaceStoredValueCall, M as RenameConstraintCall, N as RenameIndexCall, O as EnableRowLevelSecurityCall, P as RenamePostgresRlsPolicyCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, V as SetTableSchemaCall, Y as renameTableStatement, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameColumnCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall, z as SetDefaultCall } from "./op-factory-call-BRaCqnFh-avSVdAgI.mjs";
11
- import { l as resolveNamespaceIdForDdlSchema, r as issueNode } from "./control-policy-BncmQ6LO-B8SXRfP_.mjs";
12
- import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-CcR7BN-A-BuftnIR2.mjs";
13
- import { n as PostgresContractView } from "./postgres-contract-view-DBmVHV5m-DDZR3cBh.mjs";
8
+ import { i as hasAutoincrementDefault } from "./autoincrement-widths-Cy5o21bQ-DKg9UXXV.mjs";
9
+ import { a as stackDataTypes, o as writtenColumnType } from "./planner-sql-checks-CvI80tt0-B5bKCucD.mjs";
10
+ import { A as RemoveStoredValueCall, B as SetNotNullCall, C as DropNativeEnumTypeCall, D as DropTableCall, E as DropSchemaCall, F as RenameSchemaCall, H as alterColumnTypeCallText, I as RenameTableCall, K as installExtension, L as ReplaceStoredValueCall, M as RenameConstraintCall, N as RenameIndexCall, O as EnableRowLevelSecurityCall, P as RenamePostgresRlsPolicyCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, V as SetTableSchemaCall, Y as renameTableStatement, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameColumnCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall, z as SetDefaultCall } from "./op-factory-call-DsQATX-o-BHcqPXrs.mjs";
11
+ import { l as resolveNamespaceIdForDdlSchema, r as issueNode } from "./control-policy-DZzwyc3L-_Bf4iEaW.mjs";
12
+ import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-DrOE5ahI-BfrNtMDu.mjs";
13
+ import { n as PostgresContractView } from "./postgres-contract-view-CRy_3BMc-60fosJRZ.mjs";
14
14
  import { t as dataTransform } from "./data-transform-h9agBu_c-RlC5A7aY.mjs";
15
15
  import { blindCast } from "@prisma/orm-framework/utils/casts";
16
16
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -25,7 +25,7 @@ import { resolveColumnRenameAgainst, resolveTableRenameAgainst, sqlTypeLookupsOf
25
25
  import { errorMigrationOperationOptionRemoved } from "@prisma/orm-framework/errors/migration";
26
26
  import { Migration } from "@prisma/orm-family-sql/family/migration";
27
27
  import { MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
28
- //#region ../../../3-targets/postgres/1-target/dist/postgres-migration-DrLpuKus.mjs
28
+ //#region ../../../3-targets/postgres/1-target/dist/postgres-migration-CSU_fUlQ.mjs
29
29
  /**
30
30
  * The Postgres schema tree a contract describes, as the planner's "from" side:
31
31
  * the target descriptor's `migrations.contractToSchema` hook and the trees
@@ -1330,4 +1330,4 @@ function createIndexExtrasOf(extras, index) {
1330
1330
  //#endregion
1331
1331
  export { postgresColumnRenameCall as a, postgresTableRenameByHand as c, renderRenameTableCall as d, pairIndexRenames as i, postgresTableRenameCall as l, createWorkingSchema as n, postgresContractToSchema as o, pairCheckRenames as r, postgresSchemaTables as s, PostgresMigration as t, renameTableByHandStatements as u };
1332
1332
 
1333
- //# sourceMappingURL=postgres-migration-DrLpuKus-DOU9Rbkb.mjs.map
1333
+ //# sourceMappingURL=postgres-migration-CSU_fUlQ-C5TNpgq4.mjs.map