Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doQuery(query) {
- return pool.getConnectionAsync().then(function(connection) {
- return connection.queryAsync(query)
- .finally(function(){
- connection.release();
- });
- });
- }
- //don't have to worry about closing connection
- doQuery("SELECT * FROM table").spread(function(rows, fields){
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement