@prisma/adapter-mariadb 7.2.0 → 7.3.0-integration-prisma6-fix-cloudflare-engine.1

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/README.md CHANGED
@@ -6,7 +6,7 @@ This package contains the driver adapter for Prisma ORM that enables usage of th
6
6
 
7
7
  ## Usage
8
8
 
9
- This section explains how you can use it with Prisma ORM and the `@prisma/adapter-mariadb` driver adapter. Be sure that the `DATABASE_URL` environment variable is set to your MariaDB/MySQL connection string (e.g. loaded using `dotenv` from a `.env` file).
9
+ This section explains how you can use it with Prisma ORM and the `@prisma/adapter-mariadb` driver adapter. Be sure that the `DATABASE_URL` environment variable is set to your MariaDB/MySQL connection string (e.g. in a `.env` file).
10
10
 
11
11
  ### 1. Install the dependencies
12
12
 
package/dist/index.js CHANGED
@@ -130,6 +130,9 @@ function mapArg(arg, argType) {
130
130
  if (typeof arg === "string" && argType.scalarType === "bytes") {
131
131
  return Buffer.from(arg, "base64");
132
132
  }
133
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
134
+ return Buffer.from(arg);
135
+ }
133
136
  if (ArrayBuffer.isView(arg)) {
134
137
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
135
138
  }
@@ -148,6 +151,9 @@ function mapRow(row, fields) {
148
151
  case "DATETIME2" /* DATETIME2 */:
149
152
  return (/* @__PURE__ */ new Date(`${value}Z`)).toISOString().replace(/(\.000)?Z$/, "+00:00");
150
153
  }
154
+ if (Buffer.isBuffer(value)) {
155
+ return Array.from(value);
156
+ }
151
157
  if (typeof value === "bigint") {
152
158
  return value.toString();
153
159
  }
@@ -291,8 +297,7 @@ function mapDriverError(error) {
291
297
  kind: "mysql",
292
298
  code: error.errno,
293
299
  message: error.sqlMessage ?? "N/A",
294
- state: error.sqlState ?? "N/A",
295
- cause: error.cause?.message ?? void 0
300
+ state: error.sqlState ?? "N/A"
296
301
  };
297
302
  }
298
303
  }
package/dist/index.mjs CHANGED
@@ -94,6 +94,9 @@ function mapArg(arg, argType) {
94
94
  if (typeof arg === "string" && argType.scalarType === "bytes") {
95
95
  return Buffer.from(arg, "base64");
96
96
  }
97
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
98
+ return Buffer.from(arg);
99
+ }
97
100
  if (ArrayBuffer.isView(arg)) {
98
101
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
99
102
  }
@@ -112,6 +115,9 @@ function mapRow(row, fields) {
112
115
  case "DATETIME2" /* DATETIME2 */:
113
116
  return (/* @__PURE__ */ new Date(`${value}Z`)).toISOString().replace(/(\.000)?Z$/, "+00:00");
114
117
  }
118
+ if (Buffer.isBuffer(value)) {
119
+ return Array.from(value);
120
+ }
115
121
  if (typeof value === "bigint") {
116
122
  return value.toString();
117
123
  }
@@ -255,8 +261,7 @@ function mapDriverError(error) {
255
261
  kind: "mysql",
256
262
  code: error.errno,
257
263
  message: error.sqlMessage ?? "N/A",
258
- state: error.sqlState ?? "N/A",
259
- cause: error.cause?.message ?? void 0
264
+ state: error.sqlState ?? "N/A"
260
265
  };
261
266
  }
262
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-mariadb",
3
- "version": "7.2.0",
3
+ "version": "7.3.0-integration-prisma6-fix-cloudflare-engine.1",
4
4
  "description": "Prisma's driver adapter for \"mariadb\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,7 @@
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
34
  "mariadb": "3.4.5",
35
- "@prisma/driver-adapter-utils": "7.2.0"
35
+ "@prisma/driver-adapter-utils": "7.3.0-integration-prisma6-fix-cloudflare-engine.1"
36
36
  },
37
37
  "scripts": {
38
38
  "dev": "DEV=true tsx helpers/build.ts",