@prisma/orm-target-postgres 8.0.0-rc.11-dev.42 → 8.0.0-rc.11-dev.44

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 (132) hide show
  1. package/dist/{adapter-BQjOLpLF-DjdhmoYt.mjs → adapter-Br3wVafV-CIaQ1HhO.mjs} +4 -4
  2. package/dist/{adapter-BQjOLpLF-DjdhmoYt.mjs.map → adapter-Br3wVafV-CIaQ1HhO.mjs.map} +1 -1
  3. package/dist/{adapter-BQrsKoUs.d.mts → adapter-Ch23AWoY.d.mts} +2 -2
  4. package/dist/{adapter-BQrsKoUs.d.mts.map → adapter-Ch23AWoY.d.mts.map} +1 -1
  5. package/dist/adapter.d.mts +6 -6
  6. package/dist/adapter.mjs +4 -4
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +1 -1
  9. package/dist/adapter__control.d.mts +1 -1
  10. package/dist/adapter__control.mjs +19 -8
  11. package/dist/adapter__control.mjs.map +1 -1
  12. package/dist/adapter__runtime.d.mts +1 -1
  13. package/dist/adapter__runtime.mjs +5 -5
  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 +2 -2
  18. package/dist/{aggregates-s5O5YixU.mjs → aggregates-jKrxvOpL.mjs} +2 -2
  19. package/dist/{aggregates-s5O5YixU.mjs.map → aggregates-jKrxvOpL.mjs.map} +1 -1
  20. package/dist/{authoring-CniOubLM-CbhqVEcC.mjs → authoring-CJ-fJQw8-biM4ZMGz.mjs} +3 -3
  21. package/dist/{authoring-CniOubLM-CbhqVEcC.mjs.map → authoring-CJ-fJQw8-biM4ZMGz.mjs.map} +1 -1
  22. package/dist/codec-descriptor-Cf1qfOwo.d.mts +1 -0
  23. package/dist/{codec-descriptor-Bec_zukr-BfvtUqhm.d.mts → codec-descriptor-DUUGoeyI-WGLGXEoI.d.mts} +8 -6
  24. package/dist/codec-descriptor-DUUGoeyI-WGLGXEoI.d.mts.map +1 -0
  25. package/dist/{codec-descriptor-LT7BpQta-BaDM8UQQ.mjs → codec-descriptor-_SFeUKIu-CZFozFan.mjs} +5 -3
  26. package/dist/codec-descriptor-_SFeUKIu-CZFozFan.mjs.map +1 -0
  27. package/dist/{codec-types-CuQJJtqu-CFc1zyPR.d.mts → codec-types-Bx6YI-KI-sSDAuYPQ.d.mts} +4 -4
  28. package/dist/{codec-types-CuQJJtqu-CFc1zyPR.d.mts.map → codec-types-Bx6YI-KI-sSDAuYPQ.d.mts.map} +1 -1
  29. package/dist/codec-types-GORaWCVQ.d.mts +2 -0
  30. package/dist/{codecs-BDp1mDKT-eDXyAZV_.d.mts → codecs-BIXQf74u-EYQbSdG3.d.mts} +41 -9
  31. package/dist/codecs-BIXQf74u-EYQbSdG3.d.mts.map +1 -0
  32. package/dist/{codecs-7isLDrZp-DmbSAn6K.mjs → codecs-C7OoUG-w-BvO1qMT0.mjs} +82 -22
  33. package/dist/codecs-C7OoUG-w-BvO1qMT0.mjs.map +1 -0
  34. package/dist/{codecs-BfhfEZaj.d.mts → codecs-CAHnXMUO.d.mts} +3 -3
  35. package/dist/codecs-CAHnXMUO.d.mts.map +1 -0
  36. package/dist/{control-DmVutloY.d.mts → control-BJUcS9xX.d.mts} +4 -4
  37. package/dist/{control-DmVutloY.d.mts.map → control-BJUcS9xX.d.mts.map} +1 -1
  38. package/dist/{control-C5bibN_Q.mjs → control-DrE43BfH.mjs} +8 -8
  39. package/dist/{control-C5bibN_Q.mjs.map → control-DrE43BfH.mjs.map} +1 -1
  40. package/dist/{control-adapter-CoDlAe4p-C7reTsaW.mjs → control-adapter-C2Xw0sJP-v5o3srdI.mjs} +10 -8
  41. package/dist/control-adapter-C2Xw0sJP-v5o3srdI.mjs.map +1 -0
  42. package/dist/{control-policy-C0f_MdP8-DNJBynf7.mjs → control-policy-BnSDkwiY-BXJR7SYi.mjs} +4 -4
  43. package/dist/{control-policy-C0f_MdP8-DNJBynf7.mjs.map → control-policy-BnSDkwiY-BXJR7SYi.mjs.map} +1 -1
  44. package/dist/data-type-entries-CWBaprqO-BpEnoawD.mjs +101 -0
  45. package/dist/data-type-entries-CWBaprqO-BpEnoawD.mjs.map +1 -0
  46. package/dist/data-types-CflDs2nq-BaeDf3B9.mjs +111 -0
  47. package/dist/data-types-CflDs2nq-BaeDf3B9.mjs.map +1 -0
  48. package/dist/data-types-DcvGOsFZ.d.mts +37 -0
  49. package/dist/data-types-DcvGOsFZ.d.mts.map +1 -0
  50. package/dist/{default-normalizer-Bjtm2F4f-uV5vvkVt.mjs → default-normalizer-D0urhVPh-BIJnKOfV.mjs} +19 -5
  51. package/dist/default-normalizer-D0urhVPh-BIJnKOfV.mjs.map +1 -0
  52. package/dist/{descriptor-meta-CIeOZJpe-C9c6s9oy.mjs → descriptor-meta-Cl9Kh9e8-B4YvnuYb.mjs} +4 -4
  53. package/dist/{descriptor-meta-CIeOZJpe-C9c6s9oy.mjs.map → descriptor-meta-Cl9Kh9e8-B4YvnuYb.mjs.map} +1 -1
  54. package/dist/{descriptor-meta-CLCajYZj-FAx62ZG-.mjs → descriptor-meta-ClQ1wGLk-D7moct5f.mjs} +7 -5
  55. package/dist/descriptor-meta-ClQ1wGLk-D7moct5f.mjs.map +1 -0
  56. package/dist/{diff-database-schema-Cf2_tOQT-FatzfLUz.mjs → diff-database-schema-BRFwEMlV-0Xm8oaTc.mjs} +4 -4
  57. package/dist/{diff-database-schema-Cf2_tOQT-FatzfLUz.mjs.map → diff-database-schema-BRFwEMlV-0Xm8oaTc.mjs.map} +1 -1
  58. package/dist/{infer-psl-contract-CBsWEERT-CdfjzeCW.mjs → infer-psl-contract-CjRPs0zQ-ChKD4e5O.mjs} +104 -94
  59. package/dist/infer-psl-contract-CjRPs0zQ-ChKD4e5O.mjs.map +1 -0
  60. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  61. package/dist/{op-factory-call-DrO2ojHT-CEWsFOHI.mjs → op-factory-call-CNSyujs6-D8M7NkKv.mjs} +3 -3
  62. package/dist/{op-factory-call-DrO2ojHT-CEWsFOHI.mjs.map → op-factory-call-CNSyujs6-D8M7NkKv.mjs.map} +1 -1
  63. package/dist/{pack-DQegWXXx.d.mts → pack-CHgkp1ir.d.mts} +3 -3
  64. package/dist/{pack-DQegWXXx.d.mts.map → pack-CHgkp1ir.d.mts.map} +1 -1
  65. package/dist/{planner-DJVEdvln-4m20OBL3.mjs → planner-DY1qWehc-Dia9ZhnI.mjs} +6 -6
  66. package/dist/{planner-DJVEdvln-4m20OBL3.mjs.map → planner-DY1qWehc-Dia9ZhnI.mjs.map} +1 -1
  67. package/dist/{planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs → planner-ddl-builders-Bl8O1tkU-DjGfDUnx.mjs} +3 -3
  68. package/dist/{planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs.map → planner-ddl-builders-Bl8O1tkU-DjGfDUnx.mjs.map} +1 -1
  69. package/dist/{planner-produced-postgres-migration-5P8B01dP-BYOLI08i.mjs → planner-produced-postgres-migration-D9qMCo_6-DZE1bx0Q.mjs} +3 -3
  70. package/dist/{planner-produced-postgres-migration-5P8B01dP-BYOLI08i.mjs.map → planner-produced-postgres-migration-D9qMCo_6-DZE1bx0Q.mjs.map} +1 -1
  71. package/dist/{postgres-contract-view-CG5jf5TZ-DJ32uIq6.mjs → postgres-contract-view-CLAVto6M-mMf300wS.mjs} +3 -3
  72. package/dist/{postgres-contract-view-CG5jf5TZ-DJ32uIq6.mjs.map → postgres-contract-view-CLAVto6M-mMf300wS.mjs.map} +1 -1
  73. package/dist/{postgres-migration-Dm-K5enl-CqLMsqCd.mjs → postgres-migration-B9kxdt1I-DP0Sml3U.mjs} +4 -4
  74. package/dist/{postgres-migration-Dm-K5enl-CqLMsqCd.mjs.map → postgres-migration-B9kxdt1I-DP0Sml3U.mjs.map} +1 -1
  75. package/dist/{prisma7-binding-DW2FJ0Pq.mjs → prisma7-binding-BWUFwFja.mjs} +5 -5
  76. package/dist/{prisma7-binding-DW2FJ0Pq.mjs.map → prisma7-binding-BWUFwFja.mjs.map} +1 -1
  77. package/dist/{prisma7-binding-jsMIoDg0.d.mts → prisma7-binding-DwzP7EKf.d.mts} +3 -3
  78. package/dist/{prisma7-binding-jsMIoDg0.d.mts.map → prisma7-binding-DwzP7EKf.d.mts.map} +1 -1
  79. package/dist/{codecs-BrJWpXPJ.mjs → registry-zad9XdwA-D-QiVeM2.mjs} +4 -4
  80. package/dist/registry-zad9XdwA-D-QiVeM2.mjs.map +1 -0
  81. package/dist/{runtime-BdRKoWQu.d.mts → runtime-CDBw4cq0.d.mts} +2 -2
  82. package/dist/{runtime-BdRKoWQu.d.mts.map → runtime-CDBw4cq0.d.mts.map} +1 -1
  83. package/dist/{sql-renderer-BnTqIzZw-CMA2QgFY.mjs → sql-renderer-BnTqIzZw-CaTxVqe_.mjs} +2 -2
  84. package/dist/{sql-renderer-BnTqIzZw-CMA2QgFY.mjs.map → sql-renderer-BnTqIzZw-CaTxVqe_.mjs.map} +1 -1
  85. package/dist/{sql-renderer-Cshx9dNa.d.mts → sql-renderer-wEUZzVON.d.mts} +4 -4
  86. package/dist/{sql-renderer-Cshx9dNa.d.mts.map → sql-renderer-wEUZzVON.d.mts.map} +1 -1
  87. package/dist/target.d.mts +10 -9
  88. package/dist/target.mjs +20 -18
  89. package/dist/target__aggregates.mjs +1 -1
  90. package/dist/target__codec-descriptor.d.mts +2 -2
  91. package/dist/target__codec-descriptor.mjs +1 -1
  92. package/dist/target__codec-types.d.mts +3 -3
  93. package/dist/target__codecs.d.mts +2 -2
  94. package/dist/target__codecs.mjs +2 -2
  95. package/dist/target__control.mjs +2 -2
  96. package/dist/target__data-types.d.mts +2 -0
  97. package/dist/target__data-types.mjs +3 -0
  98. package/dist/target__default-normalizer.mjs +1 -1
  99. package/dist/target__diff-database-schema.mjs +1 -1
  100. package/dist/target__issue-planner.mjs +1 -1
  101. package/dist/target__migration.mjs +2 -2
  102. package/dist/target__op-factory-call.mjs +1 -1
  103. package/dist/target__pack.d.mts +1 -1
  104. package/dist/target__pack.mjs +1 -1
  105. package/dist/target__planner-ddl-builders.mjs +1 -1
  106. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  107. package/dist/target__planner.mjs +2 -2
  108. package/dist/target__prisma7-binding.d.mts +1 -1
  109. package/dist/target__prisma7-binding.mjs +1 -1
  110. package/dist/target__runtime.mjs +3 -3
  111. package/dist/target__runtime.mjs.map +1 -1
  112. package/dist/target__sql-utils.mjs +1 -1
  113. package/dist/{text-search-languages-B9_t3ep--DaX5ZABJ.mjs → text-search-languages-Bi8KwBsX-lEgZQZrL.mjs} +3 -3
  114. package/dist/{text-search-languages-B9_t3ep--DaX5ZABJ.mjs.map → text-search-languages-Bi8KwBsX-lEgZQZrL.mjs.map} +1 -1
  115. package/dist/types-v9w5Ww6z.d.mts +1 -0
  116. package/dist/{types-CkryN1AS-CZtzRJFZ.d.mts → types-xNFZRd6Q-BsnQDaBx.d.mts} +4 -4
  117. package/dist/types-xNFZRd6Q-BsnQDaBx.d.mts.map +1 -0
  118. package/package.json +10 -9
  119. package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts.map +0 -1
  120. package/dist/codec-descriptor-Bg-_412t.d.mts +0 -1
  121. package/dist/codec-descriptor-LT7BpQta-BaDM8UQQ.mjs.map +0 -1
  122. package/dist/codec-types-Cjrk3RME.d.mts +0 -2
  123. package/dist/codecs-7isLDrZp-DmbSAn6K.mjs.map +0 -1
  124. package/dist/codecs-BDp1mDKT-eDXyAZV_.d.mts.map +0 -1
  125. package/dist/codecs-BfhfEZaj.d.mts.map +0 -1
  126. package/dist/codecs-BrJWpXPJ.mjs.map +0 -1
  127. package/dist/control-adapter-CoDlAe4p-C7reTsaW.mjs.map +0 -1
  128. package/dist/default-normalizer-Bjtm2F4f-uV5vvkVt.mjs.map +0 -1
  129. package/dist/descriptor-meta-CLCajYZj-FAx62ZG-.mjs.map +0 -1
  130. package/dist/infer-psl-contract-CBsWEERT-CdfjzeCW.mjs.map +0 -1
  131. package/dist/types-C7BEZmFD.d.mts +0 -1
  132. package/dist/types-CkryN1AS-CZtzRJFZ.d.mts.map +0 -1
@@ -1,13 +1,14 @@
1
1
  import { A as PG_TIME_TEMPORAL_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, M as PG_UUID_CODEC_ID, N as PG_VARBIT_CODEC_ID, O as PG_TIMETZ_CODEC_ID, P as PG_VARCHAR_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_UNBOUNDED_INT_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_ENUM_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_FLOAT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID, y as PG_JSON_CODEC_ID } from "./codec-ids-BYhNGq22-B6yIezG2.mjs";
2
- import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-LT7BpQta-BaDM8UQQ.mjs";
2
+ import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-_SFeUKIu-CZFozFan.mjs";
3
+ import { C as pgUuid, S as pgTimetz, T as pgVarchar, _ as pgText, a as pgDate, b as pgTimestamp, c as pgFloat8, d as pgInt4, f as pgInt8, g as pgNumeric, h as pgJsonb, i as pgChar, l as pgInet, m as pgJson, n as pgBool, o as pgEnum, p as pgInterval, r as pgBytea, s as pgFloat4, t as pgBit, u as pgInt2, v as pgTextArray, w as pgVarbit, x as pgTimestamptz, y as pgTime } from "./data-types-CflDs2nq-BaeDf3B9.mjs";
3
4
  import { a as errorTemporalUnrepresentable, n as errorTemporalNonIsoCalendar, o as errorTemporalWrongType, r as errorTemporalUnavailable, s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
4
5
  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, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
6
+ import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, OrExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, isNonFiniteText, numeralText, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlTextDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
6
7
  import { CodecImpl, column, renderTsLiteral, voidParamsSchema } from "@prisma/orm-framework/components/codec";
7
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
9
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
9
10
  import { type } from "arktype";
10
- //#region ../../../3-targets/3-targets/postgres/dist/codecs-7isLDrZp.mjs
11
+ //#region ../../../3-targets/3-targets/postgres/dist/codecs-C7OoUG-w.mjs
11
12
  const precisionParamsSchema = type({ "precision?": "number.integer >= 0 & number.integer <= 6" });
12
13
  function renderLength(typeName, typeParams) {
13
14
  const length = typeParams.length;
@@ -29,8 +30,12 @@ function renderPrecision(typeName, typeParams) {
29
30
  } });
