@prisma/adapter-neon 6.14.0-dev.2 → 6.14.0-dev.21
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 +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -345,7 +345,9 @@ var customParsers = {
|
|
|
345
345
|
[ScalarColumnType.MONEY]: normalize_money,
|
|
346
346
|
[ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
|
|
347
347
|
[ScalarColumnType.JSON]: toJson,
|
|
348
|
+
[ArrayColumnType.JSON_ARRAY]: normalize_array(toJson),
|
|
348
349
|
[ScalarColumnType.JSONB]: toJson,
|
|
350
|
+
[ArrayColumnType.JSONB_ARRAY]: normalize_array(toJson),
|
|
349
351
|
[ScalarColumnType.BYTEA]: convertBytes,
|
|
350
352
|
[ArrayColumnType.BYTEA_ARRAY]: normalizeByteaArray,
|
|
351
353
|
[ArrayColumnType.BIT_ARRAY]: normalize_array(normalizeBit),
|
|
@@ -370,9 +372,16 @@ function fixArrayBufferValues(values) {
|
|
|
370
372
|
|
|
371
373
|
// src/errors.ts
|
|
372
374
|
function convertDriverError(error) {
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
+
if (isDriverError(error)) {
|
|
376
|
+
return {
|
|
377
|
+
originalCode: error.code,
|
|
378
|
+
originalMessage: error.message,
|
|
379
|
+
...mapDriverError(error)
|
|
380
|
+
};
|
|
375
381
|
}
|
|
382
|
+
throw error;
|
|
383
|
+
}
|
|
384
|
+
function mapDriverError(error) {
|
|
376
385
|
switch (error.code) {
|
|
377
386
|
case "22001":
|
|
378
387
|
return {
|
|
@@ -461,7 +470,7 @@ function convertDriverError(error) {
|
|
|
461
470
|
};
|
|
462
471
|
}
|
|
463
472
|
}
|
|
464
|
-
function
|
|
473
|
+
function isDriverError(error) {
|
|
465
474
|
return typeof error.code === "string" && typeof error.message === "string" && typeof error.severity === "string" && (typeof error.detail === "string" || error.detail === void 0) && (typeof error.column === "string" || error.column === void 0) && (typeof error.hint === "string" || error.hint === void 0);
|
|
466
475
|
}
|
|
467
476
|
|
package/dist/index.mjs
CHANGED
|
@@ -308,7 +308,9 @@ var customParsers = {
|
|
|
308
308
|
[ScalarColumnType.MONEY]: normalize_money,
|
|
309
309
|
[ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
|
|
310
310
|
[ScalarColumnType.JSON]: toJson,
|
|
311
|
+
[ArrayColumnType.JSON_ARRAY]: normalize_array(toJson),
|
|
311
312
|
[ScalarColumnType.JSONB]: toJson,
|
|
313
|
+
[ArrayColumnType.JSONB_ARRAY]: normalize_array(toJson),
|
|
312
314
|
[ScalarColumnType.BYTEA]: convertBytes,
|
|
313
315
|
[ArrayColumnType.BYTEA_ARRAY]: normalizeByteaArray,
|
|
314
316
|
[ArrayColumnType.BIT_ARRAY]: normalize_array(normalizeBit),
|
|
@@ -333,9 +335,16 @@ function fixArrayBufferValues(values) {
|
|
|
333
335
|
|
|
334
336
|
// src/errors.ts
|
|
335
337
|
function convertDriverError(error) {
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
+
if (isDriverError(error)) {
|
|
339
|
+
return {
|
|
340
|
+
originalCode: error.code,
|
|
341
|
+
originalMessage: error.message,
|
|
342
|
+
...mapDriverError(error)
|
|
343
|
+
};
|
|
338
344
|
}
|
|
345
|
+
throw error;
|
|
346
|
+
}
|
|
347
|
+
function mapDriverError(error) {
|
|
339
348
|
switch (error.code) {
|
|
340
349
|
case "22001":
|
|
341
350
|
return {
|
|
@@ -424,7 +433,7 @@ function convertDriverError(error) {
|
|
|
424
433
|
};
|
|
425
434
|
}
|
|
426
435
|
}
|
|
427
|
-
function
|
|
436
|
+
function isDriverError(error) {
|
|
428
437
|
return typeof error.code === "string" && typeof error.message === "string" && typeof error.severity === "string" && (typeof error.detail === "string" || error.detail === void 0) && (typeof error.column === "string" || error.column === void 0) && (typeof error.hint === "string" || error.hint === void 0);
|
|
429
438
|
}
|
|
430
439
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-neon",
|
|
3
|
-
"version": "6.14.0-dev.
|
|
3
|
+
"version": "6.14.0-dev.21",
|
|
4
4
|
"description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"postgres-array": "3.0.4",
|
|
35
35
|
"@neondatabase/serverless": ">0.6.0 <2",
|
|
36
|
-
"@prisma/driver-adapter-utils": "6.14.0-dev.
|
|
36
|
+
"@prisma/driver-adapter-utils": "6.14.0-dev.21"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@swc/core": "1.11.5",
|