SHARE
TWEET

Untitled

a guest Dec 15th, 2013 8 Never
  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. });
RAW Paste Data
Top