Created
January 23, 2012 10:25
-
-
Save booo/1662362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Curious, why do you
return
almost every expression?