@prisma/adapter-pg 7.10.0-dev.14 → 7.10.0-dev.16

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.js CHANGED
@@ -495,6 +495,18 @@ function mapDriverError(error) {
495
495
  constraint
496
496
  };
497
497
  }
498
+ case "23001": {
499
+ let constraint;
500
+ if (error.column) {
501
+ constraint = { fields: [error.column] };
502
+ } else if (error.constraint) {
503
+ constraint = { index: error.constraint };
504
+ }
505
+ return {
506
+ kind: "RestrictViolation",
507
+ constraint
508
+ };
509
+ }
498
510
  case "3D000":
499
511
  return {
500
512
  kind: "DatabaseDoesNotExist",
package/dist/index.mjs CHANGED
@@ -459,6 +459,18 @@ function mapDriverError(error) {
459
459
  constraint
460
460
  };
461
461
  }
462
+ case "23001": {
463
+ let constraint;
464
+ if (error.column) {
465
+ constraint = { fields: [error.column] };
466
+ } else if (error.constraint) {
467
+ constraint = { index: error.constraint };
468
+ }
469
+ return {
470
+ kind: "RestrictViolation",
471
+ constraint
472
+ };
473
+ }
462
474
  case "3D000":
463
475
  return {
464
476
  kind: "DatabaseDoesNotExist",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-pg",
3
- "version": "7.10.0-dev.14",
3
+ "version": "7.10.0-dev.16",
4
4
  "description": "Prisma's driver adapter for \"pg\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,10 +34,10 @@
34
34
  "pg": "^8.16.3",
35
35
  "postgres-array": "3.0.4",
36
36
  "@types/pg": "^8.16.0",
37
- "@prisma/driver-adapter-utils": "7.10.0-dev.14"
37
+ "@prisma/driver-adapter-utils": "7.10.0-dev.16"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.10.0-dev.14"
40
+ "@prisma/debug": "7.10.0-dev.16"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",