egg-mysql-reconnection

1.0.6 • Public • Published

egg-mysql-reconnection

NPM version build status Test coverage David deps Known Vulnerabilities npm download

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.

License

MIT

Package Sidebar

Install

npm i egg-mysql-reconnection

Weekly Downloads

3

Version

1.0.6

License

MIT

Unpacked Size

8.2 kB

Total Files

7

Last publish

Collaborators

  • nigegeswo