@prisma/adapter-pg 7.10.0-dev.22 → 7.10.0-dev.24

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
@@ -470,10 +470,18 @@ function mapDriverError(error) {
470
470
  message: error.message
471
471
  };
472
472
  case "23505": {
473
- const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
473
+ let constraint;
474
+ if (error.constraint) {
475
+ constraint = { index: error.constraint };
476
+ } else {
477
+ const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
478
+ if (fields !== void 0) {
479
+ constraint = { fields };
480
+ }
481
+ }
474
482
  return {
475
483
  kind: "UniqueConstraintViolation",
476
- constraint: fields !== void 0 ? { fields } : void 0
484
+ constraint
477
485
  };
478
486
  }
479
487
  case "23502": {
package/dist/index.mjs CHANGED
@@ -434,10 +434,18 @@ function mapDriverError(error) {
434
434
  message: error.message
435
435
  };
436
436
  case "23505": {
437
- const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
437
+ let constraint;
438
+ if (error.constraint) {
439
+ constraint = { index: error.constraint };
440
+ } else {
441
+ const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
442
+ if (fields !== void 0) {
443
+ constraint = { fields };
444
+ }
445
+ }
438
446
  return {
439
447
  kind: "UniqueConstraintViolation",
440
- constraint: fields !== void 0 ? { fields } : void 0
448
+ constraint
441
449
  };
442
450
  }
443
451
  case "23502": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-pg",
3
- "version": "7.10.0-dev.22",
3
+ "version": "7.10.0-dev.24",
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.22"
37
+ "@prisma/driver-adapter-utils": "7.10.0-dev.24"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.10.0-dev.22"
40
+ "@prisma/debug": "7.10.0-dev.24"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",