diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 2b442b1227..6718fb3f12 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -71,7 +71,7 @@ export declare class Pool extends events.EventEmitter { connect(): Promise; connect(callback: (err: Error, client: Client, done: () => void) => void): void; - end(): Promise; + end(callback?: () => void): Promise; query(queryStream: QueryConfig & stream.Readable): stream.Readable; query(queryTextOrConfig: string | QueryConfig): Promise; diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index 73c18ac1b7..4b4cfba7ec 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -74,3 +74,8 @@ pool.connect((err, client, done) => { pool.on('error', (err, client) => { console.error('idle client error', err.message, err.stack) }) + +pool.end(); +pool.end(() => { + console.log("pool is closed"); +});