parent
21053fd3bf
commit
35276f555e
|
@ -1,3 +1,8 @@
|
|||
2.2.1 / 2018-03-22
|
||||
==================
|
||||
* 增加时区和BIGINT配置
|
||||
|
||||
|
||||
2.2.0 / 2018-03-15
|
||||
==================
|
||||
* 连接池增加失败移除配置和恢复时间
|
||||
|
|
17
index.js
17
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,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mysqli",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "MySQL tool",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue