From 95a5bba4bf4291071f9dadfae9397b76dd4cc28e Mon Sep 17 00:00:00 2001 From: Brian C Date: Wed, 3 Jul 2013 13:03:46 -0500 Subject: [PATCH] Update README.md --- README.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 948f7b7..4cf47a5 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,15 @@ var conString = "tcp://postgres:1234@localhost/postgres"; var client = new pg.Client(conString); client.connect(function(err) { if(err) { - console.error('could not connect to postgres', err); - return; + return console.error('could not connect to postgres', err); } client.query('SELECT NOW() AS "theTime"', function(err, result) { - if(err) { - console.error('error running query', err); - return; - } - console.log(result.rows[0].theTime); - //output: Tue Jan 15 2013 19:12:47 GMT-600 (CST) - client.end(); + if(err) { + return console.error('error running query', err); + } + console.log(result.rows[0].theTime); + //output: Tue Jan 15 2013 19:12:47 GMT-600 (CST) + client.end(); }); }); @@ -50,16 +48,14 @@ var conString = "tcp://postgres:1234@localhost/postgres"; pg.connect(conString, function(err, client, done) { if(err) { - console.error('error fetching client from pool', err); - return; + return console.error('error fetching client from pool', err); } client.query('SELECT $1::int AS numbor', ['1'], function(err, result) { //call `done()` to release the client back to the pool done(); if(err) { - console.error('error running query', err); - return; + return console.error('error running query', err); } console.log(result.rows[0].numbor); //output: 1