# survivesLostConnections() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.surviveslostconnections/
Published: 2026-09-26
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 3.0.2 — generated reference, not hand-written

Keep a pool's lost idle connection from ending the process.

**Signature:**

```typescript
export declare function survivesLostConnections<P extends Pool>(pool: P): P;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| pool | P | The pool to guard. |


**Returns:**

P

The same pool.

## Remarks

When the server closes a connection the pool is holding idle — a `pg_terminate_backend`, a failover, a maintenance restart — `pg` emits `error` on the pool itself. With no listener, that is an unhandled `error` event and Node exits. The pool has already discarded the client by then and the next checkout opens a fresh one, so the only thing left to do is say so.

