From 35276f555e69572b8b83e6b9550a5df3bc858a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 22 Mar 2018 16:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E5=8C=BA=E5=92=8CBI?= =?UTF-8?q?GINT=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- History.md | 5 +++++ index.js | 17 +++++++++++++++-- package.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) 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": {