# @types/promise-pg

> TypeScript definitions for promise-pg

Latest version **0.0.25** (published 2025-10-24) · MIT license · 0 weekly downloads

## Install

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

## 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; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.25 |
| Published | 2025-10-24 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

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

## Dependencies (3)

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

## Recent versions

- 0.0.25 (latest) — 2025-10-24
- 0.0.24 (ts5.1) — 2025-05-16
- 0.0.23 (ts4.6) — 2023-11-07
- 0.0.20 (ts3.7) — 2021-07-08
- 0.0.19 (ts2.4) — 2017-11-09
- 0.0.18 (ts2.0) — 2017-08-21
- 0.0.22 — 2023-10-18
- 0.0.21 — 2023-09-24
- 0.0.17 — 2017-03-15
- 0.0.16 — 2016-09-19
- 0.0.15 — 2016-07-14
- 0.0.14-alpha — 2016-07-08
- 0.0.12-alpha — 2016-07-04
- 0.0.11-alpha — 2016-07-02
- 0.0.10-alpha — 2016-07-01
- … 4 more at https://npm.io/package/@types/promise-pg/versions

## README

# Installation
> `npm install --save @types/promise-pg`

# Summary
This package contains type definitions for promise-pg (https://bitbucket.org/lplabs/promise-pg).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-pg.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-pg/index.d.ts)
````ts
/// <reference types="node" />

import * as pg from "pg";
import Q = require("q");
import stream = require("stream");

export { pg as raw };

export interface ClientConfig extends pg.ClientConfig {}

export declare function connect(connection: string): Q.Promise<Client>;
export declare function connect(connection: pg.ClientConfig): Q.Promise<Client>;

export declare function end(): Q.Promise<void>;

export interface QueryConfig extends pg.QueryConfig {
    buffer?: boolean | undefined;
}

export declare class Client {
    constructor(connection: string);
    constructor(config: ClientConfig);

    raw: pg.Client;

    connect(): Q.Promise<void>;
    end(): Q.Promise<void>;

    query(queryText: string): Query;
    query(config: QueryConfig): Query;
    query(queryText: string, values: any[]): Query;

    copyFrom(queryText: string): stream.Writable;
    copyTo(queryText: string): stream.Readable;

    pauseDrain(): void;
    resumeDrain(): void;

    public on(event: "drain", listener: () => void): Client;
    public on(event: "error", listener: (err: Error) => void): Client;
    public on(event: "notification", listener: (message: any) => void): Client;
    public on(event: "notice", listener: (message: any) => void): Client;
    public on(event: string, listener: Function): Client;

    transaction(task: () => Q.Promise<any>): Q.Promise<any>;
}

export interface QueryResult extends pg.QueryResult {}
export interface ResultBuilder extends pg.ResultBuilder {}

export declare class Query extends pg.Query {
    promise: Q.Promise<QueryResult>;
}

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/pg](https://npmjs.com/package/@types/pg), [@types/q](https://npmjs.com/package/@types/q)

# Credits
These definitions were written by .

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