增加时区和BIGINT配置

master 2.2.1
宇天 2018-03-22 16:37:38 +08:00
parent 21053fd3bf
commit 35276f555e
3 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2.2.1 / 2018-03-22
==================
* 增加时区和BIGINT配置
2.2.0 / 2018-03-15 2.2.0 / 2018-03-15
================== ==================
* 连接池增加失败移除配置和恢复时间 * 连接池增加失败移除配置和恢复时间

View File

@ -36,13 +36,26 @@ class Mysqli {
}) })
config.forEach((item, i) => { 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 name = i < 1 ? 'MASTER' : 'SLAVE' + i
let collate
charset = charset || 'utf8' charset = charset || 'utf8'
let collate = collate =
charset + (charset === 'utf8mb4' ? '_unicode_ci' : '_general_ci') charset + (charset === 'utf8mb4' ? '_unicode_ci' : '_general_ci')
timezone = timezone || 'local'
supportBigNumbers = !!supportBigNumbers
this.pool.add(name, { this.pool.add(name, {
host, host,
port, port,

View File

@ -1,6 +1,6 @@
{ {
"name": "mysqli", "name": "mysqli",
"version": "2.2.0", "version": "2.2.1",
"description": "MySQL tool", "description": "MySQL tool",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {