@prisma/adapter-ppg 7.5.0-dev.3 → 7.5.0-dev.31

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
@@ -298,7 +298,10 @@ function normalize_bool(x) {
298
298
  return x === null ? null : x === "f" ? "false" : "true";
299
299
  }
300
300
  function normalize_array(element_normalizer) {
301
- return (str) => (0, import_postgres_array.parse)(str, element_normalizer);
301
+ return (str) => {
302
+ if (str === null) return null;
303
+ return (0, import_postgres_array.parse)(str, element_normalizer);
304
+ };
302
305
  }
303
306
  function normalize_numeric(numeric) {
304
307
  return numeric;
@@ -307,18 +310,22 @@ function normalize_date(date) {
307
310
  return date;
308
311
  }
309
312
  function normalize_timestamp(time) {
313
+ if (time === null) return null;
310
314
  return `${time.replace(" ", "T")}+00:00`;
311
315
  }
312
316
  function normalize_timestamptz(time) {
317
+ if (time === null) return null;
313
318
  return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
314
319
  }
315
320
  function normalize_time(time) {
316
321
  return time;
317
322
  }
318
323
  function normalize_timez(time) {
324
+ if (time === null) return null;
319
325
  return time.replace(/[+-]\d{2}(:\d{2})?$/, "");
320
326
  }
321
327
  function normalize_money(money) {
328
+ if (money === null) return null;
322
329
  return money.slice(1);
323
330
  }
324
331
  function normalize_xml(xml) {
@@ -332,9 +339,11 @@ function parsePgBytes(x) {
332
339
  }
333
340
  var builtInByteParser = (0, import_pg_types.getTypeParser)(ScalarColumnType.BYTEA);
334
341
  function normalizeByteaArray(x) {
335
- return (0, import_postgres_array.parse)(x).map(builtInByteParser);
342
+ if (x === null) return null;
343
+ return (0, import_postgres_array.parse)(x).map((elem) => elem === null ? null : builtInByteParser(elem));
336
344
  }
337
345
  function convertBytes(serializedBytes) {
346
+ if (serializedBytes === null) return null;
338
347
  return parsePgBytes(serializedBytes);
339
348
  }
340
349
  function normalizeBit(bit) {
@@ -555,6 +564,15 @@ var PrismaPostgresTransaction = class {
555
564
  this.#session.close();
556
565
  }
557
566
  }
567
+ async createSavepoint(name) {
568
+ await this.executeRaw({ sql: `SAVEPOINT ${name}`, args: [], argTypes: [] });
569
+ }
570
+ async rollbackToSavepoint(name) {
571
+ await this.executeRaw({ sql: `ROLLBACK TO SAVEPOINT ${name}`, args: [], argTypes: [] });
572
+ }
573
+ async releaseSavepoint(name) {
574
+ await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name}`, args: [], argTypes: [] });
575
+ }
558
576
  async executeRaw(params) {
559
577
  await this.#ensureBegun();
560
578
  return executeRawStatement(this.#session, params);
package/dist/index.mjs CHANGED
@@ -272,7 +272,10 @@ function normalize_bool(x) {
272
272
  return x === null ? null : x === "f" ? "false" : "true";
273
273
  }
274
274
  function normalize_array(element_normalizer) {
275
- return (str) => parseArray(str, element_normalizer);
275
+ return (str) => {
276
+ if (str === null) return null;
277
+ return parseArray(str, element_normalizer);
278
+ };
276
279
  }
277
280
  function normalize_numeric(numeric) {
278
281
  return numeric;
@@ -281,18 +284,22 @@ function normalize_date(date) {
281
284
  return date;
282
285
  }
283
286
  function normalize_timestamp(time) {
287
+ if (time === null) return null;
284
288
  return `${time.replace(" ", "T")}+00:00`;
285
289
  }
286
290
  function normalize_timestamptz(time) {
291
+ if (time === null) return null;
287
292
  return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
288
293
  }
289
294
  function normalize_time(time) {
290
295
  return time;
291
296
  }
292
297
  function normalize_timez(time) {
298
+ if (time === null) return null;
293
299
  return time.replace(/[+-]\d{2}(:\d{2})?$/, "");
294
300
  }
295
301
  function normalize_money(money) {
302
+ if (money === null) return null;
296
303
  return money.slice(1);
297
304
  }
298
305
  function normalize_xml(xml) {
@@ -306,9 +313,11 @@ function parsePgBytes(x) {
306
313
  }
307
314
  var builtInByteParser = getTypeParser(ScalarColumnType.BYTEA);
308
315
  function normalizeByteaArray(x) {
309
- return parseArray(x).map(builtInByteParser);
316
+ if (x === null) return null;
317
+ return parseArray(x).map((elem) => elem === null ? null : builtInByteParser(elem));
310
318
  }
311
319
  function convertBytes(serializedBytes) {
320
+ if (serializedBytes === null) return null;
312
321
  return parsePgBytes(serializedBytes);
313
322
  }
314
323
  function normalizeBit(bit) {
@@ -529,6 +538,15 @@ var PrismaPostgresTransaction = class {
529
538
  this.#session.close();
530
539
  }
531
540
  }
541
+ async createSavepoint(name) {
542
+ await this.executeRaw({ sql: `SAVEPOINT ${name}`, args: [], argTypes: [] });
543
+ }
544
+ async rollbackToSavepoint(name) {
545
+ await this.executeRaw({ sql: `ROLLBACK TO SAVEPOINT ${name}`, args: [], argTypes: [] });
546
+ }
547
+ async releaseSavepoint(name) {
548
+ await this.executeRaw({ sql: `RELEASE SAVEPOINT ${name}`, args: [], argTypes: [] });
549
+ }
532
550
  async executeRaw(params) {
533
551
  await this.#ensureBegun();
534
552
  return executeRawStatement(this.#session, params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-ppg",
3
- "version": "7.5.0-dev.3",
3
+ "version": "7.5.0-dev.31",
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.5.0-dev.3"
37
+ "@prisma/driver-adapter-utils": "7.5.0-dev.31"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.5.0-dev.3"
40
+ "@prisma/debug": "7.5.0-dev.31"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",