nodejs have db connection pool import module

Solutions on MaxInterview for nodejs have db connection pool import module by the best coders in the world

showing results for - "nodejs have db connection pool import module"
Adriana
05 Jul 2016
1var pool  = mysql.createPool({
2      connectionLimit : 10,
3      host            : 'example.org',
4      user            : 'bobby',
5      password        : 'pass'
6    });
7    
8pool.getConnection(function(err, connection){
9    if(err){
10        return cb(err);
11    }
12    connection.changeUser({database : "firm1"});
13    connection.query("SELECT * from history", function(err, data){
14        connection.release();
15        cb(err, data);
16    });
17});
18