function createPoolClusterAndGetConnectionViaOf (cb) { setup(function () { _teardown = function teardown () { cluster.end() } var cluster = mysql.createPoolCluster() cluster.add(connectionOptions) cluster.of('*').getConnection(function (err, conn) { if (err) throw err queryable = conn cb() }) }) }
cluster.end(function (err) { assert.ifError(err); assert.throws(cluster.add.bind(cluster, 'SLAVE3', poolConfig), /PoolCluster is closed/); });
function createPoolClusterAndGetConnection (cb) { setup(function () { _teardown = function teardown () { if (cluster) { cluster.end() cluster = undefined } } var cluster = mysql.createPoolCluster() cluster.add(connectionOptions) cluster.getConnection(function (err, conn) { if (err) throw err queryable = conn cb() }) }) }
function createPoolClusterAndGetConnectionViaOf (cb) { setup(function () { _teardown = function teardown () { cluster.end() } var cluster = mysql.createPoolCluster() cluster.add(connectionOptions) cluster.of('*').getConnection(function (err, conn) { if (err) throw err queryable = conn cb() }) }) }
function createPoolClusterAndGetConnection (cb) { setup(function () { _teardown = function teardown () { if (cluster) { cluster.end() cluster = undefined queryable = undefined } } var cluster = mysql.createPoolCluster() cluster.add(connectionOptions) cluster.getConnection(function (err, conn) { if (err) throw err queryable = conn cb() }) }) }