@prisma/adapter-mssql 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 @@ The `mssql` driver is one of the most popular drivers in the JavaScript ecosyste
6
6
 
7
7
  ## Usage
8
8
 
9
- This section explains how you can use it with Prisma ORM and the `@prisma/adapter-mssql` driver adapter. Be sure that the `DATABASE_URL` environment variable is set to your SQL Server 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-mssql` driver adapter. Be sure that the `DATABASE_URL` environment variable is set to your SQL Server connection string (e.g. in a `.env` file).
10
10
 
11
11
  ### 1. Install the dependencies
12
12
 
package/dist/index.js CHANGED
@@ -392,6 +392,9 @@ function mapArg(arg, argType) {
392
392
  if (typeof arg === "string" && argType.scalarType === "bytes") {
393
393
  return Buffer.from(arg, "base64");
394
394
  }
395
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
396
+ return Buffer.from(arg);
397
+ }
395
398
  if (ArrayBuffer.isView(arg)) {
396
399
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
397
400
  }
@@ -415,6 +418,9 @@ function mapRow(row, columns) {
415
418
  }
416
419
  return value;
417
420
  }
421
+ if (Buffer.isBuffer(value)) {
422
+ return Array.from(value);
423
+ }
418
424
  if (typeof value === "string" && type === import_mssql2.default.UniqueIdentifier) {
419
425
  return value.toLowerCase();
420
426
  }
package/dist/index.mjs CHANGED
@@ -362,6 +362,9 @@ function mapArg(arg, argType) {
362
362
  if (typeof arg === "string" && argType.scalarType === "bytes") {
363
363
  return Buffer.from(arg, "base64");
364
364
  }
365
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
366
+ return Buffer.from(arg);
367
+ }
365
368
  if (ArrayBuffer.isView(arg)) {
366
369
  return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
367
370
  }
@@ -385,6 +388,9 @@ function mapRow(row, columns) {
385
388
  }
386
389
  return value;
387
390
  }
391
+ if (Buffer.isBuffer(value)) {
392
+ return Array.from(value);
393
+ }
388
394
  if (typeof value === "string" && type === sql2.UniqueIdentifier) {
389
395
  return value.toLowerCase();
390
396
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-mssql",
3
- "version": "7.2.0",
3
+ "version": "7.3.0-integration-prisma6-fix-cloudflare-engine.1",
4
4
  "description": "Prisma's driver adapter for \"mssql\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "mssql": "^11.0.1",
35
35
  "async-mutex": "0.5.0",
36
- "@prisma/driver-adapter-utils": "7.2.0"
36
+ "@prisma/driver-adapter-utils": "7.3.0-integration-prisma6-fix-cloudflare-engine.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/mssql": "9.1.8"