@prisma/client-engine-runtime 6.14.0-dev.32 → 6.14.0-dev.34

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.
@@ -62,6 +62,7 @@ export type ResultNode = {
62
62
  type: 'Object';
63
63
  fields: Record<string, ResultNode>;
64
64
  serializedName: string | null;
65
+ skipNulls: boolean;
65
66
  } | {
66
67
  type: 'Value';
67
68
  dbName: string;
package/dist/index.d.mts CHANGED
@@ -397,6 +397,7 @@ export declare type ResultNode = {
397
397
  type: 'Object';
398
398
  fields: Record<string, ResultNode>;
399
399
  serializedName: string | null;
400
+ skipNulls: boolean;
400
401
  } | {
401
402
  type: 'Value';
402
403
  dbName: string;
package/dist/index.d.ts CHANGED
@@ -397,6 +397,7 @@ export declare type ResultNode = {
397
397
  type: 'Object';
398
398
  fields: Record<string, ResultNode>;
399
399
  serializedName: string | null;
400
+ skipNulls: boolean;
400
401
  } | {
401
402
  type: 'Value';
402
403
  dbName: string;
package/dist/index.js CHANGED
@@ -155,17 +155,20 @@ function applyDataMap(data, structure, enums) {
155
155
  }
156
156
  return { count: data };
157
157
  case "Object":
158
- return mapArrayOrObject(data, structure.fields, enums);
158
+ return mapArrayOrObject(data, structure.fields, enums, structure.skipNulls);
159
159
  case "Value":
160
160
  return mapValue(data, "<result>", structure.resultType, enums);
161
161
  default:
162
162
  assertNever(structure, `Invalid data mapping type: '${structure.type}'`);
163
163
  }
164
164
  }
165
- function mapArrayOrObject(data, fields, enums) {
165
+ function mapArrayOrObject(data, fields, enums, skipNulls) {
166
166
  if (data === null) return null;
167
167
  if (Array.isArray(data)) {
168
- const rows = data;
168
+ let rows = data;
169
+ if (skipNulls) {
170
+ rows = rows.filter((row) => row !== null);
171
+ }
169
172
  return rows.map((row) => mapObject(row, fields, enums));
170
173
  }
171
174
  if (typeof data === "object") {
@@ -181,7 +184,7 @@ function mapArrayOrObject(data, fields, enums) {
181
184
  cause: error
182
185
  });
183
186
  }
184
- return mapArrayOrObject(decodedData, fields, enums);
187
+ return mapArrayOrObject(decodedData, fields, enums, skipNulls);
185
188
  }
186
189
  throw new DataMapperError(`Expected an array or an object, got: ${typeof data}`);
187
190
  }
@@ -202,7 +205,7 @@ function mapObject(data, fields, enums) {
202
205
  );
203
206
  }
204
207
  const target = node.serializedName !== null ? data[node.serializedName] : data;
205
- result[name] = mapArrayOrObject(target, node.fields, enums);
208
+ result[name] = mapArrayOrObject(target, node.fields, enums, node.skipNulls);
206
209
  break;
207
210
  }
208
211
  case "Value":
@@ -458,7 +461,7 @@ function rethrowAsUserFacingRawError(error) {
458
461
  throw error;
459
462
  }
460
463
  throw new UserFacingError(
461
- `Raw query failed. Code: ${error.cause.originalCode ?? "N/A"}. Message: ${error.cause.originalMessage ?? renderErrorMessage(error)}`,
464
+ `Raw query failed. Code: \`${error.cause.originalCode ?? "N/A"}\`. Message: \`${error.cause.originalMessage ?? renderErrorMessage(error)}\``,
462
465
  "P2010",
463
466
  { driverAdapterError: error }
464
467
  );
@@ -574,7 +577,7 @@ function renderErrorMessage(err) {
574
577
  return `The column \`${column}\` does not exist in the current database.`;
575
578
  }
576
579
  case "InvalidIsolationLevel":
577
- return `Invalid isolation level \`${err.cause.level}\``;
580
+ return `Error in connector: Conversion error: ${err.cause.level}`;
578
581
  case "InconsistentColumnData":
579
582
  return `Inconsistent column data: ${err.cause.cause}`;
580
583
  case "MissingFullTextSearchIndex":
