Advertisement
Guest User

Untitled

a guest
Dec 15th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pool.getConnectionAsync().then(function(connection) {
  2.     //Use `connection` to do query
  3.     connection.queryAsync("SELECT * FROM table").spread(function(rows, fields){
  4.         //Handle successful query
  5.     })
  6.     .catch(function(e) {
  7.         //Handle error
  8.     })
  9.         //In either case, release connection
  10.     .finally(function(){
  11.         connection.release();
  12.     })
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement