@prisma/orm-target-postgres 8.0.0-rc.18-dev.16 → 8.0.0-rc.18-dev.18

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 (215) hide show
  1. package/dist/{adapter-BiuJIKUc.d.mts → adapter-BBw3Q5WW.d.mts} +12 -12
  2. package/dist/{adapter-BiuJIKUc.d.mts.map → adapter-BBw3Q5WW.d.mts.map} +1 -1
  3. package/dist/{adapter-HQtZIZ2r-kQG81kJ1.mjs → adapter-C2XsLnXe-DLYvtWWr.mjs} +6 -6
  4. package/dist/{adapter-HQtZIZ2r-kQG81kJ1.mjs.map → adapter-C2XsLnXe-DLYvtWWr.mjs.map} +1 -1
  5. package/dist/adapter.d.mts +8 -9
  6. package/dist/adapter.mjs +5 -6
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__control.d.mts +3 -4
  10. package/dist/adapter__control.mjs +6 -7
  11. package/dist/adapter__control.mjs.map +1 -1
  12. package/dist/adapter__runtime.d.mts +1 -1
  13. package/dist/adapter__runtime.mjs +4 -4
  14. package/dist/adapter__runtime.mjs.map +1 -1
  15. package/dist/adapter__sql-renderer.d.mts +1 -1
  16. package/dist/adapter__sql-renderer.mjs +1 -1
  17. package/dist/adapter__types.d.mts +3 -3
  18. package/dist/{aggregates-BNxcV7HS.d.mts → aggregates-D2J3oSFz.d.mts} +10 -10
  19. package/dist/{aggregates-BNxcV7HS.d.mts.map → aggregates-D2J3oSFz.d.mts.map} +1 -1
  20. package/dist/{aggregates-Brwk0sYS.mjs → aggregates-DHIDeR2f.mjs} +3 -3
  21. package/dist/{aggregates-Brwk0sYS.mjs.map → aggregates-DHIDeR2f.mjs.map} +1 -1
  22. package/dist/{authoring-BPkERq95-SR5fDsa_.mjs → authoring-DAorKc0L-DpWukVxn.mjs} +8 -8
  23. package/dist/authoring-DAorKc0L-DpWukVxn.mjs.map +1 -0
  24. package/dist/{autoincrement-widths-D_WhWVXx-D6BupdY2.mjs → autoincrement-widths-BLCRgB3t-BWl20PCZ.mjs} +3 -3
  25. package/dist/{autoincrement-widths-D_WhWVXx-D6BupdY2.mjs.map → autoincrement-widths-BLCRgB3t-BWl20PCZ.mjs.map} +1 -1
  26. package/dist/codec-descriptor-BlMs1rkg.d.mts +1 -0
  27. package/dist/{codec-descriptor-DkeVTJ3N-XTfZgDGp.d.mts → codec-descriptor-Cbz5bbma-dxeoAwS2.d.mts} +4 -4
  28. package/dist/codec-descriptor-Cbz5bbma-dxeoAwS2.d.mts.map +1 -0
  29. package/dist/{codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs → codec-descriptor-DSMjoW72-ZoCcTHLX.mjs} +3 -4
  30. package/dist/codec-descriptor-DSMjoW72-ZoCcTHLX.mjs.map +1 -0
  31. package/dist/{codec-registry-DSRFjaLX-Dwg0yBK7.mjs → codec-registry-pg69n-o5-D8K3p40k.mjs} +5 -5
  32. package/dist/{codec-registry-DSRFjaLX-Dwg0yBK7.mjs.map → codec-registry-pg69n-o5-D8K3p40k.mjs.map} +1 -1
  33. package/dist/{codec-type-map-BznmYkRz-QD11Yx27.d.mts → codec-type-map-eTeOtvJB-c3tjqXBa.d.mts} +4 -4
  34. package/dist/{codec-type-map-BznmYkRz-QD11Yx27.d.mts.map → codec-type-map-eTeOtvJB-c3tjqXBa.d.mts.map} +1 -1
  35. package/dist/{codec-types-BZXuhZ1c-B9YQf_UN.d.mts → codec-types-Cf0IZ0WQ-CMVP-ecb.d.mts} +4 -4
  36. package/dist/{codec-types-BZXuhZ1c-B9YQf_UN.d.mts.map → codec-types-Cf0IZ0WQ-CMVP-ecb.d.mts.map} +1 -1
  37. package/dist/codec-types-o-BM2rPP.d.mts +2 -0
  38. package/dist/{codecs-BChKdFcD.d.mts → codecs-B-8uGsxq.d.mts} +3 -3
  39. package/dist/{codecs-BChKdFcD.d.mts.map → codecs-B-8uGsxq.d.mts.map} +1 -1
  40. package/dist/{codecs-CQaKsvhH-X9bscCr9.mjs → codecs-CaWZPjFi-hllqyGdW.mjs} +605 -574
  41. package/dist/codecs-CaWZPjFi-hllqyGdW.mjs.map +1 -0
  42. package/dist/{codecs-CCzJelD2-bt89qO8s.d.mts → codecs-DanVXZ_F-D1_8_x3j.d.mts} +150 -169
  43. package/dist/codecs-DanVXZ_F-D1_8_x3j.d.mts.map +1 -0
  44. package/dist/{contract-contributions-DC-ACLe5-BtAuL8oB.mjs → contract-contributions-C8XjOBIq-BuK0mnF9.mjs} +55 -40
  45. package/dist/contract-contributions-C8XjOBIq-BuK0mnF9.mjs.map +1 -0
  46. package/dist/{control-Bs7Il_Ju.mjs → control--DStfvkM.mjs} +17 -14
  47. package/dist/control--DStfvkM.mjs.map +1 -0
  48. package/dist/{control-B0dyj3WB.d.mts → control-Co7_lX4j.d.mts} +2 -11
  49. package/dist/control-Co7_lX4j.d.mts.map +1 -0
  50. package/dist/{control-B6nnypMh.d.mts → control-Mc7bM0Ho.d.mts} +4 -14
  51. package/dist/control-Mc7bM0Ho.d.mts.map +1 -0
  52. package/dist/{control-policy-CQ8hGDrk-jyie0S2j.mjs → control-policy-DrK_x_Qd-BcT8Z5TM.mjs} +13 -30
  53. package/dist/control-policy-DrK_x_Qd-BcT8Z5TM.mjs.map +1 -0
  54. package/dist/{data-type-entries-MxmSzT8p-D8CgbLxS.mjs → data-type-entries-DECnlc43-BYnGiJLy.mjs} +30 -3
  55. package/dist/data-type-entries-DECnlc43-BYnGiJLy.mjs.map +1 -0
  56. package/dist/data-types-BIvSDTYw-AK5Is74Z.mjs +961 -0
  57. package/dist/data-types-BIvSDTYw-AK5Is74Z.mjs.map +1 -0
  58. package/dist/{data-types-BDkZIUMI.d.mts → data-types-BkFfMhgz.d.mts} +10 -16
  59. package/dist/{data-types-BDkZIUMI.d.mts.map → data-types-BkFfMhgz.d.mts.map} +1 -1
  60. package/dist/default-normalizer-BqFHmlox-CP8ywN-r.mjs +313 -0
  61. package/dist/default-normalizer-BqFHmlox-CP8ywN-r.mjs.map +1 -0
  62. package/dist/default-normalizer-CTAiFe9Y.d.mts +25 -0
  63. package/dist/default-normalizer-CTAiFe9Y.d.mts.map +1 -0
  64. package/dist/{descriptor-meta-CqUL_be_-BkT3aEIm.mjs → descriptor-meta-CNFvhRlG-8_vCDF2W.mjs} +6 -6
  65. package/dist/{descriptor-meta-CqUL_be_-BkT3aEIm.mjs.map → descriptor-meta-CNFvhRlG-8_vCDF2W.mjs.map} +1 -1
  66. package/dist/{descriptor-meta-DzC2NwDh-C_D6wtZj.mjs → descriptor-meta-_qLKFkLd-Cb4H-vZf.mjs} +4 -4
  67. package/dist/{descriptor-meta-DzC2NwDh-C_D6wtZj.mjs.map → descriptor-meta-_qLKFkLd-Cb4H-vZf.mjs.map} +1 -1
  68. package/dist/{descriptor-meta-runtime-CpGl9XzU-CZHs_TNl.mjs → descriptor-meta-runtime-BKtwKsDm-BirZ12T5.mjs} +3 -3
  69. package/dist/{descriptor-meta-runtime-CpGl9XzU-CZHs_TNl.mjs.map → descriptor-meta-runtime-BKtwKsDm-BirZ12T5.mjs.map} +1 -1
  70. package/dist/{diff-database-schema-BKkcK7s--BxbpuwVf.mjs → diff-database-schema-C6fmfclD-Dqn9QqOO.mjs} +4 -4
  71. package/dist/{diff-database-schema-BKkcK7s--BxbpuwVf.mjs.map → diff-database-schema-C6fmfclD-Dqn9QqOO.mjs.map} +1 -1
  72. package/dist/{full-text-DzMPXaCj.d.mts → full-text-Ht1M3vH4.d.mts} +3 -3
  73. package/dist/{full-text-DzMPXaCj.d.mts.map → full-text-Ht1M3vH4.d.mts.map} +1 -1
  74. package/dist/{full-text-collection-method-B9e_oZFf-dyzLx5i6.d.mts → full-text-collection-method-Dye6N2u5-DGPEZRTD.d.mts} +4 -4
  75. package/dist/full-text-collection-method-Dye6N2u5-DGPEZRTD.d.mts.map +1 -0
  76. package/dist/{infer-psl-contract-DgOUfqJq-At4pgf6x.mjs → infer-psl-contract-hJUt-dtW-iwec11iw.mjs} +160 -56
  77. package/dist/infer-psl-contract-hJUt-dtW-iwec11iw.mjs.map +1 -0
  78. package/dist/{issue-planner-DDhlcfH2.d.mts → issue-planner-B3E9yChD.d.mts} +2 -2
  79. package/dist/{issue-planner-DDhlcfH2.d.mts.map → issue-planner-B3E9yChD.d.mts.map} +1 -1
  80. package/dist/migration-CbOh59ZJ.mjs.map +1 -1
  81. package/dist/{migration-DdE7N4ne.d.mts → migration-cGzKlTv0.d.mts} +2 -2
  82. package/dist/{migration-DdE7N4ne.d.mts.map → migration-cGzKlTv0.d.mts.map} +1 -1
  83. package/dist/{op-factory-call-BCBPUVFr-CW8l_JKw.mjs → op-factory-call-DJz5P0h1-Cs7DC10N.mjs} +4 -4
  84. package/dist/{op-factory-call-BCBPUVFr-CW8l_JKw.mjs.map → op-factory-call-DJz5P0h1-Cs7DC10N.mjs.map} +1 -1
  85. package/dist/op-factory-call-uVDKZqw1.d.mts +1 -0
  86. package/dist/{op-factory-call-COYbR6tp-XukKl6qj.d.mts → op-factory-call-z5TKsamx-DDfPa57U.d.mts} +2 -2
  87. package/dist/{op-factory-call-COYbR6tp-XukKl6qj.d.mts.map → op-factory-call-z5TKsamx-DDfPa57U.d.mts.map} +1 -1
  88. package/dist/{operation-types-BAiYtHkM-BN_YTibJ.d.mts → operation-types--RnlMCZS-qXBhNS1Q.d.mts} +3 -3
  89. package/dist/{operation-types-BAiYtHkM-BN_YTibJ.d.mts.map → operation-types--RnlMCZS-qXBhNS1Q.d.mts.map} +1 -1
  90. package/dist/operation-types-Dfg-5VmM.d.mts +1 -0
  91. package/dist/{pack-4sJCj0w-.d.mts → pack-_zBIeh-3.d.mts} +4 -4
  92. package/dist/{pack-4sJCj0w-.d.mts.map → pack-_zBIeh-3.d.mts.map} +1 -1
  93. package/dist/{planner-Pcd2R46Y.d.mts → planner-BBGH1cAB.d.mts} +2 -2
  94. package/dist/{planner-Pcd2R46Y.d.mts.map → planner-BBGH1cAB.d.mts.map} +1 -1
  95. package/dist/planner-ddl-builders-Byw5BICu.d.mts +16 -0
  96. package/dist/planner-ddl-builders-Byw5BICu.d.mts.map +1 -0
  97. package/dist/planner-ddl-builders-D0r6cT4A-D9Wm1myF.mjs +29 -0
  98. package/dist/planner-ddl-builders-D0r6cT4A-D9Wm1myF.mjs.map +1 -0
  99. package/dist/{planner-RhYHAxZm-9qT-aXSU.mjs → planner-ewMcuoHd-DwCCA-Kc.mjs} +9 -8
  100. package/dist/planner-ewMcuoHd-DwCCA-Kc.mjs.map +1 -0
  101. package/dist/{planner-identity-values-DwvdO5iZ-C9_lmJx6.mjs → planner-identity-values-CWUHmsB9-CBQ00C_3.mjs} +3 -3
  102. package/dist/{planner-identity-values-DwvdO5iZ-C9_lmJx6.mjs.map → planner-identity-values-CWUHmsB9-CBQ00C_3.mjs.map} +1 -1
  103. package/dist/planner-produced-postgres-migration-D-ZcNy7h.d.mts +1 -0
  104. package/dist/{planner-produced-postgres-migration-B3b3MBKL-CxswQFN2.mjs → planner-produced-postgres-migration-Dy5zHiFB-BDpfjZD5.mjs} +4 -4
  105. package/dist/{planner-produced-postgres-migration-B3b3MBKL-CxswQFN2.mjs.map → planner-produced-postgres-migration-Dy5zHiFB-BDpfjZD5.mjs.map} +1 -1
  106. package/dist/{planner-produced-postgres-migration-eM7nl_4L-DSW4rLOj.d.mts → planner-produced-postgres-migration-sxhIP3Te-Cn3sD9zE.d.mts} +3 -3
  107. package/dist/planner-produced-postgres-migration-sxhIP3Te-Cn3sD9zE.d.mts.map +1 -0
  108. package/dist/{planner-sql-checks-BV2akIx8-l8qCWzYf.mjs → planner-sql-checks-D0w3Kt_G-Bh1Vlz0T.mjs} +5 -5
  109. package/dist/{planner-sql-checks-BV2akIx8-l8qCWzYf.mjs.map → planner-sql-checks-D0w3Kt_G-Bh1Vlz0T.mjs.map} +1 -1
  110. package/dist/{postgres-codec-traits-DOTVjmpT-B4f6Rkh7.mjs → postgres-codec-traits-DY-tFVjg-CjMZUKNx.mjs} +3 -3
  111. package/dist/{postgres-codec-traits-DOTVjmpT-B4f6Rkh7.mjs.map → postgres-codec-traits-DY-tFVjg-CjMZUKNx.mjs.map} +1 -1
  112. package/dist/{postgres-contract-view-Cei64xbt-BcDzLVah.mjs → postgres-contract-view-o6bwzfH6-D4jvq9PJ.mjs} +6 -6
  113. package/dist/{postgres-contract-view-Cei64xbt-BcDzLVah.mjs.map → postgres-contract-view-o6bwzfH6-D4jvq9PJ.mjs.map} +1 -1
  114. package/dist/{postgres-migration-D0TY1HnO-CXuyvNiq.d.mts → postgres-migration-D6_R3__I-rFg_i2gz.d.mts} +2 -2
  115. package/dist/{postgres-migration-D0TY1HnO-CXuyvNiq.d.mts.map → postgres-migration-D6_R3__I-rFg_i2gz.d.mts.map} +1 -1
  116. package/dist/{postgres-migration-Bj3MPD7z-Clk_A5s-.mjs → postgres-migration-Dtkb6eDn-CrButm3l.mjs} +14 -22
  117. package/dist/postgres-migration-Dtkb6eDn-CrButm3l.mjs.map +1 -0
  118. package/dist/{prisma7-binding-BwBQ58iZ.mjs → prisma7-binding-BsucflfD.mjs} +106 -87
  119. package/dist/prisma7-binding-BsucflfD.mjs.map +1 -0
  120. package/dist/{prisma7-binding-LcYpTBjP.d.mts → prisma7-binding-DGp7Ea38.d.mts} +24 -15
  121. package/dist/prisma7-binding-DGp7Ea38.d.mts.map +1 -0
  122. package/dist/{render-ops-TAy4wxZ8-FnL41Aq3.mjs → render-ops-Db7MhDM0-DsIQjmcY.mjs} +3 -3
  123. package/dist/{render-ops-TAy4wxZ8-FnL41Aq3.mjs.map → render-ops-Db7MhDM0-DsIQjmcY.mjs.map} +1 -1
  124. package/dist/{runtime-CNTEAZIz.d.mts → runtime-CXQ7Xh-G.d.mts} +2 -2
  125. package/dist/{runtime-CNTEAZIz.d.mts.map → runtime-CXQ7Xh-G.d.mts.map} +1 -1
  126. package/dist/{runtime-C1HMiDVY.d.mts → runtime-CmUxJgD8.d.mts} +2 -2
  127. package/dist/{runtime-C1HMiDVY.d.mts.map → runtime-CmUxJgD8.d.mts.map} +1 -1
  128. package/dist/{sql-renderer-Q8LMpTcq-CliGmy0r.mjs → sql-renderer-CD5aYQos-nO-jTG1T.mjs} +5 -4
  129. package/dist/sql-renderer-CD5aYQos-nO-jTG1T.mjs.map +1 -0
  130. package/dist/{sql-renderer-hQ3HTY-B.d.mts → sql-renderer-dk7d0cK0.d.mts} +4 -4
  131. package/dist/{sql-renderer-hQ3HTY-B.d.mts.map → sql-renderer-dk7d0cK0.d.mts.map} +1 -1
  132. package/dist/target.d.mts +27 -27
  133. package/dist/target.mjs +23 -24
  134. package/dist/target__aggregates.d.mts +1 -1
  135. package/dist/target__aggregates.mjs +1 -1
  136. package/dist/target__codec-descriptor.d.mts +2 -2
  137. package/dist/target__codec-descriptor.mjs +1 -1
  138. package/dist/target__codec-types.d.mts +3 -3
  139. package/dist/target__codecs.d.mts +2 -2
  140. package/dist/target__codecs.mjs +2 -3
  141. package/dist/target__control.d.mts +2 -2
  142. package/dist/target__control.mjs +4 -5
  143. package/dist/target__data-types.d.mts +2 -2
  144. package/dist/target__data-types.mjs +3 -3
  145. package/dist/target__default-normalizer.d.mts +2 -2
  146. package/dist/target__default-normalizer.mjs +2 -2
  147. package/dist/target__diff-database-schema.mjs +1 -1
  148. package/dist/target__full-text-index-authoring.mjs +1 -1
  149. package/dist/target__full-text.d.mts +3 -3
  150. package/dist/target__issue-planner.d.mts +1 -1
  151. package/dist/target__issue-planner.mjs +1 -1
  152. package/dist/target__migration.d.mts +2 -2
  153. package/dist/target__migration.mjs +2 -2
  154. package/dist/target__op-factory-call.d.mts +2 -2
  155. package/dist/target__op-factory-call.mjs +1 -1
  156. package/dist/target__operation-types.d.mts +2 -2
  157. package/dist/target__pack.d.mts +2 -2
  158. package/dist/target__pack.mjs +1 -1
  159. package/dist/target__planner-ddl-builders.d.mts +2 -2
  160. package/dist/target__planner-ddl-builders.mjs +2 -2
  161. package/dist/target__planner-identity-values.mjs +1 -1
  162. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  163. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  164. package/dist/target__planner-sql-checks.mjs +1 -1
  165. package/dist/target__planner.d.mts +1 -1
  166. package/dist/target__planner.mjs +2 -2
  167. package/dist/target__prisma7-binding.d.mts +1 -1
  168. package/dist/target__prisma7-binding.mjs +1 -1
  169. package/dist/target__render-ops.mjs +1 -1
  170. package/dist/target__runtime.d.mts +2 -2
  171. package/dist/target__runtime.mjs +4 -4
  172. package/dist/target__runtime.mjs.map +1 -1
  173. package/dist/{types-D6lgKhE5-DYkeCAjr.d.mts → types-D6lgKhE5-CjLf9QtO.d.mts} +5 -5
  174. package/dist/{types-D6lgKhE5-DYkeCAjr.d.mts.map → types-D6lgKhE5-CjLf9QtO.d.mts.map} +1 -1
  175. package/dist/types-xDgmVoc4.d.mts +2 -0
  176. package/package.json +9 -9
  177. package/dist/authoring-BPkERq95-SR5fDsa_.mjs.map +0 -1
  178. package/dist/codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs.map +0 -1
  179. package/dist/codec-descriptor-DAQDOwCJ.d.mts +0 -1
  180. package/dist/codec-descriptor-DkeVTJ3N-XTfZgDGp.d.mts.map +0 -1
  181. package/dist/codec-helpers-IfGdyCFt-ihgFCc7D.mjs +0 -571
  182. package/dist/codec-helpers-IfGdyCFt-ihgFCc7D.mjs.map +0 -1
  183. package/dist/codec-types-ZfL8TSVm.d.mts +0 -2
  184. package/dist/codecs-CCzJelD2-bt89qO8s.d.mts.map +0 -1
  185. package/dist/codecs-CQaKsvhH-X9bscCr9.mjs.map +0 -1
  186. package/dist/contract-contributions-DC-ACLe5-BtAuL8oB.mjs.map +0 -1
  187. package/dist/control-B0dyj3WB.d.mts.map +0 -1
  188. package/dist/control-B6nnypMh.d.mts.map +0 -1
  189. package/dist/control-Bs7Il_Ju.mjs.map +0 -1
  190. package/dist/control-policy-CQ8hGDrk-jyie0S2j.mjs.map +0 -1
  191. package/dist/data-type-entries-MxmSzT8p-D8CgbLxS.mjs.map +0 -1
  192. package/dist/data-types-DnIWGq_1-DTMjYG8M.mjs +0 -375
  193. package/dist/data-types-DnIWGq_1-DTMjYG8M.mjs.map +0 -1
  194. package/dist/default-normalizer-BnxtqsRm-CDjZe4vK.mjs +0 -510
  195. package/dist/default-normalizer-BnxtqsRm-CDjZe4vK.mjs.map +0 -1
  196. package/dist/default-normalizer-ZZ7Y5boE.d.mts +0 -31
  197. package/dist/default-normalizer-ZZ7Y5boE.d.mts.map +0 -1
  198. package/dist/full-text-collection-method-B9e_oZFf-dyzLx5i6.d.mts.map +0 -1
  199. package/dist/infer-psl-contract-DgOUfqJq-At4pgf6x.mjs.map +0 -1
  200. package/dist/list-decoder-DXee1orj-K3y-hxiI.mjs +0 -22
  201. package/dist/list-decoder-DXee1orj-K3y-hxiI.mjs.map +0 -1
  202. package/dist/op-factory-call-B58Fw5Rz.d.mts +0 -1
  203. package/dist/operation-types-CScw-diG.d.mts +0 -1
  204. package/dist/planner-RhYHAxZm-9qT-aXSU.mjs.map +0 -1
  205. package/dist/planner-ddl-builders-BBQC5ET6.d.mts +0 -38
  206. package/dist/planner-ddl-builders-BBQC5ET6.d.mts.map +0 -1
  207. package/dist/planner-ddl-builders-oCsZMJ3b-BTMfg1YV.mjs +0 -91
  208. package/dist/planner-ddl-builders-oCsZMJ3b-BTMfg1YV.mjs.map +0 -1
  209. package/dist/planner-produced-postgres-migration-DiBkh1Tj.d.mts +0 -1
  210. package/dist/planner-produced-postgres-migration-eM7nl_4L-DSW4rLOj.d.mts.map +0 -1
  211. package/dist/postgres-migration-Bj3MPD7z-Clk_A5s-.mjs.map +0 -1
  212. package/dist/prisma7-binding-BwBQ58iZ.mjs.map +0 -1
  213. package/dist/prisma7-binding-LcYpTBjP.d.mts.map +0 -1
  214. package/dist/sql-renderer-Q8LMpTcq-CliGmy0r.mjs.map +0 -1
  215. package/dist/types-DIUPMK41.d.mts +0 -2
@@ -1,571 +0,0 @@
1
- import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
2
- import { structuredError } from "@prisma/orm-framework/utils/structured-error";
3
- import { SAFE_INTEGER_BIGINT_RANGE, decodeJsonIntegerText, decodeJsonMatching } from "@prisma/orm-framework/components/codec";
4
- import { numeralText } from "@prisma/orm-family-sql/contract/data-type";
5
- import { withoutTrailing } from "@prisma/orm-framework/utils/text";
6
- //#region ../../../3-targets/3-targets/postgres/dist/codec-helpers-IfGdyCFt.mjs
7
- const DIGIT = /^[0-9]$/;
8
- const HEX_DIGIT = /^[0-9a-fA-F]$/;
9
- const isDigit = (ch) => ch !== void 0 && DIGIT.test(ch);
10
- /**
11
- * Text PostgreSQL reads as an `inet` value, written the way PostgreSQL prints it: an IPv4 address in
12
- * four decimal octets, an IPv6 address in lower-case hex with its longest run of zero groups written
13
- * `::`, and the prefix length only when it is shorter than the whole address. `undefined` for text
14
- * PostgreSQL does not read as an `inet` value.
15
- */
16
- function canonicalInet(text) {
17
- if (text.includes(":")) {
18
- const value = readIpv6(text);
19
- return value === void 0 ? void 0 : printIpv6(value);
20
- }
21
- const value = readIpv4(text);
22
- return value === void 0 ? void 0 : printIpv4(value);
23
- }
24
- /**
25
- * PostgreSQL's `inet_net_pton_ipv4`: one to four decimal octets, each up to 255 and leading zeros
26
- * allowed, then an optional `/` and prefix length up to 32. Without a prefix length all four octets
27
- * are required; with one, the octets written must cover it.
28
- */
29
- function readIpv4(text) {
30
- const octets = [];
31
- let index = 0;
32
- let ch = text[index++];
33
- while (isDigit(ch)) {
34
- let octet = 0;
35
- do {
36
- octet = octet * 10 + Number(ch);
37
- if (octet > 255) return void 0;
38
- ch = text[index++];
39
- } while (isDigit(ch));
40
- if (octets.length === 4) return void 0;
41
- octets.push(octet);
42
- if (ch === void 0 || ch === "/") break;
43
- if (ch !== ".") return void 0;
44
- ch = text[index++];
45
- }
46
- let bits = -1;
47
- if (ch === "/" && isDigit(text[index]) && octets.length > 0) {
48
- ch = text[index++];
49
- bits = 0;
50
- do {
51
- bits = bits * 10 + Number(ch);
52
- ch = text[index++];
53
- } while (isDigit(ch));
54
- if (ch !== void 0 || bits > 32) return void 0;
55
- }
56
- if (ch !== void 0) return void 0;
57
- if (bits === -1) {
58
- if (octets.length !== 4) return void 0;
59
- bits = 32;
60
- }
61
- if (octets.length === 0 || Math.floor(bits / 8) > octets.length) return void 0;
62
- return {
63
- bytes: [
64
- ...octets,
65
- 0,
66
- 0,
67
- 0,
68
- 0
69
- ].slice(0, 4),
70
- bits
71
- };
72
- }
73
- /** PostgreSQL's `getbits`: a prefix length up to 128, with no leading zero. */
74
- function readBits(text) {
75
- let bits = 0;
76
- let digits = 0;
77
- for (const ch of text) {
78
- if (!isDigit(ch)) return void 0;
79
- if (digits++ !== 0 && bits === 0) return void 0;
80
- bits = bits * 10 + Number(ch);
81
- if (bits > 128) return void 0;
82
- }
83
- return digits === 0 ? void 0 : bits;
84
- }
85
- /**
86
- * PostgreSQL's `getv4`, for the IPv4 tail of an IPv6 address: up to four decimal octets with no
87
- * leading zeros, and an optional prefix length. Octets left out are zero.
88
- */
89
- function readIpv4Tail(text) {
90
- const octets = [];
91
- let octet = 0;
92
- let digits = 0;
93
- for (const [index, ch] of [...text].entries()) {
94
- if (isDigit(ch)) {
95
- if (digits++ !== 0 && octet === 0) return void 0;
96
- octet = octet * 10 + Number(ch);
97
- if (octet > 255) return void 0;
98
- continue;
99
- }
100
- if (ch !== "." && ch !== "/") return void 0;
101
- if (octets.length > 3) return void 0;
102
- octets.push(octet);
103
- if (ch === "/") {
104
- const bits = readBits(text.slice(index + 1));
105
- return bits === void 0 ? void 0 : {
106
- octets,
107
- bits
108
- };
109
- }
110
- octet = 0;
111
- digits = 0;
112
- }
113
- if (digits === 0 || octets.length > 3) return void 0;
114
- return {
115
- octets: [...octets, octet],
116
- bits: void 0
117
- };
118
- }
119
- /**
120
- * PostgreSQL's `inet_cidr_pton_ipv6`: up to eight groups of one to four hex digits in either case,
121
- * one `::` standing for a run of zero groups, an optional IPv4 tail, and an optional prefix length.
122
- */
123
- function readIpv6(text) {
124
- const bytes = new Array(16).fill(0);
125
- let filled = 0;
126
- let compressedAt;
127
- let index = 0;
128
- if (text[0] === ":") {
129
- if (text[1] !== ":") return void 0;
130
- index = 1;
131
- }
132
- let tokenStart = index;
133
- let sawHexDigit = false;
134
- let group = 0;
135
- let groupDigits = 0;
136
- let bits = 128;
137
- while (index < text.length) {
138
- const ch = text[index++] ?? "";
139
- if (HEX_DIGIT.test(ch)) {
140
- group = group << 4 | Number.parseInt(ch, 16);
141
- if (++groupDigits > 4) return void 0;
142
- sawHexDigit = true;
143
- continue;
144
- }
145
- if (ch === ":") {
146
- tokenStart = index;
147
- if (!sawHexDigit) {
148
- if (compressedAt !== void 0) return void 0;
149
- compressedAt = filled;
150
- continue;
151
- }
152
- if (index >= text.length || filled + 2 > 16) return void 0;
153
- bytes[filled++] = group >> 8;
154
- bytes[filled++] = group & 255;
155
- sawHexDigit = false;
156
- group = 0;
157
- groupDigits = 0;
158
- continue;
159
- }
160
- if (ch === "." && filled + 4 <= 16) {
161
- const tail = readIpv4Tail(text.slice(tokenStart));
162
- if (tail !== void 0) {
163
- tail.octets.forEach((octet, offset) => {
164
- bytes[filled + offset] = octet;
165
- });
166
- filled += 4;
167
- sawHexDigit = false;
168
- bits = tail.bits ?? bits;
169
- break;
170
- }
171
- }
172
- if (ch === "/") {
173
- const prefix = readBits(text.slice(index));
174
- if (prefix !== void 0) {
175
- bits = prefix;
176
- break;
177
- }
178
- }
179
- return;
180
- }
181
- if (sawHexDigit) {
182
- if (filled + 2 > 16) return void 0;
183
- bytes[filled++] = group >> 8;
184
- bytes[filled++] = group & 255;
185
- }
186
- if (compressedAt !== void 0) {
187
- if (filled === 16) return void 0;
188
- const shifted = bytes.slice(compressedAt, filled);
189
- bytes.fill(0, compressedAt, filled);
190
- bytes.splice(16 - shifted.length, shifted.length, ...shifted);
191
- filled = 16;
192
- }
193
- return filled === 16 ? {
194
- bytes,
195
- bits
196
- } : void 0;
197
- }
198
- function printIpv4({ bytes, bits }) {
199
- const address = bytes.join(".");
200
- return bits === 32 ? address : `${address}/${bits}`;
201
- }
202
- /**
203
- * PostgreSQL's `inet_net_ntop_ipv6`: the first longest run of two or more zero groups is written
204
- * `::`, and an address whose first five groups are zero followed by `ffff`, or whose first six are
205
- * zero, ends in dotted IPv4.
206
- */
207
- function printIpv6({ bytes, bits }) {
208
- const groups = Array.from({ length: 8 }, (_, i) => (bytes[2 * i] ?? 0) << 8 | (bytes[2 * i + 1] ?? 0));
209
- const zeroRun = longestZeroRun(groups);
210
- let text = "";
211
- for (let i = 0; i < 8; i++) {
212
- if (zeroRun !== void 0 && i >= zeroRun.start && i < zeroRun.start + zeroRun.length) {
213
- if (i === zeroRun.start) text += ":";
214
- continue;
215
- }
216
- if (i !== 0) text += ":";
217
- if (i === 6 && zeroRun?.start === 0 && (zeroRun.length === 6 || zeroRun.length === 5 && groups[5] === 65535)) {
218
- text += bytes.slice(12).join(".");
219
- break;
220
- }
221
- text += (groups[i] ?? 0).toString(16);
222
- }
223
- if (zeroRun !== void 0 && zeroRun.start + zeroRun.length === 8) text += ":";
224
- return bits === 128 ? text : `${text}/${bits}`;
225
- }
226
- function longestZeroRun(groups) {
227
- let best;
228
- let current;
229
- for (const [i, group] of groups.entries()) {
230
- if (group === 0) {
231
- current = current === void 0 ? {
232
- start: i,
233
- length: 1
234
- } : {
235
- ...current,
236
- length: current.length + 1
237
- };
238
- continue;
239
- }
240
- if (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;
241
- current = void 0;
242
- }
243
- if (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;
244
- return best !== void 0 && best.length >= 2 ? best : void 0;
245
- }
246
- /**
247
- * Whether text fits `length` characters, counted as PostgreSQL counts them: code points. A `character` value is padded with spaces, and spaces past its length are dropped, so they do not count.
248
- */
249
- function fitsCharacterLength(text, length, blankPadded) {
250
- const significant = blankPadded ? withoutTrailing(text, " ") : text;
251
- return significant.length <= length || [...significant].length <= length;
252
- }
253
- /** The uuid input PostgreSQL reads: 32 hex digits in either case, a hyphen allowed after any group of four but the last, and the whole optionally in braces. */
254
- const UUID_INPUT = /^(?:\{[0-9a-f]{4}(?:-?[0-9a-f]{4}){7}\}|[0-9a-f]{4}(?:-?[0-9a-f]{4}){7})$/i;
255
- /** A UUID as PostgreSQL writes it: lower case, hyphenated 8-4-4-4-12. */
256
- const CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
257
- /**
258
- * Text in any form PostgreSQL reads as a UUID (either case, a hyphen after any group of four digits, optionally in braces), written the way PostgreSQL writes it; `undefined` for text it does not read as one.
259
- */
260
- function canonicalUuid(text) {
261
- if (!UUID_INPUT.test(text)) return void 0;
262
- const hex = text.replace(/[{}-]/g, "").toLowerCase();
263
- return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
264
- }
265
- /** The largest finite float4. */
266
- const FLOAT4_MAX = 34028234663852886e22;
267
- /** Whether float4 holds a finite number: it neither overflows to an infinity nor rounds to 0, both of which PostgreSQL refuses. */
268
- function fitsFloat4(value) {
269
- const single = Math.fround(value);
270
- return Number.isFinite(single) && (value === 0 || single !== 0);
271
- }
272
- /**
273
- * A `numeric` value as its canonical decimal text. A number is written out without an exponent,
274
- * because `numeric` text has no exponent syntax and `encodeJson` refuses one.
275
- */
276
- const pgNumericDecode = (wire) => {
277
- if (typeof wire === "number") return numeralText(wire);
278
- return wire;
279
- };
280
- const DECIMAL_INTEGER = /^-?\d+$/;
281
- /**
282
- * Requires an application value to be of the JS type the codec reads.
283
- *
284
- * A range check reads a value of the wrong type as a value out of range, and
285
- * reports a number plainly inside the range as outside it — so the type is
286
- * established first and answered for on its own terms, naming what a caller
287
- * has to change.
288
- */
289
- const requireJsType = (codecId, expected, value) => {
290
- if (typeof value === expected) return;
291
- throw postgresError("RUNTIME.ENCODE_FAILED", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {
292
- codecId,
293
- received: typeof value
294
- } });
295
- };
296
- /** Writes a `bigint` application value as the decimal text the wire form of the exact integer codecs carries. */
297
- const pgBigintEncode = (codecId, value) => {
298
- requireJsType(codecId, "bigint", value);
299
- return value.toString();
300
- };
301
- /**
302
- * Writes an application value as the decimal text these codecs carry as their
303
- * canonical JSON.
304
- *
305
- * A schema-written literal default (`BigInt @default(0)`) arrives here as a
306
- * `number`, since a number literal is the only integer a schema language
307
- * writes, and one that is a safe integer names its value exactly. Past that
308
- * range the literal was rounded before any of this ran, so the value written is
309
- * not the value meant — which this refuses rather than minting an exact-looking
310
- * total from it. A non-integral number is refused on the same terms.
311
- */
312
- const pgBigintEncodeJson = (codecId, value) => {
313
- if (typeof value !== "number") return pgBigintEncode(codecId, value);
314
- 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: {
315
- codecId,
316
- received: String(value)
317
- } });
318
- return BigInt(value).toString();
319
- };
320
- /**
321
- * Reads a wire or JSON value as a `bigint`, rejecting anything `BigInt()` would
322
- * misread. A number-typed wire value must also be a safe integer: past
323
- * ±(2^53 − 1) the driver's `number` has already rounded, so stringifying it
324
- * would mint a spuriously-exact `bigint` that need not equal the stored value.
325
- */
326
- const decimalIntegerDecode = (codecId, wire) => {
327
- if (typeof wire === "bigint") return wire;
328
- const text = String(wire);
329
- if (!DECIMAL_INTEGER.test(text)) throw postgresError("RUNTIME.DECODE_FAILED", `${codecId} value must be a decimal integer`, { meta: {
330
- codecId,
331
- received: text
332
- } });
333
- 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: {
334
- codecId,
335
- received: text
336
- } });
337
- return BigInt(text);
338
- };
339
- /** Reads an `int8` wire or JSON value as a `bigint`, rejecting anything `BigInt()` would misread. */
340
- const pgInt8Decode = (wire) => decimalIntegerDecode("pg/int8@1", wire);
341
- /**
342
- * Reads an unconstrained-`numeric` wire or JSON value as a `bigint`, rejecting
343
- * non-integral values — including `NaN` and the infinities, which are `numeric`
344
- * values but not integers.
345
- */
346
- const pgUnboundedIntDecode = (wire) => decimalIntegerDecode("pg/unboundedint@1", wire);
347
- /**
348
- * A SQL number literal has no form for `NaN` or the infinities; PostgreSQL reads and writes them as
349
- * the text `NaN`, `Infinity`, `-Infinity`, so the float codecs carry them as that text on the wire,
350
- * as `encodeJsonFloat` does in JSON.
351
- */
352
- const pgFloatEncode = (value) => Number.isFinite(value) ? value : String(value);
353
- /**
354
- * Requires an integer within ±(2^53 − 1), the range a JS `number` holds
355
- * exactly. The guard throws rather than rounding: past the boundary a `number`
356
- * silently loses digits, which is the failure mode this codec exists to refuse.
357
- */
358
- const pgInt8NumberGuard = (code, value) => {
359
- if (!Number.isSafeInteger(value)) throw postgresError(code, `pg/int8number@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
360
- codecId: "pg/int8number@1",
361
- received: String(value)
362
- } });
363
- return value;
364
- };
365
- const pgInt8NumberEncode = (value) => {
366
- requireJsType("pg/int8number@1", "number", value);
367
- return String(pgInt8NumberGuard("RUNTIME.ENCODE_FAILED", value));
368
- };
369
- const pgInt8NumberEncodeJson = (value) => pgInt8NumberEncode(value);
370
- /**
371
- * Reads an `int8` wire value as a `number`, throwing outside ±(2^53 − 1) and on
372
- * non-integral input. Decimal text goes through `BigInt` before the range check
373
- * so an out-of-range value is compared exactly rather than after rounding.
374
- */
375
- const pgInt8NumberDecode = (wire) => {
376
- if (typeof wire === "number") return pgInt8NumberGuard("RUNTIME.DECODE_FAILED", wire);
377
- const value = decimalIntegerDecode("pg/int8number@1", wire);
378
- if (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw postgresError("RUNTIME.DECODE_FAILED", `pg/int8number@1 value must be an integer within the safe integer range, got ${value}`, { meta: {
379
- codecId: "pg/int8number@1",
380
- received: value.toString()
381
- } });
382
- return Number(value);
383
- };
384
- const pgInt8NumberDecodeJson = (json) => Number(decodeJsonIntegerText("pg/int8number@1", json, SAFE_INTEGER_BIGINT_RANGE));
385
- /**
386
- * Renders a decimal-text default as a `bigint` literal, for the codecs whose
387
- * canonical JSON is decimal text while the application type is `bigint`
388
- * (`pg/int8@1`, `pg/unboundedint@1`) — a plain string literal would not
389
- * typecheck against the emitted column type.
390
- */
391
- const decimalTextBigintLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;
392
- /** Renders a float's stored number as a number literal. NaN and the infinities are stored as text and have no literal type, so they render nothing and the value set types as `number`. */
393
- const floatNumberLiteral = (value) => typeof value === "number" ? String(value) : void 0;
394
- /** Renders the decimal text of `pg/int8number@1`, whose application type is `number`, as a number literal. */
395
- const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
396
- const ISO_DURATION = /^P(?!$)(-?\d+Y)?(-?\d+M)?(-?\d+D)?(?:T(?!$)(-?\d+H)?(-?\d+M)?(-?\d+(?:\.\d+)?S)?)?$/;
397
- const MICROS_PER_SECOND = 1000000n;
398
- /**
399
- * Converts a fractional-seconds digit string to microseconds, rounding rather
400
- * than truncating past the sixth digit.
401
- *
402
- * PostgreSQL rounds: `INTERVAL '1.1234567 seconds'` is `1.123457`, and
403
- * `'1.9999999 seconds'` carries into `2`. Truncating here made the parsed value
404
- * disagree with the database for any input past microsecond resolution.
405
- *
406
- * Ties round toward positive infinity, matching `Math.round` on the sibling path
407
- * that reads the driver's component object — so the two agree. PostgreSQL's own
408
- * tie behaviour is unobservable, because it parses the literal into a double
409
- * first and an exact half never survives that.
410
- */
411
- const microsFromFraction = (fraction, negative) => {
412
- if (fraction === "") return 0n;
413
- const kept = BigInt(fraction.slice(0, 6).padEnd(6, "0"));
414
- const rest = fraction.slice(6).replace(/0+$/, "");
415
- if (rest === "") return kept;
416
- const half = rest[0] === "5" && rest.length === 1;
417
- return rest > "5" || half && !negative ? kept + 1n : kept;
418
- };
419
- const intervalFieldsOf = (text) => {
420
- const match = ISO_DURATION.exec(text);
421
- if (match === null) throw postgresError("RUNTIME.DECODE_FAILED", `pg/interval@1 value must be an ISO-8601 duration, got ${text}`, { meta: {
422
- codecId: "pg/interval@1",
423
- received: text
424
- } });
425
- const [, years, months, days, hours, minutes, seconds] = match;
426
- const wholeNumber = (part) => part === void 0 ? 0 : Number(part.slice(0, -1));
427
- const secondsLiteral = seconds === void 0 ? "0" : seconds.slice(0, -1);
428
- const negative = secondsLiteral.startsWith("-");
429
- const [whole = "0", fraction = ""] = secondsLiteral.replace("-", "").split(".");
430
- const magnitude = BigInt(whole) * MICROS_PER_SECOND + microsFromFraction(fraction, negative);
431
- return {
432
- months: wholeNumber(years) * 12 + wholeNumber(months),
433
- days: wholeNumber(days),
434
- micros: BigInt(wholeNumber(hours)) * 3600n * MICROS_PER_SECOND + BigInt(wholeNumber(minutes)) * 60n * MICROS_PER_SECOND + (negative ? -magnitude : magnitude)
435
- };
436
- };
437
- const secondsText = (micros) => {
438
- const sign = micros < 0n ? "-" : "";
439
- const magnitude = micros < 0n ? -micros : micros;
440
- const whole = magnitude / MICROS_PER_SECOND % 60n;
441
- const fraction = magnitude % MICROS_PER_SECOND;
442
- return `${sign}${whole}${fraction === 0n ? "" : `.${fraction.toString().padStart(6, "0").replace(/0+$/, "")}`}`;
443
- };
444
- /**
445
- * Renders {@link PgInterval} the way PostgreSQL spells an interval under
446
- * `IntervalStyle = 'iso_8601'`: zero components omitted, `T` present only when a
447
- * time component is, each component carrying its own sign, and an all-zero
448
- * interval written `PT0S`.
449
- */
450
- const formatIsoDuration = ({ months, days, micros }) => {
451
- const years = Math.trunc(months / 12);
452
- const restMonths = months % 12;
453
- const sign = micros < 0n ? "-" : "";
454
- const magnitude = micros < 0n ? -micros : micros;
455
- const hours = magnitude / (3600n * MICROS_PER_SECOND);
456
- const minutes = magnitude / (60n * MICROS_PER_SECOND) % 60n;
457
- const hasSeconds = magnitude % (60n * MICROS_PER_SECOND) !== 0n;
458
- const parts = [
459
- years === 0 ? "" : `${years}Y`,
460
- restMonths === 0 ? "" : `${restMonths}M`,
461
- days === 0 ? "" : `${days}D`
462
- ];
463
- const time = [
464
- hours === 0n ? "" : `${sign}${hours}H`,
465
- minutes === 0n ? "" : `${sign}${minutes}M`,
466
- hasSeconds ? `${secondsText(micros)}S` : ""
467
- ].join("");
468
- const rendered = `P${parts.join("")}${time === "" ? "" : `T${time}`}`;
469
- return rendered === "P" ? "PT0S" : rendered;
470
- };
471
- /**
472
- * An interval as PostgreSQL prints it under `IntervalStyle = 'postgres'`: `1 year 2 mons 3 days
473
- * 04:05:06.5`, `-1 years -2 mons +3 days -04:00:00`, `00:00:00`.
474
- */
475
- const POSTGRES_INTERVAL = /^(?:([+-]?\d+) years? ?)?(?:([+-]?\d+) mons? ?)?(?:([+-]?\d+) days? ?)?(?:([+-])?(\d+):(\d{2}):(\d{2})(?:\.(\d+))?)?$/;
476
- function postgresIntervalFields(text) {
477
- const match = POSTGRES_INTERVAL.exec(text);
478
- if (match === null || text === "" || text.endsWith(" ")) return void 0;
479
- const [, years = "0", months = "0", days = "0", sign, hours = "0", minutes = "0", seconds = "0"] = match;
480
- const fraction = match[8] ?? "";
481
- const magnitude = (BigInt(hours) * 3600n + BigInt(minutes) * 60n + BigInt(seconds)) * MICROS_PER_SECOND + microsFromFraction(fraction, sign === "-");
482
- return {
483
- months: Number(years) * 12 + Number(months),
484
- days: Number(days),
485
- micros: sign === "-" ? -magnitude : magnitude
486
- };
487
- }
488
- function intervalRefused(message) {
489
- throw structuredError("CONTRACT.CAST_REFUSED", message, {
490
- why: "pg/interval stores one canonical form for each interval (ADR 254), and reads ISO 8601 durations and the text PostgreSQL prints.",
491
- fix: "Write an ISO 8601 duration, as the message shows."
492
- });
493
- }
494
- /**
495
- * The canonical form of `pg/interval` (ADR 254), from an ISO 8601 duration or the text PostgreSQL
496
- * prints under `IntervalStyle = 'postgres'`.
497
- */
498
- function pgIntervalCanonical(text) {
499
- const fractionDigits = /\.(\d+)/.exec(text)?.[1]?.length ?? 0;
500
- if (fractionDigits > 6) intervalRefused(`"${text}" has ${fractionDigits} digits after the decimal point, but pg/interval holds microseconds, so at most 6. Round it, as in "PT1.123456S".`);
501
- if (ISO_DURATION.test(text)) return formatIsoDuration(intervalFieldsOf(text));
502
- const fields = postgresIntervalFields(text);
503
- if (fields === void 0) intervalRefused(`pg/interval cannot read "${text}". Write an ISO 8601 duration, as in "P1Y2M3DT4H5M6S".`);
504
- return formatIsoDuration(fields);
505
- }
506
- /** Renders the application value as its canonical ISO-8601 duration. */
507
- const pgIntervalToIso = (value) => formatIsoDuration(value);
508
- const pgIntervalEncodeJson = (value) => formatIsoDuration(value);
509
- const pgIntervalDecodeJson = (json) => intervalFieldsOf(decodeJsonMatching("pg/interval@1", json, ISO_DURATION, "an ISO-8601 duration"));
510
- const intervalTextFields = (text) => {
511
- if (ISO_DURATION.test(text)) return intervalFieldsOf(text);
512
- const fields = postgresIntervalFields(text);
513
- if (fields === void 0) throw postgresError("RUNTIME.DECODE_FAILED", `pg/interval@1 value must be an ISO-8601 duration or PostgreSQL interval text, got ${text}`, { meta: {
514
- codecId: "pg/interval@1",
515
- received: text
516
- } });
517
- return fields;
518
- };
519
- const pgIntervalDecode = (wire) => {
520
- if (typeof wire === "string") return intervalTextFields(wire);
521
- const part = (name) => {
522
- const raw = wire[name];
523
- return typeof raw === "number" ? raw : 0;
524
- };
525
- const seconds = part("seconds") + part("milliseconds") / 1e3;
526
- return {
527
- months: part("years") * 12 + part("months"),
528
- days: part("days"),
529
- micros: BigInt(part("hours")) * 3600n * MICROS_PER_SECOND + BigInt(part("minutes")) * 60n * MICROS_PER_SECOND + BigInt(Math.round(seconds * 1e6))
530
- };
531
- };
532
- const BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
533
- const pgByteaEncodeJson = (value) => Buffer.from(value).toString("base64");
534
- const pgByteaDecodeJson = (json) => new Uint8Array(Buffer.from(decodeJsonMatching("pg/bytea@1", json, BASE64_TEXT, "a base64 string"), "base64"));
535
- const BYTEA_TEXT = /^\\x(?:[0-9A-Fa-f]{2})*$/;
536
- const BYTEA_FORMS = String.raw`Write base64, as in "aGVsbG8=", or PostgreSQL hex, written "\\x68656c6c6f" in a PSL string.`;
537
- function byteaRefused(message) {
538
- throw structuredError("CONTRACT.CAST_REFUSED", message, {
539
- why: "pg/bytea stores its bytes as base64 (ADR 254), and reads base64 and the hex text PostgreSQL prints.",
540
- fix: BYTEA_FORMS
541
- });
542
- }
543
- /**
544
- * The canonical form of `pg/bytea` (ADR 254), the base64 its codec writes, from base64 or the hex
545
- * text PostgreSQL prints under `bytea_output = 'hex'`.
546
- */
547
- function pgByteaCanonical(text) {
548
- if (text.startsWith("\\x")) {
549
- if (!BYTEA_TEXT.test(text)) byteaRefused(`${JSON.stringify(text)} is not PostgreSQL hex, which has two hexadecimal digits for each byte. ${BYTEA_FORMS}`);
550
- return Buffer.from(text.slice(2), "hex").toString("base64");
551
- }
552
- if (!BASE64_TEXT.test(text)) byteaRefused(`pg/bytea cannot read ${JSON.stringify(text)}. Write base64 with its padding, as in "aGVsbG8=", or PostgreSQL hex, written "\\\\x68656c6c6f" in a PSL string.`);
553
- return Buffer.from(text, "base64").toString("base64");
554
- }
555
- const pgByteaDecodeWire = (wire) => {
556
- if (wire instanceof Uint8Array) return wire.constructor === Uint8Array ? wire : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength);
557
- if (!BYTEA_TEXT.test(wire)) throw postgresError("RUNTIME.DECODE_FAILED", "pg/bytea@1 wire value must be a bytea hex string or Uint8Array", { meta: {
558
- codecId: "pg/bytea@1",
559
- received: wire
560
- } });
561
- return new Uint8Array(Buffer.from(wire.slice(2), "hex"));
562
- };
563
- const parseJsonWire = JSON.parse;
564
- const pgJsonEncode = (value) => JSON.stringify(value);
565
- const pgJsonDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) : wire;
566
- const pgJsonbEncode = (value) => JSON.stringify(value);
567
- const pgJsonbDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) : wire;
568
- //#endregion
569
- export { pgJsonbEncode as A, pgIntervalDecode as C, pgJsonDecode as D, pgIntervalToIso as E, pgUnboundedIntDecode as M, pgJsonEncode as O, pgIntervalCanonical as S, pgIntervalEncodeJson as T, pgInt8Decode as _, decimalTextBigintLiteral as a, pgInt8NumberEncode as b, fitsFloat4 as c, pgBigintEncodeJson as d, pgByteaCanonical as f, pgFloatEncode as g, pgByteaEncodeJson as h, canonicalUuid as i, pgNumericDecode as j, pgJsonbDecode as k, floatNumberLiteral as l, pgByteaDecodeWire as m, FLOAT4_MAX as n, decimalTextNumberLiteral as o, pgByteaDecodeJson as p, canonicalInet as r, fitsCharacterLength as s, CANONICAL_UUID as t, pgBigintEncode as u, pgInt8NumberDecode as v, pgIntervalDecodeJson as w, pgInt8NumberEncodeJson as x, pgInt8NumberDecodeJson as y };
570
-
571
- //# sourceMappingURL=codec-helpers-IfGdyCFt-ihgFCc7D.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-helpers-IfGdyCFt-ihgFCc7D.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-helpers-IfGdyCFt.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { SAFE_INTEGER_BIGINT_RANGE, decodeJsonIntegerText, decodeJsonMatching } from \"@internal/framework-components/codec\";\nimport { withoutTrailing } from \"@internal/utils/text\";\n//#region src/core/canonical-inet.ts\nconst DIGIT = /^[0-9]$/;\nconst HEX_DIGIT = /^[0-9a-fA-F]$/;\nconst isDigit = (ch) => ch !== void 0 && DIGIT.test(ch);\n/**\n* Text PostgreSQL reads as an `inet` value, written the way PostgreSQL prints it: an IPv4 address in\n* four decimal octets, an IPv6 address in lower-case hex with its longest run of zero groups written\n* `::`, and the prefix length only when it is shorter than the whole address. `undefined` for text\n* PostgreSQL does not read as an `inet` value.\n*/\nfunction canonicalInet(text) {\n\tif (text.includes(\":\")) {\n\t\tconst value = readIpv6(text);\n\t\treturn value === void 0 ? void 0 : printIpv6(value);\n\t}\n\tconst value = readIpv4(text);\n\treturn value === void 0 ? void 0 : printIpv4(value);\n}\n/**\n* PostgreSQL's `inet_net_pton_ipv4`: one to four decimal octets, each up to 255 and leading zeros\n* allowed, then an optional `/` and prefix length up to 32. Without a prefix length all four octets\n* are required; with one, the octets written must cover it.\n*/\nfunction readIpv4(text) {\n\tconst octets = [];\n\tlet index = 0;\n\tlet ch = text[index++];\n\twhile (isDigit(ch)) {\n\t\tlet octet = 0;\n\t\tdo {\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (octets.length === 4) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === void 0 || ch === \"/\") break;\n\t\tif (ch !== \".\") return void 0;\n\t\tch = text[index++];\n\t}\n\tlet bits = -1;\n\tif (ch === \"/\" && isDigit(text[index]) && octets.length > 0) {\n\t\tch = text[index++];\n\t\tbits = 0;\n\t\tdo {\n\t\t\tbits = bits * 10 + Number(ch);\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (ch !== void 0 || bits > 32) return void 0;\n\t}\n\tif (ch !== void 0) return void 0;\n\tif (bits === -1) {\n\t\tif (octets.length !== 4) return void 0;\n\t\tbits = 32;\n\t}\n\tif (octets.length === 0 || Math.floor(bits / 8) > octets.length) return void 0;\n\treturn {\n\t\tbytes: [\n\t\t\t...octets,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t].slice(0, 4),\n\t\tbits\n\t};\n}\n/** PostgreSQL's `getbits`: a prefix length up to 128, with no leading zero. */\nfunction readBits(text) {\n\tlet bits = 0;\n\tlet digits = 0;\n\tfor (const ch of text) {\n\t\tif (!isDigit(ch)) return void 0;\n\t\tif (digits++ !== 0 && bits === 0) return void 0;\n\t\tbits = bits * 10 + Number(ch);\n\t\tif (bits > 128) return void 0;\n\t}\n\treturn digits === 0 ? void 0 : bits;\n}\n/**\n* PostgreSQL's `getv4`, for the IPv4 tail of an IPv6 address: up to four decimal octets with no\n* leading zeros, and an optional prefix length. Octets left out are zero.\n*/\nfunction readIpv4Tail(text) {\n\tconst octets = [];\n\tlet octet = 0;\n\tlet digits = 0;\n\tfor (const [index, ch] of [...text].entries()) {\n\t\tif (isDigit(ch)) {\n\t\t\tif (digits++ !== 0 && octet === 0) return void 0;\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch !== \".\" && ch !== \"/\") return void 0;\n\t\tif (octets.length > 3) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === \"/\") {\n\t\t\tconst bits = readBits(text.slice(index + 1));\n\t\t\treturn bits === void 0 ? void 0 : {\n\t\t\t\toctets,\n\t\t\t\tbits\n\t\t\t};\n\t\t}\n\t\toctet = 0;\n\t\tdigits = 0;\n\t}\n\tif (digits === 0 || octets.length > 3) return void 0;\n\treturn {\n\t\toctets: [...octets, octet],\n\t\tbits: void 0\n\t};\n}\n/**\n* PostgreSQL's `inet_cidr_pton_ipv6`: up to eight groups of one to four hex digits in either case,\n* one `::` standing for a run of zero groups, an optional IPv4 tail, and an optional prefix length.\n*/\nfunction readIpv6(text) {\n\tconst bytes = new Array(16).fill(0);\n\tlet filled = 0;\n\tlet compressedAt;\n\tlet index = 0;\n\tif (text[0] === \":\") {\n\t\tif (text[1] !== \":\") return void 0;\n\t\tindex = 1;\n\t}\n\tlet tokenStart = index;\n\tlet sawHexDigit = false;\n\tlet group = 0;\n\tlet groupDigits = 0;\n\tlet bits = 128;\n\twhile (index < text.length) {\n\t\tconst ch = text[index++] ?? \"\";\n\t\tif (HEX_DIGIT.test(ch)) {\n\t\t\tgroup = group << 4 | Number.parseInt(ch, 16);\n\t\t\tif (++groupDigits > 4) return void 0;\n\t\t\tsawHexDigit = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \":\") {\n\t\t\ttokenStart = index;\n\t\t\tif (!sawHexDigit) {\n\t\t\t\tif (compressedAt !== void 0) return void 0;\n\t\t\t\tcompressedAt = filled;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (index >= text.length || filled + 2 > 16) return void 0;\n\t\t\tbytes[filled++] = group >> 8;\n\t\t\tbytes[filled++] = group & 255;\n\t\t\tsawHexDigit = false;\n\t\t\tgroup = 0;\n\t\t\tgroupDigits = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \".\" && filled + 4 <= 16) {\n\t\t\tconst tail = readIpv4Tail(text.slice(tokenStart));\n\t\t\tif (tail !== void 0) {\n\t\t\t\ttail.octets.forEach((octet, offset) => {\n\t\t\t\t\tbytes[filled + offset] = octet;\n\t\t\t\t});\n\t\t\t\tfilled += 4;\n\t\t\t\tsawHexDigit = false;\n\t\t\t\tbits = tail.bits ?? bits;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ch === \"/\") {\n\t\t\tconst prefix = readBits(text.slice(index));\n\t\t\tif (prefix !== void 0) {\n\t\t\t\tbits = prefix;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tif (sawHexDigit) {\n\t\tif (filled + 2 > 16) return void 0;\n\t\tbytes[filled++] = group >> 8;\n\t\tbytes[filled++] = group & 255;\n\t}\n\tif (compressedAt !== void 0) {\n\t\tif (filled === 16) return void 0;\n\t\tconst shifted = bytes.slice(compressedAt, filled);\n\t\tbytes.fill(0, compressedAt, filled);\n\t\tbytes.splice(16 - shifted.length, shifted.length, ...shifted);\n\t\tfilled = 16;\n\t}\n\treturn filled === 16 ? {\n\t\tbytes,\n\t\tbits\n\t} : void 0;\n}\nfunction printIpv4({ bytes, bits }) {\n\tconst address = bytes.join(\".\");\n\treturn bits === 32 ? address : `${address}/${bits}`;\n}\n/**\n* PostgreSQL's `inet_net_ntop_ipv6`: the first longest run of two or more zero groups is written\n* `::`, and an address whose first five groups are zero followed by `ffff`, or whose first six are\n* zero, ends in dotted IPv4.\n*/\nfunction printIpv6({ bytes, bits }) {\n\tconst groups = Array.from({ length: 8 }, (_, i) => (bytes[2 * i] ?? 0) << 8 | (bytes[2 * i + 1] ?? 0));\n\tconst zeroRun = longestZeroRun(groups);\n\tlet text = \"\";\n\tfor (let i = 0; i < 8; i++) {\n\t\tif (zeroRun !== void 0 && i >= zeroRun.start && i < zeroRun.start + zeroRun.length) {\n\t\t\tif (i === zeroRun.start) text += \":\";\n\t\t\tcontinue;\n\t\t}\n\t\tif (i !== 0) text += \":\";\n\t\tif (i === 6 && zeroRun?.start === 0 && (zeroRun.length === 6 || zeroRun.length === 5 && groups[5] === 65535)) {\n\t\t\ttext += bytes.slice(12).join(\".\");\n\t\t\tbreak;\n\t\t}\n\t\ttext += (groups[i] ?? 0).toString(16);\n\t}\n\tif (zeroRun !== void 0 && zeroRun.start + zeroRun.length === 8) text += \":\";\n\treturn bits === 128 ? text : `${text}/${bits}`;\n}\nfunction longestZeroRun(groups) {\n\tlet best;\n\tlet current;\n\tfor (const [i, group] of groups.entries()) {\n\t\tif (group === 0) {\n\t\t\tcurrent = current === void 0 ? {\n\t\t\t\tstart: i,\n\t\t\t\tlength: 1\n\t\t\t} : {\n\t\t\t\t...current,\n\t\t\t\tlength: current.length + 1\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\t\tcurrent = void 0;\n\t}\n\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\treturn best !== void 0 && best.length >= 2 ? best : void 0;\n}\n//#endregion\n//#region src/core/codec-helpers.ts\n/**\n* Whether text fits `length` characters, counted as PostgreSQL counts them: code points. A `character` value is padded with spaces, and spaces past its length are dropped, so they do not count.\n*/\nfunction fitsCharacterLength(text, length, blankPadded) {\n\tconst significant = blankPadded ? withoutTrailing(text, \" \") : text;\n\treturn significant.length <= length || [...significant].length <= length;\n}\n/** The uuid input PostgreSQL reads: 32 hex digits in either case, a hyphen allowed after any group of four but the last, and the whole optionally in braces. */\nconst UUID_INPUT = /^(?:\\{[0-9a-f]{4}(?:-?[0-9a-f]{4}){7}\\}|[0-9a-f]{4}(?:-?[0-9a-f]{4}){7})$/i;\n/** A UUID as PostgreSQL writes it: lower case, hyphenated 8-4-4-4-12. */\nconst CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n/**\n* Text in any form PostgreSQL reads as a UUID (either case, a hyphen after any group of four digits, optionally in braces), written the way PostgreSQL writes it; `undefined` for text it does not read as one.\n*/\nfunction canonicalUuid(text) {\n\tif (!UUID_INPUT.test(text)) return void 0;\n\tconst hex = text.replace(/[{}-]/g, \"\").toLowerCase();\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n/** The largest finite float4. */\nconst FLOAT4_MAX = 34028234663852886e22;\n/** Whether float4 holds a finite number: it neither overflows to an infinity nor rounds to 0, both of which PostgreSQL refuses. */\nfunction fitsFloat4(value) {\n\tconst single = Math.fround(value);\n\treturn Number.isFinite(single) && (value === 0 || single !== 0);\n}\n/**\n* A `numeric` value as its canonical decimal text. A number is written out without an exponent,\n* because `numeric` text has no exponent syntax and `encodeJson` refuses one.\n*/\nconst pgNumericDecode = (wire) => {\n\tif (typeof wire === \"number\") return numeralText(wire);\n\treturn wire;\n};\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/**\n* Requires an application value to be of the JS type the codec reads.\n*\n* A range check reads a value of the wrong type as a value out of range, and\n* reports a number plainly inside the range as outside it — so the type is\n* established first and answered for on its own terms, naming what a caller\n* has to change.\n*/\nconst requireJsType = (codecId, expected, value) => {\n\tif (typeof value === expected) return;\n\tthrow postgresError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof value\n\t} });\n};\n/** Writes a `bigint` application value as the decimal text the wire form of the exact integer codecs carries. */\nconst pgBigintEncode = (codecId, value) => {\n\trequireJsType(codecId, \"bigint\", value);\n\treturn value.toString();\n};\n/**\n* Writes an application value as the decimal text these codecs carry as their\n* canonical JSON.\n*\n* A schema-written literal default (`BigInt @default(0)`) arrives here as a\n* `number`, since a number literal is the only integer a schema language\n* writes, and one that is a safe integer names its value exactly. Past that\n* range the literal was rounded before any of this ran, so the value written is\n* not the value meant — which this refuses rather than minting an exact-looking\n* total from it. A non-integral number is refused on the same terms.\n*/\nconst pgBigintEncodeJson = (codecId, value) => {\n\tif (typeof value !== \"number\") return pgBigintEncode(codecId, value);\n\tif (!Number.isSafeInteger(value)) throw postgresError(\"RUNTIME.ENCODE_FAILED\", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\treturn BigInt(value).toString();\n};\n/**\n* Reads a wire or JSON value as a `bigint`, rejecting anything `BigInt()` would\n* misread. A number-typed wire value must also be a safe integer: past\n* ±(2^53 − 1) the driver's `number` has already rounded, so stringifying it\n* would mint a spuriously-exact `bigint` that need not equal the stored value.\n*/\nconst decimalIntegerDecode = (codecId, wire) => {\n\tif (typeof wire === \"bigint\") return wire;\n\tconst text = String(wire);\n\tif (!DECIMAL_INTEGER.test(text)) throw postgresError(\"RUNTIME.DECODE_FAILED\", `${codecId} value must be a decimal integer`, { meta: {\n\t\tcodecId,\n\t\treceived: text\n\t} });\n\tif (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: {\n\t\tcodecId,\n\t\treceived: text\n\t} });\n\treturn BigInt(text);\n};\n/** Reads an `int8` wire or JSON value as a `bigint`, rejecting anything `BigInt()` would misread. */\nconst pgInt8Decode = (wire) => decimalIntegerDecode(\"pg/int8@1\", wire);\n/**\n* Reads an unconstrained-`numeric` wire or JSON value as a `bigint`, rejecting\n* non-integral values — including `NaN` and the infinities, which are `numeric`\n* values but not integers.\n*/\nconst pgUnboundedIntDecode = (wire) => decimalIntegerDecode(\"pg/unboundedint@1\", wire);\n/**\n* A SQL number literal has no form for `NaN` or the infinities; PostgreSQL reads and writes them as\n* the text `NaN`, `Infinity`, `-Infinity`, so the float codecs carry them as that text on the wire,\n* as `encodeJsonFloat` does in JSON.\n*/\nconst pgFloatEncode = (value) => Number.isFinite(value) ? value : String(value);\n/**\n* Requires an integer within ±(2^53 − 1), the range a JS `number` holds\n* exactly. The guard throws rather than rounding: past the boundary a `number`\n* silently loses digits, which is the failure mode this codec exists to refuse.\n*/\nconst pgInt8NumberGuard = (code, value) => {\n\tif (!Number.isSafeInteger(value)) throw postgresError(code, `pg/int8number@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId: \"pg/int8number@1\",\n\t\treceived: String(value)\n\t} });\n\treturn value;\n};\nconst pgInt8NumberEncode = (value) => {\n\trequireJsType(\"pg/int8number@1\", \"number\", value);\n\treturn String(pgInt8NumberGuard(\"RUNTIME.ENCODE_FAILED\", value));\n};\nconst pgInt8NumberEncodeJson = (value) => pgInt8NumberEncode(value);\n/**\n* Reads an `int8` wire value as a `number`, throwing outside ±(2^53 − 1) and on\n* non-integral input. Decimal text goes through `BigInt` before the range check\n* so an out-of-range value is compared exactly rather than after rounding.\n*/\nconst pgInt8NumberDecode = (wire) => {\n\tif (typeof wire === \"number\") return pgInt8NumberGuard(\"RUNTIME.DECODE_FAILED\", wire);\n\tconst value = decimalIntegerDecode(\"pg/int8number@1\", wire);\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/int8number@1 value must be an integer within the safe integer range, got ${value}`, { meta: {\n\t\tcodecId: \"pg/int8number@1\",\n\t\treceived: value.toString()\n\t} });\n\treturn Number(value);\n};\nconst pgInt8NumberDecodeJson = (json) => Number(decodeJsonIntegerText(\"pg/int8number@1\", json, SAFE_INTEGER_BIGINT_RANGE));\n/**\n* Renders a decimal-text default as a `bigint` literal, for the codecs whose\n* canonical JSON is decimal text while the application type is `bigint`\n* (`pg/int8@1`, `pg/unboundedint@1`) — a plain string literal would not\n* typecheck against the emitted column type.\n*/\nconst decimalTextBigintLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;\n/** Renders a float's stored number as a number literal. NaN and the infinities are stored as text and have no literal type, so they render nothing and the value set types as `number`. */\nconst floatNumberLiteral = (value) => typeof value === \"number\" ? String(value) : void 0;\n/** Renders the decimal text of `pg/int8number@1`, whose application type is `number`, as a number literal. */\nconst decimalTextNumberLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? value : void 0;\nconst ISO_DURATION = /^P(?!$)(-?\\d+Y)?(-?\\d+M)?(-?\\d+D)?(?:T(?!$)(-?\\d+H)?(-?\\d+M)?(-?\\d+(?:\\.\\d+)?S)?)?$/;\nconst MICROS_PER_SECOND = 1000000n;\n/**\n* Converts a fractional-seconds digit string to microseconds, rounding rather\n* than truncating past the sixth digit.\n*\n* PostgreSQL rounds: `INTERVAL '1.1234567 seconds'` is `1.123457`, and\n* `'1.9999999 seconds'` carries into `2`. Truncating here made the parsed value\n* disagree with the database for any input past microsecond resolution.\n*\n* Ties round toward positive infinity, matching `Math.round` on the sibling path\n* that reads the driver's component object — so the two agree. PostgreSQL's own\n* tie behaviour is unobservable, because it parses the literal into a double\n* first and an exact half never survives that.\n*/\nconst microsFromFraction = (fraction, negative) => {\n\tif (fraction === \"\") return 0n;\n\tconst kept = BigInt(fraction.slice(0, 6).padEnd(6, \"0\"));\n\tconst rest = fraction.slice(6).replace(/0+$/, \"\");\n\tif (rest === \"\") return kept;\n\tconst half = rest[0] === \"5\" && rest.length === 1;\n\treturn rest > \"5\" || half && !negative ? kept + 1n : kept;\n};\nconst intervalFieldsOf = (text) => {\n\tconst match = ISO_DURATION.exec(text);\n\tif (match === null) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/interval@1 value must be an ISO-8601 duration, got ${text}`, { meta: {\n\t\tcodecId: \"pg/interval@1\",\n\t\treceived: text\n\t} });\n\tconst [, years, months, days, hours, minutes, seconds] = match;\n\tconst wholeNumber = (part) => part === void 0 ? 0 : Number(part.slice(0, -1));\n\tconst secondsLiteral = seconds === void 0 ? \"0\" : seconds.slice(0, -1);\n\tconst negative = secondsLiteral.startsWith(\"-\");\n\tconst [whole = \"0\", fraction = \"\"] = secondsLiteral.replace(\"-\", \"\").split(\".\");\n\tconst magnitude = BigInt(whole) * MICROS_PER_SECOND + microsFromFraction(fraction, negative);\n\treturn {\n\t\tmonths: wholeNumber(years) * 12 + wholeNumber(months),\n\t\tdays: wholeNumber(days),\n\t\tmicros: BigInt(wholeNumber(hours)) * 3600n * MICROS_PER_SECOND + BigInt(wholeNumber(minutes)) * 60n * MICROS_PER_SECOND + (negative ? -magnitude : magnitude)\n\t};\n};\nconst secondsText = (micros) => {\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst whole = magnitude / MICROS_PER_SECOND % 60n;\n\tconst fraction = magnitude % MICROS_PER_SECOND;\n\treturn `${sign}${whole}${fraction === 0n ? \"\" : `.${fraction.toString().padStart(6, \"0\").replace(/0+$/, \"\")}`}`;\n};\n/**\n* Renders {@link PgInterval} the way PostgreSQL spells an interval under\n* `IntervalStyle = 'iso_8601'`: zero components omitted, `T` present only when a\n* time component is, each component carrying its own sign, and an all-zero\n* interval written `PT0S`.\n*/\nconst formatIsoDuration = ({ months, days, micros }) => {\n\tconst years = Math.trunc(months / 12);\n\tconst restMonths = months % 12;\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst hours = magnitude / (3600n * MICROS_PER_SECOND);\n\tconst minutes = magnitude / (60n * MICROS_PER_SECOND) % 60n;\n\tconst hasSeconds = magnitude % (60n * MICROS_PER_SECOND) !== 0n;\n\tconst parts = [\n\t\tyears === 0 ? \"\" : `${years}Y`,\n\t\trestMonths === 0 ? \"\" : `${restMonths}M`,\n\t\tdays === 0 ? \"\" : `${days}D`\n\t];\n\tconst time = [\n\t\thours === 0n ? \"\" : `${sign}${hours}H`,\n\t\tminutes === 0n ? \"\" : `${sign}${minutes}M`,\n\t\thasSeconds ? `${secondsText(micros)}S` : \"\"\n\t].join(\"\");\n\tconst rendered = `P${parts.join(\"\")}${time === \"\" ? \"\" : `T${time}`}`;\n\treturn rendered === \"P\" ? \"PT0S\" : rendered;\n};\n/**\n* An interval as PostgreSQL prints it under `IntervalStyle = 'postgres'`: `1 year 2 mons 3 days\n* 04:05:06.5`, `-1 years -2 mons +3 days -04:00:00`, `00:00:00`.\n*/\nconst POSTGRES_INTERVAL = /^(?:([+-]?\\d+) years? ?)?(?:([+-]?\\d+) mons? ?)?(?:([+-]?\\d+) days? ?)?(?:([+-])?(\\d+):(\\d{2}):(\\d{2})(?:\\.(\\d+))?)?$/;\nfunction postgresIntervalFields(text) {\n\tconst match = POSTGRES_INTERVAL.exec(text);\n\tif (match === null || text === \"\" || text.endsWith(\" \")) return void 0;\n\tconst [, years = \"0\", months = \"0\", days = \"0\", sign, hours = \"0\", minutes = \"0\", seconds = \"0\"] = match;\n\tconst fraction = match[8] ?? \"\";\n\tconst magnitude = (BigInt(hours) * 3600n + BigInt(minutes) * 60n + BigInt(seconds)) * MICROS_PER_SECOND + microsFromFraction(fraction, sign === \"-\");\n\treturn {\n\t\tmonths: Number(years) * 12 + Number(months),\n\t\tdays: Number(days),\n\t\tmicros: sign === \"-\" ? -magnitude : magnitude\n\t};\n}\nfunction intervalRefused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"pg/interval stores one canonical form for each interval (ADR 254), and reads ISO 8601 durations and the text PostgreSQL prints.\",\n\t\tfix: \"Write an ISO 8601 duration, as the message shows.\"\n\t});\n}\n/**\n* The canonical form of `pg/interval` (ADR 254), from an ISO 8601 duration or the text PostgreSQL\n* prints under `IntervalStyle = 'postgres'`.\n*/\nfunction pgIntervalCanonical(text) {\n\tconst fractionDigits = /\\.(\\d+)/.exec(text)?.[1]?.length ?? 0;\n\tif (fractionDigits > 6) intervalRefused(`\"${text}\" has ${fractionDigits} digits after the decimal point, but pg/interval holds microseconds, so at most 6. Round it, as in \"PT1.123456S\".`);\n\tif (ISO_DURATION.test(text)) return formatIsoDuration(intervalFieldsOf(text));\n\tconst fields = postgresIntervalFields(text);\n\tif (fields === void 0) intervalRefused(`pg/interval cannot read \"${text}\". Write an ISO 8601 duration, as in \"P1Y2M3DT4H5M6S\".`);\n\treturn formatIsoDuration(fields);\n}\n/** Renders the application value as its canonical ISO-8601 duration. */\nconst pgIntervalToIso = (value) => formatIsoDuration(value);\nconst pgIntervalEncodeJson = (value) => formatIsoDuration(value);\nconst pgIntervalDecodeJson = (json) => intervalFieldsOf(decodeJsonMatching(\"pg/interval@1\", json, ISO_DURATION, \"an ISO-8601 duration\"));\nconst intervalTextFields = (text) => {\n\tif (ISO_DURATION.test(text)) return intervalFieldsOf(text);\n\tconst fields = postgresIntervalFields(text);\n\tif (fields === void 0) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/interval@1 value must be an ISO-8601 duration or PostgreSQL interval text, got ${text}`, { meta: {\n\t\tcodecId: \"pg/interval@1\",\n\t\treceived: text\n\t} });\n\treturn fields;\n};\nconst pgIntervalDecode = (wire) => {\n\tif (typeof wire === \"string\") return intervalTextFields(wire);\n\tconst part = (name) => {\n\t\tconst raw = wire[name];\n\t\treturn typeof raw === \"number\" ? raw : 0;\n\t};\n\tconst seconds = part(\"seconds\") + part(\"milliseconds\") / 1e3;\n\treturn {\n\t\tmonths: part(\"years\") * 12 + part(\"months\"),\n\t\tdays: part(\"days\"),\n\t\tmicros: BigInt(part(\"hours\")) * 3600n * MICROS_PER_SECOND + BigInt(part(\"minutes\")) * 60n * MICROS_PER_SECOND + BigInt(Math.round(seconds * 1e6))\n\t};\n};\nconst BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst pgByteaEncodeJson = (value) => Buffer.from(value).toString(\"base64\");\nconst pgByteaDecodeJson = (json) => new Uint8Array(Buffer.from(decodeJsonMatching(\"pg/bytea@1\", json, BASE64_TEXT, \"a base64 string\"), \"base64\"));\nconst BYTEA_TEXT = /^\\\\x(?:[0-9A-Fa-f]{2})*$/;\nconst BYTEA_FORMS = String.raw`Write base64, as in \"aGVsbG8=\", or PostgreSQL hex, written \"\\\\x68656c6c6f\" in a PSL string.`;\nfunction byteaRefused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"pg/bytea stores its bytes as base64 (ADR 254), and reads base64 and the hex text PostgreSQL prints.\",\n\t\tfix: BYTEA_FORMS\n\t});\n}\n/**\n* The canonical form of `pg/bytea` (ADR 254), the base64 its codec writes, from base64 or the hex\n* text PostgreSQL prints under `bytea_output = 'hex'`.\n*/\nfunction pgByteaCanonical(text) {\n\tif (text.startsWith(\"\\\\x\")) {\n\t\tif (!BYTEA_TEXT.test(text)) byteaRefused(`${JSON.stringify(text)} is not PostgreSQL hex, which has two hexadecimal digits for each byte. ${BYTEA_FORMS}`);\n\t\treturn Buffer.from(text.slice(2), \"hex\").toString(\"base64\");\n\t}\n\tif (!BASE64_TEXT.test(text)) byteaRefused(`pg/bytea cannot read ${JSON.stringify(text)}. Write base64 with its padding, as in \"aGVsbG8=\", or PostgreSQL hex, written \"\\\\\\\\x68656c6c6f\" in a PSL string.`);\n\treturn Buffer.from(text, \"base64\").toString(\"base64\");\n}\nconst pgByteaDecodeWire = (wire) => {\n\tif (wire instanceof Uint8Array) return wire.constructor === Uint8Array ? wire : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength);\n\tif (!BYTEA_TEXT.test(wire)) throw postgresError(\"RUNTIME.DECODE_FAILED\", \"pg/bytea@1 wire value must be a bytea hex string or Uint8Array\", { meta: {\n\t\tcodecId: \"pg/bytea@1\",\n\t\treceived: wire\n\t} });\n\treturn new Uint8Array(Buffer.from(wire.slice(2), \"hex\"));\n};\nconst parseJsonWire = JSON.parse;\nconst pgJsonEncode = (value) => JSON.stringify(value);\nconst pgJsonDecode = (wire) => typeof wire === \"string\" ? parseJsonWire(wire) : wire;\nconst pgJsonbEncode = (value) => JSON.stringify(value);\nconst pgJsonbDecode = (wire) => typeof wire === \"string\" ? parseJsonWire(wire) : wire;\n//#endregion\nexport { pgNumericDecode as A, pgIntervalDecodeJson as C, pgJsonEncode as D, pgJsonDecode as E, canonicalInet as M, pgJsonbDecode as O, pgIntervalDecode as S, pgIntervalToIso as T, pgInt8NumberDecode as _, decimalTextNumberLiteral as a, pgInt8NumberEncodeJson as b, floatNumberLiteral as c, pgByteaCanonical as d, pgByteaDecodeJson as f, pgInt8Decode as g, pgFloatEncode as h, decimalTextBigintLiteral as i, pgUnboundedIntDecode as j, pgJsonbEncode as k, pgBigintEncode as l, pgByteaEncodeJson as m, FLOAT4_MAX as n, fitsCharacterLength as o, pgByteaDecodeWire as p, canonicalUuid as r, fitsFloat4 as s, CANONICAL_UUID as t, pgBigintEncodeJson as u, pgInt8NumberDecodeJson as v, pgIntervalEncodeJson as w, pgIntervalCanonical as x, pgInt8NumberEncode as y };\n\n//# sourceMappingURL=codec-helpers-IfGdyCFt.mjs.map"],"mappings":";;;;;;AAMA,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAM,WAAW,OA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