@@ -1826,7 +1829,7 @@ var TransactionStartTimeoutError = class extends TransactionManagerError {
1826
1829
  var TransactionExecutionTimeoutError = class extends TransactionManagerError {
1827
1830
  constructor(operation, { timeout, timeTaken }) {
1828
1831
  super(
1829
- `A ${operation} cannot be executed on an expired transaction. The timeout for this transaction was ${timeout} ms, however ${timeTaken} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,
1832
+ `A ${operation} cannot be executed on an expired transaction. The timeout for this transaction was ${timeout} ms, however ${timeTaken} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`,
1830
1833
  { operation, timeout, timeTaken }
1831
1834
  );
1832
1835
  }
@@ -1897,7 +1900,7 @@ var TransactionManager = class {
1897
1900
  this.transactions.set(transaction.id, transaction);
1898
1901
  let hasTimedOut = false;
1899
1902
  const startTimer = setTimeout(() => hasTimedOut = true, validatedOptions.maxWait);
1900
- transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1903
+ transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel).catch(rethrowAsUserFacing);
1901
1904
  clearTimeout(startTimer);
1902
1905
  switch (transaction.status) {
1903
1906
  case "waiting":
package/dist/index.mjs CHANGED
@@ -105,17 +105,20 @@ function applyDataMap(data, structure, enums) {
105
105
  }
106
106
  return { count: data };
107
107
  case "Object":
108
- return mapArrayOrObject(data, structure.fields, enums);
108
+ return mapArrayOrObject(data, structure.fields, enums, structure.skipNulls);
109
109
  case "Value":
110
110
  return mapValue(data, "<result>", structure.resultType, enums);
111
111
  default:
112
112
  assertNever(structure, `Invalid data mapping type: '${structure.type}'`);
113
113
  }
114
114
  }
115
- function mapArrayOrObject(data, fields, enums) {
115
+ function mapArrayOrObject(data, fields, enums, skipNulls) {
116
116
  if (data === null) return null;
117
117
  if (Array.isArray(data)) {
118
- const rows = data;
118
+ let rows = data;
119
+ if (skipNulls) {
120
+ rows = rows.filter((row) => row !== null);
121
+ }
119
122
  return rows.map((row) => mapObject(row, fields, enums));
120
123
  }
121
124
  if (typeof data === "object") {
@@ -131,7 +134,7 @@ function mapArrayOrObject(data, fields, enums) {
131
134
  cause: error
132
135
  });
133
136
  }
134
- return mapArrayOrObject(decodedData, fields, enums);
137
+ return mapArrayOrObject(decodedData, fields, enums, skipNulls);
135
138
  }
136
139
  throw new DataMapperError(`Expected an array or an object, got: ${typeof data}`);
137
140
  }
@@ -152,7 +155,7 @@ function mapObject(data, fields, enums) {
152
155
  );
153
156
  }
154
157
  const target = node.serializedName !== null ? data[node.serializedName] : data;
155
- result[name] = mapArrayOrObject(target, node.fields, enums);
158
+ result[name] = mapArrayOrObject(target, node.fields, enums, node.skipNulls);
156
159
  break;
157
160
  }
158
161
  case "Value":
@@ -408,7 +411,7 @@ function rethrowAsUserFacingRawError(error) {
408
411
  throw error;
409
412
  }
410
413
  throw new UserFacingError(
411
- `Raw query failed. Code: ${error.cause.originalCode ?? "N/A"}. Message: ${error.cause.originalMessage ?? renderErrorMessage(error)}`,
414
+ `Raw query failed. Code: \`${error.cause.originalCode ?? "N/A"}\`. Message: \`${error.cause.originalMessage ?? renderErrorMessage(error)}\``,
412
415
  "P2010",
413
416
  { driverAdapterError: error }
414
417
  );
@@ -524,7 +527,7 @@ function renderErrorMessage(err) {
524
527
  return `The column \`${column}\` does not exist in the current database.`;
525
528
  }
526
529
  case "InvalidIsolationLevel":
527
- return `Invalid isolation level \`${err.cause.level}\``;
530
+ return `Error in connector: Conversion error: ${err.cause.level}`;
528
531
  case "InconsistentColumnData":
529
532
  return `Inconsistent column data: ${err.cause.cause}`;
530
533
  case "MissingFullTextSearchIndex":
@@ -1776,7 +1779,7 @@ var TransactionStartTimeoutError = class extends TransactionManagerError {
1776
1779
  var TransactionExecutionTimeoutError = class extends TransactionManagerError {
1777
1780
  constructor(operation, { timeout, timeTaken }) {
1778
1781
  super(
1779
- `A ${operation} cannot be executed on an expired transaction. The timeout for this transaction was ${timeout} ms, however ${timeTaken} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,
1782
+ `A ${operation} cannot be executed on an expired transaction. The timeout for this transaction was ${timeout} ms, however ${timeTaken} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`,
1780
1783
  { operation, timeout, timeTaken }
1781
1784
  );
1782
1785
  }
@@ -1847,7 +1850,7 @@ var TransactionManager = class {
1847
1850
  this.transactions.set(transaction.id, transaction);
1848
1851
  let hasTimedOut = false;
1849
1852
  const startTimer = setTimeout(() => hasTimedOut = true, validatedOptions.maxWait);
1850
- transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel);
1853
+ transaction.transaction = await this.driverAdapter.startTransaction(validatedOptions.isolationLevel).catch(rethrowAsUserFacing);
1851
1854
  clearTimeout(startTimer);
1852
1855
  switch (transaction.status) {
1853
1856
  case "waiting":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.14.0-dev.32",
3
+ "version": "6.14.0-dev.34",
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,8 +31,8 @@
31
31
  "nanoid": "5.1.5",
32
32
  "ulid": "3.0.0",
33
33
  "uuid": "11.1.0",
34
- "@prisma/debug": "6.14.0-dev.32",
35
- "@prisma/driver-adapter-utils": "6.14.0-dev.32"
34
+ "@prisma/debug": "6.14.0-dev.34",
35
+ "@prisma/driver-adapter-utils": "6.14.0-dev.34"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",