@prisma/adapter-mariadb 7.10.0-dev.43 → 7.10.0-dev.44

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
@@ -190,10 +190,14 @@ function convertDriverError(error) {
190
190
  function mapDriverError(error) {
191
191
  switch (error.errno) {
192
192
  case 1062: {
193
- const index = error.sqlMessage?.split(" ").pop()?.split("'").at(1)?.split(".").pop();
193
+ const rawKey = error.sqlMessage?.split(" ").pop()?.split("'").at(1);
194
+ const keyParts = rawKey?.split(".");
195
+ const table = keyParts && keyParts.length > 1 ? keyParts.slice(0, -1).join(".") : void 0;
196
+ const index = keyParts?.at(-1);
194
197
  return {
195
198
  kind: "UniqueConstraintViolation",
196
- constraint: index !== void 0 ? { index } : void 0
199
+ constraint: index !== void 0 ? { index } : void 0,
200
+ table
197
201
  };
198
202
  }
199
203
  case 1451:
package/dist/index.mjs CHANGED
@@ -154,10 +154,14 @@ function convertDriverError(error) {
154
154
  function mapDriverError(error) {
155
155
  switch (error.errno) {
156
156
  case 1062: {
157
- const index = error.sqlMessage?.split(" ").pop()?.split("'").at(1)?.split(".").pop();
157
+ const rawKey = error.sqlMessage?.split(" ").pop()?.split("'").at(1);
158
+ const keyParts = rawKey?.split(".");
159
+ const table = keyParts && keyParts.length > 1 ? keyParts.slice(0, -1).join(".") : void 0;
160
+ const index = keyParts?.at(-1);
158
161
  return {
159
162
  kind: "UniqueConstraintViolation",
160
- constraint: index !== void 0 ? { index } : void 0
163
+ constraint: index !== void 0 ? { index } : void 0,
164
+ table
161
165
  };
162
166
  }
163
167
  case 1451:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-mariadb",
3
- "version": "7.10.0-dev.43",
3
+ "version": "7.10.0-dev.44",
4
4
  "description": "Prisma's driver adapter for \"mariadb\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,10 +32,10 @@
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
34
  "mariadb": "3.4.5",
35
- "@prisma/driver-adapter-utils": "7.10.0-dev.43"
35
+ "@prisma/driver-adapter-utils": "7.10.0-dev.44"
36
36
  },
37
37
  "devDependencies": {
38
- "@prisma/debug": "7.10.0-dev.43"
38
+ "@prisma/debug": "7.10.0-dev.44"
39
39
  },
40
40
  "scripts": {
41
41
  "dev": "DEV=true tsx helpers/build.ts",