diff --git a/History.md b/History.md index 88495a7..5edb05b 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,8 @@ +2.2.1 / 2018-03-22 +================== + * 增加时区和BIGINT配置 + + 2.2.0 / 2018-03-15 ================== * 连接池增加失败移除配置和恢复时间 diff --git a/index.js b/index.js index fce04eb..0d4b414 100644 --- a/index.js +++ b/index.js @@ -36,13 +36,26 @@ class Mysqli { }) config.forEach((item, i) => { - let { host, port, user, charset, passwd: password, db: database } = item + let { + host, + port, + user, + charset, + passwd: password, + db: database, + timezone, + supportBigNumbers + } = item let name = i < 1 ? 'MASTER' : 'SLAVE' + i + let collate charset = charset || 'utf8' - let collate = + collate = charset + (charset === 'utf8mb4' ? '_unicode_ci' : '_general_ci') + timezone = timezone || 'local' + supportBigNumbers = !!supportBigNumbers + this.pool.add(name, { host, port, diff --git a/package.json b/package.json index 32216ca..b4a897d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysqli", - "version": "2.2.0", + "version": "2.2.1", "description": "MySQL tool", "main": "index.js", "dependencies": {