Skip to content

Instantly share code, notes, and snippets.

@booo
Created January 23, 2012 10:25
Show Gist options
  • Save booo/1662362 to your computer and use it in GitHub Desktop.
Save booo/1662362 to your computer and use it in GitHub Desktop.
(function() {
var pg;
pg = require("pg");
pg.connect("pg://postgres:thesecret@localhost/database", function(error, client) {
if (error) {
return console.log(error);
} else {
return client.query("CREATE TEMP TABLE users(id int, name varchar)", function(error, result) {
if (error) {
return console.log(error);
} else {
return client.query("INSERT INTO users(id, name) VALUES (0, 'foo') RETURNING id", function(error, results) {
if (error) {
return console.log(error);
} else {
return console.log(results);
}
});
}
});
}
});
}).call(this);
@kdbanman
Copy link

Curious, why do you return almost every expression?

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