30
31
  return `${typeName}<${precision}>`;
31
32
  }
33
+ /**
34
+ * A `numeric` value as its canonical decimal text. A number is written out without an exponent,
35
+ * because `numeric` text has no exponent syntax and `encodeJson` refuses one.
36
+ */
32
37
  const pgNumericDecode = (wire) => {
33
- if (typeof wire === "number") return String(wire);
38
+ if (typeof wire === "number") return numeralText(wire);
34
39
  return wire;
35
40
  };
36
41
  const DECIMAL_INTEGER = /^-?\d+$/;
@@ -100,6 +105,21 @@ const pgInt8Decode = (wire) => decimalIntegerDecode("pg/int8@1", wire);
100
105
  * values but not integers.
101
106
  */
102
107
  const pgUnboundedIntDecode = (wire) => decimalIntegerDecode("pg/unboundedint@1", wire);
108
+ /**
109
+ * Neither JSON nor a SQL number literal has a form for `NaN` or the infinities; PostgreSQL reads
110
+ * and writes them as the text `NaN`, `Infinity`, `-Infinity`, so the float codecs carry them as
111
+ * that text on the wire and in JSON.
112
+ */
113
+ const pgFloatEncode = (value) => Number.isFinite(value) ? value : String(value);
114
+ const pgFloatEncodeJson = (value) => pgFloatEncode(value);
115
+ const pgFloatDecodeJson = (codecId, json) => {
116
+ if (typeof json === "number") return json;
117
+ if (typeof json === "string" && isNonFiniteText(json)) return Number(json);
118
+ throw postgresError("RUNTIME.DECODE_FAILED", `${codecId} database JSON value must be a number or the text NaN, Infinity or -Infinity`, { meta: {
119
+ codecId,
120
+ received: typeof json
121
+ } });
122
+ };
103
123
  const MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
