@prisma/adapter-d1 6.10.0-dev.2 → 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 +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -192,14 +192,16 @@ function convertDriverError(error) {
|
|
|
192
192
|
let stripped = error.message.split("D1_ERROR: ").at(1) ?? error.message;
|
|
193
193
|
stripped = stripped.split("SqliteError: ").at(1) ?? stripped;
|
|
194
194
|
if (stripped.startsWith("UNIQUE constraint failed") || stripped.startsWith("PRIMARY KEY constraint failed")) {
|
|
195
|
+
const fields = stripped.split(": ").at(1)?.split(", ").map((field) => field.split(".").pop());
|
|
195
196
|
return {
|
|
196
197
|
kind: "UniqueConstraintViolation",
|
|
197
|
-
|
|
198
|
+
constraint: fields !== void 0 ? { fields } : void 0
|
|
198
199
|
};
|
|
199
200
|
} else if (stripped.startsWith("NOT NULL constraint failed")) {
|
|
201
|
+
const fields = stripped.split(": ").at(1)?.split(", ").map((field) => field.split(".").pop());
|
|
200
202
|
return {
|
|
201
203
|
kind: "NullConstraintViolation",
|
|
202
|
-
|
|
204
|
+
constraint: fields !== void 0 ? { fields } : void 0
|
|
203
205
|
};
|
|
204
206
|
} else if (stripped.startsWith("FOREIGN KEY constraint failed") || stripped.startsWith("CHECK constraint failed")) {
|
|
205
207
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -158,14 +158,16 @@ function convertDriverError(error) {
|
|
|
158
158
|
let stripped = error.message.split("D1_ERROR: ").at(1) ?? error.message;
|
|
159
159
|
stripped = stripped.split("SqliteError: ").at(1) ?? stripped;
|
|
160
160
|
if (stripped.startsWith("UNIQUE constraint failed") || stripped.startsWith("PRIMARY KEY constraint failed")) {
|
|
161
|
+
const fields = stripped.split(": ").at(1)?.split(", ").map((field) => field.split(".").pop());
|
|
161
162
|
return {
|
|
162
163
|
kind: "UniqueConstraintViolation",
|
|
163
|
-
|
|
164
|
+
constraint: fields !== void 0 ? { fields } : void 0
|
|
164
165
|
};
|
|
165
166
|
} else if (stripped.startsWith("NOT NULL constraint failed")) {
|
|
167
|
+
const fields = stripped.split(": ").at(1)?.split(", ").map((field) => field.split(".").pop());
|
|
166
168
|
return {
|
|
167
169
|
kind: "NullConstraintViolation",
|
|
168
|
-
|
|
170
|
+
constraint: fields !== void 0 ? { fields } : void 0
|
|
169
171
|
};
|
|
170
172
|
} else if (stripped.startsWith("FOREIGN KEY constraint failed") || stripped.startsWith("CHECK constraint failed")) {
|
|
171
173
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-d1",
|
|
3
|
-
"version": "6.10.0-dev.
|
|
3
|
+
"version": "6.10.0-dev.4",
|
|
4
4
|
"description": "Prisma's driver adapter for Cloudflare D1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@cloudflare/workers-types": "4.20250214.0",
|
|
39
39
|
"ky": "1.7.5",
|
|
40
|
-
"@prisma/driver-adapter-utils": "6.10.0-dev.
|
|
40
|
+
"@prisma/driver-adapter-utils": "6.10.0-dev.4"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "DEV=true tsx helpers/build.ts",
|