Skip to content

Instantly share code, notes, and snippets.

@booo
Created November 25, 2011 21:46
Show Gist options
  • Select an option

  • Save booo/1394485 to your computer and use it in GitHub Desktop.

Select an option

Save booo/1394485 to your computer and use it in GitHub Desktop.
var pg = require("pg");
var connectionString = "xxx";
pg.connect(connectionString, function(error, client){
if(error) {
console.log(error);
} else {
query = client.query("SELECT * FROM nodes");
query.on('error', function(error){ console.log(error);});
query.on('row', function(row){ console.log(row);});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment