0.0.4 • Published 4 years ago

egg-mysql-events v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

egg-mysql-events

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

This is an egg plugin based on https://www.npmjs.com/package/@rodrigogs/mysql-events

Install

$ npm i egg-mysql-events --save

Usage

// {app_root}/config/plugin.js
exports.mysqlEvents = {
  enable: true,
  package: 'egg-mysql-events',
};

Configuration

// {app_root}/config/config.default.js
exports.mysqlEvents = config.mysqlEvents = [{
  connection: {
    host: '127.0.0.1',
    port: 3306,
    user: 'mysql-user',
    password: 'password'
  },
  triggers: [{
    name: 'TEST',
    expression: 'db.t_projects',
    onEvent: ({ event, app }) => console.log(event, app)
  }]
}]

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT