egg-mysql-reconnection
v1.0.6
Published
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]]
Downloads
9
Readme
egg-mysql-reconnection
Install
npm i egg-mysql-reconnection --save
Usage
// {app_root}/config/plugin.js
exports.mysql = {
enable: true,
package: 'egg-mysql-reconnection',
};
Configuration
// {app_root}/config/config.default.js
exports.mysql = {
// database configuration
client: {
// host
host: 'mysql.com',
// port
port: '3306',
// username
user: 'test_user',
// password
password: 'test_password',
// database
database: 'test',
},
// load into app, default is open
app: true,
// 每隔几秒就在数据库查询一次,保持活性,单位毫秒
interval: 2000
};
see config/config.default.js for more detail.
Example
Questions & Suggestions
Please open an issue here.