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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/README.md +4 -6
  2. package/dist/adapter-5qylEP__.d.mts +403 -0
  3. package/dist/adapter-5qylEP__.d.mts.map +1 -0
  4. package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs → adapter-svGTIjA2-1p-Iw8D2.mjs} +24 -30
  5. package/dist/adapter-svGTIjA2-1p-Iw8D2.mjs.map +1 -0
  6. package/dist/adapter.d.mts +11 -13
  7. package/dist/adapter.mjs +7 -8
  8. package/dist/adapter__adapter.d.mts +2 -2
  9. package/dist/adapter__adapter.mjs +3 -2
  10. package/dist/adapter__column-types.d.mts +2 -2
  11. package/dist/adapter__column-types.mjs +2 -2
  12. package/dist/adapter__control.d.mts +4 -5
  13. package/dist/adapter__control.mjs +11 -423
  14. package/dist/adapter__control.mjs.map +1 -1
  15. package/dist/adapter__runtime.d.mts +1 -1
  16. package/dist/adapter__runtime.mjs +29 -19
  17. package/dist/adapter__runtime.mjs.map +1 -1
  18. package/dist/adapter__sql-renderer.d.mts +1 -1
  19. package/dist/adapter__sql-renderer.mjs +1 -1
  20. package/dist/adapter__types.d.mts +4 -3
  21. package/dist/aggregates-CEqqEg8k.d.mts +318 -0
  22. package/dist/aggregates-CEqqEg8k.d.mts.map +1 -0
  23. package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Dw-lAutX.mjs} +105 -40
  24. package/dist/aggregates-Dw-lAutX.mjs.map +1 -0
  25. package/dist/authoring-DWd5pnnV-BBX7P1wT.d.mts +52 -0
  26. package/dist/authoring-DWd5pnnV-BBX7P1wT.d.mts.map +1 -0
  27. package/dist/authoring-SbdvmVJh-nQ7YliD_.mjs +1342 -0
  28. package/dist/authoring-SbdvmVJh-nQ7YliD_.mjs.map +1 -0
  29. package/dist/autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs +58 -0
  30. package/dist/autoincrement-widths-DonNJgfS-CCvZ4u1W.mjs.map +1 -0
  31. package/dist/{canonicalize-CQlxSR4D-MnrT5gtW.d.mts → canonicalize-B-xvDOdd-G3yUeKj4.d.mts} +7 -3
  32. package/dist/canonicalize-B-xvDOdd-G3yUeKj4.d.mts.map +1 -0
  33. package/dist/{canonicalize-CrN3u_xM-D4MrOqcB.mjs → canonicalize-RdxoUHao-FTTkizfe.mjs} +15 -3
  34. package/dist/canonicalize-RdxoUHao-FTTkizfe.mjs.map +1 -0
  35. package/dist/check-expressions-7uCCP01t-DtX2Vak9.mjs +48 -0
  36. package/dist/check-expressions-7uCCP01t-DtX2Vak9.mjs.map +1 -0
  37. package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-CtTzM58x-LloO-5Vf.d.mts} +14 -13
  38. package/dist/check-expressions-CtTzM58x-LloO-5Vf.d.mts.map +1 -0
  39. package/dist/{codec-descriptor-LT7BpQta-BaDM8UQQ.mjs → codec-descriptor-DoR-cTFZ-BlG5Gj-X.mjs} +12 -21
  40. package/dist/codec-descriptor-DoR-cTFZ-BlG5Gj-X.mjs.map +1 -0
  41. package/dist/codec-descriptor-Fb3UoQGb.d.mts +1 -0
  42. package/dist/codec-descriptor-d1ByNBEk-DhrtS_5y.d.mts +47 -0
  43. package/dist/codec-descriptor-d1ByNBEk-DhrtS_5y.d.mts.map +1 -0
  44. package/dist/codec-ids-BMhEpFwv-B8Zh0s_Q.mjs +41 -0
  45. package/dist/codec-ids-BMhEpFwv-B8Zh0s_Q.mjs.map +1 -0
  46. package/dist/codec-ids-C6II64Wy-CPYTqDTT.d.mts +41 -0
  47. package/dist/codec-ids-C6II64Wy-CPYTqDTT.d.mts.map +1 -0
  48. package/dist/codec-ids-CcB5uBNf.d.mts +1 -0
  49. package/dist/codec-registry-D7XslgPe-DTZnVB8W.mjs +61 -0
  50. package/dist/codec-registry-D7XslgPe-DTZnVB8W.mjs.map +1 -0
  51. package/dist/codec-type-map-Fj5xCgwT-BeCXgfuR.d.mts +53 -0
  52. package/dist/codec-type-map-Fj5xCgwT-BeCXgfuR.d.mts.map +1 -0
  53. package/dist/codec-types-BBACckHa.d.mts +2 -0
  54. package/dist/codec-types-Ct_4iTVc-3tFJcIBo.d.mts +84 -0
  55. package/dist/codec-types-Ct_4iTVc-3tFJcIBo.d.mts.map +1 -0
  56. package/dist/codecs-CADK7dCR-C8WToYQb.d.mts +724 -0
  57. package/dist/codecs-CADK7dCR-C8WToYQb.d.mts.map +1 -0
  58. package/dist/codecs-CRl9-i_r-Co-bgYl3.mjs +1743 -0
  59. package/dist/codecs-CRl9-i_r-Co-bgYl3.mjs.map +1 -0
  60. package/dist/codecs-CoEpEqjM.d.mts +31 -0
  61. package/dist/codecs-CoEpEqjM.d.mts.map +1 -0
  62. package/dist/column-types-B4zsV-u3.mjs +106 -0
  63. package/dist/column-types-B4zsV-u3.mjs.map +1 -0
  64. package/dist/column-types-Bs2V0j8T.d.mts +164 -0
  65. package/dist/column-types-Bs2V0j8T.d.mts.map +1 -0
  66. package/dist/{control-adapter-DFr4gS-r-DM3KcZdQ.mjs → contract-contributions-Xz2FpyfI-CeQZqHKf.mjs} +489 -292
  67. package/dist/contract-contributions-Xz2FpyfI-CeQZqHKf.mjs.map +1 -0
  68. package/dist/{contract-free-DzpGxLfb.d.mts → contract-free-B6-wuc6M.d.mts} +36 -6
  69. package/dist/contract-free-B6-wuc6M.d.mts.map +1 -0
  70. package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-o7olebm9.mjs} +13 -9
  71. package/dist/contract-free-o7olebm9.mjs.map +1 -0
  72. package/dist/control--HupSPoV.d.mts +847 -0
  73. package/dist/control--HupSPoV.d.mts.map +1 -0
  74. package/dist/{control-BaUpALVp.d.mts → control-CQEjh4P7.d.mts} +2 -2
  75. package/dist/control-CQEjh4P7.d.mts.map +1 -0
  76. package/dist/{control-DLTOAEHj.d.mts → control-D4cTcpcJ.d.mts} +22 -48
  77. package/dist/control-D4cTcpcJ.d.mts.map +1 -0
  78. package/dist/{control-Y6FxMu3o.mjs → control-DZQwENIP.mjs} +21 -9
  79. package/dist/control-DZQwENIP.mjs.map +1 -0
  80. package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-DtU5u9Dm-44r_OF94.mjs} +444 -218
  81. package/dist/control-policy-DtU5u9Dm-44r_OF94.mjs.map +1 -0
  82. package/dist/{data-transform-ChZzy2dP-CxVCat_8.mjs → data-transform-h9agBu_c-RlC5A7aY.mjs} +12 -5
  83. package/dist/data-transform-h9agBu_c-RlC5A7aY.mjs.map +1 -0
  84. package/dist/{data-transform-Ck5FbyNO-BNE7QlAo.d.mts → data-transform-nGy9rz87-CE3DGlgn.d.mts} +15 -4
  85. package/dist/data-transform-nGy9rz87-CE3DGlgn.d.mts.map +1 -0
  86. package/dist/data-transform-nqkqNIb8.d.mts +1 -0
  87. package/dist/data-type-entries-gQW3-KSb-BIl8vgus.mjs +128 -0
  88. package/dist/data-type-entries-gQW3-KSb-BIl8vgus.mjs.map +1 -0
  89. package/dist/data-types--7V9yY1G.d.mts +99 -0
  90. package/dist/data-types--7V9yY1G.d.mts.map +1 -0
  91. package/dist/data-types-Chx0mjTP-DczU4S9b.mjs +950 -0
  92. package/dist/data-types-Chx0mjTP-DczU4S9b.mjs.map +1 -0
  93. package/dist/date-time-now-generators-CMkXVbMG-C-GjhReE.d.mts +45 -0
  94. package/dist/date-time-now-generators-CMkXVbMG-C-GjhReE.d.mts.map +1 -0
  95. package/dist/ddl-B7Rqlz6D-B7dRDgYb.mjs +647 -0
  96. package/dist/ddl-B7Rqlz6D-B7dRDgYb.mjs.map +1 -0
  97. package/dist/ddl-B8nQZTWN.d.mts +1 -0
  98. package/dist/default-constraint-names-Cz9Yoeim-sUzOGvIm.mjs +18 -0
  99. package/dist/default-constraint-names-Cz9Yoeim-sUzOGvIm.mjs.map +1 -0
  100. package/dist/default-normalizer-BqK6XxdC-2OUb2ybG.mjs +311 -0
  101. package/dist/default-normalizer-BqK6XxdC-2OUb2ybG.mjs.map +1 -0
  102. package/dist/default-normalizer-DO-cH75Q.d.mts +25 -0
  103. package/dist/default-normalizer-DO-cH75Q.d.mts.map +1 -0
  104. package/dist/descriptor-meta-BkD3nXF_-CZaNqC6r.mjs +36 -0
  105. package/dist/descriptor-meta-BkD3nXF_-CZaNqC6r.mjs.map +1 -0
  106. package/dist/descriptor-meta-DaFDNnHQ-QjiiAEtC.mjs +64 -0
  107. package/dist/descriptor-meta-DaFDNnHQ-QjiiAEtC.mjs.map +1 -0
  108. package/dist/descriptor-meta-runtime-Dft1L7eE-D8vpOz_Z.mjs +15 -0
  109. package/dist/descriptor-meta-runtime-Dft1L7eE-D8vpOz_Z.mjs.map +1 -0
  110. package/dist/{diff-database-schema-DsoNznGC.d.mts → diff-database-schema-BxzhZaVN.d.mts} +12 -7
  111. package/dist/diff-database-schema-BxzhZaVN.d.mts.map +1 -0
  112. package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-DAEzWtzU-DoyVgKqh.mjs} +38 -18
  113. package/dist/diff-database-schema-DAEzWtzU-DoyVgKqh.mjs.map +1 -0
  114. package/dist/driver.d.mts +3 -3
  115. package/dist/driver.mjs +3 -2
  116. package/dist/driver__control.d.mts +1 -1
  117. package/dist/driver__control.mjs +1 -1
  118. package/dist/driver__runtime.d.mts +2 -2
  119. package/dist/driver__runtime.mjs +2 -639
  120. package/dist/errors-BrhQYgdL-IvZHPjwL.mjs +103 -0
  121. package/dist/errors-BrhQYgdL-IvZHPjwL.mjs.map +1 -0
  122. package/dist/{errors-CU4xIwwk.d.mts → errors-D3Mj-x0o.d.mts} +3 -3
  123. package/dist/errors-D3Mj-x0o.d.mts.map +1 -0
  124. package/dist/full-text-BYg7EVX2.mjs +39 -0
  125. package/dist/full-text-BYg7EVX2.mjs.map +1 -0
  126. package/dist/full-text-SDbfxrE_.d.mts +26 -0
  127. package/dist/full-text-SDbfxrE_.d.mts.map +1 -0
  128. package/dist/full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts +27 -0
  129. package/dist/full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts.map +1 -0
  130. package/dist/full-text-index-authoring-CN1L9C1k.d.mts +7 -0
  131. package/dist/full-text-index-authoring-CN1L9C1k.d.mts.map +1 -0
  132. package/dist/full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs +195 -0
  133. package/dist/full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs.map +1 -0
  134. package/dist/full-text-index-definition-D5iBWLss-BEpqiucV.d.mts +71 -0
  135. package/dist/full-text-index-definition-D5iBWLss-BEpqiucV.d.mts.map +1 -0
  136. package/dist/full-text-parsers-CFFxiOrp-CrZ7VI1m.mjs +139 -0
  137. package/dist/full-text-parsers-CFFxiOrp-CrZ7VI1m.mjs.map +1 -0
  138. package/dist/full-text-search-document-Doy5TF7c-aMWM_1KB.mjs +54 -0
  139. package/dist/full-text-search-document-Doy5TF7c-aMWM_1KB.mjs.map +1 -0
  140. package/dist/index-types-BihjrAAq-C2VnfAyF.mjs +14 -0
  141. package/dist/index-types-BihjrAAq-C2VnfAyF.mjs.map +1 -0
  142. package/dist/indexes-BYf6nXVv-BXwLw7fO.d.mts +60 -0
  143. package/dist/indexes-BYf6nXVv-BXwLw7fO.d.mts.map +1 -0
  144. package/dist/infer-psl-contract-BSSHcuRi-ChdFSviw.mjs +1143 -0
  145. package/dist/infer-psl-contract-BSSHcuRi-ChdFSviw.mjs.map +1 -0
  146. package/dist/{issue-planner-Biq9Ls7e.d.mts → issue-planner-D-On52xP.d.mts} +39 -9
  147. package/dist/issue-planner-D-On52xP.d.mts.map +1 -0
  148. package/dist/list-decoder-BcrLExnx-DlCwavhu.d.mts +7 -0
  149. package/dist/list-decoder-BcrLExnx-DlCwavhu.d.mts.map +1 -0
  150. package/dist/marker-lock-BviIbusV.d.mts +11 -0
  151. package/dist/marker-lock-BviIbusV.d.mts.map +1 -0
  152. package/dist/marker-lock-DFc1Tfv5-BkBKBRE3.mjs +11 -0
  153. package/dist/marker-lock-DFc1Tfv5-BkBKBRE3.mjs.map +1 -0
  154. package/dist/{migration-PTHAY9Cv.mjs → migration-Be_iuIpn.mjs} +5 -4
  155. package/dist/migration-Be_iuIpn.mjs.map +1 -0
  156. package/dist/migration-D4lMmLVj.d.mts +26 -0
  157. package/dist/migration-D4lMmLVj.d.mts.map +1 -0
  158. package/dist/{namespace-ids-xtp_ZY86-Cpp8PTxD.mjs → namespace-ids-xtp_ZY86-Cxc0dBbO.mjs} +2 -2
  159. package/dist/namespace-ids-xtp_ZY86-Cxc0dBbO.mjs.map +1 -0
  160. package/dist/native-type-normalizer-BaGa9eeb.d.mts +30 -0
  161. package/dist/native-type-normalizer-BaGa9eeb.d.mts.map +1 -0
  162. package/dist/native-type-normalizer-Cn-RGt_E.mjs +24 -0
  163. package/dist/native-type-normalizer-Cn-RGt_E.mjs.map +1 -0
  164. package/dist/{nodes-DAvDJLvJ-BBdvFXNa.mjs → nodes-G8VTh4PM-DNvIhHag.mjs} +78 -7
  165. package/dist/nodes-G8VTh4PM-DNvIhHag.mjs.map +1 -0
  166. package/dist/{nodes-BU-V-aZA-RqwPH68u.d.mts → nodes-s0Oe37jT-Cw3BU2gL.d.mts} +82 -29
  167. package/dist/nodes-s0Oe37jT-Cw3BU2gL.d.mts.map +1 -0
  168. package/dist/op-factory-call-CRaVUOb_.d.mts +1 -0
  169. package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-gGX-mZu--0QUG5xH4.mjs} +1014 -258
  170. package/dist/op-factory-call-gGX-mZu--0QUG5xH4.mjs.map +1 -0
  171. package/dist/{op-factory-call-BAeyLFYf-BAgG1h1C.d.mts → op-factory-call-nLHvNx0O-BTBhGbOF.d.mts} +169 -111
  172. package/dist/op-factory-call-nLHvNx0O-BTBhGbOF.d.mts.map +1 -0
  173. package/dist/operation-types--Wa_cv45-RoRnL1Dn.d.mts +192 -0
  174. package/dist/operation-types--Wa_cv45-RoRnL1Dn.d.mts.map +1 -0
  175. package/dist/operation-types-OXILTAOX.d.mts +1 -0
  176. package/dist/pack-2CYw2w-b.d.mts +1573 -0
  177. package/dist/pack-2CYw2w-b.d.mts.map +1 -0
  178. package/dist/{planner-CT-7zSfk.d.mts → planner-AD3Dt57t.d.mts} +23 -51
  179. package/dist/planner-AD3Dt57t.d.mts.map +1 -0
  180. package/dist/planner-VuR6URu3-CCUT2Osx.mjs +954 -0
  181. package/dist/planner-VuR6URu3-CCUT2Osx.mjs.map +1 -0
  182. package/dist/planner-ddl-builders-CPM3y7cQ.d.mts +16 -0
  183. package/dist/planner-ddl-builders-CPM3y7cQ.d.mts.map +1 -0
  184. package/dist/planner-ddl-builders-cYnH52gC-BWifb_M6.mjs +28 -0
  185. package/dist/planner-ddl-builders-cYnH52gC-BWifb_M6.mjs.map +1 -0
  186. package/dist/planner-identity-values-Dsq989Lh.d.mts +26 -0
  187. package/dist/planner-identity-values-Dsq989Lh.d.mts.map +1 -0
  188. package/dist/planner-identity-values-QstrMJ2U-CcpaRVPY.mjs +70 -0
  189. package/dist/planner-identity-values-QstrMJ2U-CcpaRVPY.mjs.map +1 -0
  190. package/dist/planner-produced-postgres-migration-BBUwtjA_.d.mts +1 -0
  191. package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs} +5 -5
  192. package/dist/planner-produced-postgres-migration-BZclL_xO-uflxtYuP.mjs.map +1 -0
  193. package/dist/{planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.d.mts → planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts} +4 -4
  194. package/dist/planner-produced-postgres-migration-DyIXJ3MR-DHO5wn_X.d.mts.map +1 -0
  195. package/dist/{planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs → planner-schema-lookup-BbUY9oVy.mjs} +2 -2
  196. package/dist/planner-schema-lookup-BbUY9oVy.mjs.map +1 -0
  197. package/dist/{planner-schema-lookup-C4DHAddq.d.mts → planner-schema-lookup-ceCNOGFf.d.mts} +2 -2
  198. package/dist/planner-schema-lookup-ceCNOGFf.d.mts.map +1 -0
  199. package/dist/planner-sql-checks-D-K44J19-CzvrqzNB.mjs +151 -0
  200. package/dist/planner-sql-checks-D-K44J19-CzvrqzNB.mjs.map +1 -0
  201. package/dist/planner-sql-checks-Ed-WGtge-D9ByMrW4.d.mts +37 -0
  202. package/dist/planner-sql-checks-Ed-WGtge-D9ByMrW4.d.mts.map +1 -0
  203. package/dist/planner-sql-checks-rEjFx_Jv.d.mts +1 -0
  204. package/dist/planner-target-details-CUEF0s90-6g-mOgTI.mjs +14 -0
  205. package/dist/planner-target-details-CUEF0s90-6g-mOgTI.mjs.map +1 -0
  206. package/dist/{planner-target-details-HkP4RrRO-_xPQVPF0.d.mts → planner-target-details-HkP4RrRO-D6VtK0jY.d.mts} +2 -2
  207. package/dist/planner-target-details-HkP4RrRO-D6VtK0jY.d.mts.map +1 -0
  208. package/dist/postgres-codec-traits-CnP5Bjxp-Dxdgv0TI.mjs +11 -0
  209. package/dist/postgres-codec-traits-CnP5Bjxp-Dxdgv0TI.mjs.map +1 -0
  210. package/dist/{postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts → postgres-contract-view-BFzIDwwN-hL3QLe_b.d.mts} +2 -2
  211. package/dist/postgres-contract-view-BFzIDwwN-hL3QLe_b.d.mts.map +1 -0
  212. package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-BO2elRMz-BqMBzJoJ.mjs} +27 -14
  213. package/dist/postgres-contract-view-BO2elRMz-BqMBzJoJ.mjs.map +1 -0
  214. package/dist/{postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts → postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts} +4 -4
  215. package/dist/postgres-database-schema-node-Cv8usVNX-BmvGozi4.d.mts.map +1 -0
  216. package/dist/postgres-migration-BSWmeRLo-CUfVTUf0.mjs +1312 -0
  217. package/dist/postgres-migration-BSWmeRLo-CUfVTUf0.mjs.map +1 -0
  218. package/dist/{postgres-migration-BNsrwlxh-CwI5BqAu.d.mts → postgres-migration-C5deJ3Ne-C4Jxu-e6.d.mts} +135 -15
  219. package/dist/postgres-migration-C5deJ3Ne-C4Jxu-e6.d.mts.map +1 -0
  220. package/dist/{postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs → postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs} +2 -2
  221. package/dist/postgres-native-enum-CdP3b_-R-DgG3pi5p.mjs.map +1 -0
  222. package/dist/postgres-object-name-FPikIvOw-B8FfJI7z.mjs +23 -0
  223. package/dist/postgres-object-name-FPikIvOw-B8FfJI7z.mjs.map +1 -0
  224. package/dist/{postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts → postgres-rls-policy-CnDxf3z9-BjpVyUnK.d.mts} +2 -2
  225. package/dist/postgres-rls-policy-CnDxf3z9-BjpVyUnK.d.mts.map +1 -0
  226. package/dist/{postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs → postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs} +3 -3
  227. package/dist/postgres-role-schema-node-B8Z5i5D--BzOKm4N1.mjs.map +1 -0
  228. package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-C6w1rzOF-D1fdwqRx.mjs} +14 -12
  229. package/dist/postgres-schema-C6w1rzOF-D1fdwqRx.mjs.map +1 -0
  230. package/dist/{postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts → postgres-schema-Xsjt3RKO-bis-SVSB.d.mts} +4 -4
  231. package/dist/postgres-schema-Xsjt3RKO-bis-SVSB.d.mts.map +1 -0
  232. package/dist/{postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs → postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs} +2 -2
  233. package/dist/postgres-table-schema-node-BBkitBQh-Dll8iaZT.mjs.map +1 -0
  234. package/dist/prisma7-binding-BjiLA9F7.mjs +307 -0
  235. package/dist/prisma7-binding-BjiLA9F7.mjs.map +1 -0
  236. package/dist/prisma7-binding-a56klfkc.d.mts +1651 -0
  237. package/dist/prisma7-binding-a56klfkc.d.mts.map +1 -0
  238. package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-BgqtCw9Z-T8BPTX85.mjs} +17 -10
  239. package/dist/render-ops-BgqtCw9Z-T8BPTX85.mjs.map +1 -0
  240. package/dist/{render-ops-DPwhZt2W.d.mts → render-ops-Bl84i7ut.d.mts} +3 -3
  241. package/dist/render-ops-Bl84i7ut.d.mts.map +1 -0
  242. package/dist/{render-typescript-6sCFvMBh.d.mts → render-typescript-BysdXYpH.d.mts} +2 -2
  243. package/dist/render-typescript-BysdXYpH.d.mts.map +1 -0
  244. package/dist/{render-typescript-Dqp1Spgn-B128r1qw.mjs → render-typescript-Dqp1Spgn-B4mJhuVr.mjs} +2 -2
  245. package/dist/render-typescript-Dqp1Spgn-B4mJhuVr.mjs.map +1 -0
  246. package/dist/resolve-ddl-schema-D3VNPMSm-BuB6NyOI.mjs +34 -0
  247. package/dist/resolve-ddl-schema-D3VNPMSm-BuB6NyOI.mjs.map +1 -0
  248. package/dist/{runtime-lHBKgjB9.d.mts → runtime-C0VXuM0b.d.mts} +4 -3
  249. package/dist/runtime-C0VXuM0b.d.mts.map +1 -0
  250. package/dist/runtime-CXfxy5ED.mjs +660 -0
  251. package/dist/runtime-CXfxy5ED.mjs.map +1 -0
  252. package/dist/{runtime-_TfO66h5.d.mts → runtime-Ci_toEDZ.d.mts} +12 -4
  253. package/dist/runtime-Ci_toEDZ.d.mts.map +1 -0
  254. package/dist/{runtime-DOXznQe0.d.mts → runtime-DtjW0GP_.d.mts} +4 -4
  255. package/dist/runtime-DtjW0GP_.d.mts.map +1 -0
  256. package/dist/{schema-ir-annotations-DuuYh0gl.d.mts → schema-ir-annotations-BygaWBiC.d.mts} +2 -2
  257. package/dist/schema-ir-annotations-BygaWBiC.d.mts.map +1 -0
  258. package/dist/{schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts → schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts} +2 -2
  259. package/dist/schema-node-kinds-C52Bb1ve-DmxQRPPS.d.mts.map +1 -0
  260. package/dist/{normalize-error-CNjgVO71-CLlZ3CuJ.mjs → server-text-types-DeNPQpv5-DqX0h8WF.mjs} +45 -3
  261. package/dist/server-text-types-DeNPQpv5-DqX0h8WF.mjs.map +1 -0
  262. package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-BdWJPa5F-Ct0CPlXc.mjs} +113 -123
  263. package/dist/sql-renderer-BdWJPa5F-Ct0CPlXc.mjs.map +1 -0
  264. package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-BiBhge7D.d.mts} +9 -7
  265. package/dist/sql-renderer-BiBhge7D.d.mts.map +1 -0
  266. package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-Bnw3JbWf-BN0gcjZB.mjs} +31 -8
  267. package/dist/sql-utils-Bnw3JbWf-BN0gcjZB.mjs.map +1 -0
  268. package/dist/{sql-utils-DW6fkczF.d.mts → sql-utils-CnnGiZBc.d.mts} +12 -4
  269. package/dist/sql-utils-CnnGiZBc.d.mts.map +1 -0
  270. package/dist/{table-source-ikHOZmhD-DriY1Lcr.d.mts → table-source-ikHOZmhD-vYcblBYv.d.mts} +2 -2
  271. package/dist/table-source-ikHOZmhD-vYcblBYv.d.mts.map +1 -0
  272. package/dist/target.d.mts +61 -49
  273. package/dist/target.mjs +45 -36
  274. package/dist/target__aggregates.d.mts +1 -1
  275. package/dist/target__aggregates.mjs +1 -1
  276. package/dist/target__codec-descriptor.d.mts +2 -2
  277. package/dist/target__codec-descriptor.mjs +1 -1
  278. package/dist/target__codec-ids.d.mts +3 -3
  279. package/dist/target__codec-ids.mjs +2 -2
  280. package/dist/target__codec-types.d.mts +4 -4
  281. package/dist/target__codecs.d.mts +4 -3
  282. package/dist/target__codecs.mjs +3 -3
  283. package/dist/target__contract-free.d.mts +3 -3
  284. package/dist/target__contract-free.mjs +4 -4
  285. package/dist/target__control.d.mts +4 -2
  286. package/dist/target__control.mjs +2501 -2
  287. package/dist/target__control.mjs.map +1 -0
  288. package/dist/target__data-transform.d.mts +2 -2
  289. package/dist/target__data-transform.mjs +1 -1
  290. package/dist/target__data-types.d.mts +2 -0
  291. package/dist/target__data-types.mjs +3 -0
  292. package/dist/target__ddl.d.mts +4 -4
  293. package/dist/target__ddl.mjs +2 -2
  294. package/dist/target__default-normalizer.d.mts +2 -2
  295. package/dist/target__default-normalizer.mjs +2 -2
  296. package/dist/target__diff-database-schema.d.mts +1 -1
  297. package/dist/target__diff-database-schema.mjs +1 -1
  298. package/dist/target__errors.d.mts +1 -1
  299. package/dist/target__errors.mjs +1 -1
  300. package/dist/target__full-text-index-authoring.d.mts +3 -0
  301. package/dist/target__full-text-index-authoring.mjs +3 -0
  302. package/dist/target__full-text.d.mts +4 -0
  303. package/dist/target__full-text.mjs +3 -0
  304. package/dist/target__issue-planner.d.mts +1 -1
  305. package/dist/target__issue-planner.mjs +1 -1
  306. package/dist/target__marker-lock.d.mts +2 -0
  307. package/dist/target__marker-lock.mjs +2 -0
  308. package/dist/target__migration.d.mts +4 -4
  309. package/dist/target__migration.mjs +5 -5
  310. package/dist/target__native-type-normalizer.d.mts +2 -2
  311. package/dist/target__native-type-normalizer.mjs +2 -2
  312. package/dist/target__op-factory-call.d.mts +3 -3
  313. package/dist/target__op-factory-call.mjs +2 -2
  314. package/dist/target__operation-types.d.mts +4 -0
  315. package/dist/target__pack.d.mts +3 -2
  316. package/dist/target__pack.mjs +1 -1
  317. package/dist/target__planner-ddl-builders.d.mts +2 -2
  318. package/dist/target__planner-ddl-builders.mjs +2 -2
  319. package/dist/target__planner-identity-values.d.mts +1 -1
  320. package/dist/target__planner-identity-values.mjs +1 -1
  321. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  322. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  323. package/dist/target__planner-schema-lookup.d.mts +1 -1
  324. package/dist/target__planner-schema-lookup.mjs +1 -1
  325. package/dist/target__planner-sql-checks.d.mts +3 -2
  326. package/dist/target__planner-sql-checks.mjs +2 -2
  327. package/dist/target__planner-target-details.d.mts +1 -1
  328. package/dist/target__planner.d.mts +1 -1
  329. package/dist/target__planner.mjs +2 -2
  330. package/dist/target__prisma7-binding.d.mts +2 -0
  331. package/dist/target__prisma7-binding.mjs +2 -0
  332. package/dist/target__render-ops.d.mts +1 -1
  333. package/dist/target__render-ops.mjs +1 -1
  334. package/dist/target__render-typescript.d.mts +1 -1
  335. package/dist/target__render-typescript.mjs +1 -1
  336. package/dist/target__rls-canonicalize.d.mts +2 -2
  337. package/dist/target__rls-canonicalize.mjs +2 -2
  338. package/dist/target__runtime.d.mts +6 -3
  339. package/dist/target__runtime.mjs +193 -4
  340. package/dist/target__runtime.mjs.map +1 -1
  341. package/dist/target__schema-ir-annotations.d.mts +1 -1
  342. package/dist/target__schema-ir-annotations.mjs +1 -1
  343. package/dist/target__sql-utils.d.mts +3 -2
  344. package/dist/target__sql-utils.mjs +4 -2
  345. package/dist/target__types.d.mts +7 -7
  346. package/dist/target__types.mjs +5 -5
  347. package/dist/types-AvjnIUna.d.mts +2 -0
  348. package/dist/types-D6lgKhE5-D1J9YJnd.d.mts +28 -0
  349. package/dist/types-D6lgKhE5-D1J9YJnd.d.mts.map +1 -0
  350. package/dist/{types-CjGjPLr5.d.mts → types-DOmgp_12.d.mts} +8 -8
  351. package/dist/types-DOmgp_12.d.mts.map +1 -0
  352. package/dist/{types-ue6jkJyF-BQJzjx1P.d.mts → types-ue6jkJyF-D79DmBTl.d.mts} +2 -2
  353. package/dist/types-ue6jkJyF-D79DmBTl.d.mts.map +1 -0
  354. package/package.json +22 -14
  355. package/dist/adapter-B0xsc80z-sYcF0RVF.mjs.map +0 -1
  356. package/dist/adapter-CPesdzv0.d.mts +0 -26
  357. package/dist/adapter-CPesdzv0.d.mts.map +0 -1
  358. package/dist/adapter__operation-types.d.mts +0 -2
  359. package/dist/aggregates-CgqNfj2O.d.mts +0 -10
  360. package/dist/aggregates-CgqNfj2O.d.mts.map +0 -1
  361. package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
  362. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs +0 -773
  363. package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
  364. package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts.map +0 -1
  365. package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs.map +0 -1
  366. package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs +0 -41
  367. package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs.map +0 -1
  368. package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
  369. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts +0 -37
  370. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts.map +0 -1
  371. package/dist/codec-descriptor-Bg-_412t.d.mts +0 -1
  372. package/dist/codec-descriptor-LT7BpQta-BaDM8UQQ.mjs.map +0 -1
  373. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
  374. package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
  375. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
  376. package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
  377. package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
  378. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts +0 -84
  379. package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
  380. package/dist/codec-types-bX63JRLf.d.mts +0 -2
  381. package/dist/codecs-B1HgsJZ2.mjs +0 -15
  382. package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
  383. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs +0 -1680
  384. package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
  385. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts +0 -638
  386. package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
  387. package/dist/codecs-DmCKO7dg.d.mts +0 -15
  388. package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
  389. package/dist/column-types-BH-MU6uU.d.mts +0 -108
  390. package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
  391. package/dist/column-types-Bh92dNjD.mjs +0 -126
  392. package/dist/column-types-Bh92dNjD.mjs.map +0 -1
  393. package/dist/contract-free-DzpGxLfb.d.mts.map +0 -1
  394. package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
  395. package/dist/control-2F195jJk.d.mts +0 -11
  396. package/dist/control-2F195jJk.d.mts.map +0 -1
  397. package/dist/control-BaUpALVp.d.mts.map +0 -1
  398. package/dist/control-DLTOAEHj.d.mts.map +0 -1
  399. package/dist/control-V7OkAC55.mjs +0 -1459
  400. package/dist/control-V7OkAC55.mjs.map +0 -1
  401. package/dist/control-Y6FxMu3o.mjs.map +0 -1
  402. package/dist/control-adapter-DFr4gS-r-DM3KcZdQ.mjs.map +0 -1
  403. package/dist/control-policy-B53lnBCT-B9K9Cj1x.mjs.map +0 -1
  404. package/dist/data-transform-BSM7TQpE.d.mts +0 -1
  405. package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs.map +0 -1
  406. package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts.map +0 -1
  407. package/dist/ddl-B4Rh8ntj.d.mts +0 -1
  408. package/dist/ddl-CNQJds-C-WfZ3y4y8.mjs +0 -395
  409. package/dist/ddl-CNQJds-C-WfZ3y4y8.mjs.map +0 -1
  410. package/dist/default-normalizer-B36TOul4.d.mts +0 -31
  411. package/dist/default-normalizer-B36TOul4.d.mts.map +0 -1
  412. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs +0 -253
  413. package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs.map +0 -1
  414. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs +0 -354
  415. package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
  416. package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs +0 -30
  417. package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map +0 -1
  418. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs +0 -13
  419. package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs.map +0 -1
  420. package/dist/diff-database-schema-DKq76rCk-uehceHYz.mjs.map +0 -1
  421. package/dist/diff-database-schema-DsoNznGC.d.mts.map +0 -1
  422. package/dist/driver__runtime.mjs.map +0 -1
  423. package/dist/errors-CU4xIwwk.d.mts.map +0 -1
  424. package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
  425. package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
  426. package/dist/issue-planner-Biq9Ls7e.d.mts.map +0 -1
  427. package/dist/migration-PTHAY9Cv.mjs.map +0 -1
  428. package/dist/migration-aFeTWTOJ.d.mts +0 -25
  429. package/dist/migration-aFeTWTOJ.d.mts.map +0 -1
  430. package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs.map +0 -1
  431. package/dist/native-type-normalizer-DqJlOTeX.d.mts +0 -19
  432. package/dist/native-type-normalizer-DqJlOTeX.d.mts.map +0 -1
  433. package/dist/native-type-normalizer-yvd3tqv-.mjs +0 -38
  434. package/dist/native-type-normalizer-yvd3tqv-.mjs.map +0 -1
  435. package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts.map +0 -1
  436. package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs.map +0 -1
  437. package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs.map +0 -1
  438. package/dist/op-factory-call-BAeyLFYf-BAgG1h1C.d.mts.map +0 -1
  439. package/dist/op-factory-call-BTU8I_x0.d.mts +0 -1
  440. package/dist/op-factory-call-H6zeDGLe-_1pAftJk.mjs.map +0 -1
  441. package/dist/operation-types-BfRocNI8.d.mts +0 -22
  442. package/dist/operation-types-BfRocNI8.d.mts.map +0 -1
  443. package/dist/pack-CySS3DQU.d.mts +0 -626
  444. package/dist/pack-CySS3DQU.d.mts.map +0 -1
  445. package/dist/planner-CT-7zSfk.d.mts.map +0 -1
  446. package/dist/planner-D0uogzvT-1WyGIC5p.mjs +0 -671
  447. package/dist/planner-D0uogzvT-1WyGIC5p.mjs.map +0 -1
  448. package/dist/planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs +0 -102
  449. package/dist/planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map +0 -1
  450. package/dist/planner-ddl-builders-ijp60-JO.d.mts +0 -19
  451. package/dist/planner-ddl-builders-ijp60-JO.d.mts.map +0 -1
  452. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs +0 -90
  453. package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs.map +0 -1
  454. package/dist/planner-identity-values-TfEhnoWa.d.mts +0 -25
  455. package/dist/planner-identity-values-TfEhnoWa.d.mts.map +0 -1
  456. package/dist/planner-produced-postgres-migration-BaviT8KK-Yo9kw6rs.d.mts.map +0 -1
  457. package/dist/planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map +0 -1
  458. package/dist/planner-produced-postgres-migration-D6C0T2xV.d.mts +0 -1
  459. package/dist/planner-schema-lookup-C4DHAddq.d.mts.map +0 -1
  460. package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map +0 -1
  461. package/dist/planner-sql-checks-CFgbRTJw.d.mts +0 -20
  462. package/dist/planner-sql-checks-CFgbRTJw.d.mts.map +0 -1
  463. package/dist/planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs +0 -152
  464. package/dist/planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map +0 -1
  465. package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts.map +0 -1
  466. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs +0 -15
  467. package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs.map +0 -1
  468. package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts.map +0 -1
  469. package/dist/postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map +0 -1
  470. package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts.map +0 -1
  471. package/dist/postgres-migration-BNsrwlxh-CwI5BqAu.d.mts.map +0 -1
  472. package/dist/postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs +0 -205
  473. package/dist/postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map +0 -1
  474. package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs.map +0 -1
  475. package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts.map +0 -1
  476. package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs.map +0 -1
  477. package/dist/postgres-schema-CF0yHESb-D7n2X21R.mjs.map +0 -1
  478. package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts.map +0 -1
  479. package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs.map +0 -1
  480. package/dist/render-ops-DOsRP0Po-BKn_c_Ia.mjs.map +0 -1
  481. package/dist/render-ops-DPwhZt2W.d.mts.map +0 -1
  482. package/dist/render-typescript-6sCFvMBh.d.mts.map +0 -1
  483. package/dist/render-typescript-Dqp1Spgn-B128r1qw.mjs.map +0 -1
  484. package/dist/resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs +0 -22
  485. package/dist/resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map +0 -1
  486. package/dist/runtime-DOXznQe0.d.mts.map +0 -1
  487. package/dist/runtime-_TfO66h5.d.mts.map +0 -1
  488. package/dist/runtime-lHBKgjB9.d.mts.map +0 -1
  489. package/dist/schema-ir-annotations-DuuYh0gl.d.mts.map +0 -1
  490. package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts.map +0 -1
  491. package/dist/sql-renderer-BgC0ZgLS.d.mts.map +0 -1
  492. package/dist/sql-renderer-ComgusFq-BBlqM1fw.mjs.map +0 -1
  493. package/dist/sql-utils-DW6fkczF.d.mts.map +0 -1
  494. package/dist/sql-utils-DuzN3JZg-DiXy4Vah.mjs.map +0 -1
  495. package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts.map +0 -1
  496. package/dist/types-B-4d5_4a.d.mts +0 -1
  497. package/dist/types-CjGjPLr5.d.mts.map +0 -1
  498. package/dist/types-CkryN1AS-BcQRGsDn.d.mts +0 -27
  499. package/dist/types-CkryN1AS-BcQRGsDn.d.mts.map +0 -1
  500. package/dist/types-ue6jkJyF-BQJzjx1P.d.mts.map +0 -1
  501. /package/dist/{adapter__operation-types.mjs → target__operation-types.mjs} +0 -0
