@prisma/adapter-neon 7.3.0-integration-prisma6-fix-cloudflare-engine.3 → 7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.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
@@ -8,7 +8,7 @@ The [Neon serverless driver](https://github.com/neondatabase/serverless) is a lo
8
8
 
9
9
  ## Getting started
10
10
 
11
- > **Note**: Make sure your connection string exists in your `.env` file. Refer to [Neon's docs](https://neon.tech/docs/connect/connect-from-any-app) to learn how to retrieve your database's connection string.
11
+ > **Note**: Make sure your connection string exists in your `process.env`. Refer to [Neon's docs](https://neon.tech/docs/connect/connect-from-any-app) to learn how to retrieve your database's connection string.
12
12
  >
13
13
  > ```bash
14
14
  > DATABASE_URL="postgres://user:password@server.us-east-2.aws.neon.tech/neondb"
package/dist/index.d.mts CHANGED
@@ -66,7 +66,7 @@ declare class PrismaNeonAdapter extends NeonWsQueryable<neon.Pool> implements Sq
66
66
  underlyingDriver(): neon.Pool;
67
67
  }
68
68
 
69
- export declare class PrismaNeonHTTP implements SqlDriverAdapterFactory {
69
+ export declare class PrismaNeonHttp implements SqlDriverAdapterFactory {
70
70
  private readonly connectionString;
71
71
  private readonly options;
72
72
  readonly provider = "postgres";
package/dist/index.d.ts CHANGED
@@ -66,7 +66,7 @@ declare class PrismaNeonAdapter extends NeonWsQueryable<neon.Pool> implements Sq
66
66
  underlyingDriver(): neon.Pool;
67
67
  }
68
68
 
69
- export declare class PrismaNeonHTTP implements SqlDriverAdapterFactory {
69
+ export declare class PrismaNeonHttp implements SqlDriverAdapterFactory {
70
70
  private readonly connectionString;
71
71
  private readonly options;
72
72
  readonly provider = "postgres";
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  PrismaNeon: () => PrismaNeonAdapterFactory,
34
- PrismaNeonHTTP: () => PrismaNeonHTTPAdapterFactory
34
+ PrismaNeonHttp: () => PrismaNeonHttpAdapterFactory
35
35
  });
36
36
  module.exports = __toCommonJS(index_exports);
37
37
 
@@ -316,18 +316,10 @@ function normalize_xml(xml) {
316
316
  function toJson(json) {
317
317
  return json;
318
318
  }
319
- function encodeBuffer(buffer) {
320
- return Array.from(new Uint8Array(buffer));
321
- }
322
319
  var parsePgBytes = getTypeParser(ScalarColumnType.BYTEA);
323
- var parseBytesArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
324
- function normalizeByteaArray(serializedBytesArray) {
325
- const buffers = parseBytesArray(serializedBytesArray);
326
- return buffers.map((buf) => buf ? encodeBuffer(buf) : null);
327
- }
320
+ var normalizeByteaArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
328
321
  function convertBytes(serializedBytes) {
329
- const buffer = parsePgBytes(serializedBytes);
330
- return encodeBuffer(buffer);
322
+ return parsePgBytes(serializedBytes);
331
323
  }
332
324
  function normalizeBit(bit) {
333
325
  return bit;
@@ -380,11 +372,8 @@ function mapArg(arg, argType) {
380
372
  if (typeof arg === "string" && argType.scalarType === "bytes") {
381
373
  return Buffer.from(arg, "base64");
382
374
  }
383
- if (Array.isArray(arg) && argType.scalarType === "bytes") {
384
- return Buffer.from(arg);
385
- }
386
375
  if (ArrayBuffer.isView(arg)) {
387
- return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
376
+ return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
388
377
  }
389
378
  return arg;
390
379
  }
@@ -426,6 +415,11 @@ function mapDriverError(error) {
426
415
  kind: "ValueOutOfRange",
427
416
  cause: error.message
428
417
  };
418
+ case "22P02":
419
+ return {
420
+ kind: "InvalidInputValue",
421
+ message: error.message
422
+ };
429
423
  case "23505": {
430
424
  const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
431
425
  return {
@@ -684,7 +678,7 @@ var PrismaNeonAdapterFactory = class {
684
678
  return new PrismaNeonAdapter(pool, this.options);
685
679
  }
686
680
  };
687
- var PrismaNeonHTTPAdapter = class extends NeonQueryable {
681
+ var PrismaNeonHttpAdapter = class extends NeonQueryable {
688
682
  client;
689
683
  constructor(client) {
690
684
  super();
@@ -720,7 +714,7 @@ var PrismaNeonHTTPAdapter = class extends NeonQueryable {
720
714
  async dispose() {
721
715
  }
722
716
  };
723
- var PrismaNeonHTTPAdapterFactory = class {
717
+ var PrismaNeonHttpAdapterFactory = class {
724
718
  constructor(connectionString, options) {
725
719
  this.connectionString = connectionString;
726
720
  this.options = options;
@@ -728,11 +722,11 @@ var PrismaNeonHTTPAdapterFactory = class {
728
722
  provider = "postgres";
729
723
  adapterName = name;
730
724
  async connect() {
731
- return new PrismaNeonHTTPAdapter(neon.neon(this.connectionString, this.options));
725
+ return new PrismaNeonHttpAdapter(neon.neon(this.connectionString, this.options));
732
726
  }
733
727
  };
734
728
  // Annotate the CommonJS export names for ESM import in node:
735
729
  0 && (module.exports = {
736
730
  PrismaNeon,
737
- PrismaNeonHTTP
731
+ PrismaNeonHttp
738
732
  });
package/dist/index.mjs CHANGED
@@ -279,18 +279,10 @@ function normalize_xml(xml) {
279
279
  function toJson(json) {
280
280
  return json;
281
281
  }
282
- function encodeBuffer(buffer) {
283
- return Array.from(new Uint8Array(buffer));
284
- }
285
282
  var parsePgBytes = getTypeParser(ScalarColumnType.BYTEA);
286
- var parseBytesArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
287
- function normalizeByteaArray(serializedBytesArray) {
288
- const buffers = parseBytesArray(serializedBytesArray);
289
- return buffers.map((buf) => buf ? encodeBuffer(buf) : null);
290
- }
283
+ var normalizeByteaArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY);
291
284
  function convertBytes(serializedBytes) {
292
- const buffer = parsePgBytes(serializedBytes);
293
- return encodeBuffer(buffer);
285
+ return parsePgBytes(serializedBytes);
294
286
  }
295
287
  function normalizeBit(bit) {
296
288
  return bit;
@@ -343,11 +335,8 @@ function mapArg(arg, argType) {
343
335
  if (typeof arg === "string" && argType.scalarType === "bytes") {
344
336
  return Buffer.from(arg, "base64");
345
337
  }
346
- if (Array.isArray(arg) && argType.scalarType === "bytes") {
347
- return Buffer.from(arg);
348
- }
349
338
  if (ArrayBuffer.isView(arg)) {
350
- return Buffer.from(arg.buffer, arg.byteOffset, arg.byteLength);
339
+ return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
351
340
  }
352
341
  return arg;
353
342
  }
@@ -389,6 +378,11 @@ function mapDriverError(error) {
389
378
  kind: "ValueOutOfRange",
390
379
  cause: error.message
391
380
  };
381
+ case "22P02":
382
+ return {
383
+ kind: "InvalidInputValue",
384
+ message: error.message
385
+ };
392
386
  case "23505": {
393
387
  const fields = error.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
394
388
  return {
@@ -647,7 +641,7 @@ var PrismaNeonAdapterFactory = class {
647
641
  return new PrismaNeonAdapter(pool, this.options);
648
642
  }
649
643
  };
650
- var PrismaNeonHTTPAdapter = class extends NeonQueryable {
644
+ var PrismaNeonHttpAdapter = class extends NeonQueryable {
651
645
  client;
652
646
  constructor(client) {
653
647
  super();
@@ -683,7 +677,7 @@ var PrismaNeonHTTPAdapter = class extends NeonQueryable {
683
677
  async dispose() {
684
678
  }
685
679
  };
686
- var PrismaNeonHTTPAdapterFactory = class {
680
+ var PrismaNeonHttpAdapterFactory = class {
687
681
  constructor(connectionString, options) {
688
682
  this.connectionString = connectionString;
689
683
  this.options = options;
@@ -691,10 +685,10 @@ var PrismaNeonHTTPAdapterFactory = class {
691
685
  provider = "postgres";
692
686
  adapterName = name;
693
687
  async connect() {
694
- return new PrismaNeonHTTPAdapter(neon.neon(this.connectionString, this.options));
688
+ return new PrismaNeonHttpAdapter(neon.neon(this.connectionString, this.options));
695
689
  }
696
690
  };
697
691
  export {
698
692
  PrismaNeonAdapterFactory as PrismaNeon,
699
- PrismaNeonHTTPAdapterFactory as PrismaNeonHTTP
693
+ PrismaNeonHttpAdapterFactory as PrismaNeonHttp
700
694
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-neon",
3
- "version": "7.3.0-integration-prisma6-fix-cloudflare-engine.3",
3
+ "version": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1",
4
4
  "description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,10 +33,10 @@
33
33
  "dependencies": {
34
34
  "postgres-array": "3.0.4",
35
35
  "@neondatabase/serverless": ">0.6.0 <2",
36
- "@prisma/driver-adapter-utils": "7.3.0-integration-prisma6-fix-cloudflare-engine.3"
36
+ "@prisma/driver-adapter-utils": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@prisma/debug": "7.3.0-integration-prisma6-fix-cloudflare-engine.3"
39
+ "@prisma/debug": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "DEV=true tsx helpers/build.ts",