104
124
  const MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
105
125
  /**
@@ -114,11 +134,11 @@ const pgInt8NumberGuard = (code, value) => {
114
134
  } });
115
135
  return value;
116
136
  };
117
- const pgInt8NumberEncodeJson = (value) => {
137
+ const pgInt8NumberEncode = (value) => {
118
138
  requireJsType("pg/int8number@1", "number", value);
119
- return pgInt8NumberGuard("RUNTIME.ENCODE_FAILED", value);
139
+ return String(pgInt8NumberGuard("RUNTIME.ENCODE_FAILED", value));
120
140
  };
121
- const pgInt8NumberEncode = (value) => String(pgInt8NumberEncodeJson(value));
141
+ const pgInt8NumberEncodeJson = (value) => pgInt8NumberEncode(value);
122
142
  /**
123
143
  * Reads an `int8` wire value as a `number`, throwing outside ±(2^53 − 1) and on
124
144
  * non-integral input. Decimal text goes through `BigInt` before the range check
@@ -134,11 +154,11 @@ const pgInt8NumberDecode = (wire) => {
134
154
  return Number(value);
135
155
  };
136
156
  const pgInt8NumberDecodeJson = (json) => {
137
- if (typeof json !== "number") throw postgresError("RUNTIME.DECODE_FAILED", "pg/int8number@1 database JSON value must be a number", { meta: {
157
+ if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/int8number@1 database JSON value must be decimal text", { meta: {
138
158
  codecId: "pg/int8number@1",
139
159
  received: typeof json
140
160
  } });
141
- return pgInt8NumberGuard("RUNTIME.DECODE_FAILED", json);
161
+ return pgInt8NumberDecode(json);
142
162
  };
143
163
  /**
144
164
  * Renders a decimal-text default as a `bigint` literal, for the codecs whose
@@ -147,6 +167,8 @@ const pgInt8NumberDecodeJson = (json) => {
147
167
  * typecheck against the emitted column type.
148
168
  */
149
169
  const decimalTextBigintLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;
