@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
@@ -1,1680 +0,0 @@
1
- import { C as PG_TIMESTAMP_CODEC_ID, D as PG_UUID_CODEC_ID, E as PG_UNBOUNDED_INT_CODEC_ID, O as PG_VARBIT_CODEC_ID, S as PG_TIMESTAMPTZ_CODEC_ID, T as PG_TIME_CODEC_ID, _ as PG_JSONB_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_ARRAY_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_INT_CODEC_ID, h as PG_INTERVAL_CODEC_ID, i as PG_CHAR_CODEC_ID, k as PG_VARCHAR_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INT8_NUMBER_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_ENUM_CODEC_ID, p as PG_INT8_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT4_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_JSON_CODEC_ID, w as PG_TIMETZ_CODEC_ID, x as PG_TEXT_CODEC_ID, y as PG_NUMERIC_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
2
- import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-LT7BpQta-BaDM8UQQ.mjs";
3
- import { n as postgresError } from "./errors-DKjQzNaN-DFcF1thx.mjs";
4
- import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
5
- import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, OrExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlTextDescriptor, sqlTimestampDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
6
- import { CodecImpl, column, renderTsLiteral, voidParamsSchema } from "@prisma/orm-framework/components/codec";
7
- import { blindCast } from "@prisma/orm-framework/utils/casts";
8
- import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
9
- import { type } from "arktype";
10
- //#region ../../../3-targets/3-targets/postgres/dist/codecs-BmPCJWqb.mjs
11
- function renderLength(typeName, typeParams) {
12
- const length = typeParams["length"];
13
- if (length === void 0) return;
14
- if (typeof length !== "number" || !Number.isFinite(length) || !Number.isInteger(length)) throw postgresError("RUNTIME.TYPE_PARAMS_INVALID", `renderOutputType: expected integer "length" in typeParams for ${typeName}, got ${String(length)}`, { meta: {
15
- nativeType: typeName,
16
- param: "length",
17
- received: String(length)
18
- } });
19
- return `${typeName}<${length}>`;
20
- }
21
- function renderPrecision(typeName, typeParams) {
22
- const precision = typeParams["precision"];
23
- if (precision === void 0) return typeName;
24
- if (typeof precision !== "number" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw postgresError("RUNTIME.TYPE_PARAMS_INVALID", `renderOutputType: expected integer "precision" in typeParams for ${typeName}, got ${String(precision)}`, { meta: {
25
- nativeType: typeName,
26
- param: "precision",
27
- received: String(precision)
28
- } });
29
- return `${typeName}<${precision}>`;
30
- }
31
- const pgNumericDecode = (wire) => {
32
- if (typeof wire === "number") return String(wire);
33
- return wire;
34
- };
35
- const DECIMAL_INTEGER = /^-?\d+$/;
36
- /**
37
- * Requires an application value to be of the JS type the codec reads.
38
- *
39
- * A range check reads a value of the wrong type as a value out of range, and
40
- * reports a number plainly inside the range as outside it — so the type is
41
- * established first and answered for on its own terms, naming what a caller
42
- * has to change.
43
- */
44
- const requireJsType = (codecId, expected, value) => {
45
- if (typeof value === expected) return;
46
- throw postgresError("RUNTIME.ENCODE_FAILED", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {
47
- codecId,
48
- received: typeof value
49
- } });
50
- };
51
- /** Writes a `bigint` application value as the decimal text the wire form of the exact integer codecs carries. */
52
- const pgBigintEncode = (codecId, value) => {
53
- requireJsType(codecId, "bigint", value);
54
- return value.toString();
55
- };
56
- /**
57
- * Writes an application value as the decimal text these codecs carry as their
58
- * canonical JSON.
59
- *
60
- * A schema-written literal default (`BigInt @default(0)`) arrives here as a
61
- * `number`, since a number literal is the only integer a schema language
62
- * writes, and one that is a safe integer names its value exactly. Past that
63
- * range the literal was rounded before any of this ran, so the value written is
64
- * not the value meant — which this refuses rather than minting an exact-looking
65
- * total from it. A non-integral number is refused on the same terms.
66
- */
67
- const pgBigintEncodeJson = (codecId, value) => {
68
- if (typeof value !== "number") return pgBigintEncode(codecId, value);
69
- if (!Number.isSafeInteger(value)) throw postgresError("RUNTIME.ENCODE_FAILED", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {
70
- codecId,
71
- received: String(value)
72
- } });
73
- return BigInt(value).toString();
74
- };
75
- /**
76
- * Reads a wire or JSON value as a `bigint`, rejecting anything `BigInt()` would
77
- * misread. A number-typed wire value must also be a safe integer: past
78
- * ±(2^53 − 1) the driver's `number` has already rounded, so stringifying it
79
- * would mint a spuriously-exact `bigint` that need not equal the stored value.
80
- */
81
- const decimalIntegerDecode = (codecId, wire) => {
82
- if (typeof wire === "bigint") return wire;
83
- const text = String(wire);
84
- if (!DECIMAL_INTEGER.test(text)) throw postgresError("RUNTIME.DECODE_FAILED", `${codecId} value must be a decimal integer`, { meta: {
85
- codecId,
86
- received: text
87
- } });
88
- if (typeof wire === "number" && !Number.isSafeInteger(wire)) throw postgresError("RUNTIME.DECODE_FAILED", `${codecId} wire number must be an integer within the safe integer range, got ${text}`, { meta: {
89
- codecId,
90
- received: text
91
- } });
92
- return BigInt(text);
93
- };
94
- /** Reads an `int8` wire or JSON value as a `bigint`, rejecting anything `BigInt()` would misread. */
95
- const pgInt8Decode = (wire) => decimalIntegerDecode("pg/int8@1", wire);
96
- /**
97
- * Reads an unconstrained-`numeric` wire or JSON value as a `bigint`, rejecting
98
- * non-integral values — including `NaN` and the infinities, which are `numeric`
99
- * values but not integers.
100
- */
101
- const pgUnboundedIntDecode = (wire) => decimalIntegerDecode("pg/unboundedint@1", wire);
102
- const MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
103
- const MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
104
- /**
105
- * Requires an integer within ±(2^53 − 1), the range a JS `number` holds
106
- * exactly. The guard throws rather than rounding: past the boundary a `number`
107
- * silently loses digits, which is the failure mode this codec exists to refuse.
108
- */
109
- const pgInt8NumberGuard = (code, value) => {
110
- if (!Number.isSafeInteger(value)) throw postgresError(code, `pg/int8number@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
111
- codecId: "pg/int8number@1",
112
- received: String(value)
113
- } });
114
- return value;
115
- };
116
- const pgInt8NumberEncodeJson = (value) => {
117
- requireJsType("pg/int8number@1", "number", value);
118
- return pgInt8NumberGuard("RUNTIME.ENCODE_FAILED", value);
119
- };
120
- const pgInt8NumberEncode = (value) => String(pgInt8NumberEncodeJson(value));
121
- /**
122
- * Reads an `int8` wire value as a `number`, throwing outside ±(2^53 − 1) and on
123
- * non-integral input. Decimal text goes through `BigInt` before the range check
124
- * so an out-of-range value is compared exactly rather than after rounding.
125
- */
126
- const pgInt8NumberDecode = (wire) => {
127
- if (typeof wire === "number") return pgInt8NumberGuard("RUNTIME.DECODE_FAILED", wire);
128
- const value = decimalIntegerDecode("pg/int8number@1", wire);
129
- if (value < MIN_SAFE_INTEGER_BIGINT || value > MAX_SAFE_INTEGER_BIGINT) throw postgresError("RUNTIME.DECODE_FAILED", `pg/int8number@1 value must be an integer within the safe integer range, got ${value}`, { meta: {
130
- codecId: "pg/int8number@1",
131
- received: value.toString()
132
- } });
133
- return Number(value);
134
- };
135
- const pgInt8NumberDecodeJson = (json) => {
136
- if (typeof json !== "number") throw postgresError("RUNTIME.DECODE_FAILED", "pg/int8number@1 database JSON value must be a number", { meta: {
137
- codecId: "pg/int8number@1",
138
- received: typeof json
139
- } });
140
- return pgInt8NumberGuard("RUNTIME.DECODE_FAILED", json);
141
- };
142
- /**
143
- * Renders a decimal-text default as a `bigint` literal, for the codecs whose
144
- * canonical JSON is decimal text while the application type is `bigint`
145
- * (`pg/int8@1`, `pg/unboundedint@1`) — a plain string literal would not
146
- * typecheck against the emitted column type.
147
- */
148
- const decimalTextBigintLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;
149
- const pgNumericRenderOutputType = (typeParams) => {
150
- const precision = typeParams.precision;
151
- if (precision === void 0) return void 0;
152
- if (typeof precision !== "number" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw postgresError("RUNTIME.TYPE_PARAMS_INVALID", `renderOutputType: expected integer "precision" in typeParams for Numeric, got ${String(precision)}`, { meta: {
153
- nativeType: "Numeric",
154
- param: "precision",
155
- received: String(precision)
156
- } });
157
- const scale = typeParams.scale;
158
- if (scale === void 0) return `Numeric<${precision}>`;
159
- if (typeof scale !== "number" || !Number.isFinite(scale) || !Number.isInteger(scale)) throw postgresError("RUNTIME.TYPE_PARAMS_INVALID", `renderOutputType: expected integer "scale" in typeParams for Numeric, got ${String(scale)}`, { meta: {
160
- nativeType: "Numeric",
161
- param: "scale",
162
- received: String(scale)
163
- } });
164
- return `Numeric<${precision}, ${scale}>`;
165
- };
166
- const ISO_8601_TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?$/;
167
- const ISO_8601_TIMESTAMPTZ = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;
168
- const pgTimestampEncodeJson = (value) => value.toISOString().slice(0, -1);
169
- const pgTimestampDecodeJson = (json) => {
170
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", `Expected ISO date string for pg/timestamp@1, got ${typeof json}`, { meta: {
171
- codecId: "pg/timestamp@1",
172
- received: typeof json
173
- } });
174
- if (!ISO_8601_TIMESTAMP.test(json)) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid ISO date string for pg/timestamp@1: ${json}`, { meta: {
175
- codecId: "pg/timestamp@1",
176
- received: json
177
- } });
178
- const date = /* @__PURE__ */ new Date(`${json}Z`);
179
- if (Number.isNaN(date.getTime())) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid ISO date string for pg/timestamp@1: ${json}`, { meta: {
180
- codecId: "pg/timestamp@1",
181
- received: json
182
- } });
183
- return date;
184
- };
185
- const pgTimestamptzEncodeJson = (value) => value.toISOString().replace(/Z$/, "+00:00");
186
- const pgTimestamptzDecodeJson = (json) => {
187
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", `Expected ISO date string for pg/timestamptz@1, got ${typeof json}`, { meta: {
188
- codecId: "pg/timestamptz@1",
189
- received: typeof json
190
- } });
191
- if (!ISO_8601_TIMESTAMPTZ.test(json)) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid ISO date string for pg/timestamptz@1: ${json}`, { meta: {
192
- codecId: "pg/timestamptz@1",
193
- received: json
194
- } });
195
- const date = new Date(json);
196
- if (Number.isNaN(date.getTime())) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid ISO date string for pg/timestamptz@1: ${json}`, { meta: {
197
- codecId: "pg/timestamptz@1",
198
- received: json
199
- } });
200
- return date;
201
- };
202
- const ISO_8601_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
203
- function formatDateOnly(year, month, day) {
204
- return `${String(year).padStart(4, "0")}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
205
- }
206
- /**
207
- * A Postgres `date` has no time-of-day or timezone component, so `pg/date@1`
208
- * canonicalizes its JS-level value as a `Date` at UTC midnight
209
- * (`Date.UTC(y, m, d)`), independent of the process's local timezone.
210
- *
211
- * `pgDateEncode` reads the calendar date via UTC getters (matching that
212
- * canonical form) and formats it as `YYYY-MM-DD` directly, bypassing the pg
213
- * driver's own `Date` serialization (`dateToString`), which reads *local*
214
- * getters and would shift the calendar day near midnight in negative-UTC-offset
215
- * environments.
216
- */
217
- const pgDateEncode = (value) => formatDateOnly(value.getUTCFullYear(), value.getUTCMonth() + 1, value.getUTCDate());
218
- /**
219
- * Normalizes the pg driver's already-parsed `Date` for a `date` column into
220
- * the canonical UTC-midnight form. The driver (via `postgres-date`) builds
221
- * that `Date` at *local* midnight from the wire text; reading it back with the
222
- * same (local) getters recovers the exact calendar date the driver parsed,
223
- * and reconstructing via `Date.UTC` makes the result's instant independent of
224
- * the process's timezone.
225
- */
226
- const pgDateDecode = (wire) => new Date(Date.UTC(wire.getFullYear(), wire.getMonth(), wire.getDate()));
227
- const pgDateEncodeJson = (value) => pgDateEncode(value);
228
- const pgDateDecodeJson = (json) => {
229
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", `Expected date string for pg/date@1, got ${typeof json}`, { meta: {
230
- codecId: "pg/date@1",
231
- received: typeof json
232
- } });
233
- const match = ISO_8601_DATE.exec(json);
234
- if (!match) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid date string for pg/date@1: ${json}`, { meta: {
235
- codecId: "pg/date@1",
236
- received: json
237
- } });
238
- const [, yearText, monthText, dayText] = match;
239
- const year = Number(yearText);
240
- const month = Number(monthText) - 1;
241
- const day = Number(dayText);
242
- const date = new Date(Date.UTC(year, month, day));
243
- if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) throw postgresError("RUNTIME.DECODE_FAILED", `Invalid date string for pg/date@1: ${json}`, { meta: {
244
- codecId: "pg/date@1",
245
- received: json
246
- } });
247
- return date;
248
- };
249
- const ISO_DURATION = /^P(?!$)(-?\d+Y)?(-?\d+M)?(-?\d+D)?(?:T(?!$)(-?\d+H)?(-?\d+M)?(-?\d+(?:\.\d+)?S)?)?$/;
250
- const MICROS_PER_SECOND = 1000000n;
251
- /**
252
- * Converts a fractional-seconds digit string to microseconds, rounding rather
253
- * than truncating past the sixth digit.
254
- *
255
- * PostgreSQL rounds: `INTERVAL '1.1234567 seconds'` is `1.123457`, and
256
- * `'1.9999999 seconds'` carries into `2`. Truncating here made the parsed value
257
- * disagree with the database for any input past microsecond resolution.
258
- *
259
- * Ties round toward positive infinity, matching `Math.round` on the sibling path
260
- * that reads the driver's component object — so the two agree. PostgreSQL's own
261
- * tie behaviour is unobservable, because it parses the literal into a double
262
- * first and an exact half never survives that.
263
- */
264
- const microsFromFraction = (fraction, negative) => {
265
- if (fraction === "") return 0n;
266
- const kept = BigInt(fraction.slice(0, 6).padEnd(6, "0"));
267
- const rest = fraction.slice(6).replace(/0+$/, "");
268
- if (rest === "") return kept;
269
- const half = rest[0] === "5" && rest.length === 1;
270
- return rest > "5" || half && !negative ? kept + 1n : kept;
271
- };
272
- const intervalFieldsOf = (text) => {
273
- const match = ISO_DURATION.exec(text);
274
- if (match === null) throw postgresError("RUNTIME.DECODE_FAILED", `pg/interval@1 value must be an ISO-8601 duration, got ${text}`, { meta: {
275
- codecId: "pg/interval@1",
276
- received: text
277
- } });
278
- const [, years, months, days, hours, minutes, seconds] = match;
279
- const wholeNumber = (part) => part === void 0 ? 0 : Number(part.slice(0, -1));
280
- const secondsLiteral = seconds === void 0 ? "0" : seconds.slice(0, -1);
281
- const negative = secondsLiteral.startsWith("-");
282
- const [whole = "0", fraction = ""] = secondsLiteral.replace("-", "").split(".");
283
- const magnitude = BigInt(whole) * MICROS_PER_SECOND + microsFromFraction(fraction, negative);
284
- return {
285
- months: wholeNumber(years) * 12 + wholeNumber(months),
286
- days: wholeNumber(days),
287
- micros: BigInt(wholeNumber(hours)) * 3600n * MICROS_PER_SECOND + BigInt(wholeNumber(minutes)) * 60n * MICROS_PER_SECOND + (negative ? -magnitude : magnitude)
288
- };
289
- };
290
- const secondsText = (micros) => {
291
- const sign = micros < 0n ? "-" : "";
292
- const magnitude = micros < 0n ? -micros : micros;
293
- const whole = magnitude / MICROS_PER_SECOND % 60n;
294
- const fraction = magnitude % MICROS_PER_SECOND;
295
- return `${sign}${whole}${fraction === 0n ? "" : `.${fraction.toString().padStart(6, "0").replace(/0+$/, "")}`}`;
296
- };
297
- /**
298
- * Renders {@link PgInterval} the way PostgreSQL spells an interval under
299
- * `IntervalStyle = 'iso_8601'`: zero components omitted, `T` present only when a
300
- * time component is, each component carrying its own sign, and an all-zero
301
- * interval written `PT0S`.
302
- */
303
- const formatIsoDuration = ({ months, days, micros }) => {
304
- const years = Math.trunc(months / 12);
305
- const restMonths = months % 12;
306
- const sign = micros < 0n ? "-" : "";
307
- const magnitude = micros < 0n ? -micros : micros;
308
- const hours = magnitude / (3600n * MICROS_PER_SECOND);
309
- const minutes = magnitude / (60n * MICROS_PER_SECOND) % 60n;
310
- const hasSeconds = magnitude % (60n * MICROS_PER_SECOND) !== 0n;
311
- const parts = [
312
- years === 0 ? "" : `${years}Y`,
313
- restMonths === 0 ? "" : `${restMonths}M`,
314
- days === 0 ? "" : `${days}D`
315
- ];
316
- const time = [
317
- hours === 0n ? "" : `${sign}${hours}H`,
318
- minutes === 0n ? "" : `${sign}${minutes}M`,
319
- hasSeconds ? `${secondsText(micros)}S` : ""
320
- ].join("");
321
- const rendered = `P${parts.join("")}${time === "" ? "" : `T${time}`}`;
322
- return rendered === "P" ? "PT0S" : rendered;
323
- };
324
- /** Renders the application value as its canonical ISO-8601 duration. */
325
- const pgIntervalToIso = (value) => formatIsoDuration(value);
326
- const pgIntervalEncodeJson = (value) => formatIsoDuration(value);
327
- const pgIntervalDecodeJson = (json) => {
328
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/interval@1 database JSON value must be an ISO-8601 duration string", { meta: {
329
- codecId: "pg/interval@1",
330
- received: typeof json
331
- } });
332
- return intervalFieldsOf(json);
333
- };
334
- /**
335
- * Reads the driver's wire value into the application value. `pg` parses an
336
- * interval into a component object, which is the same three fields under other
337
- * names; a text wire value is an ISO-8601 duration, because that is what the
338
- * codec writes.
339
- */
340
- const pgIntervalDecode = (wire) => {
341
- if (typeof wire === "string") return intervalFieldsOf(wire);
342
- const part = (name) => {
343
- const raw = wire[name];
344
- return typeof raw === "number" ? raw : 0;
345
- };
346
- const seconds = part("seconds") + part("milliseconds") / 1e3;
347
- return {
348
- months: part("years") * 12 + part("months"),
349
- days: part("days"),
350
- micros: BigInt(part("hours")) * 3600n * MICROS_PER_SECOND + BigInt(part("minutes")) * 60n * MICROS_PER_SECOND + BigInt(Math.round(seconds * 1e6))
351
- };
352
- };
353
- const BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
354
- const pgByteaEncodeJson = (value) => Buffer.from(value).toString("base64");
355
- const pgByteaDecodeJson = (value) => {
356
- if (typeof value !== "string" || !BASE64_TEXT.test(value)) throw postgresError("RUNTIME.DECODE_FAILED", "pg/bytea@1 database JSON value must be a base64 string", { meta: { codecId: "pg/bytea@1" } });
357
- return new Uint8Array(Buffer.from(value, "base64"));
358
- };
359
- const pgJsonEncode = (value) => JSON.stringify(value);
360
- const pgJsonDecode = (wire) => typeof wire === "string" ? JSON.parse(wire) : wire;
361
- const pgJsonbEncode = (value) => JSON.stringify(value);
362
- const pgJsonbDecode = (wire) => typeof wire === "string" ? JSON.parse(wire) : wire;
363
- const lengthParamsSchema = type({ "length?": "number.integer > 0" });
364
- const numericParamsSchema = type({
365
- "precision?": "number.integer > 0 & number.integer <= 1000",
366
- "scale?": "number.integer >= 0"
367
- });
368
- const precisionParamsSchema = type({ "precision?": "number.integer >= 0 & number.integer <= 6" });
369
- const PG_TEXT_NATIVE_TYPE = "text";
370
- const PG_TEXT_ARRAY_NATIVE_TYPE = "text[]";
371
- const PG_INT4_NATIVE_TYPE = "integer";
372
- const PG_INT2_NATIVE_TYPE = "smallint";
373
- const PG_INT8_NATIVE_TYPE = "bigint";
374
- const PG_FLOAT4_NATIVE_TYPE = "real";
375
- const PG_FLOAT8_NATIVE_TYPE = "double precision";
376
- const PG_NUMERIC_NATIVE_TYPE = "numeric";
377
- const PG_DATE_NATIVE_TYPE = "date";
378
- const PG_TIMESTAMP_NATIVE_TYPE = "timestamp without time zone";
379
- const PG_TIMESTAMPTZ_NATIVE_TYPE = "timestamp with time zone";
380
- const PG_TIME_NATIVE_TYPE = "time";
381
- const PG_TIMETZ_NATIVE_TYPE = "timetz";
382
- const PG_BOOL_NATIVE_TYPE = "boolean";
383
- const PG_BIT_NATIVE_TYPE = "bit";
384
- const PG_VARBIT_NATIVE_TYPE = "bit varying";
385
- const PG_BYTEA_NATIVE_TYPE = "bytea";
386
- const PG_INTERVAL_NATIVE_TYPE = "interval";
387
- const PG_JSON_NATIVE_TYPE = "json";
388
- const PG_JSONB_NATIVE_TYPE = "jsonb";
389
- /**
390
- * Projects the expression unchanged, for codecs whose canonical JSON is what
391
- * PostgreSQL's own JSON conversion already produces.
392
- *
393
- * Identity here is a claim about the target's behaviour, not an absence of one:
394
- * the codec's conformance cases are what test it, including at the boundaries
395
- * of the representation — escaping, sign, and range — where a native conversion
396
- * would be most likely to diverge.
397
- */
398
- /**
399
- * Whether a string is numeric text in the form PostgreSQL *prints*, which is
400
- * narrower than the form it accepts.
401
- *
402
- * `numeric` reads `+123`, `.5`, `1.`, `1e5`, `0x1f`, `1_000` and whitespace-padded
403
- * input, but prints every one of them in a single normalised form — `123`,
404
- * `0.5`, `1`, `100000`, `31`, `1000`, `12`. The projection reads the column back
405
- * through that printing, so accepting an input spelling here would produce an
406
- * application value the projection can never return: `encodeJson('1e5')` would
407
- * claim `1e5` where the database yields `100000`.
408
- *
409
- * `NaN`, `Infinity` and `-Infinity` are genuine `numeric` values, not error
410
- * states, and PostgreSQL emits them into JSON as strings — so they belong to the
411
- * canonical form and round-trip like any other value.
412
- */
413
- const CANONICAL_NUMERIC_TEXT = /^(?:-?\d+(?:\.\d+)?|NaN|-?Infinity)$/;
414
- const isCanonicalNumericText = (value) => CANONICAL_NUMERIC_TEXT.test(value);
415
- const identityJsonProjection = (expression) => expression;
416
- /**
417
- * Projects a numeric-valued expression as decimal text.
418
- *
419
- * The cast is part of the projected expression, which is what makes it correct:
420
- * whatever `jsonProjection` returns is the argument the JSON constructor
421
- * receives, so casting here happens *before* PostgreSQL builds the JSON value.
422
- * Handed a `numeric` or `int8` directly, the constructor emits a JSON **number**,
423
- * and every digit past IEEE-754's 53 bits of significand is gone by the time the
424
- * driver has parsed it — before any codec can intervene. A cast applied to the
425
- * constructor's result instead of its argument would be too late to matter.
426
- */
427
- const decimalTextJsonProjection = (expression) => CastExpr.as(expression, "text");
428
- /**
429
- * Projects a `bytea` as base64 text.
430
- *
431
- * Like the decimal-text cast, the encoding is part of the projected expression:
432
- * PostgreSQL's own JSON conversion of a `bytea` emits its `\x`-prefixed hex
433
- * output form, so the base64 encoding has to replace that conversion rather
434
- * than post-process it.
435
- *
436
- * `encode` emits RFC 2045 base64, which carries a line break every 76
437
- * characters — so any value over 56 bytes arrives wrapped. The breaks are
438
- * removed here, because the canonical form is unwrapped base64 and
439
- * `decodeJson` rejects anything else. `chr(10)` rather than a newline literal
440
- * keeps the rendered SQL on one line.
441
- */
442
- const base64JsonProjection = (expression) => FunctionCallExpr.of("translate", [
443
- FunctionCallExpr.of("encode", [expression, LiteralExpr.of("base64")]),
444
- FunctionCallExpr.of("chr", [LiteralExpr.of(10)]),
445
- LiteralExpr.of("")
446
- ]);
447
- /**
448
- * Projects a `timestamptz` as a UTC ISO-8601 string that no session setting can
449
- * move.
450
- *
451
- * A `timestamptz` handed straight to a JSON constructor is rendered in the
452
- * session's `TimeZone`, so the same stored instant reads as `+00:00`, `-05:00`
453
- * or `+05:30` depending on who is connected. `timezone('UTC', …)` resolves the
454
- * instant to UTC wall-clock independently of the session, and the explicit
455
- * `to_char` format pins the rendering rather than inheriting `DateStyle`.
456
- */
457
- const utcIsoJsonProjection = (expression) => FunctionCallExpr.of("to_char", [FunctionCallExpr.of("timezone", [LiteralExpr.of("UTC"), expression]), LiteralExpr.of("YYYY-MM-DD\"T\"HH24:MI:SS.MS\"+00:00\"")]);
458
- const datePart = (field, expression) => FunctionCallExpr.of("date_part", [LiteralExpr.of(field), expression]);
459
- const whenNonZero = (value, rendered) => CaseExpr.of([{
460
- condition: BinaryExpr.neq(value, LiteralExpr.of(0)),
461
- value: rendered
462
- }], LiteralExpr.of(null));
463
- /**
464
- * Projects an `interval` as an ISO-8601 duration.
465
- *
466
- * An interval carries months, days and microseconds independently — `P1M` and
467
- * `P30D` are different intervals — so the projection reads each field with
468
- * `date_part` and assembles them rather than reducing the value to an epoch,
469
- * which would have to choose a length for a month. `IntervalStyle` decides how
470
- * PostgreSQL spells an interval and cannot be bound per expression, so the
471
- * spelling is constructed here instead of inherited.
472
- *
473
- * `concat` drops NULL arguments, so a zero component is omitted by rendering as
474
- * NULL; the seconds field is taken through `numeric` because a `double
475
- * precision` microsecond renders in scientific notation.
476
- *
477
- * That same NULL-dropping is why the whole assembly sits under an explicit NULL
478
- * check: for a NULL interval every field is NULL, `concat` yields `'P'`, and the
479
- * zero-duration fallback below would report an absent value as a zero one.
480
- */
481
- const isoDurationJsonProjection = (expression) => {
482
- const field = (name) => datePart(name, expression);
483
- const seconds = CastExpr.as(field("second"), "numeric");
484
- const assembled = FunctionCallExpr.of("concat", [
485
- LiteralExpr.of("P"),
486
- whenNonZero(field("year"), FunctionCallExpr.of("concat", [field("year"), LiteralExpr.of("Y")])),
487
- whenNonZero(field("month"), FunctionCallExpr.of("concat", [field("month"), LiteralExpr.of("M")])),
488
- whenNonZero(field("day"), FunctionCallExpr.of("concat", [field("day"), LiteralExpr.of("D")])),
489
- CaseExpr.of([{
490
- condition: OrExpr.of([
491
- BinaryExpr.neq(field("hour"), LiteralExpr.of(0)),
492
- BinaryExpr.neq(field("minute"), LiteralExpr.of(0)),
493
- BinaryExpr.neq(field("second"), LiteralExpr.of(0))
494
- ]),
495
- value: LiteralExpr.of("T")
496
- }], LiteralExpr.of(null)),
497
- whenNonZero(field("hour"), FunctionCallExpr.of("concat", [field("hour"), LiteralExpr.of("H")])),
498
- whenNonZero(field("minute"), FunctionCallExpr.of("concat", [field("minute"), LiteralExpr.of("M")])),
499
- whenNonZero(field("second"), FunctionCallExpr.of("concat", [seconds, LiteralExpr.of("S")]))
500
- ]);
501
- return CaseExpr.of([{
502
- condition: NullCheckExpr.isNull(expression),
503
- value: LiteralExpr.of(null)
504
- }], FunctionCallExpr.of("coalesce", [FunctionCallExpr.of("nullif", [assembled, LiteralExpr.of("P")]), LiteralExpr.of("PT0S")]));
505
- };
506
- const postgresSqlCharDescriptor = postgresCodec(sqlCharDescriptor, {
507
- nativeType: () => "character",
508
- jsonProjection: identityJsonProjection
509
- });
510
- const postgresSqlVarcharDescriptor = postgresCodec(sqlVarcharDescriptor, {
511
- nativeType: () => "character varying",
512
- jsonProjection: identityJsonProjection
513
- });
514
- const postgresSqlIntDescriptor = postgresCodec(sqlIntDescriptor, {
515
- nativeType: () => "int4",
516
- jsonProjection: identityJsonProjection
517
- });
518
- const postgresSqlFloatDescriptor = postgresCodec(sqlFloatDescriptor, {
519
- nativeType: () => "float8",
520
- jsonProjection: identityJsonProjection
521
- });
522
- const postgresSqlTextDescriptor = postgresCodec(sqlTextDescriptor, {
523
- nativeType: () => "text",
524
- jsonProjection: identityJsonProjection
525
- });
526
- const postgresSqlTimestampDescriptor = postgresCodec(sqlTimestampDescriptor, {
527
- nativeType: () => "timestamp",
528
- jsonProjection: identityJsonProjection
529
- });
530
- var PgTextCodec = class extends CodecImpl {
531
- async encode(value, _ctx) {
532
- return value;
533
- }
534
- async decode(wire, _ctx) {
535
- return wire;
536
- }
537
- encodeJson(value) {
538
- return value;
539
- }
540
- decodeJson(json) {
541
- return json;
542
- }
543
- };
544
- var PgTextDescriptor = class extends PostgresCodecDescriptor {
545
- nativeType() {
546
- return PG_TEXT_NATIVE_TYPE;
547
- }
548
- jsonProjection(expression) {
549
- return expression;
550
- }
551
- codecId = PG_TEXT_CODEC_ID;
552
- traits = [
553
- "equality",
554
- "order",
555
- "textual"
556
- ];
557
- targetTypes = ["text"];
558
- paramsSchema = voidParamsSchema;
559
- renderValueLiteral(value) {
560
- return renderTsLiteral(value);
561
- }
562
- factory() {
563
- return () => new PgTextCodec(this);
564
- }
565
- };
566
- const pgTextDescriptor = new PgTextDescriptor();
567
- const pgTextColumn = () => column(pgTextDescriptor.factory(), pgTextDescriptor.codecId, void 0, "text");
568
- /**
569
- * Codec for a `pg.enum(Ref)` column bound to a native Postgres enum type.
570
- * Text passthrough, identical to `pg/text@1` — encode/decode do not carry the
571
- * enum's member values; membership is enforced by the native type itself, not
572
- * by this codec. `renderValueLiteral` renders a member value as its TS
573
- * literal, which is what drives the column's typed value-union (via
574
- * `renderValueSetType` reading the column's `valueSet` ref) — the codec
575
- * itself carries no params of its own; typing comes entirely from the
576
- * column's value-set, not from `pg/enum@1`.
577
- *
578
- * A distinct codec id (rather than reusing `pg/text@1` on a plain text
579
- * column) keeps native-enum columns independently identifiable — from a
580
- * column's `codecId` alone, without also inspecting `nativeType` — which
581
- * the managed (DDL) phase needs to target `CREATE TYPE`/`ALTER TYPE`
582
- * operations at exactly the columns that use one.
583
- */
584
- var PgEnumCodec = class extends CodecImpl {
585
- async encode(value, _ctx) {
586
- return value;
587
- }
588
- async decode(wire, _ctx) {
589
- return wire;
590
- }
591
- encodeJson(value) {
592
- return value;
593
- }
594
- decodeJson(json) {
595
- return blindCast(json);
596
- }
597
- };
598
- /**
599
- * Narrows codec `typeParams` to {@link PgEnumParams} — the shape that binds a
600
- * column to a named database type (a native enum's `CREATE TYPE` name).
601
- */
602
- function isPgEnumParams(value) {
603
- return typeof value === "object" && value !== null && !Array.isArray(value) && "typeName" in value && typeof value.typeName === "string";
604
- }
605
- const pgEnumParamsSchema = type({ typeName: "string" });
606
- var PgEnumDescriptor = class extends PostgresCodecDescriptor {
607
- nativeType(params) {
608
- return params.typeName;
609
- }
610
- jsonProjection(expression) {
611
- return expression;
612
- }
613
- codecId = PG_ENUM_CODEC_ID;
614
- traits = [
615
- "equality",
616
- "order",
617
- "textual"
618
- ];
619
- targetTypes = ["text"];
620
- paramsSchema = pgEnumParamsSchema;
621
- renderValueLiteral(value) {
622
- return renderTsLiteral(value);
623
- }
624
- factory(_params) {
625
- return () => new PgEnumCodec(this);
626
- }
627
- /**
628
- * Authoring-time hook a `pg.enum(<ref>)` type constructor calls once it has
629
- * resolved its ref argument to the referenced `native_enum` entity:
630
- * produces this codec's per-column `typeParams` and native type from the
631
- * entity's bare type name. Schema-qualification (`auth.aal_level` for a
632
- * named non-default schema) is not this hook's concern — the field's
633
- * namespace isn't known at this call site for every authoring path (the TS
634
- * builder resolves a column before it knows its model's namespace), so it is
635
- * applied later, at contract construction, by {@link qualifyNativeType} via
636
- * the target's `authoring.qualifyColumnType` hook. `nativeType` mirrors
637
- * `typeParams.typeName` — the same value `nativeTypeFor` derives at render
638
- * time — so the column's declared native type and the render-time cast
639
- * agree. Returns `undefined` if `entity` is not a `PostgresNativeEnum` (a
640
- * contributor bug, not a user-schema error — the caller decides how to
641
- * report it).
642
- */
643
- columnFromEntity(entity) {
644
- if (!PostgresNativeEnum.is(entity)) return void 0;
645
- return {
646
- typeParams: { typeName: entity.typeName },
647
- nativeType: entity.typeName
648
- };
649
- }
650
- /**
651
- * Schema-qualifies this native enum type's name for the namespace the
652
- * consuming column lives in: `${namespaceId}.${typeName}` for a named
653
- * non-default schema, bare for the target's default schema (`public`) or
654
- * the late-bound unbound sentinel (whose schema `search_path` resolves at
655
- * runtime). Postgres's `format_type()` reports the bare name for a
656
- * public-schema type, so a public column's declared native type must stay
657
- * bare to match. Owned here because the codec owns its native type.
658
- */
659
- qualifyNativeType(typeName, namespaceId) {
660
- return namespaceId === "public" || namespaceId === UNBOUND_NAMESPACE_ID ? typeName : `${namespaceId}.${typeName}`;
661
- }
662
- };
663
- const pgEnumDescriptor = new PgEnumDescriptor();
664
- /**
665
- * Contract-construction-time column-type qualifier the Postgres target
666
- * contributes through `authoring.qualifyColumnType`.
667
- * `buildSqlContractFromDefinition` calls this for every column as it is
668
- * constructed, passing the column's bare type info and its owning
669
- * `namespaceId`; a native-enum column (`pg/enum@1`) gets its type name
670
- * schema-qualified for that namespace (via
671
- * {@link PgEnumDescriptor.qualifyNativeType}), keeping `nativeType` and
672
- * `typeParams.typeName` in sync. Every other codec passes through unchanged.
673
- * Both the PSL `pg.enum(Ref)` path and the TS `pg.enum(handle)` path route
674
- * through here — the dispatch keys off the codec id, not authoring surface.
675
- */
676
- function postgresQualifyColumnType(input, namespaceId) {
677
- if (input.codecId !== "pg/enum@1") return input;
678
- const bareTypeName = input.typeParams?.["typeName"];
679
- if (typeof bareTypeName !== "string") return input;
680
- const qualified = pgEnumDescriptor.qualifyNativeType(bareTypeName, namespaceId);
681
- return {
682
- nativeType: qualified,
683
- typeParams: {
684
- ...input.typeParams,
685
- typeName: qualified
686
- }
687
- };
688
- }
689
- /**
690
- * Postgres `text[]` codec. Encode is an identity pass-through: the pg wire
691
- * driver serialises a JS `string[]` to a Postgres array literal under the
692
- * `$N::text[]` cast the renderer emits from this codec's `text[]` native type,
693
- * and decode reads it back as a JS array. Used by the control plane to write
694
- * the marker's `invariants` column. Not a user-facing scalar — it is not part
695
- * of the authorable `CodecTypes` surface, only the runtime codec registry.
696
- */
697
- var PgTextArrayCodec = class extends CodecImpl {
698
- async encode(value, _ctx) {
699
- return value;
700
- }
701
- async decode(wire, _ctx) {
702
- return wire;
703
- }
704
- encodeJson(value) {
705
- return [...value];
706
- }
707
- decodeJson(json) {
708
- return Array.isArray(json) ? json.map((entry) => String(entry)) : [];
709
- }
710
- };
711
- var PgTextArrayDescriptor = class extends PostgresCodecDescriptor {
712
- nativeType() {
713
- return PG_TEXT_ARRAY_NATIVE_TYPE;
714
- }
715
- jsonProjection(expression) {
716
- return expression;
717
- }
718
- codecId = PG_TEXT_ARRAY_CODEC_ID;
719
- traits = ["equality"];
720
- targetTypes = ["text[]"];
721
- paramsSchema = voidParamsSchema;
722
- factory() {
723
- return () => new PgTextArrayCodec(this);
724
- }
725
- };
726
- const pgTextArrayDescriptor = new PgTextArrayDescriptor();
727
- var PgInt4Codec = class extends CodecImpl {
728
- async encode(value, _ctx) {
729
- return value;
730
- }
731
- async decode(wire, _ctx) {
732
- return wire;
733
- }
734
- encodeJson(value) {
735
- return value;
736
- }
737
- decodeJson(json) {
738
- return json;
739
- }
740
- };
741
- var PgInt4Descriptor = class extends PostgresCodecDescriptor {
742
- nativeType() {
743
- return PG_INT4_NATIVE_TYPE;
744
- }
745
- jsonProjection(expression) {
746
- return expression;
747
- }
748
- codecId = PG_INT4_CODEC_ID;
749
- traits = [
750
- "equality",
751
- "order",
752
- "numeric"
753
- ];
754
- targetTypes = ["int4"];
755
- paramsSchema = voidParamsSchema;
756
- renderValueLiteral(value) {
757
- return renderTsLiteral(value);
758
- }
759
- factory() {
760
- return () => new PgInt4Codec(this);
761
- }
762
- };
763
- const pgInt4Descriptor = new PgInt4Descriptor();
764
- const pgInt4Column = () => column(pgInt4Descriptor.factory(), pgInt4Descriptor.codecId, void 0, "int4");
765
- var PgInt2Codec = class extends CodecImpl {
766
- async encode(value, _ctx) {
767
- return value;
768
- }
769
- async decode(wire, _ctx) {
770
- return wire;
771
- }
772
- encodeJson(value) {
773
- return value;
774
- }
775
- decodeJson(json) {
776
- return json;
777
- }
778
- };
779
- var PgInt2Descriptor = class extends PostgresCodecDescriptor {
780
- nativeType() {
781
- return PG_INT2_NATIVE_TYPE;
782
- }
783
- jsonProjection(expression) {
784
- return expression;
785
- }
786
- codecId = PG_INT2_CODEC_ID;
787
- traits = [
788
- "equality",
789
- "order",
790
- "numeric"
791
- ];
792
- targetTypes = ["int2"];
793
- paramsSchema = voidParamsSchema;
794
- renderValueLiteral(value) {
795
- return renderTsLiteral(value);
796
- }
797
- factory() {
798
- return () => new PgInt2Codec(this);
799
- }
800
- };
801
- const pgInt2Descriptor = new PgInt2Descriptor();
802
- const pgInt2Column = () => column(pgInt2Descriptor.factory(), pgInt2Descriptor.codecId, void 0, "int2");
803
- /**
804
- * A Postgres `int8` spans the full signed 64-bit range, which a JS `number`
805
- * cannot hold past 2^53. Application values are `bigint` and the canonical JSON
806
- * is decimal text; the wire form is the decimal string `pg` reads and writes for
807
- * this type.
808
- */
809
- var PgInt8Codec = class extends CodecImpl {
810
- async encode(value, _ctx) {
811
- return pgBigintEncode(PG_INT8_CODEC_ID, value);
812
- }
813
- async decode(wire, _ctx) {
814
- return pgInt8Decode(wire);
815
- }
816
- encodeJson(value) {
817
- return pgBigintEncodeJson(PG_INT8_CODEC_ID, value);
818
- }
819
- decodeJson(json) {
820
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/int8@1 database JSON value must be a decimal string", { meta: {
821
- codecId: PG_INT8_CODEC_ID,
822
- received: typeof json
823
- } });
824
- return pgInt8Decode(json);
825
- }
826
- };
827
- var PgInt8Descriptor = class extends PostgresCodecDescriptor {
828
- nativeType() {
829
- return PG_INT8_NATIVE_TYPE;
830
- }
831
- jsonProjection(expression) {
832
- return decimalTextJsonProjection(expression);
833
- }
834
- codecId = PG_INT8_CODEC_ID;
835
- traits = [
836
- "equality",
837
- "order",
838
- "numeric"
839
- ];
840
- targetTypes = ["int8"];
841
- paramsSchema = voidParamsSchema;
842
- renderValueLiteral(value) {
843
- return decimalTextBigintLiteral(value);
844
- }
845
- factory() {
846
- return () => new PgInt8Codec(this);
847
- }
848
- };
849
- const pgInt8Descriptor = new PgInt8Descriptor();
850
- const pgInt8Column = () => column(pgInt8Descriptor.factory(), pgInt8Descriptor.codecId, void 0, "int8");
851
- /**
852
- * A Postgres `int8` decoded as a JS `number`, for columns whose values stay
853
- * within the safe integer range ±(2^53 − 1). Both directions guard rather than
854
- * round: decode (wire and JSON) and encode throw a structured error on
855
- * out-of-range or non-integral input. The canonical JSON is a JSON number —
856
- * the deliberate exception to the decimal-text rule for 64-bit integers, and
857
- * the codec's purpose. The descriptor claims no target type, so `int8` in type
858
- * position stays `pg/int8@1`.
859
- */
860
- var PgInt8NumberCodec = class extends CodecImpl {
861
- async encode(value, _ctx) {
862
- return pgInt8NumberEncode(value);
863
- }
864
- async decode(wire, _ctx) {
865
- return pgInt8NumberDecode(wire);
866
- }
867
- encodeJson(value) {
868
- return pgInt8NumberEncodeJson(value);
869
- }
870
- decodeJson(json) {
871
- return pgInt8NumberDecodeJson(json);
872
- }
873
- };
874
- var PgInt8NumberDescriptor = class extends PostgresCodecDescriptor {
875
- nativeType() {
876
- return PG_INT8_NATIVE_TYPE;
877
- }
878
- jsonProjection(expression) {
879
- return expression;
880
- }
881
- codecId = PG_INT8_NUMBER_CODEC_ID;
882
- traits = [
883
- "equality",
884
- "order",
885
- "numeric"
886
- ];
887
- targetTypes = [];
888
- paramsSchema = voidParamsSchema;
889
- renderValueLiteral(value) {
890
- return renderTsLiteral(value);
891
- }
892
- factory() {
893
- return () => new PgInt8NumberCodec(this);
894
- }
895
- };
896
- const pgInt8NumberDescriptor = new PgInt8NumberDescriptor();
897
- const pgInt8NumberColumn = () => column(pgInt8NumberDescriptor.factory(), pgInt8NumberDescriptor.codecId, void 0, "int8");
898
- var PgFloat4Codec = class extends CodecImpl {
899
- async encode(value, _ctx) {
900
- return value;
901
- }
902
- async decode(wire, _ctx) {
903
- return wire;
904
- }
905
- encodeJson(value) {
906
- return value;
907
- }
908
- decodeJson(json) {
909
- return json;
910
- }
911
- };
912
- var PgFloat4Descriptor = class extends PostgresCodecDescriptor {
913
- nativeType() {
914
- return PG_FLOAT4_NATIVE_TYPE;
915
- }
916
- jsonProjection(expression) {
917
- return expression;
918
- }
919
- codecId = PG_FLOAT4_CODEC_ID;
920
- traits = [
921
- "equality",
922
- "order",
923
- "numeric"
924
- ];
925
- targetTypes = ["float4"];
926
- paramsSchema = voidParamsSchema;
927
- renderValueLiteral(value) {
928
- return renderTsLiteral(value);
929
- }
930
- factory() {
931
- return () => new PgFloat4Codec(this);
932
- }
933
- };
934
- const pgFloat4Descriptor = new PgFloat4Descriptor();
935
- const pgFloat4Column = () => column(pgFloat4Descriptor.factory(), pgFloat4Descriptor.codecId, void 0, "float4");
936
- var PgFloat8Codec = class extends CodecImpl {
937
- async encode(value, _ctx) {
938
- return value;
939
- }
940
- async decode(wire, _ctx) {
941
- return wire;
942
- }
943
- encodeJson(value) {
944
- return value;
945
- }
946
- decodeJson(json) {
947
- return json;
948
- }
949
- };
950
- var PgFloat8Descriptor = class extends PostgresCodecDescriptor {
951
- nativeType() {
952
- return PG_FLOAT8_NATIVE_TYPE;
953
- }
954
- jsonProjection(expression) {
955
- return expression;
956
- }
957
- codecId = PG_FLOAT8_CODEC_ID;
958
- traits = [
959
- "equality",
960
- "order",
961
- "numeric"
962
- ];
963
- targetTypes = ["float8"];
964
- paramsSchema = voidParamsSchema;
965
- renderValueLiteral(value) {
966
- return renderTsLiteral(value);
967
- }
968
- factory() {
969
- return () => new PgFloat8Codec(this);
970
- }
971
- };
972
- const pgFloat8Descriptor = new PgFloat8Descriptor();
973
- const pgFloat8Column = () => column(pgFloat8Descriptor.factory(), pgFloat8Descriptor.codecId, void 0, "float8");
974
- var PgBoolCodec = class extends CodecImpl {
975
- async encode(value, _ctx) {
976
- return value;
977
- }
978
- async decode(wire, _ctx) {
979
- return wire;
980
- }
981
- encodeJson(value) {
982
- return value;
983
- }
984
- decodeJson(json) {
985
- return json;
986
- }
987
- };
988
- var PgBoolDescriptor = class extends PostgresCodecDescriptor {
989
- nativeType() {
990
- return PG_BOOL_NATIVE_TYPE;
991
- }
992
- jsonProjection(expression) {
993
- return expression;
994
- }
995
- codecId = PG_BOOL_CODEC_ID;
996
- traits = ["equality", "boolean"];
997
- targetTypes = ["bool"];
998
- paramsSchema = voidParamsSchema;
999
- renderValueLiteral(value) {
1000
- return renderTsLiteral(value);
1001
- }
1002
- factory() {
1003
- return () => new PgBoolCodec(this);
1004
- }
1005
- };
1006
- const pgBoolDescriptor = new PgBoolDescriptor();
1007
- const pgBoolColumn = () => column(pgBoolDescriptor.factory(), pgBoolDescriptor.codecId, void 0, "bool");
1008
- var PgNumericCodec = class extends CodecImpl {
1009
- async encode(value, _ctx) {
1010
- return value;
1011
- }
1012
- async decode(wire, _ctx) {
1013
- return pgNumericDecode(wire);
1014
- }
1015
- encodeJson(value) {
1016
- if (!isCanonicalNumericText(value)) throw postgresError("RUNTIME.ENCODE_FAILED", "pg/numeric@1 application value must be canonical numeric text: an optionally negated decimal numeral, or NaN, Infinity or -Infinity", { meta: {
1017
- codecId: PG_NUMERIC_CODEC_ID,
1018
- received: value
1019
- } });
1020
- return value;
1021
- }
1022
- decodeJson(json) {
1023
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/numeric@1 database JSON value must be a decimal string", { meta: {
1024
- codecId: PG_NUMERIC_CODEC_ID,
1025
- received: typeof json
1026
- } });
1027
- return json;
1028
- }
1029
- };
1030
- var PgNumericDescriptor = class extends PostgresCodecDescriptor {
1031
- nativeType() {
1032
- return PG_NUMERIC_NATIVE_TYPE;
1033
- }
1034
- jsonProjection(expression) {
1035
- return decimalTextJsonProjection(expression);
1036
- }
1037
- codecId = PG_NUMERIC_CODEC_ID;
1038
- traits = [
1039
- "equality",
1040
- "order",
1041
- "numeric"
1042
- ];
1043
- targetTypes = ["numeric", "decimal"];
1044
- paramsSchema = numericParamsSchema;
1045
- renderOutputType(params) {
1046
- return pgNumericRenderOutputType(params);
1047
- }
1048
- factory(_params) {
1049
- return () => new PgNumericCodec(this);
1050
- }
1051
- };
1052
- const pgNumericDescriptor = new PgNumericDescriptor();
1053
- const pgNumericColumn = (params = {}) => column(pgNumericDescriptor.factory(params), pgNumericDescriptor.codecId, params, "numeric");
1054
- /**
1055
- * A genuinely unbounded integer over unconstrained Postgres `numeric` storage.
1056
- * Application values are `bigint` and the canonical JSON is decimal text, like
1057
- * `pg/int8@1`; decode rejects non-integral values. The descriptor claims no
1058
- * target type, so `numeric` and `decimal` in type position stay `pg/numeric@1`.
1059
- */
1060
- var PgUnboundedIntCodec = class extends CodecImpl {
1061
- async encode(value, _ctx) {
1062
- return pgBigintEncode(PG_UNBOUNDED_INT_CODEC_ID, value);
1063
- }
1064
- async decode(wire, _ctx) {
1065
- return pgUnboundedIntDecode(wire);
1066
- }
1067
- encodeJson(value) {
1068
- return pgBigintEncodeJson(PG_UNBOUNDED_INT_CODEC_ID, value);
1069
- }
1070
- decodeJson(json) {
1071
- if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/unboundedint@1 database JSON value must be a decimal string", { meta: {
1072
- codecId: PG_UNBOUNDED_INT_CODEC_ID,
1073
- received: typeof json
1074
- } });
1075
- return pgUnboundedIntDecode(json);
1076
- }
1077
- };
1078
- var PgUnboundedIntDescriptor = class extends PostgresCodecDescriptor {
1079
- nativeType() {
1080
- return PG_NUMERIC_NATIVE_TYPE;
1081
- }
1082
- jsonProjection(expression) {
1083
- return decimalTextJsonProjection(expression);
1084
- }
1085
- codecId = PG_UNBOUNDED_INT_CODEC_ID;
1086
- traits = [
1087
- "equality",
1088
- "order",
1089
- "numeric"
1090
- ];
1091
- targetTypes = [];
1092
- paramsSchema = voidParamsSchema;
1093
- renderValueLiteral(value) {
1094
- return decimalTextBigintLiteral(value);
1095
- }
1096
- factory() {
1097
- return () => new PgUnboundedIntCodec(this);
1098
- }
1099
- };
1100
- const pgUnboundedIntDescriptor = new PgUnboundedIntDescriptor();
1101
- const pgUnboundedIntColumn = () => column(pgUnboundedIntDescriptor.factory(), pgUnboundedIntDescriptor.codecId, void 0, "numeric");
1102
- /**
1103
- * A Postgres `date` has no time-of-day or timezone component. This codec
1104
- * canonicalizes its JS-level value as a `Date` at UTC midnight, so its
1105
- * round-trip is independent of the process's local timezone — see
1106
- * `pgDateEncode`/`pgDateDecode` in `codec-helpers.ts`.
1107
- */
1108
- var PgDateCodec = class extends CodecImpl {
1109
- async encode(value, _ctx) {
1110
- return pgDateEncode(value);
1111
- }
1112
- async decode(wire, _ctx) {
1113
- return pgDateDecode(wire);
1114
- }
1115
- encodeJson(value) {
1116
- return pgDateEncodeJson(value);
1117
- }
1118
- decodeJson(json) {
1119
- return pgDateDecodeJson(json);
1120
- }
1121
- };
1122
- var PgDateDescriptor = class extends PostgresCodecDescriptor {
1123
- nativeType() {
1124
- return PG_DATE_NATIVE_TYPE;
1125
- }
1126
- jsonProjection(expression) {
1127
- return expression;
1128
- }
1129
- codecId = PG_DATE_CODEC_ID;
1130
- traits = ["equality", "order"];
1131
- targetTypes = ["date"];
1132
- paramsSchema = voidParamsSchema;
1133
- factory() {
1134
- return () => new PgDateCodec(this);
1135
- }
1136
- };
1137
- const pgDateDescriptor = new PgDateDescriptor();
1138
- const pgDateColumn = () => column(pgDateDescriptor.factory(), pgDateDescriptor.codecId, void 0, "date");
1139
- var PgTimestampCodec = class extends CodecImpl {
1140
- async encode(value, _ctx) {
1141
- return value;
1142
- }
1143
- async decode(wire, _ctx) {
1144
- return wire;
1145
- }
1146
- encodeJson(value) {
1147
- return pgTimestampEncodeJson(value);
1148
- }
1149
- decodeJson(json) {
1150
- return pgTimestampDecodeJson(json);
1151
- }
1152
- };
1153
- var PgTimestampDescriptor = class extends PostgresCodecDescriptor {
1154
- nativeType() {
1155
- return PG_TIMESTAMP_NATIVE_TYPE;
1156
- }
1157
- jsonProjection(expression) {
1158
- return expression;
1159
- }
1160
- codecId = PG_TIMESTAMP_CODEC_ID;
1161
- traits = ["equality", "order"];
1162
- targetTypes = ["timestamp"];
1163
- paramsSchema = precisionParamsSchema;
1164
- renderOutputType(params) {
1165
- return renderPrecision("Timestamp", params);
1166
- }
1167
- factory(_params) {
1168
- return () => new PgTimestampCodec(this);
1169
- }
1170
- };
1171
- const pgTimestampDescriptor = new PgTimestampDescriptor();
1172
- const pgTimestampColumn = (params = {}) => column(pgTimestampDescriptor.factory(params), pgTimestampDescriptor.codecId, params, "timestamp");
1173
- var PgTimestamptzCodec = class extends CodecImpl {
1174
- async encode(value, _ctx) {
1175
- return value;
1176
- }
1177
- async decode(wire, _ctx) {
1178
- return wire;
1179
- }
1180
- encodeJson(value) {
1181
- return pgTimestamptzEncodeJson(value);
1182
- }
1183
- decodeJson(json) {
1184
- return pgTimestamptzDecodeJson(json);
1185
- }
1186
- };
1187
- var PgTimestamptzDescriptor = class extends PostgresCodecDescriptor {
1188
- nativeType() {
1189
- return PG_TIMESTAMPTZ_NATIVE_TYPE;
1190
- }
1191
- jsonProjection(expression) {
1192
- return utcIsoJsonProjection(expression);
1193
- }
1194
- codecId = PG_TIMESTAMPTZ_CODEC_ID;
1195
- traits = ["equality", "order"];
1196
- targetTypes = ["timestamptz"];
1197
- paramsSchema = precisionParamsSchema;
1198
- renderOutputType(params) {
1199
- return renderPrecision("Timestamptz", params);
1200
- }
1201
- factory(_params) {
1202
- return () => new PgTimestamptzCodec(this);
1203
- }
1204
- };
1205
- const pgTimestamptzDescriptor = new PgTimestamptzDescriptor();
1206
- const pgTimestamptzColumn = (params = {}) => column(pgTimestamptzDescriptor.factory(params), pgTimestamptzDescriptor.codecId, params, "timestamptz");
1207
- var PgTimeCodec = class extends CodecImpl {
1208
- async encode(value, _ctx) {
1209
- return value;
1210
- }
1211
- async decode(wire, _ctx) {
1212
- return wire;
1213
- }
1214
- encodeJson(value) {
1215
- return value;
1216
- }
1217
- decodeJson(json) {
1218
- return json;
1219
- }
1220
- };
1221
- var PgTimeDescriptor = class extends PostgresCodecDescriptor {
1222
- nativeType() {
1223
- return PG_TIME_NATIVE_TYPE;
1224
- }
1225
- jsonProjection(expression) {
1226
- return expression;
1227
- }
1228
- codecId = PG_TIME_CODEC_ID;
1229
- traits = ["equality", "order"];
1230
- targetTypes = ["time"];
1231
- paramsSchema = precisionParamsSchema;
1232
- renderOutputType(params) {
1233
- return renderPrecision("Time", params);
1234
- }
1235
- factory(_params) {
1236
- return () => new PgTimeCodec(this);
1237
- }
1238
- };
1239
- const pgTimeDescriptor = new PgTimeDescriptor();
1240
- const pgTimeColumn = (params = {}) => column(pgTimeDescriptor.factory(params), pgTimeDescriptor.codecId, params, "time");
1241
- var PgTimetzCodec = class extends CodecImpl {
1242
- async encode(value, _ctx) {
1243
- return value;
1244
- }
1245
- async decode(wire, _ctx) {
1246
- return wire;
1247
- }
1248
- encodeJson(value) {
1249
- return value;
1250
- }
1251
- decodeJson(json) {
1252
- return json;
1253
- }
1254
- };
1255
- var PgTimetzDescriptor = class extends PostgresCodecDescriptor {
1256
- nativeType() {
1257
- return PG_TIMETZ_NATIVE_TYPE;
1258
- }
1259
- jsonProjection(expression) {
1260
- return expression;
1261
- }
1262
- codecId = PG_TIMETZ_CODEC_ID;
1263
- traits = ["equality", "order"];
1264
- targetTypes = ["timetz"];
1265
- paramsSchema = precisionParamsSchema;
1266
- renderOutputType(params) {
1267
- return renderPrecision("Timetz", params);
1268
- }
1269
- factory(_params) {
1270
- return () => new PgTimetzCodec(this);
1271
- }
1272
- };
1273
- const pgTimetzDescriptor = new PgTimetzDescriptor();
1274
- const pgTimetzColumn = (params = {}) => column(pgTimetzDescriptor.factory(params), pgTimetzDescriptor.codecId, params, "timetz");
1275
- var PgBitCodec = class extends CodecImpl {
1276
- async encode(value, _ctx) {
1277
- return value;
1278
- }
1279
- async decode(wire, _ctx) {
1280
- return wire;
1281
- }
1282
- encodeJson(value) {
1283
- return value;
1284
- }
1285
- decodeJson(json) {
1286
- return json;
1287
- }
1288
- };
1289
- var PgBitDescriptor = class extends PostgresCodecDescriptor {
1290
- nativeType() {
1291
- return PG_BIT_NATIVE_TYPE;
1292
- }
1293
- jsonProjection(expression) {
1294
- return expression;
1295
- }
1296
- codecId = PG_BIT_CODEC_ID;
1297
- traits = ["equality", "order"];
1298
- targetTypes = ["bit"];
1299
- paramsSchema = lengthParamsSchema;
1300
- renderOutputType(params) {
1301
- return renderLength("Bit", params);
1302
- }
1303
- factory(_params) {
1304
- return () => new PgBitCodec(this);
1305
- }
1306
- };
1307
- const pgBitDescriptor = new PgBitDescriptor();
1308
- const pgBitColumn = (params = {}) => column(pgBitDescriptor.factory(params), pgBitDescriptor.codecId, params, "bit");
1309
- var PgVarbitCodec = class extends CodecImpl {
1310
- async encode(value, _ctx) {
1311
- return value;
1312
- }
1313
- async decode(wire, _ctx) {
1314
- return wire;
1315
- }
1316
- encodeJson(value) {
1317
- return value;
1318
- }
1319
- decodeJson(json) {
1320
- return json;
1321
- }
1322
- };
1323
- var PgVarbitDescriptor = class extends PostgresCodecDescriptor {
1324
- nativeType() {
1325
- return PG_VARBIT_NATIVE_TYPE;
1326
- }
1327
- jsonProjection(expression) {
1328
- return expression;
1329
- }
1330
- codecId = PG_VARBIT_CODEC_ID;
1331
- traits = ["equality", "order"];
1332
- targetTypes = ["bit varying"];
1333
- paramsSchema = lengthParamsSchema;
1334
- renderOutputType(params) {
1335
- return renderLength("VarBit", params);
1336
- }
1337
- factory(_params) {
1338
- return () => new PgVarbitCodec(this);
1339
- }
1340
- };
1341
- const pgVarbitDescriptor = new PgVarbitDescriptor();
1342
- const pgVarbitColumn = (params = {}) => column(pgVarbitDescriptor.factory(params), pgVarbitDescriptor.codecId, params, "bit varying");
1343
- var PgByteaCodec = class extends CodecImpl {
1344
- async encode(value, _ctx) {
1345
- return value;
1346
- }
1347
- async decode(wire, _ctx) {
1348
- return wire instanceof Uint8Array && wire.constructor === Uint8Array ? wire : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength);
1349
- }
1350
- encodeJson(value) {
1351
- return pgByteaEncodeJson(value);
1352
- }
1353
- decodeJson(json) {
1354
- return pgByteaDecodeJson(json);
1355
- }
1356
- };
1357
- var PgByteaDescriptor = class extends PostgresCodecDescriptor {
1358
- nativeType() {
1359
- return PG_BYTEA_NATIVE_TYPE;
1360
- }
1361
- jsonProjection(expression) {
1362
- return base64JsonProjection(expression);
1363
- }
1364
- codecId = PG_BYTEA_CODEC_ID;
1365
- traits = ["equality"];
1366
- targetTypes = ["bytea"];
1367
- paramsSchema = voidParamsSchema;
1368
- factory() {
1369
- return () => new PgByteaCodec(this);
1370
- }
1371
- };
1372
- const pgByteaDescriptor = new PgByteaDescriptor();
1373
- const PG_UUID_NATIVE_TYPE = "uuid";
1374
- var PgUuidCodec = class extends CodecImpl {
1375
- async encode(value, _ctx) {
1376
- return value;
1377
- }
1378
- async decode(wire, _ctx) {
1379
- return wire;
1380
- }
1381
- encodeJson(value) {
1382
- return value;
1383
- }
1384
- decodeJson(json) {
1385
- return blindCast(json);
1386
- }
1387
- };
1388
- var PgUuidDescriptor = class extends PostgresCodecDescriptor {
1389
- nativeType() {
1390
- return PG_UUID_NATIVE_TYPE;
1391
- }
1392
- jsonProjection(expression) {
1393
- return expression;
1394
- }
1395
- codecId = PG_UUID_CODEC_ID;
1396
- traits = ["equality", "order"];
1397
- targetTypes = ["uuid"];
1398
- paramsSchema = voidParamsSchema;
1399
- factory() {
1400
- return () => new PgUuidCodec(this);
1401
- }
1402
- };
1403
- const pgUuidDescriptor = new PgUuidDescriptor();
1404
- const pgUuidColumn = () => column(pgUuidDescriptor.factory(), pgUuidDescriptor.codecId, void 0, "uuid");
1405
- const PG_INET_NATIVE_TYPE = "inet";
1406
- var PgInetCodec = class extends CodecImpl {
1407
- async encode(value, _ctx) {
1408
- return value;
1409
- }
1410
- async decode(wire, _ctx) {
1411
- return wire;
1412
- }
1413
- encodeJson(value) {
1414
- return value;
1415
- }
1416
- decodeJson(json) {
1417
- return blindCast(json);
1418
- }
1419
- };
1420
- var PgInetDescriptor = class extends PostgresCodecDescriptor {
1421
- nativeType() {
1422
- return PG_INET_NATIVE_TYPE;
1423
- }
1424
- jsonProjection(expression) {
1425
- return expression;
1426
- }
1427
- codecId = PG_INET_CODEC_ID;
1428
- traits = ["equality", "order"];
1429
- targetTypes = ["inet"];
1430
- paramsSchema = voidParamsSchema;
1431
- factory() {
1432
- return () => new PgInetCodec(this);
1433
- }
1434
- };
1435
- const pgInetDescriptor = new PgInetDescriptor();
1436
- const pgInetColumn = () => column(pgInetDescriptor.factory(), pgInetDescriptor.codecId, void 0, "inet");
1437
- /**
1438
- * An application value is a {@link PgInterval} — the three fields PostgreSQL
1439
- * actually stores, `{ months, days, micros }` — and its canonical JSON is the
1440
- * ISO-8601 duration string PostgreSQL spells under
1441
- * `IntervalStyle = 'iso_8601'`: `P1M`, `P30D`, `P1Y2M3DT4H5M6S`, `PT0S` for
1442
- * zero, each component carrying its own sign.
1443
- *
1444
- * Value and representation are independent here, as they are for `pg/bytea@1`
1445
- * (`Uint8Array` carried as base64) and `pg/int8@1` (`bigint` carried as decimal
1446
- * text). Reading an interval hands back numbers to compute with rather than a
1447
- * string to parse; writing one takes the same numbers.
1448
- *
1449
- * The fields stay independent because a month has no fixed length: `{months: 1}`
1450
- * and `{days: 30}` are different values and neither converts to the other. The
1451
- * ISO rendering normalises only in its own spelling — twelve months render as a
1452
- * year — so `{months: 13}` renders `P1Y1M` and reads back as `{months: 13}`.
1453
- */
1454
- var PgIntervalCodec = class extends CodecImpl {
1455
- async encode(value, _ctx) {
1456
- return pgIntervalToIso(value);
1457
- }
1458
- async decode(wire, _ctx) {
1459
- return pgIntervalDecode(wire);
1460
- }
1461
- encodeJson(value) {
1462
- return pgIntervalEncodeJson(value);
1463
- }
1464
- decodeJson(json) {
1465
- return pgIntervalDecodeJson(json);
1466
- }
1467
- };
1468
- var PgIntervalDescriptor = class extends PostgresCodecDescriptor {
1469
- nativeType() {
1470
- return PG_INTERVAL_NATIVE_TYPE;
1471
- }
1472
- jsonProjection(expression) {
1473
- return isoDurationJsonProjection(expression);
1474
- }
1475
- codecId = PG_INTERVAL_CODEC_ID;
1476
- traits = ["equality", "order"];
1477
- targetTypes = ["interval"];
1478
- paramsSchema = precisionParamsSchema;
1479
- renderOutputType(params) {
1480
- return renderPrecision("Interval", params);
1481
- }
1482
- factory(_params) {
1483
- return () => new PgIntervalCodec(this);
1484
- }
1485
- };
1486
- const pgIntervalDescriptor = new PgIntervalDescriptor();
1487
- const pgIntervalColumn = (params = {}) => column(pgIntervalDescriptor.factory(params), pgIntervalDescriptor.codecId, params, "interval");
1488
- var PgJsonCodec = class extends CodecImpl {
1489
- async encode(value, _ctx) {
1490
- return pgJsonEncode(value);
1491
- }
1492
- async decode(wire, _ctx) {
1493
- return pgJsonDecode(wire);
1494
- }
1495
- encodeJson(value) {
1496
- return value;
1497
- }
1498
- decodeJson(json) {
1499
- return json;
1500
- }
1501
- };
1502
- var PgJsonDescriptor = class extends PostgresCodecDescriptor {
1503
- nativeType() {
1504
- return PG_JSON_NATIVE_TYPE;
1505
- }
1506
- jsonProjection(expression) {
1507
- return expression;
1508
- }
1509
- codecId = PG_JSON_CODEC_ID;
1510
- traits = [];
1511
- targetTypes = ["json"];
1512
- paramsSchema = voidParamsSchema;
1513
- factory() {
1514
- return () => new PgJsonCodec(this);
1515
- }
1516
- };
1517
- const pgJsonDescriptor = new PgJsonDescriptor();
1518
- const pgJsonColumn = () => column(pgJsonDescriptor.factory(), pgJsonDescriptor.codecId, void 0, "json");
1519
- var PgJsonbCodec = class extends CodecImpl {
1520
- async encode(value, _ctx) {
1521
- return pgJsonbEncode(value);
1522
- }
1523
- async decode(wire, _ctx) {
1524
- return pgJsonbDecode(wire);
1525
- }
1526
- encodeJson(value) {
1527
- return value;
1528
- }
1529
- decodeJson(json) {
1530
- return json;
1531
- }
1532
- };
1533
- var PgJsonbDescriptor = class extends PostgresCodecDescriptor {
1534
- nativeType() {
1535
- return PG_JSONB_NATIVE_TYPE;
1536
- }
1537
- jsonProjection(expression) {
1538
- return expression;
1539
- }
1540
- codecId = PG_JSONB_CODEC_ID;
1541
- traits = ["equality"];
1542
- targetTypes = ["jsonb"];
1543
- paramsSchema = voidParamsSchema;
1544
- factory() {
1545
- return () => new PgJsonbCodec(this);
1546
- }
1547
- };
1548
- const pgJsonbDescriptor = new PgJsonbDescriptor();
1549
- const pgJsonbColumn = () => column(pgJsonbDescriptor.factory(), pgJsonbDescriptor.codecId, void 0, "jsonb");
1550
- const PG_CHAR_NATIVE_TYPE = "character";
1551
- const PG_VARCHAR_NATIVE_TYPE = "character varying";
1552
- const PG_INT_NATIVE_TYPE = "integer";
1553
- const PG_FLOAT_NATIVE_TYPE = "double precision";
1554
- var PgCharDescriptor = class extends PostgresCodecDescriptor {
1555
- nativeType() {
1556
- return PG_CHAR_NATIVE_TYPE;
1557
- }
1558
- jsonProjection(expression) {
1559
- return expression;
1560
- }
1561
- codecId = PG_CHAR_CODEC_ID;
1562
- targetTypes = ["character"];
1563
- traits = sqlCharDescriptor.traits;
1564
- paramsSchema = sqlCharDescriptor.paramsSchema;
1565
- renderOutputType(params) {
1566
- return sqlCharDescriptor.renderOutputType(params);
1567
- }
1568
- renderValueLiteral(value) {
1569
- return renderTsLiteral(value);
1570
- }
1571
- factory(_params) {
1572
- return () => new SqlCharCodec(this);
1573
- }
1574
- };
1575
- const pgCharDescriptor = new PgCharDescriptor();
1576
- const pgCharColumn = (params = {}) => column(pgCharDescriptor.factory(params), pgCharDescriptor.codecId, params, "character");
1577
- var PgVarcharDescriptor = class extends PostgresCodecDescriptor {
1578
- nativeType() {
1579
- return PG_VARCHAR_NATIVE_TYPE;
1580
- }
1581
- jsonProjection(expression) {
1582
- return expression;
1583
- }
1584
- codecId = PG_VARCHAR_CODEC_ID;
1585
- targetTypes = ["character varying"];
1586
- traits = sqlVarcharDescriptor.traits;
1587
- paramsSchema = sqlVarcharDescriptor.paramsSchema;
1588
- renderOutputType(params) {
1589
- return sqlVarcharDescriptor.renderOutputType(params);
1590
- }
1591
- renderValueLiteral(value) {
1592
- return renderTsLiteral(value);
1593
- }
1594
- factory(_params) {
1595
- return () => new SqlVarcharCodec(this);
1596
- }
1597
- };
1598
- const pgVarcharDescriptor = new PgVarcharDescriptor();
1599
- const pgVarcharColumn = (params = {}) => column(pgVarcharDescriptor.factory(params), pgVarcharDescriptor.codecId, params, "character varying");
1600
- var PgIntDescriptor = class extends PostgresCodecDescriptor {
1601
- nativeType() {
1602
- return PG_INT_NATIVE_TYPE;
1603
- }
1604
- jsonProjection(expression) {
1605
- return expression;
1606
- }
1607
- codecId = PG_INT_CODEC_ID;
1608
- targetTypes = ["int4"];
1609
- traits = sqlIntDescriptor.traits;
1610
- paramsSchema = sqlIntDescriptor.paramsSchema;
1611
- renderValueLiteral(value) {
1612
- return renderTsLiteral(value);
1613
- }
1614
- factory() {
1615
- return () => new SqlIntCodec(this);
1616
- }
1617
- };
1618
- const pgIntDescriptor = new PgIntDescriptor();
1619
- const pgIntColumn = () => column(pgIntDescriptor.factory(), pgIntDescriptor.codecId, void 0, "int4");
1620
- var PgFloatDescriptor = class extends PostgresCodecDescriptor {
1621
- nativeType() {
1622
- return PG_FLOAT_NATIVE_TYPE;
1623
- }
1624
- jsonProjection(expression) {
1625
- return expression;
1626
- }
1627
- codecId = PG_FLOAT_CODEC_ID;
1628
- targetTypes = ["float8"];
1629
- traits = sqlFloatDescriptor.traits;
1630
- paramsSchema = sqlFloatDescriptor.paramsSchema;
1631
- renderValueLiteral(value) {
1632
- return renderTsLiteral(value);
1633
- }
1634
- factory() {
1635
- return () => new SqlFloatCodec(this);
1636
- }
1637
- };
1638
- const pgFloatDescriptor = new PgFloatDescriptor();
1639
- const pgFloatColumn = () => column(pgFloatDescriptor.factory(), pgFloatDescriptor.codecId, void 0, "float8");
1640
- const codecDescriptors = definePostgresCodecs([
1641
- postgresSqlCharDescriptor,
1642
- postgresSqlVarcharDescriptor,
1643
- postgresSqlIntDescriptor,
1644
- postgresSqlFloatDescriptor,
1645
- postgresSqlTextDescriptor,
1646
- postgresSqlTimestampDescriptor,
1647
- pgTextDescriptor,
1648
- pgEnumDescriptor,
1649
- pgCharDescriptor,
1650
- pgVarcharDescriptor,
1651
- pgIntDescriptor,
1652
- pgFloatDescriptor,
1653
- pgInt4Descriptor,
1654
- pgInt2Descriptor,
1655
- pgInt8Descriptor,
1656
- pgInt8NumberDescriptor,
1657
- pgFloat4Descriptor,
1658
- pgFloat8Descriptor,
1659
- pgNumericDescriptor,
1660
- pgUnboundedIntDescriptor,
1661
- pgDateDescriptor,
1662
- pgTimestampDescriptor,
1663
- pgTimestamptzDescriptor,
1664
- pgTimeDescriptor,
1665
- pgTimetzDescriptor,
1666
- pgBoolDescriptor,
1667
- pgBitDescriptor,
1668
- pgVarbitDescriptor,
1669
- pgByteaDescriptor,
1670
- pgUuidDescriptor,
1671
- pgInetDescriptor,
1672
- pgIntervalDescriptor,
1673
- pgJsonDescriptor,
1674
- pgJsonbDescriptor,
1675
- pgTextArrayDescriptor
1676
- ]);
1677
- //#endregion
1678
- export { postgresQualifyColumnType as A, pgTimestampColumn as C, pgUuidColumn as D, pgUnboundedIntColumn as E, pgVarbitColumn as O, pgTimeColumn as S, pgTimetzColumn as T, pgIntervalColumn as _, pgCharColumn as a, pgNumericColumn as b, pgFloat4Column as c, pgInetColumn as d, pgInt2Column as f, pgIntColumn as g, pgInt8NumberColumn as h, pgBoolColumn as i, pgVarcharColumn as k, pgFloat8Column as l, pgInt8Column as m, isPgEnumParams as n, pgDateColumn as o, pgInt4Column as p, pgBitColumn as r, pgEnumDescriptor as s, codecDescriptors as t, pgFloatColumn as u, pgJsonColumn as v, pgTimestamptzColumn as w, pgTextColumn as x, pgJsonbColumn as y };
1679
-
1680
- //# sourceMappingURL=codecs-BmPCJWqb-DveZGJvm.mjs.map