@prisma/client-engine-runtime 7.5.0-dev.7 → 7.5.0-dev.9

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.
package/dist/index.d.mts CHANGED
@@ -80,7 +80,7 @@ export declare type DecimalTaggedValue = {
80
80
  value: string;
81
81
  };
82
82
 
83
- export declare function deserializeJsonResponse(result: unknown): unknown;
83
+ export declare function deserializeJsonObject(result: unknown): unknown;
84
84
 
85
85
  /**
86
86
  * Checks if two objects representing the names and values of key columns match. A match is
@@ -187,7 +187,7 @@ export declare type JoinExpression = {
187
187
  isRelationUnique: boolean;
188
188
  };
189
189
 
190
- export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue;
190
+ export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue | RawTaggedValue;
191
191
 
192
192
  export declare type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
193
193
 
@@ -421,6 +421,11 @@ export declare type RawResponse = {
421
421
  rows: unknown[][];
422
422
  };
423
423
 
424
+ export declare type RawTaggedValue = {
425
+ $type: 'Raw';
426
+ value: unknown;
427
+ };
428
+
424
429
  export declare type ResultNode = {
425
430
  type: 'affectedRows';
426
431
  } | {
package/dist/index.d.ts CHANGED
@@ -80,7 +80,7 @@ export declare type DecimalTaggedValue = {
80
80
  value: string;
81
81
  };
82
82
 
83
- export declare function deserializeJsonResponse(result: unknown): unknown;
83
+ export declare function deserializeJsonObject(result: unknown): unknown;
84
84
 
85
85
  /**
86
86
  * Checks if two objects representing the names and values of key columns match. A match is
@@ -187,7 +187,7 @@ export declare type JoinExpression = {
187
187
  isRelationUnique: boolean;
188
188
  };
189
189
 
190
- export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue;
190
+ export declare type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue | RawTaggedValue;
191
191
 
192
192
  export declare type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
193
193
 
@@ -421,6 +421,11 @@ export declare type RawResponse = {
421
421
  rows: unknown[][];
422
422
  };
423
423
 
424
+ export declare type RawTaggedValue = {
425
+ $type: 'Raw';
426
+ value: unknown;
427
+ };
428
+
424
429
  export declare type ResultNode = {
425
430
  type: 'affectedRows';
426
431
  } | {
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ __export(index_exports, {
37
37
  UserFacingError: () => UserFacingError,
38
38
  applySqlCommenters: () => applySqlCommenters,
39
39
  convertCompactedRows: () => convertCompactedRows,
40
- deserializeJsonResponse: () => deserializeJsonResponse,
40
+ deserializeJsonObject: () => deserializeJsonObject,
41
41
  doKeysMatch: () => doKeysMatch,
42
42
  isDeepStrictEqual: () => isDeepStrictEqual,
43
43
  isPrismaValueGenerator: () => isPrismaValueGenerator,
@@ -170,7 +170,10 @@ function normalizeJsonProtocolValues(result) {
170
170
  function isTaggedValue(value) {
171
171
  return value !== null && typeof value == "object" && typeof value["$type"] === "string";
172
172
  }
173
- function normalizeTaggedValue({ $type, value }) {
173
+ function normalizeTaggedValue({
174
+ $type,
175
+ value
176
+ }) {
174
177
  switch ($type) {
175
178
  case "BigInt":
176
179
  return { $type, value: String(value) };
@@ -182,6 +185,12 @@ function normalizeTaggedValue({ $type, value }) {
182
185
  return { $type, value: String(new import_client_runtime_utils2.Decimal(value)) };
183
186
  case "Json":
184
187
  return { $type, value: JSON.stringify(JSON.parse(value)) };
188
+ case "Raw":
189
+ return { $type, value };
190
+ case "FieldRef":
191
+ return { $type, value };
192
+ case "Enum":
193
+ return { $type, value };
185
194
  default:
186
195
  assertNever(value, "Unknown tagged value");
187
196
  }
@@ -193,12 +202,12 @@ function mapObjectValues(object, mapper) {
193
202
  }
194
203
  return result;
195
204
  }
196
- function deserializeJsonResponse(result) {
205
+ function deserializeJsonObject(result) {
197
206
  if (result === null) {
198
207
  return result;
199
208
  }
200
209
  if (Array.isArray(result)) {
201
- return result.map(deserializeJsonResponse);
210
+ return result.map(deserializeJsonObject);
202
211
  }
203
212
  if (typeof result === "object") {
204
213
  if (isTaggedValue(result)) {
@@ -207,7 +216,7 @@ function deserializeJsonResponse(result) {
207
216
  if (result.constructor !== null && result.constructor.name !== "Object") {
208
217
  return result;
209
218
  }
210
- return mapObjectValues(result, deserializeJsonResponse);
219
+ return mapObjectValues(result, deserializeJsonObject);
211
220
  }
212
221
  return result;
213
222
  }
@@ -225,6 +234,12 @@ function deserializeTaggedValue({ $type, value }) {
225
234
  return new import_client_runtime_utils2.Decimal(value);
226
235
  case "Json":
227
236
  return JSON.parse(value);
237
+ case "Raw":
238
+ return value;
239
+ case "FieldRef":
240
+ throw new Error("FieldRef tagged values cannot be deserialized to JavaScript values");
241
+ case "Enum":
242
+ return value;
228
243
  default:
229
244
  assertNever(value, "Unknown tagged value");
230
245
  }
@@ -456,7 +471,7 @@ function resolveArgPlaceholders(args, placeholderValues) {
456
471
  function convertCompactedRows(rows, compiledBatch, placeholderValues = {}) {
457
472
  const keysPerRow = rows.map(
458
473
  (item) => compiledBatch.keys.reduce((acc, key) => {
459
- acc[key] = deserializeJsonResponse(item[key]);
474
+ acc[key] = deserializeJsonObject(item[key]);
460
475
  return acc;
461
476
  }, {})
462
477
  );
@@ -2266,7 +2281,7 @@ function createTimeoutIfDefined(cb, ms) {
2266
2281
  UserFacingError,
2267
2282
  applySqlCommenters,
2268
2283
  convertCompactedRows,
2269
- deserializeJsonResponse,
2284
+ deserializeJsonObject,
2270
2285
  doKeysMatch,
2271
2286
  isDeepStrictEqual,
2272
2287
  isPrismaValueGenerator,
package/dist/index.mjs CHANGED
@@ -119,7 +119,10 @@ function normalizeJsonProtocolValues(result) {
119
119
  function isTaggedValue(value) {
120
120
  return value !== null && typeof value == "object" && typeof value["$type"] === "string";
121
121
  }
122
- function normalizeTaggedValue({ $type, value }) {
122
+ function normalizeTaggedValue({
123
+ $type,
124
+ value
125
+ }) {
123
126
  switch ($type) {
124
127
  case "BigInt":
125
128
  return { $type, value: String(value) };
@@ -131,6 +134,12 @@ function normalizeTaggedValue({ $type, value }) {
131
134
  return { $type, value: String(new Decimal2(value)) };
132
135
  case "Json":
133
136
  return { $type, value: JSON.stringify(JSON.parse(value)) };
137
+ case "Raw":
138
+ return { $type, value };
139
+ case "FieldRef":
140
+ return { $type, value };
141
+ case "Enum":
142
+ return { $type, value };
134
143
  default:
135
144
  assertNever(value, "Unknown tagged value");
136
145
  }
@@ -142,12 +151,12 @@ function mapObjectValues(object, mapper) {
142
151
  }
143
152
  return result;
144
153
  }
145
- function deserializeJsonResponse(result) {
154
+ function deserializeJsonObject(result) {
146
155
  if (result === null) {
147
156
  return result;
148
157
  }
149
158
  if (Array.isArray(result)) {
150
- return result.map(deserializeJsonResponse);
159
+ return result.map(deserializeJsonObject);
151
160
  }
152
161
  if (typeof result === "object") {
153
162
  if (isTaggedValue(result)) {
@@ -156,7 +165,7 @@ function deserializeJsonResponse(result) {
156
165
  if (result.constructor !== null && result.constructor.name !== "Object") {
157
166
  return result;
158
167
  }
159
- return mapObjectValues(result, deserializeJsonResponse);
168
+ return mapObjectValues(result, deserializeJsonObject);
160
169
  }
161
170
  return result;
162
171
  }
@@ -174,6 +183,12 @@ function deserializeTaggedValue({ $type, value }) {
174
183
  return new Decimal2(value);
175
184
  case "Json":
176
185
  return JSON.parse(value);
186
+ case "Raw":
187
+ return value;
188
+ case "FieldRef":
189
+ throw new Error("FieldRef tagged values cannot be deserialized to JavaScript values");
190
+ case "Enum":
191
+ return value;
177
192
  default:
178
193
  assertNever(value, "Unknown tagged value");
179
194
  }
@@ -405,7 +420,7 @@ function resolveArgPlaceholders(args, placeholderValues) {
405
420
  function convertCompactedRows(rows, compiledBatch, placeholderValues = {}) {
406
421
  const keysPerRow = rows.map(
407
422
  (item) => compiledBatch.keys.reduce((acc, key) => {
408
- acc[key] = deserializeJsonResponse(item[key]);
423
+ acc[key] = deserializeJsonObject(item[key]);
409
424
  return acc;
410
425
  }, {})
411
426
  );
@@ -2214,7 +2229,7 @@ export {
2214
2229
  UserFacingError,
2215
2230
  applySqlCommenters,
2216
2231
  convertCompactedRows,
2217
- deserializeJsonResponse,
2232
+ deserializeJsonObject,
2218
2233
  doKeysMatch,
2219
2234
  isDeepStrictEqual,
2220
2235
  isPrismaValueGenerator,
@@ -29,10 +29,14 @@ export type JsonTaggedValue = {
29
29
  $type: 'Json';
30
30
  value: string;
31
31
  };
32
- export type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue;
32
+ export type RawTaggedValue = {
33
+ $type: 'Raw';
34
+ value: unknown;
35
+ };
36
+ export type JsonInputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | FieldRefTaggedValue | JsonTaggedValue | EnumTaggedValue | RawTaggedValue;
33
37
  export type JsonOutputTaggedValue = DateTaggedValue | DecimalTaggedValue | BytesTaggedValue | BigIntTaggedValue | JsonTaggedValue;
34
38
  export type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | {
35
39
  [key: string]: JsOutputValue;
36
40
  };
37
41
  export declare function normalizeJsonProtocolValues(result: unknown): unknown;
38
- export declare function deserializeJsonResponse(result: unknown): unknown;
42
+ export declare function deserializeJsonObject(result: unknown): unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "7.5.0-dev.7",
3
+ "version": "7.5.0-dev.9",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,10 +31,10 @@
31
31
  "nanoid": "5.1.5",
32
32
  "ulid": "3.0.0",
33
33
  "uuid": "11.1.0",
34
- "@prisma/client-runtime-utils": "7.5.0-dev.7",
35
- "@prisma/debug": "7.5.0-dev.7",
36
- "@prisma/sqlcommenter": "7.5.0-dev.7",
37
- "@prisma/driver-adapter-utils": "7.5.0-dev.7"
34
+ "@prisma/client-runtime-utils": "7.5.0-dev.9",
35
+ "@prisma/debug": "7.5.0-dev.9",
36
+ "@prisma/driver-adapter-utils": "7.5.0-dev.9",
37
+ "@prisma/sqlcommenter": "7.5.0-dev.9"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@codspeed/benchmark.js-plugin": "4.0.0",