Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pool.getConnectionAsync().then(function(connection) {
- //Use `connection` to do query
- connection.queryAsync("SELECT * FROM table").spread(function(rows, fields){
- //Handle successful query
- })
- .catch(function(e) {
- //Handle error
- })
- //In either case, release connection
- .finally(function(){
- connection.release();
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement