@prisma/adapter-libsql 7.10.0-dev.9 → 7.10.0-integration-prisma7-project-closeout.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.
@@ -219,10 +219,13 @@ function mapDriverError(error) {
219
219
  switch (rawCode) {
220
220
  case 2067:
221
221
  case 1555: {
222
- const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
222
+ const columns = error.message.split("constraint failed: ").at(1)?.split(", ");
223
+ const fields = columns?.map((field) => field.split(".").pop());
224
+ const table = columns?.at(0)?.split(".").slice(0, -1).join(".") || void 0;
223
225
  return {
224
226
  kind: "UniqueConstraintViolation",
225
- constraint: fields !== void 0 ? { fields } : void 0
227
+ constraint: fields !== void 0 ? { fields } : void 0,
228
+ table
226
229
  };
227
230
  }
228
231
  case 1299: {
@@ -193,10 +193,13 @@ function mapDriverError(error) {
193
193
  switch (rawCode) {
194
194
  case 2067:
195
195
  case 1555: {
196
- const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
196
+ const columns = error.message.split("constraint failed: ").at(1)?.split(", ");
197
+ const fields = columns?.map((field) => field.split(".").pop());
198
+ const table = columns?.at(0)?.split(".").slice(0, -1).join(".") || void 0;
197
199
  return {
198
200
  kind: "UniqueConstraintViolation",
199
- constraint: fields !== void 0 ? { fields } : void 0
201
+ constraint: fields !== void 0 ? { fields } : void 0,
202
+ table
200
203
  };
201
204
  }
202
205
  case 1299: {
package/dist/index-web.js CHANGED
@@ -219,10 +219,13 @@ function mapDriverError(error) {
219
219
  switch (rawCode) {
220
220
  case 2067:
221
221
  case 1555: {
222
- const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
222
+ const columns = error.message.split("constraint failed: ").at(1)?.split(", ");
223
+ const fields = columns?.map((field) => field.split(".").pop());
224
+ const table = columns?.at(0)?.split(".").slice(0, -1).join(".") || void 0;
223
225
  return {
224
226
  kind: "UniqueConstraintViolation",
225
- constraint: fields !== void 0 ? { fields } : void 0
227
+ constraint: fields !== void 0 ? { fields } : void 0,
228
+ table
226
229
  };
227
230
  }
228
231
  case 1299: {
@@ -193,10 +193,13 @@ function mapDriverError(error) {
193
193
  switch (rawCode) {
194
194
  case 2067:
195
195
  case 1555: {
196
- const fields = error.message.split("constraint failed: ").at(1)?.split(", ").map((field) => field.split(".").pop());
196
+ const columns = error.message.split("constraint failed: ").at(1)?.split(", ");
197
+ const fields = columns?.map((field) => field.split(".").pop());
198
+ const table = columns?.at(0)?.split(".").slice(0, -1).join(".") || void 0;
197
199
  return {
198
200
  kind: "UniqueConstraintViolation",
199
- constraint: fields !== void 0 ? { fields } : void 0
201
+ constraint: fields !== void 0 ? { fields } : void 0,
202
+ table
200
203
  };
201
204
  }
202
205
  case 1299: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-libsql",
3
- "version": "7.10.0-dev.9",
3
+ "version": "7.10.0-integration-prisma7-project-closeout.6",
4
4
  "description": "Prisma's driver adapter for libSQL and Turso",
5
5
  "main": "dist/index-node.js",
6
6
  "module": "dist/index-node.mjs",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@libsql/client": "^0.17.0",
45
45
  "async-mutex": "0.5.0",
46
- "@prisma/driver-adapter-utils": "7.10.0-dev.9"
46
+ "@prisma/driver-adapter-utils": "7.10.0-integration-prisma7-project-closeout.6"
47
47
  },
48
48
  "scripts": {
49
49
  "dev": "DEV=true tsx helpers/build.ts",