@prisma/client-engine-runtime 7.2.0-dev.4 → 7.2.0-dev.6

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
@@ -47,8 +47,11 @@ export declare type CompactedBatchResponse = {
47
47
  */
48
48
  export declare function convertCompactedRows(rows: {}[], compiledBatch: CompactedBatchResponse): unknown[];
49
49
 
50
- export declare class DataMapperError extends Error {
50
+ export declare class DataMapperError extends UserFacingError {
51
51
  name: string;
52
+ constructor(message: string, options?: {
53
+ cause?: unknown;
54
+ });
52
55
  }
53
56
 
54
57
  export declare type DataRule = {
package/dist/index.d.ts CHANGED
@@ -47,8 +47,11 @@ export declare type CompactedBatchResponse = {
47
47
  */
48
48
  export declare function convertCompactedRows(rows: {}[], compiledBatch: CompactedBatchResponse): unknown[];
49
49
 
50
- export declare class DataMapperError extends Error {
50
+ export declare class DataMapperError extends UserFacingError {
51
51
  name: string;
52
+ constructor(message: string, options?: {
53
+ cause?: unknown;
54
+ });
52
55
  }
53
56
 
54
57
  export declare type DataRule = {
package/dist/index.js CHANGED
@@ -300,6 +300,8 @@ function getErrorCode(err) {
300
300
  return "P2002";
301
301
  case "ForeignKeyConstraintViolation":
302
302
  return "P2003";
303
+ case "InvalidInputValue":
304
+ return "P2007";
303
305
  case "UnsupportedNativeDataType":
304
306
  return "P2010";
305
307
  case "NullConstraintViolation":
@@ -396,6 +398,8 @@ function renderErrorMessage(err) {
396
398
  return `Error in external connector (id ${err.cause.id})`;
397
399
  case "TooManyConnections":
398
400
  return `Too many database connections opened: ${err.cause.cause}`;
401
+ case "InvalidInputValue":
402
+ return `Invalid input value: ${err.cause.message}`;
399
403
  case "sqlite":
400
404
  case "postgres":
401
405
  case "mysql":
@@ -445,8 +449,11 @@ function convertCompactedRows(rows, compiledBatch) {
445
449
 
446
450
  // src/interpreter/data-mapper.ts
447
451
  var import_client_runtime_utils3 = require("@prisma/client-runtime-utils");
448
- var DataMapperError = class extends Error {
452
+ var DataMapperError = class extends UserFacingError {
449
453
  name = "DataMapperError";
454
+ constructor(message, options) {
455
+ super(message, "P2023", options);
456
+ }
450
457
  };
451
458
  function applyDataMap(data, structure, enums) {
452
459
  switch (structure.type) {
package/dist/index.mjs CHANGED
@@ -249,6 +249,8 @@ function getErrorCode(err) {
249
249
  return "P2002";
250
250
  case "ForeignKeyConstraintViolation":
251
251
  return "P2003";
252
+ case "InvalidInputValue":
253
+ return "P2007";
252
254
  case "UnsupportedNativeDataType":
253
255
  return "P2010";
254
256
  case "NullConstraintViolation":
@@ -345,6 +347,8 @@ function renderErrorMessage(err) {
345
347
  return `Error in external connector (id ${err.cause.id})`;
346
348
  case "TooManyConnections":
347
349
  return `Too many database connections opened: ${err.cause.cause}`;
350
+ case "InvalidInputValue":
351
+ return `Invalid input value: ${err.cause.message}`;
348
352
  case "sqlite":
349
353
  case "postgres":
350
354
  case "mysql":
@@ -394,8 +398,11 @@ function convertCompactedRows(rows, compiledBatch) {
394
398
 
395
399
  // src/interpreter/data-mapper.ts
396
400
  import { Decimal as Decimal3 } from "@prisma/client-runtime-utils";
397
- var DataMapperError = class extends Error {
401
+ var DataMapperError = class extends UserFacingError {
398
402
  name = "DataMapperError";
403
+ constructor(message, options) {
404
+ super(message, "P2023", options);
405
+ }
399
406
  };
400
407
  function applyDataMap(data, structure, enums) {
401
408
  switch (structure.type) {
@@ -1,6 +1,10 @@
1
1
  import { ResultNode } from '../query-plan';
2
+ import { UserFacingError } from '../user-facing-error';
2
3
  import { Value } from './scope';
3
- export declare class DataMapperError extends Error {
4
+ export declare class DataMapperError extends UserFacingError {
4
5
  name: string;
6
+ constructor(message: string, options?: {
7
+ cause?: unknown;
8
+ });
5
9
  }
6
10
  export declare function applyDataMap(data: Value, structure: ResultNode, enums: Record<string, Record<string, string>>): Value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "7.2.0-dev.4",
3
+ "version": "7.2.0-dev.6",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,10 +30,10 @@
30
30
  "nanoid": "5.1.5",
31
31
  "ulid": "3.0.0",
32
32
  "uuid": "11.1.0",
33
- "@prisma/client-runtime-utils": "7.2.0-dev.4",
34
- "@prisma/driver-adapter-utils": "7.2.0-dev.4",
35
- "@prisma/debug": "7.2.0-dev.4",
36
- "@prisma/sqlcommenter": "7.2.0-dev.4"
33
+ "@prisma/client-runtime-utils": "7.2.0-dev.6",
34
+ "@prisma/debug": "7.2.0-dev.6",
35
+ "@prisma/driver-adapter-utils": "7.2.0-dev.6",
36
+ "@prisma/sqlcommenter": "7.2.0-dev.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "29.5.14",