diff --git a/README.md b/README.md index 8957ad8..fa89079 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ Generally you will access the PostgreSQL server through a pool of clients. A cl var pg = require('pg'); var conString = "postgres://username:password@localhost/database"; +//this starts initializes a connection pool +//it will keep idle connections open for a (configurable) 30 seconds +//and set a limit of 20 (also configurable) pg.connect(conString, function(err, client, done) { if(err) { return console.error('error fetching client from pool', err); @@ -34,7 +37,6 @@ pg.connect(conString, function(err, client, done) { } console.log(result.rows[0].number); //output: 1 - client.end(); }); }); ```