Advertisement
Guest User

Untitled

a guest
Dec 15th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function doQuery(query) {
  2.     return pool.getConnectionAsync().then(function(connection) {
  3.         return connection.queryAsync(query)
  4.             .finally(function(){
  5.                 connection.release();
  6.             });
  7.     });
  8. }
  9.  
  10. //don't have to worry about closing connection
  11. doQuery("SELECT * FROM table").spread(function(rows, fields){
  12.  
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement