@prisma/adapter-better-sqlite3 6.10.0-dev.3 → 6.10.0-dev.4

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
@@ -421,16 +421,20 @@ function convertDriverError(error) {
421
421
  kind: "SocketTimeout"
422
422
  };
423
423
  case "SQLITE_CONSTRAINT_UNIQUE":
424
- case "SQLITE_CONSTRAINT_PRIMARYKEY":
424
+ case "SQLITE_CONSTRAINT_PRIMARYKEY": {
425
+ const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
425
426
  return {
426
427
  kind: "UniqueConstraintViolation",
427
- fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
428
+ constraint: fields !== void 0 ? { fields } : void 0
428
429
  };
429
- case "SQLITE_CONSTRAINT_NOTNULL":
430
+ }
431
+ case "SQLITE_CONSTRAINT_NOTNULL": {
432
+ const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
430
433
  return {
431
434
  kind: "NullConstraintViolation",
432
- fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
435
+ constraint: fields !== void 0 ? { fields } : void 0
433
436
  };
437
+ }
434
438
  case "SQLITE_CONSTRAINT_FOREIGNKEY":
435
439
  case "SQLITE_CONSTRAINT_TRIGGER":
436
440
  return {
package/dist/index.mjs CHANGED
@@ -385,16 +385,20 @@ function convertDriverError(error) {
385
385
  kind: "SocketTimeout"
386
386
  };
387
387
  case "SQLITE_CONSTRAINT_UNIQUE":
388
- case "SQLITE_CONSTRAINT_PRIMARYKEY":
388
+ case "SQLITE_CONSTRAINT_PRIMARYKEY": {
389
+ const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
389
390
  return {
390
391
  kind: "UniqueConstraintViolation",
391
- fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
392
+ constraint: fields !== void 0 ? { fields } : void 0
392
393
  };
393
- case "SQLITE_CONSTRAINT_NOTNULL":
394
+ }
395
+ case "SQLITE_CONSTRAINT_NOTNULL": {
396
+ const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
394
397
  return {
395
398
  kind: "NullConstraintViolation",
396
- fields: error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop()) ?? []
399
+ constraint: fields !== void 0 ? { fields } : void 0
397
400
  };
401
+ }
398
402
  case "SQLITE_CONSTRAINT_FOREIGNKEY":
399
403
  case "SQLITE_CONSTRAINT_TRIGGER":
400
404
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-better-sqlite3",
3
- "version": "6.10.0-dev.3",
3
+ "version": "6.10.0-dev.4",
4
4
  "description": "Prisma's driver adapter for better-sqlite3, a fast SQLite3 driver for JavaScript runtimes",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "license": "Apache-2.0",
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
- "@prisma/driver-adapter-utils": "6.10.0-dev.3"
34
+ "@prisma/driver-adapter-utils": "6.10.0-dev.4"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/better-sqlite3": "7.6.12",