/** * * User: Martin Donnelly * Date: 2016-03-09 * Time: 11:44 * */ 'use strict'; var pg = require('pg'); var conString = 'postgres://postgres:MPReoa43@localhost/oBrand'; pg.connect(conString, function(err, client, done) { if(err) { return console.error('error fetching client from pool',err); } client.query('select $1::int as number',[1], function(err,result) { done(); if (err) { return console.error('error running query', err); } console.log(result.rows[0].number); }) });