@prisma/adapter-pg 6.15.0-dev.4 → 6.15.0-dev.6

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.d.mts CHANGED
@@ -58,6 +58,7 @@ declare type PrismaPgOptions = {
58
58
  schema?: string;
59
59
  disposeExternalPool?: boolean;
60
60
  onPoolError?: (err: Error) => void;
61
+ onConnectionError?: (err: Error) => void;
61
62
  };
62
63
 
63
64
  declare type StdClient = pg.Pool;
package/dist/index.d.ts CHANGED
@@ -58,6 +58,7 @@ declare type PrismaPgOptions = {
58
58
  schema?: string;
59
59
  disposeExternalPool?: boolean;
60
60
  onPoolError?: (err: Error) => void;
61
+ onConnectionError?: (err: Error) => void;
61
62
  };
62
63
 
63
64
  declare type StdClient = pg.Pool;
package/dist/index.js CHANGED
@@ -685,6 +685,10 @@ var PrismaPgAdapter = class extends PgQueryable {
685
685
  const tag = "[js::startTransaction]";
686
686
  debug("%s options: %O", tag, options);
687
687
  const conn = await this.client.connect().catch((error) => this.onError(error));
688
+ conn.on("error", (err) => {
689
+ debug(`Error from pool connection: ${err.message} %O`, err);
690
+ this.options?.onConnectionError?.(err);
691
+ });
688
692
  try {
689
693
  const tx = new PgTransaction(conn, options);
690
694
  await tx.executeRaw({ sql: "BEGIN", args: [], argTypes: [] });
package/dist/index.mjs CHANGED
@@ -649,6 +649,10 @@ var PrismaPgAdapter = class extends PgQueryable {
649
649
  const tag = "[js::startTransaction]";
650
650
  debug("%s options: %O", tag, options);
651
651
  const conn = await this.client.connect().catch((error) => this.onError(error));
652
+ conn.on("error", (err) => {
653
+ debug(`Error from pool connection: ${err.message} %O`, err);
654
+ this.options?.onConnectionError?.(err);
655
+ });
652
656
  try {
653
657
  const tx = new PgTransaction(conn, options);
654
658
  await tx.executeRaw({ sql: "BEGIN", args: [], argTypes: [] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-pg",
3
- "version": "6.15.0-dev.4",
3
+ "version": "6.15.0-dev.6",
4
4
  "description": "Prisma's driver adapter for \"pg\"",
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
  "pg": "^8.11.3",
36
- "@prisma/driver-adapter-utils": "6.15.0-dev.4"
36
+ "@prisma/driver-adapter-utils": "6.15.0-dev.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@swc/core": "1.11.5",