lib/db/adapter/mysql.js
function(callback)
    {
        self.pool = (require('mysql')).createPool({
            user     : self.config.username,
            password : self.config.password,
            database : self.config.db,
            host     : self.config.host,
            port     : self.config.port
        });

        // Initiate a connection - just to proof configuration
        self.pool.getConnection(function(err, connection) {

            if (err || !connection) {
                callback && callback(err);
                return;
            }

            self.prepare(connection);

            // The connection can be closed immediately
            connection.release();
            return callback && callback(null, self.pool);
        });
    }
function(callback)
    {
        self.pool = (require('mysql')).createPool({
            user     : self.config.username,
            password : self.config.password,
            database : self.config.db,
            host     : self.config.host,
            port     : self.config.port
        });

        // Initiate a connection - just to proof configuration
        self.pool.getConnection(function(err, connection) {

            if (err || !connection) {
                callback && callback(err);
                return;
            }

            self.prepare(connection);

            // The connection can be closed immediately
            connection.release();
            return callback && callback(null, self.pool);
        });
    }
function ( callback ) { self . pool = ( require ( 'mysql' ) ) . createPool ( { user : self . config . username , password : self . config . password , database : self . config . db , host : self . config . host , port : self . config . port } ) ; // Initiate a connection - just to proof configuration self . pool . getConnection ( function ( err , connection ) { if ( err || ! connection ) { callback && callback ( err ) ; return ; } self . prepare ( connection ) ; // The connection can be closed immediately connection . release ( ) ; return callback && callback ( null , self . pool ) ; } ) ; }
Setup the plain MySQL connection, pooling enabled
Setup the plain MySQL connection pooling enabled