@prisma/adapter-planetscale 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/dist/index.js CHANGED
@@ -114,7 +114,11 @@ var cast = (field, value) => {
114
114
  if (field.type === "JSON") {
115
115
  return typeof value === "string" && value.length ? decodeUtf8(value) : value;
116
116
  }
117
- return (0, import_database.cast)(field, value);
117
+ const defaultValue = (0, import_database.cast)(field, value);
118
+ if (defaultValue instanceof Uint8Array) {
119
+ return Array.from(defaultValue);
120
+ }
121
+ return defaultValue;
118
122
  };
119
123
  function mapArg(arg, argType) {
120
124
  if (arg === null) {
@@ -141,6 +145,9 @@ function mapArg(arg, argType) {
141
145
  if (typeof arg === "string" && argType.scalarType === "bytes") {
142
146
  return Buffer.from(arg, "base64");
143
147
  }
148
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
149
+ return Buffer.from(arg);
150
+ }
144
151
  return arg;
145
152
  }
146
153
  function formatDateTime(date) {
package/dist/index.mjs CHANGED
@@ -78,7 +78,11 @@ var cast = (field, value) => {
78
78
  if (field.type === "JSON") {
79
79
  return typeof value === "string" && value.length ? decodeUtf8(value) : value;
80
80
  }
81
- return defaultCast(field, value);
81
+ const defaultValue = defaultCast(field, value);
82
+ if (defaultValue instanceof Uint8Array) {
83
+ return Array.from(defaultValue);
84
+ }
85
+ return defaultValue;
82
86
  };
83
87
  function mapArg(arg, argType) {
84
88
  if (arg === null) {
@@ -105,6 +109,9 @@ function mapArg(arg, argType) {
105
109
  if (typeof arg === "string" && argType.scalarType === "bytes") {
106
110
  return Buffer.from(arg, "base64");
107
111
  }
112
+ if (Array.isArray(arg) && argType.scalarType === "bytes") {
113
+ return Buffer.from(arg);
114
+ }
108
115
  return arg;
109
116
  }
110
117
  function formatDateTime(date) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-planetscale",
3
- "version": "7.2.0",
3
+ "version": "7.3.0-integration-prisma6-fix-cloudflare-engine.1",
4
4
  "description": "Prisma's driver adapter for \"@planetscale/database\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,9 +31,9 @@
31
31
  "license": "Apache-2.0",
32
32
  "sideEffects": false,
33
33
  "dependencies": {
34
- "@planetscale/database": "^1.19.0",
35
34
  "async-mutex": "0.5.0",
36
- "@prisma/driver-adapter-utils": "7.2.0"
35
+ "@planetscale/database": "^1.15.0",
36
+ "@prisma/driver-adapter-utils": "7.3.0-integration-prisma6-fix-cloudflare-engine.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "undici": "7.4.0"