Answers for "nodejs have db connection pool import module"

0

nodejs have db connection pool import module

var pool  = mysql.createPool({
      connectionLimit : 10,
      host            : 'example.org',
      user            : 'bobby',
      password        : 'pass'
    });
    
pool.getConnection(function(err, connection){
    if(err){
        return cb(err);
    }
    connection.changeUser({database : "firm1"});
    connection.query("SELECT * from history", function(err, data){
        connection.release();
        cb(err, data);
    });
});
Posted by: Guest on January-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language