170
+ /** Renders the decimal text of `pg/int8number@1`, whose application type is `number`, as a number literal. */
171
+ const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
150
172
  const pgNumericRenderOutputType = (typeParams) => {
151
173
  const precision = typeParams.precision;
152
174
  if (precision === void 0) return void 0;
@@ -434,6 +456,7 @@ var PgTimestamptzDateDescriptor = class extends PostgresCodecDescriptor {
434
456
  jsonProjection(expression) {
435
457
  return CastExpr.as(expression, "text");
436
458
  }
459
+ dataType = pgTimestamptz.id;
437
460
  codecId = PG_TIMESTAMPTZ_DATE_CODEC_ID;
438
461
  traits = ["equality", "order"];
439
462
  targetTypes = [];
@@ -468,6 +491,7 @@ var PgDateTemporalDescriptor = class extends PostgresCodecDescriptor {
468
491
  jsonProjection(expression) {
469
492
  return CastExpr.as(expression, "text");
470
493
  }
494
+ dataType = pgDate.id;
471
495
  codecId = PG_DATE_TEMPORAL_CODEC_ID;
472
496
  traits = ["equality", "order"];
473
497
  targetTypes = ["date"];
@@ -498,6 +522,7 @@ var PgTimestampTemporalDescriptor = class extends PostgresCodecDescriptor {
498
522
  jsonProjection(expression) {
499
523
  return CastExpr.as(expression, "text");
500
524
  }
525
+ dataType = pgTimestamp.id;
501
526
  codecId = PG_TIMESTAMP_TEMPORAL_CODEC_ID;
502
527
  traits = ["equality", "order"];
503
528
  targetTypes = ["timestamp"];
@@ -528,6 +553,7 @@ var PgTimestamptzTemporalDescriptor = class extends PostgresCodecDescriptor {
528
553
  jsonProjection(expression) {
529
554
  return CastExpr.as(expression, "text");
530
555
  }
556
+ dataType = pgTimestamptz.id;
531
557
  codecId = PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID;
532
558
  traits = ["equality", "order"];
533
559
  targetTypes = ["timestamptz"];
@@ -558,6 +584,7 @@ var PgTimeTemporalDescriptor = class extends PostgresCodecDescriptor {
558
584
  jsonProjection(expression) {
559
585
  return CastExpr.as(expression, "text");
560
586
  }
587
+ dataType = pgTime.id;
561
588
  codecId = PG_TIME_TEMPORAL_CODEC_ID;
562
589
  traits = ["equality", "order"];
563
590
  targetTypes = ["time"];
@@ -588,6 +615,7 @@ var PgDateStringDescriptor = class extends PostgresCodecDescriptor {
588
615
  jsonProjection(expression) {
589
616
  return CastExpr.as(expression, "text");
590
617
  }
618
+ dataType = pgDate.id;
591
619
  codecId = PG_DATE_STRING_CODEC_ID;
592
620
  traits = ["equality", "order"];
593
621
  targetTypes = [];
@@ -618,6 +646,7 @@ var PgTimestampStringDescriptor = class extends PostgresCodecDescriptor {
618
646
  jsonProjection(expression) {
619
647
  return CastExpr.as(expression, "text");
620
648
  }
649
+ dataType = pgTimestamp.id;
621
650
  codecId = PG_TIMESTAMP_STRING_CODEC_ID;
622
651
  traits = ["equality", "order"];
623
652
  targetTypes = [];
@@ -651,6 +680,7 @@ var PgTimestamptzStringDescriptor = class extends PostgresCodecDescriptor {
651
680
  jsonProjection(expression) {
652
681
  return CastExpr.as(expression, "text");
653
682
  }
683
+ dataType = pgTimestamptz.id;
654
684
  codecId = PG_TIMESTAMPTZ_STRING_CODEC_ID;
655
685
  traits = ["equality", "order"];
656
686
  targetTypes = [];
@@ -684,6 +714,7 @@ var PgTimeStringDescriptor = class extends PostgresCodecDescriptor {
684
714
  jsonProjection(expression) {
685
715
  return CastExpr.as(expression, "text");
686
716
  }
717
+ dataType = pgTime.id;
687
718
  codecId = PG_TIME_STRING_CODEC_ID;
688
719
  traits = ["equality", "order"];
689
720
  targetTypes = [];
@@ -834,22 +865,27 @@ const isoDurationJsonProjection = (expression) => {
834
865
  }], FunctionCallExpr.of("coalesce", [FunctionCallExpr.of("nullif", [assembled, LiteralExpr.of("P")]), LiteralExpr.of("PT0S")]));
835
866
  };
836
867
  const postgresSqlCharDescriptor = postgresCodec(sqlCharDescriptor, {
868
+ dataType: pgChar.id,
837
869
  nativeType: () => "character",
838
870
  jsonProjection: identityJsonProjection
839
871
  });
840
872
  const postgresSqlVarcharDescriptor = postgresCodec(sqlVarcharDescriptor, {
873
+ dataType: pgVarchar.id,
841
874
  nativeType: () => "character varying",
842
875
  jsonProjection: identityJsonProjection
843
876
  });
844
877
  const postgresSqlIntDescriptor = postgresCodec(sqlIntDescriptor, {
878
+ dataType: pgInt4.id,
845
879
  nativeType: () => "int4",
846
880
  jsonProjection: identityJsonProjection
847
881
  });
848
882
  const postgresSqlFloatDescriptor = postgresCodec(sqlFloatDescriptor, {
883
+ dataType: pgFloat8.id,
849
884
  nativeType: () => "float8",
850
885
  jsonProjection: identityJsonProjection
851
886
  });
852
887
  const postgresSqlTextDescriptor = postgresCodec(sqlTextDescriptor, {
888
+ dataType: pgText.id,
853
889
  nativeType: () => "text",
854
890
  jsonProjection: identityJsonProjection
855
891
  });
@@ -874,6 +910,7 @@ var PgTextDescriptor = class extends PostgresCodecDescriptor {
874
910
  jsonProjection(expression) {
875
911
  return expression;
876
912
  }
913
+ dataType = pgText.id;
877
914
  codecId = PG_TEXT_CODEC_ID;
878
915
  traits = [
879
916
  "equality",
@@ -936,6 +973,7 @@ var PgEnumDescriptor = class extends PostgresCodecDescriptor {
936
973
  jsonProjection(expression) {
937
974
  return expression;
938
975
  }
976
+ dataType = pgEnum.id;
939
977
  codecId = PG_ENUM_CODEC_ID;
940
978
  traits = [
941
979
  "equality",
@@ -1041,6 +1079,7 @@ var PgTextArrayDescriptor = class extends PostgresCodecDescriptor {
1041
1079
  jsonProjection(expression) {
1042
1080
  return expression;
1043
1081
  }
1082
+ dataType = pgTextArray.id;
1044
1083
  codecId = PG_TEXT_ARRAY_CODEC_ID;
1045
1084
  traits = ["equality"];
1046
1085
  targetTypes = ["text[]"];
@@ -1071,6 +1110,7 @@ var PgInt4Descriptor = class extends PostgresCodecDescriptor {
1071
1110
  jsonProjection(expression) {
1072
1111
  return expression;
1073
1112
  }
1113
+ dataType = pgInt4.id;
1074
1114
  codecId = PG_INT4_CODEC_ID;
1075
1115
  traits = [
1076
1116
  "equality",
@@ -1109,6 +1149,7 @@ var PgInt2Descriptor = class extends PostgresCodecDescriptor {
1109
1149
  jsonProjection(expression) {
1110
1150
  return expression;
1111
1151
  }
1152
+ dataType = pgInt2.id;
1112
1153
  codecId = PG_INT2_CODEC_ID;
1113
1154
  traits = [
1114
1155
  "equality",
@@ -1157,6 +1198,7 @@ var PgInt8Descriptor = class extends PostgresCodecDescriptor {
1157
1198
  jsonProjection(expression) {
1158
1199
  return decimalTextJsonProjection(expression);
1159
1200
  }
1201
+ dataType = pgInt8.id;
1160
1202
  codecId = PG_INT8_CODEC_ID;
1161
1203
  traits = [
1162
1204
  "equality",
@@ -1178,10 +1220,9 @@ const pgInt8Column = () => column(pgInt8Descriptor.factory(), pgInt8Descriptor.c
1178
1220
  * A Postgres `int8` decoded as a JS `number`, for columns whose values stay
1179
1221
  * within the safe integer range ±(2^53 − 1). Both directions guard rather than
1180
1222
  * round: decode (wire and JSON) and encode throw a structured error on
1181
- * out-of-range or non-integral input. The canonical JSON is a JSON number —
1182
- * the deliberate exception to the decimal-text rule for 64-bit integers, and
1183
- * the codec's purpose. The descriptor claims no target type, so `int8` in type
1184
- * position stays `pg/int8@1`.
1223
+ * out-of-range or non-integral input. The canonical JSON is the decimal text
1224
+ * `pg/int8` carries, which every codec of that data type shares. The descriptor
1225
+ * claims no target type, so `int8` in type position stays `pg/int8@1`.
1185
1226
  */
1186
1227
  var PgInt8NumberCodec = class extends CodecImpl {
1187
1228
  async encode(value, _ctx) {
@@ -1202,8 +1243,9 @@ var PgInt8NumberDescriptor = class extends PostgresCodecDescriptor {
1202
1243
  return PG_INT8_NATIVE_TYPE;
1203
1244
  }
1204
1245
  jsonProjection(expression) {
1205
- return expression;
1246
+ return decimalTextJsonProjection(expression);
1206
1247
  }
1248
+ dataType = pgInt8.id;
1207
1249
  codecId = PG_INT8_NUMBER_CODEC_ID;
1208
1250
  traits = [
1209
1251
  "equality",
@@ -1213,7 +1255,7 @@ var PgInt8NumberDescriptor = class extends PostgresCodecDescriptor {
1213
1255
  targetTypes = [];
1214
1256
  paramsSchema = voidParamsSchema;
1215
1257
  renderValueLiteral(value) {
1216
- return renderTsLiteral(value);
1258
+ return decimalTextNumberLiteral(value);
1217
1259
  }
1218
1260
  factory() {
1219
1261
  return () => new PgInt8NumberCodec(this);
@@ -1223,16 +1265,16 @@ const pgInt8NumberDescriptor = new PgInt8NumberDescriptor();
1223
1265
  const pgInt8NumberColumn = () => column(pgInt8NumberDescriptor.factory(), pgInt8NumberDescriptor.codecId, void 0, "int8");
1224
1266
  var PgFloat4Codec = class extends CodecImpl {
1225
1267
  async encode(value, _ctx) {
1226
- return value;
1268
+ return pgFloatEncode(value);
1227
1269
  }
1228
1270
  async decode(wire, _ctx) {
1229
1271
  return decodePostgresNumberWire(wire);
1230
1272
  }
1231
1273
  encodeJson(value) {
1232
- return value;
1274
+ return pgFloatEncodeJson(value);
1233
1275
  }
1234
1276
  decodeJson(json) {
1235
- return blindCast(json);
1277
+ return pgFloatDecodeJson(PG_FLOAT4_CODEC_ID, json);
1236
1278
  }
1237
1279
  };
1238
1280
  var PgFloat4Descriptor = class extends PostgresCodecDescriptor {
@@ -1242,6 +1284,7 @@ var PgFloat4Descriptor = class extends PostgresCodecDescriptor {
1242
1284
  jsonProjection(expression) {
1243
1285
  return expression;
1244
1286
  }
1287
+ dataType = pgFloat4.id;
1245
1288
  codecId = PG_FLOAT4_CODEC_ID;
1246
1289
  traits = [
1247
1290
  "equality",
@@ -1261,16 +1304,16 @@ const pgFloat4Descriptor = new PgFloat4Descriptor();
1261
1304
  const pgFloat4Column = () => column(pgFloat4Descriptor.factory(), pgFloat4Descriptor.codecId, void 0, "float4");
1262
1305
  var PgFloat8Codec = class extends CodecImpl {
1263
1306
  async encode(value, _ctx) {
1264
- return value;
1307
+ return pgFloatEncode(value);
1265
1308
  }
1266
1309
  async decode(wire, _ctx) {
1267
1310
  return decodePostgresNumberWire(wire);
1268
1311
  }
1269
1312
  encodeJson(value) {
1270
- return value;
1313
+ return pgFloatEncodeJson(value);
1271
1314
  }
1272
1315
  decodeJson(json) {
1273
- return blindCast(json);
1316
+ return pgFloatDecodeJson(PG_FLOAT8_CODEC_ID, json);
1274
1317
  }
1275
1318
  };
1276
1319
  var PgFloat8Descriptor = class extends PostgresCodecDescriptor {
@@ -1280,6 +1323,7 @@ var PgFloat8Descriptor = class extends PostgresCodecDescriptor {
1280
1323
  jsonProjection(expression) {
1281
1324
  return expression;
1282
1325
  }
1326
+ dataType = pgFloat8.id;
1283
1327
  codecId = PG_FLOAT8_CODEC_ID;
1284
1328
  traits = [
1285
1329
  "equality",
@@ -1318,6 +1362,7 @@ var PgBoolDescriptor = class extends PostgresCodecDescriptor {
1318
1362
  jsonProjection(expression) {
1319
1363
  return expression;
1320
1364
  }
1365
+ dataType = pgBool.id;
1321
1366
  codecId = PG_BOOL_CODEC_ID;
1322
1367
  traits = ["equality", "boolean"];
1323
1368
  targetTypes = ["bool"];
@@ -1360,6 +1405,7 @@ var PgNumericDescriptor = class extends PostgresCodecDescriptor {
1360
1405
  jsonProjection(expression) {
1361
1406
  return decimalTextJsonProjection(expression);
1362
1407
  }
1408
+ dataType = pgNumeric.id;
1363
1409
  codecId = PG_NUMERIC_CODEC_ID;
1364
1410
  traits = [
1365
1411
  "equality",
@@ -1408,6 +1454,7 @@ var PgUnboundedIntDescriptor = class extends PostgresCodecDescriptor {
1408
1454
  jsonProjection(expression) {
1409
1455
  return decimalTextJsonProjection(expression);
1410
1456
  }
1457
+ dataType = pgNumeric.id;
1411
1458
  codecId = PG_UNBOUNDED_INT_CODEC_ID;
1412
1459
  traits = [
1413
1460
  "equality",
@@ -1446,6 +1493,7 @@ var PgTimetzDescriptor = class extends PostgresCodecDescriptor {
1446
1493
  jsonProjection(expression) {
1447
1494
  return expression;
1448
1495
  }
1496
+ dataType = pgTimetz.id;
1449
1497
  codecId = PG_TIMETZ_CODEC_ID;
1450
1498
  traits = ["equality", "order"];
1451
1499
  targetTypes = ["timetz"];
@@ -1480,6 +1528,7 @@ var PgBitDescriptor = class extends PostgresCodecDescriptor {
1480
1528
  jsonProjection(expression) {
1481
1529
  return expression;
1482
1530
  }
1531
+ dataType = pgBit.id;
1483
1532
  codecId = PG_BIT_CODEC_ID;
1484
1533
  traits = ["equality", "order"];
1485
1534
  targetTypes = ["bit"];
@@ -1514,6 +1563,7 @@ var PgVarbitDescriptor = class extends PostgresCodecDescriptor {
1514
1563
  jsonProjection(expression) {
1515
1564
  return expression;
1516
1565
  }
1566
+ dataType = pgVarbit.id;
1517
1567
  codecId = PG_VARBIT_CODEC_ID;
1518
1568
  traits = ["equality", "order"];
1519
1569
  targetTypes = ["bit varying"];
@@ -1548,6 +1598,7 @@ var PgByteaDescriptor = class extends PostgresCodecDescriptor {
1548
1598
  jsonProjection(expression) {
1549
1599
  return base64JsonProjection(expression);
1550
1600
  }
1601
+ dataType = pgBytea.id;
1551
1602
  codecId = PG_BYTEA_CODEC_ID;
1552
1603
  traits = ["equality"];
1553
1604
  targetTypes = ["bytea"];
@@ -1579,6 +1630,7 @@ var PgUuidDescriptor = class extends PostgresCodecDescriptor {
1579
1630
  jsonProjection(expression) {
1580
1631
  return expression;
1581
1632
  }
1633
+ dataType = pgUuid.id;
1582
1634
  codecId = PG_UUID_CODEC_ID;
1583
1635
  traits = ["equality", "order"];
1584
1636
  targetTypes = ["uuid"];
@@ -1611,6 +1663,7 @@ var PgInetDescriptor = class extends PostgresCodecDescriptor {
1611
1663
  jsonProjection(expression) {
1612
1664
  return expression;
1613
1665
  }
1666
+ dataType = pgInet.id;
1614
1667
  codecId = PG_INET_CODEC_ID;
1615
1668
  traits = ["equality", "order"];
1616
1669
  targetTypes = ["inet"];
@@ -1659,6 +1712,7 @@ var PgIntervalDescriptor = class extends PostgresCodecDescriptor {
1659
1712
  jsonProjection(expression) {
1660
1713
  return isoDurationJsonProjection(expression);
1661
1714
  }
1715
+ dataType = pgInterval.id;
1662
1716
  codecId = PG_INTERVAL_CODEC_ID;
1663
1717
  traits = ["equality", "order"];
1664
1718
  targetTypes = ["interval"];
@@ -1693,6 +1747,7 @@ var PgJsonDescriptor = class extends PostgresCodecDescriptor {
1693
1747
  jsonProjection(expression) {
1694
1748
  return expression;
1695
1749
  }
1750
+ dataType = pgJson.id;
1696
1751
  codecId = PG_JSON_CODEC_ID;
1697
1752
  traits = [];
1698
1753
  targetTypes = ["json"];
@@ -1724,6 +1779,7 @@ var PgJsonbDescriptor = class extends PostgresCodecDescriptor {
1724
1779
  jsonProjection(expression) {
1725
1780
  return expression;
1726
1781
  }
1782
+ dataType = pgJsonb.id;
1727
1783
  codecId = PG_JSONB_CODEC_ID;
1728
1784
  traits = ["equality"];
1729
1785
  targetTypes = ["jsonb"];
@@ -1755,6 +1811,7 @@ var PgCharDescriptor = class extends PostgresCodecDescriptor {
1755
1811
  jsonProjection(expression) {
1756
1812
  return expression;
1757
1813
  }
1814
+ dataType = pgChar.id;
1758
1815
  codecId = PG_CHAR_CODEC_ID;
1759
1816
  targetTypes = ["character"];
1760
1817
  traits = sqlCharDescriptor.traits;
@@ -1778,6 +1835,7 @@ var PgVarcharDescriptor = class extends PostgresCodecDescriptor {
1778
1835
  jsonProjection(expression) {
1779
1836
  return expression;
1780
1837
  }
1838
+ dataType = pgVarchar.id;
1781
1839
  codecId = PG_VARCHAR_CODEC_ID;
1782
1840
  targetTypes = ["character varying"];
1783
1841
  traits = sqlVarcharDescriptor.traits;
@@ -1801,6 +1859,7 @@ var PgIntDescriptor = class extends PostgresCodecDescriptor {
1801
1859
  jsonProjection(expression) {
1802
1860
  return expression;
1803
1861
  }
1862
+ dataType = pgInt4.id;
1804
1863
  codecId = PG_INT_CODEC_ID;
1805
1864
  targetTypes = ["int4"];
1806
1865
  traits = sqlIntDescriptor.traits;
@@ -1821,6 +1880,7 @@ var PgFloatDescriptor = class extends PostgresCodecDescriptor {
1821
1880
  jsonProjection(expression) {
1822
1881
  return expression;
1823
1882
  }
1883
+ dataType = pgFloat8.id;
1824
1884
  codecId = PG_FLOAT_CODEC_ID;
1825
1885
  targetTypes = ["float8"];
1826
1886
  traits = sqlFloatDescriptor.traits;
@@ -1878,4 +1938,4 @@ const codecDescriptors = definePostgresCodecs([
1878
1938
  //#endregion
1879
1939
  export { postgresQualifyColumnType as A, pgTimestamptzDateColumn as C, pgUuidColumn as D, pgUnboundedIntColumn as E, pgVarbitColumn as O, pgTextColumn as S, pgTimetzColumn as T, pgIntColumn as _, pgBitColumn as a, pgJsonbColumn as b, pgEnumDescriptor as c, pgFloatColumn as d, pgInetColumn as f, pgInt8NumberColumn as g, pgInt8Column as h, isPgEnumParams as i, pgVarcharColumn as k, pgFloat4Column as l, pgInt4Column as m, PgTimestamptzDateDescriptor as n, pgBoolColumn as o, pgInt2Column as p, codecDescriptors as r, pgCharColumn as s, PgTimestamptzDateCodec as t, pgFloat8Column as u, pgIntervalColumn as v, pgTimestamptzDateDescriptor as w, pgNumericColumn as x, pgJsonColumn as y };
1880
1940
 
1881
- //# sourceMappingURL=codecs-7isLDrZp-DmbSAn6K.mjs.map
1941
+ //# sourceMappingURL=codecs-C7OoUG-w-BvO1qMT0.mjs.map