@@ -0,0 +1,103 @@
1
+ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
2
+ import { CliStructuredError } from "@prisma/orm-framework/errors/control";
3
+ //#region ../../../3-targets/postgres/1-target/dist/errors-BrhQYgdL.mjs
4
+ function postgresError(code, message, options) {
5
+ return structuredError(code, message, options);
6
+ }
7
+ /**
8
+ * A `PostgresMigration` operation that needs the materialized control adapter
9
+ * — named by `operation` (e.g. `createTable`, `dropColumn`, `dataTransform`) —
10
+ * was invoked, but the migration was constructed without a `ControlStack`.
11
+ * Concrete authoring usage always goes through the migration CLI entrypoint,
12
+ * which assembles a stack from the loaded `prisma.config.ts`; reaching this
13
+ * error means a test fixture or ad-hoc consumer instantiated `PostgresMigration`
14
+ * with the no-arg form (legal for `operations` / `describe` introspection only).
15
+ *
16
+ * The `operation` argument is required so every throw site names the operation
17
+ * that actually failed; a new operation cannot inherit a misattributed message.
18
+ *
19
+ * Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)
20
+ * and `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` (data-transform query
21
+ * plan against wrong contract) because the missing input is the stack
22
+ * itself, not the per-operation contract.
23
+ *
24
+ * Lives in `@internal/target-postgres/errors` rather than the shared
25
+ * framework migration errors module because the failure is target-specific:
26
+ * the contract it talks about (`PostgresMigration`, the Postgres control
27
+ * adapter, the Postgres-target stack) only exists in this package.
28
+ */
29
+ function errorPostgresMigrationStackMissing(operation) {
30
+ return new CliStructuredError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `PostgresMigration.${operation} requires a control adapter`, {
31
+ why: `PostgresMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its plan.`,
32
+ fix: "Construct the migration via the migration CLI entrypoint (which assembles a ControlStack from the loaded prisma.config.ts), or pass a ControlStack containing a Postgres adapter to the migration constructor in test fixtures.",
33
+ meta: { operation }
34
+ });
35
+ }
36
+ function errorTemporalUnavailable(codecId, operation) {
37
+ return postgresError("RUNTIME.TEMPORAL_UNAVAILABLE", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {
38
+ why: "Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.",
39
+ fix: "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with its *String type to read and write PostgreSQL's own text instead.",
40
+ meta: {
41
+ codecId,
42
+ operation
43
+ }
44
+ });
45
+ }
46
+ function errorTemporalUnavailableForDefault(generatorId) {
47
+ return postgresError("RUNTIME.TEMPORAL_UNAVAILABLE", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {
48
+ why: "The generator answers a Temporal-backed column, so the value it produces is a Temporal.Instant, which this runtime cannot construct.",
49
+ fix: "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with `temporal.createdAtString()` / `temporal.updatedAtString()` to store PostgreSQL's own text instead.",
50
+ meta: { generatorId }
51
+ });
52
+ }
53
+ function errorTemporalUnrepresentable(options) {
54
+ const { codecId, operation, stringType, value, detail } = options;
55
+ return postgresError(operation === "decode" ? "RUNTIME.DECODE_FAILED" : "RUNTIME.ENCODE_FAILED", `Codec '${codecId}' cannot represent the value ${operation === "decode" ? "PostgreSQL returned" : "the application supplied"}: ${JSON.stringify(value)} — ${detail}. Use ${stringType} to carry this column as PostgreSQL's own text.`, {
56
+ why: `${detail}. Temporal is the authoritative parser and range check for this codec, so a value it cannot express has no representation on this column.`,
57
+ fix: `Author the column as ${stringType} to read and write PostgreSQL's own text for it, which preserves every value the database accepts.`,
58
+ meta: {
59
+ codecId,
60
+ operation,
61
+ value,
62
+ stringType
63
+ },
64
+ ...options.cause === void 0 ? {} : { cause: options.cause }
65
+ });
66
+ }
67
+ function errorTemporalWrongType(codecId, temporalTag, stringType, received) {
68
+ return postgresError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {
69
+ why: "The codec serializes through the Temporal value's own toString(). A different type reaches PostgreSQL in a spelling it does not accept, and the resulting error names the column rather than the codec.",
70
+ fix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write PostgreSQL text directly.`,
71
+ meta: {
72
+ codecId,
73
+ temporalTag,
74
+ stringType,
75
+ received
76
+ }
77
+ });
78
+ }
79
+ /** A string timestamp codec received something other than text, such as a `Date` from a contract emitted before its generator wrote text. */
80
+ function errorTimestampTextWrongType(codecId, received) {
81
+ return postgresError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' writes PostgreSQL's text for the value, but received ${received}.`, {
82
+ why: "The codec sends its value to PostgreSQL unchanged. A Date would be sent in the process's local time zone, and a timestamp column without a time zone would store the wrong wall-clock time.",
83
+ fix: "Pass the timestamp as text, such as \"2024-01-02 03:04:05.678\". If the value came from a generated default, emit the contract again: a contract emitted by an earlier version pairs this column with timestampNow, which generates a Date.",
84
+ meta: {
85
+ codecId,
86
+ received
87
+ }
88
+ });
89
+ }
90
+ function errorTemporalNonIsoCalendar(codecId, calendarId) {
91
+ return postgresError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {
92
+ why: "PostgreSQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.",
93
+ fix: "Convert the value with .withCalendar(\"iso8601\") before writing if the ISO projection is what you mean to store.",
94
+ meta: {
95
+ codecId,
96
+ calendarId
97
+ }
98
+ });
99
+ }
100
+ //#endregion
101
+ export { errorTemporalUnrepresentable as a, postgresError as c, errorTemporalUnavailableForDefault as i, errorTemporalNonIsoCalendar as n, errorTemporalWrongType as o, errorTemporalUnavailable as r, errorTimestampTextWrongType as s, errorPostgresMigrationStackMissing as t };
102
+
103
+ //# sourceMappingURL=errors-BrhQYgdL-IvZHPjwL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-BrhQYgdL-IvZHPjwL.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/errors-BrhQYgdL.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\n//#region src/core/errors.ts\nfunction postgresError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n/**\n* A `PostgresMigration` operation that needs the materialized control adapter\n* — named by `operation` (e.g. `createTable`, `dropColumn`, `dataTransform`) —\n* was invoked, but the migration was constructed without a `ControlStack`.\n* Concrete authoring usage always goes through the migration CLI entrypoint,\n* which assembles a stack from the loaded `prisma.config.ts`; reaching this\n* error means a test fixture or ad-hoc consumer instantiated `PostgresMigration`\n* with the no-arg form (legal for `operations` / `describe` introspection only).\n*\n* The `operation` argument is required so every throw site names the operation\n* that actually failed; a new operation cannot inherit a misattributed message.\n*\n* Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)\n* and `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` (data-transform query\n* plan against wrong contract) because the missing input is the stack\n* itself, not the per-operation contract.\n*\n* Lives in `@internal/target-postgres/errors` rather than the shared\n* framework migration errors module because the failure is target-specific:\n* the contract it talks about (`PostgresMigration`, the Postgres control\n* adapter, the Postgres-target stack) only exists in this package.\n*/\nfunction errorPostgresMigrationStackMissing(operation) {\n\treturn new CliStructuredError(\"MIGRATION.POSTGRES_CONTROL_STACK_MISSING\", `PostgresMigration.${operation} requires a control adapter`, {\n\t\twhy: `PostgresMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its plan.`,\n\t\tfix: \"Construct the migration via the migration CLI entrypoint (which assembles a ControlStack from the loaded prisma.config.ts), or pass a ControlStack containing a Postgres adapter to the migration constructor in test fixtures.\",\n\t\tmeta: { operation }\n\t});\n}\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with its *String type to read and write PostgreSQL's own text instead.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed column, so the value it produces is a Temporal.Instant, which this runtime cannot construct.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with `temporal.createdAtString()` / `temporal.updatedAtString()` to store PostgreSQL's own text instead.\",\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalUnrepresentable(options) {\n\tconst { codecId, operation, stringType, value, detail } = options;\n\treturn postgresError(operation === \"decode\" ? \"RUNTIME.DECODE_FAILED\" : \"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot represent the value ${operation === \"decode\" ? \"PostgreSQL returned\" : \"the application supplied\"}: ${JSON.stringify(value)} — ${detail}. Use ${stringType} to carry this column as PostgreSQL's own text.`, {\n\t\twhy: `${detail}. Temporal is the authoritative parser and range check for this codec, so a value it cannot express has no representation on this column.`,\n\t\tfix: `Author the column as ${stringType} to read and write PostgreSQL's own text for it, which preserves every value the database accepts.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation,\n\t\t\tvalue,\n\t\t\tstringType\n\t\t},\n\t\t...options.cause === void 0 ? {} : { cause: options.cause }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec serializes through the Temporal value's own toString(). A different type reaches PostgreSQL in a spelling it does not accept, and the resulting error names the column rather than the codec.\",\n\t\tfix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write PostgreSQL text directly.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\n/** A string timestamp codec received something other than text, such as a `Date` from a contract emitted before its generator wrote text. */\nfunction errorTimestampTextWrongType(codecId, received) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' writes PostgreSQL's text for the value, but received ${received}.`, {\n\t\twhy: \"The codec sends its value to PostgreSQL unchanged. A Date would be sent in the process's local time zone, and a timestamp column without a time zone would store the wrong wall-clock time.\",\n\t\tfix: \"Pass the timestamp as text, such as \\\"2024-01-02 03:04:05.678\\\". If the value came from a generated default, emit the contract again: a contract emitted by an earlier version pairs this column with timestampNow, which generates a Date.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"PostgreSQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n//#endregion\nexport { errorTemporalUnrepresentable as a, postgresError as c, errorTemporalUnavailableForDefault as i, errorTemporalNonIsoCalendar as n, errorTemporalWrongType as o, errorTemporalUnavailable as r, errorTimestampTextWrongType as s, errorPostgresMigrationStackMissing as t };\n\n//# sourceMappingURL=errors-BrhQYgdL.mjs.map"],"mappings":";;;AAGA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,mCAAmC,WAAW;CACtD,OAAO,IAAI,mBAAmB,4CAA4C,qBAAqB,UAAU,8BAA8B;EACtI,KAAK,qBAAqB,UAAU;EACpC,KAAK;EACL,MAAM,EAAE,UAAU;CACnB,CAAC;AACF;AACA,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,cAAc,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EAClK,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,cAAc,gCAAgC,+BAA+B,YAAY,uFAAuF;EACtL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,6BAA6B,SAAS;CAC9C,MAAM,EAAE,SAAS,WAAW,YAAY,OAAO,WAAW;CAC1D,OAAO,cAAc,cAAc,WAAW,0BAA0B,yBAAyB,UAAU,QAAQ,+BAA+B,cAAc,WAAW,wBAAwB,2BAA2B,IAAI,KAAK,UAAU,KAAK,EAAE,KAAK,OAAO,QAAQ,WAAW,kDAAkD;EACxU,KAAK,GAAG,OAAO;EACf,KAAK,wBAAwB,WAAW;EACxC,MAAM;GACL;GACA;GACA;GACA;EACD;EACA,GAAG,QAAQ,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,QAAQ,MAAM;CAC3D,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,cAAc,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EACvH,KAAK;EACL,KAAK,UAAU,YAAY,kCAAkC,WAAW;EACxE,MAAM;GACL;GACA;GACA;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,4BAA4B,SAAS,UAAU;CACvD,OAAO,cAAc,yBAAyB,UAAU,QAAQ,yDAAyD,SAAS,IAAI;EACrI,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,4BAA4B,SAAS,YAAY;CACzD,OAAO,cAAc,yBAAyB,UAAU,QAAQ,8DAA8D,WAAW,KAAK;EAC7I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF"}
@@ -1,8 +1,8 @@
1
1
  import { StructuredError, StructuredErrorOptions } from "@prisma/orm-framework/utils/structured-error";
