mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #17753 from leizha/pool
[pg] Pool.end() accepts an optional callback param
This commit is contained in:
Vendored
+1
-1
@@ -71,7 +71,7 @@ export declare class Pool extends events.EventEmitter {
|
||||
connect(): Promise<Client>;
|
||||
connect(callback: (err: Error, client: Client, done: () => void) => void): void;
|
||||
|
||||
end(): Promise<void>;
|
||||
end(callback?: () => void): Promise<void>;
|
||||
|
||||
query(queryStream: QueryConfig & stream.Readable): stream.Readable;
|
||||
query(queryTextOrConfig: string | QueryConfig): Promise<QueryResult>;
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user