# @types/pg-pool

> TypeScript definitions for pg-pool

Latest version **2.0.7** (published 2025-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/pg-pool
pnpm add @types/pg-pool
yarn add @types/pg-pool
bun add @types/pg-pool
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2025-12-10 |
| First published | 2016-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51430 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/pg-pool
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-pool
- npm.io page: https://npm.io/package/@types/pg-pool

## Dependencies (1)

- [@types/pg](https://npm.io/package/@types/pg.md) *

## Recent versions

- 2.0.7 (latest) — 2025-12-10
- 2.0.6 (ts4.5) — 2023-11-07
- 2.0.3 (ts3.6) — 2021-07-08
- 2.0.2 (ts3.1) — 2020-01-16
- 2.0.1 (ts2.3) — 2019-09-04
- 2.0.0 (ts2.0) — 2019-08-20
- 2.0.5 — 2023-10-18
- 2.0.4 — 2023-09-24
- 0.0.3 — 2017-07-25
- 0.0.2 — 2016-09-23
- 0.0.1 — 2016-09-19

## README

# Installation
> `npm install --save @types/pg-pool`

# Summary
This package contains type definitions for pg-pool (https://github.com/brianc/node-pg-pool).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-pool.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-pool/index.d.ts)
````ts
import * as pg from "pg";

declare class Pool<T extends pg.Client> extends pg.Pool {
    readonly Client: Pool.ClientLikeCtr<T>;

    constructor(config?: Pool.Config<T>, client?: Pool.ClientLikeCtr<T>);

    connect(): Promise<T & pg.PoolClient>;
    connect(callback: (err?: Error, client?: T & pg.PoolClient, done?: (release?: any) => void) => void): void;

    on<K extends "error" | "release" | "connect" | "acquire" | "remove">(
        event: K,
        listener: K extends "error" | "release" ? (err: Error, client: T & pg.PoolClient) => void
            : (client: T & pg.PoolClient) => void,
    ): this;
}

declare namespace Pool {
    type ClientLikeCtr<T extends pg.Client> = new(config?: string | pg.ClientConfig) => T;

    interface Config<T extends pg.Client> extends pg.PoolConfig {
        Client?: ClientLikeCtr<T> | undefined;
    }
}

export = Pool;

````

### Additional Details
 * Last updated: Wed, 10 Dec 2025 20:02:11 GMT
 * Dependencies: [@types/pg](https://npmjs.com/package/@types/pg)

# Credits
These definitions were written by [Leo Liang](https://github.com/aleung), and [Nikita Tokarchuk](https://github.com/mainnika).

---
_Source: https://npm.io/package/@types/pg-pool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
