mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
- remove outdated comment - add link to the documentation - update test with parameterless ctor Thanks!
This commit is contained in:
committed by
Andrew Branch
parent
8a0e74bb2f
commit
07fcb1bd3d
Vendored
+8
-3
@@ -144,10 +144,15 @@ export class Connection extends events.EventEmitter {
|
||||
end(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link https://node-postgres.com/api/pool}
|
||||
*/
|
||||
export class Pool extends events.EventEmitter {
|
||||
// `new Pool('pg://user@localhost/mydb')` is not allowed.
|
||||
// But it passes type check because of issue:
|
||||
// https://github.com/Microsoft/TypeScript/issues/7485
|
||||
/**
|
||||
* Every field of the config object is entirely optional.
|
||||
* The config passed to the pool is also passed to every client
|
||||
* instance within the pool when the pool creates that client.
|
||||
*/
|
||||
constructor(config?: PoolConfig);
|
||||
|
||||
readonly totalCount: number;
|
||||
|
||||
@@ -124,6 +124,12 @@ client.end()
|
||||
.then(() => console.log('client has disconnected'))
|
||||
.catch(err => console.error('error during disconnection', err.stack));
|
||||
|
||||
// pg.Pool
|
||||
// https://node-postgres.com/api/pool
|
||||
|
||||
// no params ctor
|
||||
const poolParameterlessCtor = new Pool();
|
||||
|
||||
const poolOne = new Pool({
|
||||
connectionString: 'postgresql://dbuser:secretpassword@database.server.com:3211/mydb'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user