Add connectionString property to the config object

This commit is contained in:
Leo Liang
2017-08-30 10:55:55 +08:00
parent 3bc2634b09
commit adcf24f32d
2 changed files with 5 additions and 0 deletions

1
types/pg/index.d.ts vendored
View File

@@ -15,6 +15,7 @@ export interface ConnectionConfig {
password?: string;
port?: number;
host?: string;
connectionString?: string;
}
export interface Defaults extends ConnectionConfig {

View File

@@ -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,