2
2
  import { CliStructuredError } from "@prisma/orm-framework/errors/control";
3
- //#region ../../../3-targets/3-targets/postgres/dist/errors.d.mts
3
+ //#region ../../../3-targets/postgres/1-target/dist/errors.d.mts
4
4
  //#region src/core/errors.d.ts
5
- type PostgresTargetErrorCode = 'CONTRACT.CODEC_DESCRIPTOR_MISSING' | 'CONTRACT.DEFAULT_INVALID' | 'CONTRACT.ENTITY_KIND_INVALID' | 'CONTRACT.IDENTIFIER_INVALID' | 'CONTRACT.INDEX_INVALID' | 'CONTRACT.INFER_UNSUPPORTED' | 'CONTRACT.MODEL_UNKNOWN' | 'CONTRACT.NAME_DUPLICATE' | 'CONTRACT.NATIVE_TYPE_INVALID' | 'CONTRACT.PACK_CONTRIBUTION_INVALID' | 'CONTRACT.POLICY_INVALID' | 'CONTRACT.ROLE_INVALID' | 'MIGRATION.CONTRACT_SPACE_VIOLATION' | 'MIGRATION.POSTGRES_CONTROL_STACK_MISSING' | 'MIGRATION.TARGET_MISMATCH' | 'RUNTIME.DECODE_FAILED' | 'RUNTIME.ENCODE_FAILED' | 'RUNTIME.TYPE_PARAMS_INVALID';
5
+ type PostgresTargetErrorCode = 'CONTRACT.CODEC_DESCRIPTOR_MISSING' | 'CONTRACT.PRINT_UNSUPPORTED' | 'CONTRACT.DEFAULT_INVALID' | 'CONTRACT.ENTITY_KIND_INVALID' | 'CONTRACT.IDENTIFIER_INVALID' | 'CONTRACT.INDEX_INVALID' | 'CONTRACT.INFER_UNSUPPORTED' | 'CONTRACT.MODEL_UNKNOWN' | 'CONTRACT.NAME_DUPLICATE' | 'CONTRACT.PACK_CONTRIBUTION_INVALID' | 'CONTRACT.POLICY_INVALID' | 'CONTRACT.ROLE_INVALID' | 'MIGRATION.ALTER_COLUMN_TYPE_USING_WITHOUT_TYPE_CHANGE' | 'MIGRATION.COLUMN_TYPE_UNREADABLE' | 'MIGRATION.CONTRACT_SPACE_VIOLATION' | 'MIGRATION.POSTGRES_CONTROL_STACK_MISSING' | 'MIGRATION.SQL_EXPRESSION_INVALID' | 'MIGRATION.TARGET_MISMATCH' | 'RUNTIME.ARGUMENT_INVALID' | 'RUNTIME.DECODE_FAILED' | 'RUNTIME.ENCODE_FAILED' | 'RUNTIME.TEMPORAL_UNAVAILABLE' | 'RUNTIME.TYPE_PARAMS_INVALID';
6
6
  declare function postgresError(code: PostgresTargetErrorCode, message: string, options?: StructuredErrorOptions): StructuredError;
