mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
Add connectionString property to the config object
This commit is contained in:
1
types/pg/index.d.ts
vendored
1
types/pg/index.d.ts
vendored
@@ -15,6 +15,7 @@ export interface ConnectionConfig {
|
||||
password?: string;
|
||||
port?: number;
|
||||
host?: string;
|
||||
connectionString?: string;
|
||||
}
|
||||
|
||||
export interface Defaults extends ConnectionConfig {
|
||||
|
||||
@@ -77,6 +77,10 @@ client.end()
|
||||
.then(() => console.log('client has disconnected'))
|
||||
.catch(err => console.error('error during disconnection', err.stack));
|
||||
|
||||
const poolOne = new pg.Pool({
|
||||
connectionString: 'postgresql://dbuser:secretpassword@database.server.com:3211/mydb'
|
||||
});
|
||||
|
||||
const pool = new pg.Pool({
|
||||
host: 'localhost',
|
||||
port: 5432,
|
||||
|
||||
Reference in New Issue
Block a user