mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Update README.md
This commit is contained in:
parent
139cbdea16
commit
2421a769cb
19
README.md
19
README.md
@ -17,23 +17,24 @@ to use pg-pool you must first create an instance of a pool
|
||||
```js
|
||||
var Pool = require('pg-pool')
|
||||
|
||||
//by default the pool uses the same
|
||||
//configuration as whatever `pg` version you have installed
|
||||
// by default the pool uses the same
|
||||
// configuration as whatever `pg` version you have installed
|
||||
var pool = new Pool()
|
||||
|
||||
//you can pass properties to the pool
|
||||
//these properties are passed unchanged to both the node-postgres Client constructor
|
||||
//and the node-pool (https://github.com/coopernurse/node-pool) constructor
|
||||
//allowing you to fully configure the behavior of both
|
||||
// you can pass properties to the pool
|
||||
// these properties are passed unchanged to both the node-postgres Client constructor
|
||||
// and the node-pool (https://github.com/coopernurse/node-pool) constructor
|
||||
// allowing you to fully configure the behavior of both
|
||||
var pool2 = new Pool({
|
||||
database: 'postgres',
|
||||
user: 'brianc',
|
||||
password: 'secret!',
|
||||
port: 5432,
|
||||
ssl: true,
|
||||
max: 20, //set pool max size to 20
|
||||
min: 4, //set min pool size to 4
|
||||
idleTimeoutMillis: 1000 //close idle clients after 1 second
|
||||
max: 20, // set pool max size to 20
|
||||
min: 4, // set min pool size to 4
|
||||
idleTimeoutMillis: 1000, // close idle clients after 1 second
|
||||
connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established
|
||||
})
|
||||
|
||||
//you can supply a custom client constructor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user