7
7
  /**
8
8
  * A `PostgresMigration` operation that needs the materialized control adapter
@@ -29,4 +29,4 @@ declare function postgresError(code: PostgresTargetErrorCode, message: string, o
29
29
  declare function errorPostgresMigrationStackMissing(operation: string): CliStructuredError;
30
30
  //#endregion
31
31
  export { postgresError as n, errorPostgresMigrationStackMissing as t };
32
- //# sourceMappingURL=errors-CU4xIwwk.d.mts.map
32
+ //# sourceMappingURL=errors-D3Mj-x0o.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-D3Mj-x0o.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/errors.d.mts"],"mappings":";;;;KAGK;iBACY,cAAc,MAAM,yBAAyB,iBAAiB,UAAU,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;iBAuBjG,mCAAmC,oBAAoB"}
@@ -0,0 +1,39 @@
1
+ import { c as postgresError } from "./errors-BrhQYgdL-IvZHPjwL.mjs";
2
+ import { c as toTsquery, i as languageLiteral } from "./full-text-parsers-CFFxiOrp-CrZ7VI1m.mjs";
3
+ //#region ../../../3-targets/postgres/1-target/dist/full-text.mjs
4
+ /**
5
+ * An empty term, `''`, is a `tsquery` syntax error; a single space parses as a term with no words,
6
+ * as a stop word does.
7
+ */
8
+ function quotedTerm(value) {
9
+ return value === "" ? "' '" : `'${value.replaceAll("\\", "\\\\").replaceAll("'", "''")}'`;
10
+ }
11
+ function literalPart(strings, index) {
12
+ const part = strings[index];
13
+ if (part === void 0) throw postgresError("RUNTIME.ARGUMENT_INVALID", `tsquery: literal part ${index} of the template has an invalid escape sequence.`, {
14
+ why: "JavaScript gives a template tag no text for a literal part with an invalid escape such as \\u or \\x, so the tsquery syntax written there would be lost.",
15
+ fix: "Write a literal backslash as \\\\, or remove the escape.",
16
+ meta: {
17
+ helper: "tsquery",
18
+ argument: `literal part ${index}`,
19
+ received: strings.raw[index]
20
+ }
21
+ });
22
+ return part;
23
+ }
24
+ function assemble(strings, values) {
25
+ return values.reduce((text, value, i) => `${text}${quotedTerm(value)}${literalPart(strings, i + 1)}`, literalPart(strings, 0));
26
+ }
27
+ function isTemplate(value) {
28
+ return Array.isArray(value);
29
+ }
30
+ function tsquery(first, ...values) {
31
+ if (isTemplate(first)) return toTsquery(assemble(first, values));
32
+ const language = first.language ?? "english";
33
+ languageLiteral("tsquery", language);
34
+ return (strings, ...templateValues) => toTsquery(assemble(strings, templateValues), { language });
35
+ }
36
+ //#endregion
37
+ export { tsquery as t };
38
+
39
+ //# sourceMappingURL=full-text-BYg7EVX2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-BYg7EVX2.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { c as FullTextDocument, i as websearchToTsquery, l as fullTextDocument, n as plaintoTsquery, o as languageLiteral, r as toTsquery, t as phrasetoTsquery } from \"./full-text-parsers-CFFxiOrp.mjs\";\n//#region src/core/tsquery-tag.ts\n/**\n* An empty term, `''`, is a `tsquery` syntax error; a single space parses as a term with no words,\n* as a stop word does.\n*/\nfunction quotedTerm(value) {\n\treturn value === \"\" ? \"' '\" : `'${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"'\", \"''\")}'`;\n}\nfunction literalPart(strings, index) {\n\tconst part = strings[index];\n\tif (part === void 0) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", `tsquery: literal part ${index} of the template has an invalid escape sequence.`, {\n\t\twhy: \"JavaScript gives a template tag no text for a literal part with an invalid escape such as \\\\u or \\\\x, so the tsquery syntax written there would be lost.\",\n\t\tfix: \"Write a literal backslash as \\\\\\\\, or remove the escape.\",\n\t\tmeta: {\n\t\t\thelper: \"tsquery\",\n\t\t\targument: `literal part ${index}`,\n\t\t\treceived: strings.raw[index]\n\t\t}\n\t});\n\treturn part;\n}\nfunction assemble(strings, values) {\n\treturn values.reduce((text, value, i) => `${text}${quotedTerm(value)}${literalPart(strings, i + 1)}`, literalPart(strings, 0));\n}\nfunction isTemplate(value) {\n\treturn Array.isArray(value);\n}\nfunction tsquery(first, ...values) {\n\tif (isTemplate(first)) return toTsquery(assemble(first, values));\n\tconst language = first.language ?? \"english\";\n\tlanguageLiteral(\"tsquery\", language);\n\treturn (strings, ...templateValues) => toTsquery(assemble(strings, templateValues), { language });\n}\n//#endregion\nexport { FullTextDocument, fullTextDocument, phrasetoTsquery, plaintoTsquery, toTsquery, tsquery, websearchToTsquery };\n\n//# sourceMappingURL=full-text.mjs.map"],"mappings":";;;;;;;AAQA,SAAS,WAAW,OAAO;CAC1B,OAAO,UAAU,KAAK,QAAQ,IAAI,MAAM,WAAW,MAAM,MAAM,CAAC,CAAC,WAAW,KAAK,IAAI,EAAE;AACxF;AACA,SAAS,YAAY,SAAS,OAAO;CACpC,MAAM,OAAO,QAAQ;CACrB,IAAI,SAAS,KAAK,GAAG,MAAM,cAAc,4BAA4B,yBAAyB,MAAM,mDAAmD;EACtJ,KAAK;EACL,KAAK;EACL,MAAM;GACL,QAAQ;GACR,UAAU,gBAAgB;GAC1B,UAAU,QAAQ,IAAI;EACvB;CACD,CAAC;CACD,OAAO;AACR;AACA,SAAS,SAAS,SAAS,QAAQ;CAClC,OAAO,OAAO,QAAQ,MAAM,OAAO,MAAM,GAAG,OAAO,WAAW,KAAK,IAAI,YAAY,SAAS,IAAI,CAAC,KAAK,YAAY,SAAS,CAAC,CAAC;AAC9H;AACA,SAAS,WAAW,OAAO;CAC1B,OAAO,MAAM,QAAQ,KAAK;AAC3B;AACA,SAAS,QAAQ,OAAO,GAAG,QAAQ;CAClC,IAAI,WAAW,KAAK,GAAG,OAAO,UAAU,SAAS,OAAO,MAAM,CAAC;CAC/D,MAAM,WAAW,MAAM,YAAY;CACnC,gBAAgB,WAAW,QAAQ;CACnC,QAAQ,SAAS,GAAG,mBAAmB,UAAU,SAAS,SAAS,cAAc,GAAG,EAAE,SAAS,CAAC;AACjG"}
@@ -0,0 +1,26 @@
1
+ import { f as TsqueryExpression, m as TsqueryParserOptions } from "./operation-types--Wa_cv45-RoRnL1Dn.mjs";
2
+ import "./full-text-collection-method-BFd2u2cs-Ba3OiWM3.mjs";
3
+ //#region ../../../3-targets/postgres/1-target/dist/full-text.d.mts
4
+ //#region src/core/tsquery-tag.d.ts
5
+ type TsqueryTag = (strings: TemplateStringsArray, ...values: string[]) => TsqueryExpression;
6
+ /**
7
+ * Builds a `tsquery` from `to_tsquery` syntax the application writes, with values such as user input
8
+ * interpolated safely: `` tsquery`${term}:*` `` for a typeahead prefix match.
9
+ *
10
+ * The literal parts are trusted `tsquery` syntax and are used as written. Each interpolated value
11
+ * becomes exactly one quoted term, so it cannot add operators or break the syntax, whatever it
12
+ * contains; an empty value adds no words, like a stop word. The whole text is one bound parameter,
13
+ * parsed by Postgres `to_tsquery`, which lowercases and stems every word.
14
+ *
15
+ * A value with several words becomes a phrase: `` tsquery`${'new y'}:*` `` gives
16
+ * `'new':* <-> 'y':*`, so the words must be adjacent and in order, and `:*` applies to each word.
17
+ * Do not put quotes around the interpolation yourself: `` tsquery`'${term}':*` `` is a syntax error
18
+ * for every input.
19
+ *
20
+ * `` tsquery`...` `` uses `english`; `` tsquery({ language })`...` `` picks the configuration.
21
+ */
22
+ declare function tsquery(options: TsqueryParserOptions): TsqueryTag;
23
+ declare function tsquery(strings: TemplateStringsArray, ...values: string[]): TsqueryExpression;
24
+ //#endregion
25
+ export { tsquery as n, TsqueryTag as t };
26
+ //# sourceMappingURL=full-text-SDbfxrE_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-SDbfxrE_.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text.d.mts"],"mappings":";;;;KAGK,cAAc,SAAS,yBAAyB,qBAAqB;;;;;;;;;;;;;;;;;iBAiBzD,QAAQ,SAAS,uBAAuB;iBACxC,QAAQ,SAAS,yBAAyB,mBAAmB"}
@@ -0,0 +1,27 @@
1
+ import { n as FULL_TEXT_INDEX_TYPE } from "./full-text-index-definition-D5iBWLss-BEpqiucV.mjs";
2
+ import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-Fj5xCgwT-BeCXgfuR.mjs";
3
+ import { d as TsqueryArgument } from "./operation-types--Wa_cv45-RoRnL1Dn.mjs";
4
+ import { UniqueIndexNamesOfType } from "@prisma/orm-family-sql/relational-core/index-reference";
5
+ import { CollectionMethodContributionType, CollectionMethodModelType } from "@prisma/orm-family-sql/relational-core/collection-methods";
6
+ //#region ../../../3-targets/postgres/1-target/dist/full-text-collection-method-BFd2u2cs.d.mts
7
+ //#region src/core/full-text-collection-method.d.ts
8
+ /** A `tsquery` expression from a parser or the `tsquery` tag, or a `tsquery` value read back from a query. */
9
+ type PostgresTsqueryArgument = TsqueryArgument<Resolve<ExtractedCodecTypes>>;
10
+ interface FullTextSearchSignature {
11
+ readonly parameters: readonly [query: PostgresTsqueryArgument];
12
+ readonly filters: true;
13
+ readonly orders: true;
14
+ }
15
+ type FullTextMethodTable<Model extends CollectionMethodModelType> = Model['target'] extends 'postgres' ? { readonly [Name in UniqueIndexNamesOfType<Model['table']['indexes'][number], typeof FULL_TEXT_INDEX_TYPE>]: FullTextSearchSignature; } : Record<never, never>;
16
+ /** One method for each full-text index of a Postgres model, named after the index: `using.<index>(query)` filters to the rows that match `query`, most relevant first. */
17
+ interface PostgresFullTextMethods extends CollectionMethodContributionType {
18
+ readonly methods: FullTextMethodTable<this['model']>;
19
+ }
20
+ declare module '@prisma/orm-family-sql/relational-core/collection-methods' {
21
+ interface CollectionMethodRegistry {
22
+ readonly 'postgres/fullText': PostgresFullTextMethods;
23
+ }
24
+ }
25
+ //#endregion
26
+ export { PostgresTsqueryArgument as n, PostgresFullTextMethods as t };
27
+ //# sourceMappingURL=full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-collection-method-BFd2u2cs-Ba3OiWM3.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text-collection-method-BFd2u2cs.d.mts"],"mappings":";;;;;;;;KAOK,0BAA0B,gBAAgB,QAAQ;UAC7C;WACC,sBAAsB,OAAO;WAC7B;WACA;;KAEN,oBAAoB,cAAc,6BAA6B,iDAAiD,QAAQ,uBAAuB,0CAA0C,wBAAwB,6BAA6B;;UAEzO,gCAAgC;WAC/B,SAAS;;;YAGR;aACC,qBAAqB"}
@@ -0,0 +1,7 @@
1
+ //#region ../../../3-targets/postgres/1-target/dist/full-text-index-authoring.d.mts
2
+ //#region src/core/postgres-codec-traits.d.ts
3
+ /** The traits of a Postgres codec, or `undefined` for a codec the target does not register. */
4
+ declare function postgresCodecTraitsOf(codecId: string): readonly string[] | undefined;
5
+ //#endregion
6
+ export { postgresCodecTraitsOf as t };
7
+ //# sourceMappingURL=full-text-index-authoring-CN1L9C1k.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-index-authoring-CN1L9C1k.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text-index-authoring.d.mts"],"mappings":";;;iBAGiB,sBAAsB"}
@@ -0,0 +1,195 @@
1
+ import { c as postgresError } from "./errors-BrhQYgdL-IvZHPjwL.mjs";
2
+ import { type } from "arktype";
3
+ import { invariant } from "@prisma/orm-framework/utils/assertions";
4
+ //#region ../../../3-targets/postgres/1-target/dist/full-text-index-definition-BPxQQBuC.mjs
5
+ /** The weights Postgres's `setweight` takes, strongest first. Each weight group takes the next one. */
6
+ const FULL_TEXT_WEIGHTS = [
7
+ "A",
8
+ "B",
9
+ "C",
10
+ "D"
11
+ ];
12
+ function weightGroupsOf(fields, isField) {
13
+ if (isField(fields)) return [[fields]];
14
+ return fields.map((item) => isField(item) ? [item] : item);
15
+ }
16
+ /**
17
+ * The text-search configurations a stock PostgreSQL server ships with. The language reaches SQL as
18
+ * an inline literal rather than a bound parameter, so only names on this list may be used.
19
+ */
20
+ const POSTGRES_TEXT_SEARCH_LANGUAGES = [
21
+ "simple",
22
+ "arabic",
23
+ "armenian",
24
+ "basque",
25
+ "catalan",
26
+ "danish",
27
+ "dutch",
28
+ "english",
29
+ "finnish",
30
+ "french",
31
+ "german",
32
+ "greek",
33
+ "hindi",
34
+ "hungarian",
35
+ "indonesian",
36
+ "irish",
37
+ "italian",
38
+ "lithuanian",
39
+ "nepali",
40
+ "norwegian",
41
+ "portuguese",
42
+ "romanian",
43
+ "russian",
44
+ "serbian",
45
+ "spanish",
46
+ "swedish",
47
+ "tamil",
48
+ "turkish",
49
+ "yiddish"
50
+ ];
51
+ const DEFAULT_FULL_TEXT_SEARCH_LANGUAGE = "english";
52
+ const KNOWN_LANGUAGES = new Set(POSTGRES_TEXT_SEARCH_LANGUAGES);
53
+ function isFullTextSearchLanguage(language) {
54
+ return KNOWN_LANGUAGES.has(language);
55
+ }
56
+ /** The index type a full-text index is registered under. */
57
+ const FULL_TEXT_INDEX_TYPE = "fullText";
58
+ /** The traits the codec of every column a full-text index covers must carry. */
59
+ const FULL_TEXT_COLUMN_TRAITS = ["textual"];
60
+ /**
61
+ * The rules of a full-text index, stated once: one to four weight groups, none empty, each field
62
+ * once, text columns only, and not unique. Every site that checks a full-text index calls this.
63
+ */
64
+ function fullTextIndexProblems(candidate) {
65
+ const { weightGroups } = candidate;
66
+ const problems = [];
67
+ if (weightGroups.length === 0) problems.push({ kind: "no-fields" });
68
+ if (weightGroups.length > FULL_TEXT_WEIGHTS.length) problems.push({
69
+ kind: "too-many-groups",
70
+ groupCount: weightGroups.length
71
+ });
72
+ weightGroups.forEach((group, position) => {
73
+ if (group.length === 0) problems.push({
74
+ kind: "empty-group",
75
+ position
76
+ });
77
+ });
78
+ const seen = /* @__PURE__ */ new Set();
79
+ for (const field of weightGroups.flat()) {
80
+ if (seen.has(field)) problems.push({
81
+ kind: "duplicate-field",
82
+ field
83
+ });
84
+ seen.add(field);
85
+ }
86
+ const { codecs } = candidate;
87
+ if (codecs !== void 0) for (const field of new Set(weightGroups.flat())) {
88
+ const codecId = codecs.codecIdOf(field);
89
+ if (codecId === void 0 || !carriesFullTextTraits(codecs.traitsOf(codecId))) problems.push({
90
+ kind: "not-text",
91
+ field,
92
+ codecId
93
+ });
94
+ }
95
+ if (candidate.unique === true) problems.push({ kind: "unique" });
96
+ return problems;
97
+ }
98
+ function carriesFullTextTraits(traits) {
99
+ return traits !== void 0 && FULL_TEXT_COLUMN_TRAITS.every((trait) => traits.includes(trait));
100
+ }
101
+ function describeFullTextIndexProblem(subject, problem, fieldLabel = (field) => field) {
102
+ switch (problem.kind) {
103
+ case "no-fields": return `${subject} needs at least one field.`;
104
+ case "too-many-groups": return `${subject} takes at most ${FULL_TEXT_WEIGHTS.length} weight groups, one for each of the weights ${FULL_TEXT_WEIGHTS.join(", ")}, but was given ${problem.groupCount}.`;
105
+ case "empty-group": return `${subject} has an empty weight group at position ${problem.position + 1}.`;
106
+ case "duplicate-field": return `${subject} names the field "${fieldLabel(problem.field)}" more than once.`;
107
+ case "not-text": return `${subject} indexes text columns, but "${fieldLabel(problem.field)}" is ${problem.codecId === void 0 ? "not a stored scalar field" : `stored as \`${problem.codecId}\``}.`;
108
+ case "unique": return `${subject} is unique, but Postgres builds no unique gin index.`;
109
+ }
110
+ }
111
+ /** The options of a full-text index: its weight groups, as storage column names, and its language. */
112
+ const fullTextIndexOptions = type({
113
+ "+": "reject",
114
+ weightGroups: type("string > 0").array().array().narrow((weightGroups, ctx) => {
115
+ const [problem] = fullTextIndexProblems({ weightGroups });
116
+ return problem === void 0 || ctx.reject({ message: describeFullTextIndexProblem("a full-text index", problem) });
117
+ }),
118
+ language: type.enumerated(...POSTGRES_TEXT_SEARCH_LANGUAGES)
119
+ });
120
+ /**
121
+ * The registration of the full-text index type. Its options are the index's definition, not
122
+ * storage parameters, and the target turns them into a `gin` index over the rendered search
123
+ * document.
124
+ */
125
+ const fullTextIndexType = {
126
+ options: fullTextIndexOptions,
127
+ accessMethod: "gin",
128
+ columnTraits: FULL_TEXT_COLUMN_TRAITS
129
+ };
130
+ /**
131
+ * The definition a full-text index carries, or `undefined` for an index of any other type. It
132
+ * reads an index {@link assertFullTextIndexes} has accepted, as every loaded contract's has been.
133
+ */
134
+ function fullTextIndexDefinitionOf(index) {
135
+ if (index.type !== "fullText") return void 0;
136
+ const definition = fullTextIndexOptions(index.options ?? {});
137
+ invariant(!(definition instanceof type.errors), "a full-text index is read only after its contract was checked");
138
+ return definition;
139
+ }
140
+ /**
141
+ * Refuses a table's full-text index the contract cannot carry: invalid options, a broken rule of
142
+ * {@link fullTextIndexProblems}, `columns` that are not the fields of its weight groups, in order,
143
+ * or a foreign key that names it as its backing index. The text-columns rule is checked only when
144
+ * `traitsOf` is given.
145
+ */
146
+ function assertFullTextIndexes(table, traitsOf) {
147
+ const codecs = traitsOf === void 0 ? void 0 : {
148
+ codecIdOf: (column) => table.columns[column]?.codecId,
149
+ traitsOf
150
+ };
151
+ for (const index of table.indexes) assertFullTextIndex(index, codecs);
152
+ for (const foreignKey of table.foreignKeys) {
153
+ const backing = foreignKey.index;
154
+ if (backing === void 0 || !("name" in backing)) continue;
155
+ const index = table.indexes.find((candidate) => candidate.name === backing.name);
156
+ if (index?.type !== "fullText") continue;
157
+ throw postgresError("CONTRACT.INDEX_INVALID", `The foreign key on columns (${foreignKey.source.columns.join(", ")}) is backed by full-text index "${index.name}".`, {
158
+ why: "A full-text index is a gin index over a search document rendered from its weight groups, not over its columns, so it does not serve the foreign key's lookups.",
159
+ fix: "Re-emit the contract from its source, where a relation cannot name a full-text index as its index.",
160
+ meta: {
161
+ index: index.name,
162
+ columns: foreignKey.source.columns
163
+ }
164
+ });
165
+ }
166
+ }
167
+ function assertFullTextIndex(index, codecs) {
168
+ if (index.type !== "fullText") return;
169
+ const definition = fullTextIndexOptions(index.options ?? {});
170
+ if (definition instanceof type.errors) throw invalidFullTextIndex(index, `Full-text index "${index.name}" has invalid options: ${definition.summary}`, "The options of a full-text index are its definition: its weight groups and its language.");
171
+ const [problem] = fullTextIndexProblems({
172
+ weightGroups: definition.weightGroups,
173
+ unique: index.unique,
174
+ codecs
175
+ });
176
+ if (problem !== void 0) throw invalidFullTextIndex(index, describeFullTextIndexProblem(`Full-text index "${index.name}"`, problem), "A full-text index is a gin index over text columns, in one to four weight groups that name each column once.");
177
+ const fields = definition.weightGroups.flat();
178
+ const columns = index.columns ?? [];
179
+ if (columns.length !== fields.length || columns.some((column, i) => column !== fields[i])) throw invalidFullTextIndex(index, `Full-text index "${index.name}" covers the columns [${columns.join(", ")}], but its weight groups name [${fields.join(", ")}].`, "The columns of a full-text index are the fields of its weight groups, in order. Foreign-key backing and the printer read the columns; the search document is rendered from the groups, so the two must agree.");
180
+ }
181
+ function invalidFullTextIndex(index, message, why) {
182
+ return postgresError("CONTRACT.INDEX_INVALID", message, {
183
+ why,
184
+ fix: "Re-emit the contract from its `@@fullTextIndex` or `fullTextIndex` source rather than editing the index by hand.",
185
+ meta: {
186
+ index: index.name,
187
+ columns: index.columns,
188
+ options: index.options
189
+ }
190
+ });
191
+ }
192
+ //#endregion
193
+ export { assertFullTextIndexes as a, fullTextIndexOptions as c, isFullTextSearchLanguage as d, weightGroupsOf as f, POSTGRES_TEXT_SEARCH_LANGUAGES as i, fullTextIndexProblems as l, FULL_TEXT_INDEX_TYPE as n, describeFullTextIndexProblem as o, FULL_TEXT_WEIGHTS as r, fullTextIndexDefinitionOf as s, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as t, fullTextIndexType as u };
194
+
195
+ //# sourceMappingURL=full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-index-definition-BPxQQBuC-VLyQ1kEL.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text-index-definition-BPxQQBuC.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { type } from \"arktype\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/full-text-weight-groups.ts\n/** The weights Postgres's `setweight` takes, strongest first. Each weight group takes the next one. */\nconst FULL_TEXT_WEIGHTS = [\n\t\"A\",\n\t\"B\",\n\t\"C\",\n\t\"D\"\n];\nfunction weightGroupsOf(fields, isField) {\n\tif (isField(fields)) return [[fields]];\n\treturn fields.map((item) => isField(item) ? [item] : item);\n}\n//#endregion\n//#region src/core/text-search-languages.ts\n/**\n* The text-search configurations a stock PostgreSQL server ships with. The language reaches SQL as\n* an inline literal rather than a bound parameter, so only names on this list may be used.\n*/\nconst POSTGRES_TEXT_SEARCH_LANGUAGES = [\n\t\"simple\",\n\t\"arabic\",\n\t\"armenian\",\n\t\"basque\",\n\t\"catalan\",\n\t\"danish\",\n\t\"dutch\",\n\t\"english\",\n\t\"finnish\",\n\t\"french\",\n\t\"german\",\n\t\"greek\",\n\t\"hindi\",\n\t\"hungarian\",\n\t\"indonesian\",\n\t\"irish\",\n\t\"italian\",\n\t\"lithuanian\",\n\t\"nepali\",\n\t\"norwegian\",\n\t\"portuguese\",\n\t\"romanian\",\n\t\"russian\",\n\t\"serbian\",\n\t\"spanish\",\n\t\"swedish\",\n\t\"tamil\",\n\t\"turkish\",\n\t\"yiddish\"\n];\nconst DEFAULT_FULL_TEXT_SEARCH_LANGUAGE = \"english\";\nconst KNOWN_LANGUAGES = new Set(POSTGRES_TEXT_SEARCH_LANGUAGES);\nfunction isFullTextSearchLanguage(language) {\n\treturn KNOWN_LANGUAGES.has(language);\n}\n//#endregion\n//#region src/core/full-text-index-definition.ts\n/** The index type a full-text index is registered under. */\nconst FULL_TEXT_INDEX_TYPE = \"fullText\";\n/** The traits the codec of every column a full-text index covers must carry. */\nconst FULL_TEXT_COLUMN_TRAITS = [\"textual\"];\n/**\n* The rules of a full-text index, stated once: one to four weight groups, none empty, each field\n* once, text columns only, and not unique. Every site that checks a full-text index calls this.\n*/\nfunction fullTextIndexProblems(candidate) {\n\tconst { weightGroups } = candidate;\n\tconst problems = [];\n\tif (weightGroups.length === 0) problems.push({ kind: \"no-fields\" });\n\tif (weightGroups.length > FULL_TEXT_WEIGHTS.length) problems.push({\n\t\tkind: \"too-many-groups\",\n\t\tgroupCount: weightGroups.length\n\t});\n\tweightGroups.forEach((group, position) => {\n\t\tif (group.length === 0) problems.push({\n\t\t\tkind: \"empty-group\",\n\t\t\tposition\n\t\t});\n\t});\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const field of weightGroups.flat()) {\n\t\tif (seen.has(field)) problems.push({\n\t\t\tkind: \"duplicate-field\",\n\t\t\tfield\n\t\t});\n\t\tseen.add(field);\n\t}\n\tconst { codecs } = candidate;\n\tif (codecs !== void 0) for (const field of new Set(weightGroups.flat())) {\n\t\tconst codecId = codecs.codecIdOf(field);\n\t\tif (codecId === void 0 || !carriesFullTextTraits(codecs.traitsOf(codecId))) problems.push({\n\t\t\tkind: \"not-text\",\n\t\t\tfield,\n\t\t\tcodecId\n\t\t});\n\t}\n\tif (candidate.unique === true) problems.push({ kind: \"unique\" });\n\treturn problems;\n}\nfunction carriesFullTextTraits(traits) {\n\treturn traits !== void 0 && FULL_TEXT_COLUMN_TRAITS.every((trait) => traits.includes(trait));\n}\nfunction describeFullTextIndexProblem(subject, problem, fieldLabel = (field) => field) {\n\tswitch (problem.kind) {\n\t\tcase \"no-fields\": return `${subject} needs at least one field.`;\n\t\tcase \"too-many-groups\": return `${subject} takes at most ${FULL_TEXT_WEIGHTS.length} weight groups, one for each of the weights ${FULL_TEXT_WEIGHTS.join(\", \")}, but was given ${problem.groupCount}.`;\n\t\tcase \"empty-group\": return `${subject} has an empty weight group at position ${problem.position + 1}.`;\n\t\tcase \"duplicate-field\": return `${subject} names the field \"${fieldLabel(problem.field)}\" more than once.`;\n\t\tcase \"not-text\": return `${subject} indexes text columns, but \"${fieldLabel(problem.field)}\" is ${problem.codecId === void 0 ? \"not a stored scalar field\" : `stored as \\`${problem.codecId}\\``}.`;\n\t\tcase \"unique\": return `${subject} is unique, but Postgres builds no unique gin index.`;\n\t}\n}\n/** The options of a full-text index: its weight groups, as storage column names, and its language. */\nconst fullTextIndexOptions = type({\n\t\"+\": \"reject\",\n\tweightGroups: type(\"string > 0\").array().array().narrow((weightGroups, ctx) => {\n\t\tconst [problem] = fullTextIndexProblems({ weightGroups });\n\t\treturn problem === void 0 || ctx.reject({ message: describeFullTextIndexProblem(\"a full-text index\", problem) });\n\t}),\n\tlanguage: type.enumerated(...POSTGRES_TEXT_SEARCH_LANGUAGES)\n});\n/**\n* The registration of the full-text index type. Its options are the index's definition, not\n* storage parameters, and the target turns them into a `gin` index over the rendered search\n* document.\n*/\nconst fullTextIndexType = {\n\toptions: fullTextIndexOptions,\n\taccessMethod: \"gin\",\n\tcolumnTraits: FULL_TEXT_COLUMN_TRAITS\n};\n/**\n* The definition a full-text index carries, or `undefined` for an index of any other type. It\n* reads an index {@link assertFullTextIndexes} has accepted, as every loaded contract's has been.\n*/\nfunction fullTextIndexDefinitionOf(index) {\n\tif (index.type !== \"fullText\") return void 0;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tinvariant(!(definition instanceof type.errors), \"a full-text index is read only after its contract was checked\");\n\treturn definition;\n}\n/**\n* Refuses a table's full-text index the contract cannot carry: invalid options, a broken rule of\n* {@link fullTextIndexProblems}, `columns` that are not the fields of its weight groups, in order,\n* or a foreign key that names it as its backing index. The text-columns rule is checked only when\n* `traitsOf` is given.\n*/\nfunction assertFullTextIndexes(table, traitsOf) {\n\tconst codecs = traitsOf === void 0 ? void 0 : {\n\t\tcodecIdOf: (column) => table.columns[column]?.codecId,\n\t\ttraitsOf\n\t};\n\tfor (const index of table.indexes) assertFullTextIndex(index, codecs);\n\tfor (const foreignKey of table.foreignKeys) {\n\t\tconst backing = foreignKey.index;\n\t\tif (backing === void 0 || !(\"name\" in backing)) continue;\n\t\tconst index = table.indexes.find((candidate) => candidate.name === backing.name);\n\t\tif (index?.type !== \"fullText\") continue;\n\t\tthrow postgresError(\"CONTRACT.INDEX_INVALID\", `The foreign key on columns (${foreignKey.source.columns.join(\", \")}) is backed by full-text index \"${index.name}\".`, {\n\t\t\twhy: \"A full-text index is a gin index over a search document rendered from its weight groups, not over its columns, so it does not serve the foreign key's lookups.\",\n\t\t\tfix: \"Re-emit the contract from its source, where a relation cannot name a full-text index as its index.\",\n\t\t\tmeta: {\n\t\t\t\tindex: index.name,\n\t\t\t\tcolumns: foreignKey.source.columns\n\t\t\t}\n\t\t});\n\t}\n}\nfunction assertFullTextIndex(index, codecs) {\n\tif (index.type !== \"fullText\") return;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tif (definition instanceof type.errors) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" has invalid options: ${definition.summary}`, \"The options of a full-text index are its definition: its weight groups and its language.\");\n\tconst [problem] = fullTextIndexProblems({\n\t\tweightGroups: definition.weightGroups,\n\t\tunique: index.unique,\n\t\tcodecs\n\t});\n\tif (problem !== void 0) throw invalidFullTextIndex(index, describeFullTextIndexProblem(`Full-text index \"${index.name}\"`, problem), \"A full-text index is a gin index over text columns, in one to four weight groups that name each column once.\");\n\tconst fields = definition.weightGroups.flat();\n\tconst columns = index.columns ?? [];\n\tif (columns.length !== fields.length || columns.some((column, i) => column !== fields[i])) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" covers the columns [${columns.join(\", \")}], but its weight groups name [${fields.join(\", \")}].`, \"The columns of a full-text index are the fields of its weight groups, in order. Foreign-key backing and the printer read the columns; the search document is rendered from the groups, so the two must agree.\");\n}\nfunction invalidFullTextIndex(index, message, why) {\n\treturn postgresError(\"CONTRACT.INDEX_INVALID\", message, {\n\t\twhy,\n\t\tfix: \"Re-emit the contract from its `@@fullTextIndex` or `fullTextIndex` source rather than editing the index by hand.\",\n\t\tmeta: {\n\t\t\tindex: index.name,\n\t\t\tcolumns: index.columns,\n\t\t\toptions: index.options\n\t\t}\n\t});\n}\n//#endregion\nexport { fullTextIndexOptions as a, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as c, FULL_TEXT_WEIGHTS as d, weightGroupsOf as f, fullTextIndexDefinitionOf as i, POSTGRES_TEXT_SEARCH_LANGUAGES as l, assertFullTextIndexes as n, fullTextIndexProblems as o, describeFullTextIndexProblem as r, fullTextIndexType as s, FULL_TEXT_INDEX_TYPE as t, isFullTextSearchLanguage as u };\n\n//# sourceMappingURL=full-text-index-definition-BPxQQBuC.mjs.map"],"mappings":"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"}
@@ -0,0 +1,71 @@
1
+ //#region ../../../3-targets/postgres/1-target/dist/full-text-index-definition-D5iBWLss.d.mts
2
+ //#region src/core/full-text-weight-groups.d.ts
3
+ /** Fields in order of weight: each inner list is one weight group. */
4
+ type FullTextWeightGroups<Field> = readonly (readonly Field[])[];
5
+ /**
6
+ * How an author lists the fields of a full-text index: one field, or a list whose items are fields
7
+ * or lists of fields. Each top-level item is one weight group, strongest first.
8
+ */
9
+ type FullTextFieldsInput<Field> = Field | readonly (Field | readonly Field[])[];
10
+ declare function weightGroupsOf<Field>(fields: FullTextFieldsInput<Field>, isField: (value: unknown) => value is Field): FullTextWeightGroups<Field>;
11
+ //#endregion
12
+ //#region src/core/text-search-languages.d.ts
13
+ /**
14
+ * The text-search configurations a stock PostgreSQL server ships with. The language reaches SQL as
15
+ * an inline literal rather than a bound parameter, so only names on this list may be used.
16
+ */
17
+ declare const POSTGRES_TEXT_SEARCH_LANGUAGES: readonly ["simple", "arabic", "armenian", "basque", "catalan", "danish", "dutch", "english", "finnish", "french", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "lithuanian", "nepali", "norwegian", "portuguese", "romanian", "russian", "serbian", "spanish", "swedish", "tamil", "turkish", "yiddish"];
18
+ type FullTextSearchLanguage = (typeof POSTGRES_TEXT_SEARCH_LANGUAGES)[number];
19
+ declare const DEFAULT_FULL_TEXT_SEARCH_LANGUAGE = "english";
20
+ //#endregion
21
+ //#region src/core/full-text-index-definition.d.ts
22
+ /** The index type a full-text index is registered under. */
23
+ declare const FULL_TEXT_INDEX_TYPE = "fullText";
24
+ /** A full-text index as the contract stores it in the index's `options`. */
25
+ interface FullTextIndexDefinition {
26
+ /** The weight groups, strongest first, as storage column names. */
27
+ readonly weightGroups: FullTextWeightGroups<string>;
28
+ readonly language: FullTextSearchLanguage;
29
+ }
30
+ /** How the codec of a column is found, for the rule that a full-text index covers text columns only. */
31
+ interface FullTextColumnCodecs {
32
+ /** The codec a column stores its values through; `undefined` for a field that stores no value. */
33
+ readonly codecIdOf: (column: string) => string | undefined;
34
+ /** The traits of a codec; `undefined` for a codec nobody registered. */
35
+ readonly traitsOf: (codecId: string) => readonly string[] | undefined;
36
+ }
37
+ /** A full-text index, or part of one, to check against the rules of {@link fullTextIndexProblems}. */
38
+ interface FullTextIndexCandidate {
39
+ readonly weightGroups: FullTextWeightGroups<string>;
40
+ readonly unique?: boolean | undefined;
41
+ /** Checks the text-columns rule when given; a site that cannot see the codecs leaves it out. */
42
+ readonly codecs?: FullTextColumnCodecs | undefined;
43
+ }
44
+ /** What is wrong with a full-text index, in the order an author would fix it. */
45
+ type FullTextIndexProblem = {
46
+ readonly kind: 'no-fields';
47
+ } | {
48
+ readonly kind: 'too-many-groups';
49
+ readonly groupCount: number;
50
+ } | {
51
+ readonly kind: 'empty-group';
52
+ readonly position: number;
53
+ } | {
54
+ readonly kind: 'duplicate-field';
55
+ readonly field: string;
56
+ } | {
57
+ readonly kind: 'not-text';
58
+ readonly field: string;
59
+ readonly codecId: string | undefined;
60
+ } | {
61
+ readonly kind: 'unique';
62
+ };
63
+ /**
64
+ * The rules of a full-text index, stated once: one to four weight groups, none empty, each field
65
+ * once, text columns only, and not unique. Every site that checks a full-text index calls this.
66
+ */
67
+ declare function fullTextIndexProblems(candidate: FullTextIndexCandidate): readonly FullTextIndexProblem[];
68
+ declare function describeFullTextIndexProblem(subject: string, problem: FullTextIndexProblem, fieldLabel?: (field: string) => string): string;
69
+ //#endregion
70
+ export { FullTextIndexCandidate as a, FullTextSearchLanguage as c, fullTextIndexProblems as d, weightGroupsOf as f, FullTextFieldsInput as i, FullTextWeightGroups as l, FULL_TEXT_INDEX_TYPE as n, FullTextIndexDefinition as o, FullTextColumnCodecs as r, FullTextIndexProblem as s, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as t, describeFullTextIndexProblem as u };
71
+ //# sourceMappingURL=full-text-index-definition-D5iBWLss-BEpqiucV.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"full-text-index-definition-D5iBWLss-BEpqiucV.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/full-text-index-definition-D5iBWLss.d.mts"],"mappings":";;;KAGK,qBAAqB,4BAA4B;;;;;KAKjD,oBAAoB,SAAS,kBAAkB,iBAAiB;iBACpD,eAAe,OAAO,QAAQ,oBAAoB,QAAQ,UAAU,mBAAmB,SAAS,QAAQ,qBAAqB;;;;;;;cAOhI;KACT,iCAAiC;cACxB;;;;cAIA;;UAEJ;;WAEC,cAAc;WACd,UAAU;;;UAGX;;WAEC,YAAY;;WAEZ,WAAW;;;UAGZ;WACC,cAAc;WACd;;WAEA,SAAS;;;KAGf;WACM;;WAEA;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;WACA;WACA;;WAEA;;;;;;iBAMM,sBAAsB,WAAW,kCAAkC;iBACnE,6BAA6B,iBAAiB,SAAS,sBAAsB,cAAc"}