Skip to content

Instantly share code, notes, and snippets.

@brianc
Created November 19, 2010 17:47
Show Gist options
  • Save brianc/706852 to your computer and use it in GitHub Desktop.
Save brianc/706852 to your computer and use it in GitHub Desktop.
debugging node postgres
var Client = require(__dirname + '/node-postgres/lib').Client;
var client = new Client({
host: '1.0.1.1',
port: 6543,
user: 'Kev',
database: 'dev',
password: '...'
});
client.connection.on('message', function(msg) {
console.log(msg.name)
})
client.connection.on('connect', function() {
console.log('connected')
})
client.connection.stream.on('connect', function() {
console.log('stream connected')
})
client.connect();
client.on('drain', client.end.bind(client));
@vedro-compota
Copy link

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment