mysqljs/mysql

pool cluster's on is not exist.

Open

#1,161 建立於 2015年7月28日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)JavaScript (18,137 star) (2,502 fork)batch import
help wanted

描述

i'm trying pool cluster of mysql module.

below is my stub code.

and i created pool cluster, and get pool using of('namespace');

but there are wpool's on function is not exist ( ERROR )

how can is use this?

var wpool = poolCluster.of('MASTER-01', 'ORDER');//RANDOM, 
var rpool = poolCluster.of('SLAVE-*', 'ORDER');

wpool.on('connection', function (connection) {
    connection.query('USE muscat'); 
    connection.query('SET SESSION auto_increment_increment=1');
    queryFormat(connection);
});
wpool.on('connection', function (connection) {
      ^
TypeError: undefined is not a function
    at Object.<anonymous> (/Users/breaklee/Documents/project/eazler/muscat/database/mysql.js:32:7)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/breaklee/Documents/project/eazler/muscat/database/index.js:4:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

貢獻者指南