@prisma/adapter-ppg 7.2.0-dev.2 → 7.2.0-dev.20

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
@@ -327,23 +327,15 @@ function normalize_xml(xml) {
327
327
  function toJson(json) {
328
328
  return json;
329
329
  }
330
- function encodeBuffer(buffer) {
331
- return Array.from(new Uint8Array(buffer));
332
- }
333
330
  function parsePgBytes(x) {
334
331
  return Buffer.from(x, "base64");
335
332
  }
336
333
  var builtInByteParser = (0, import_pg_types.getTypeParser)(ScalarColumnType.BYTEA);
337
- function parseBytesArray(x) {
334
+ function normalizeByteaArray(x) {
338
335
  return (0, import_postgres_array.parse)(x).map(builtInByteParser);
339
336
  }
340
- function normalizeByteaArray(serializedBytesArray) {
341
- const buffers = parseBytesArray(serializedBytesArray);
342
- return buffers.map((buf) => buf ? encodeBuffer(buf) : null);
343
- }
344
337
  function convertBytes(serializedBytes) {
345
- const buffer = parsePgBytes(serializedBytes);
346
- return encodeBuffer(buffer);
338
+ return parsePgBytes(serializedBytes);
347
339
  }
348
340
  function normalizeBit(bit) {
349
341
  return bit;
@@ -372,6 +364,11 @@ function mapDriverError(error) {
372
364
  kind: "ValueOutOfRange",
373
365
  cause: error.message
374
366
  };
367
+ case "22P02":
368
+ return {
369
+ kind: "InvalidInputValue",
370
+ message: error.message
371
+ };
375
372
  case "23505": {
376
373
  const fields = error.details.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
377
374
  return {
package/dist/index.mjs CHANGED
@@ -301,23 +301,15 @@ function normalize_xml(xml) {
301
301
  function toJson(json) {
302
302
  return json;
303
303
  }
304
- function encodeBuffer(buffer) {
305
- return Array.from(new Uint8Array(buffer));
306
- }
307
304
  function parsePgBytes(x) {
308
305
  return Buffer.from(x, "base64");
309
306
  }
310
307
  var builtInByteParser = getTypeParser(ScalarColumnType.BYTEA);
311
- function parseBytesArray(x) {
308
+ function normalizeByteaArray(x) {
312
309
  return parseArray(x).map(builtInByteParser);
313
310
  }
314
- function normalizeByteaArray(serializedBytesArray) {
315
- const buffers = parseBytesArray(serializedBytesArray);
316
- return buffers.map((buf) => buf ? encodeBuffer(buf) : null);
317
- }
318
311
  function convertBytes(serializedBytes) {
319
- const buffer = parsePgBytes(serializedBytes);
320
- return encodeBuffer(buffer);
312
+ return parsePgBytes(serializedBytes);
321
313
  }
322
314
  function normalizeBit(bit) {
323
315
  return bit;
@@ -346,6 +338,11 @@ function mapDriverError(error) {
346
338
  kind: "ValueOutOfRange",
347
339
  cause: error.message
348
340
  };
341
+ case "22P02":
342
+ return {
343
+ kind: "InvalidInputValue",
344
+ message: error.message
345
+ };
349
346
  case "23505": {
350
347
  const fields = error.details.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");
351
348
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-ppg",
3
- "version": "7.2.0-dev.2",
3
+ "version": "7.2.0-dev.20",
4
4
  "description": "Prisma Postgres Serverless driver adapter",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,10 +34,10 @@
34
34
  "postgres-array": "3.0.4",
35
35
  "pg-types": "4.0.2",
36
36
  "@prisma/ppg": "^1.0.1",
37
- "@prisma/driver-adapter-utils": "7.2.0-dev.2"
37
+ "@prisma/driver-adapter-utils": "7.2.0-dev.20"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.2.0-dev.2"
40
+ "@prisma/debug": "7.2.0-dev.20"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",