@prisma/adapter-pg 7.6.0-dev.5 → 7.6.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.js CHANGED
@@ -519,11 +519,13 @@ function mapDriverError(error) {
519
519
  kind: "TableDoesNotExist",
520
520
  table: error.message.split(" ").at(1)?.split('"').at(1)
521
521
  };
522
- case "42703":
522
+ case "42703": {
523
+ const rawColumn = error.message.match(/^column (.+) does not exist$/)?.at(1);
523
524
  return {
524
525
  kind: "ColumnNotFound",
525
- column: error.message.split(" ").at(1)?.split('"').at(1)
526
+ column: rawColumn?.replace(/"((?:""|[^"])*)"/g, (_, id) => id.replaceAll('""', '"'))
526
527
  };
528
+ }
527
529
  case "42P04":
528
530
  return {
529
531
  kind: "DatabaseAlreadyExists",
package/dist/index.mjs CHANGED
@@ -483,11 +483,13 @@ function mapDriverError(error) {
483
483
  kind: "TableDoesNotExist",
484
484
  table: error.message.split(" ").at(1)?.split('"').at(1)
485
485
  };
486
- case "42703":
486
+ case "42703": {
487
+ const rawColumn = error.message.match(/^column (.+) does not exist$/)?.at(1);
487
488
  return {
488
489
  kind: "ColumnNotFound",
489
- column: error.message.split(" ").at(1)?.split('"').at(1)
490
+ column: rawColumn?.replace(/"((?:""|[^"])*)"/g, (_, id) => id.replaceAll('""', '"'))
490
491
  };
492
+ }
491
493
  case "42P04":
492
494
  return {
493
495
  kind: "DatabaseAlreadyExists",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-pg",
3
- "version": "7.6.0-dev.5",
3
+ "version": "7.6.0-dev.6",
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.11.11",
37
- "@prisma/driver-adapter-utils": "7.6.0-dev.5"
37
+ "@prisma/driver-adapter-utils": "7.6.0-dev.6"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.6.0-dev.5"
40
+ "@prisma/debug": "7.6.0-dev.6"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",