egg-real-mysql
Description
this plugin based on promise-mysql package, and promise-mysql based on node-mysql, so you can simply use it
the version on EggJs
egg-real-mysql version | egg 2.x |
---|---|
2.x | 😁 |
1.x | ❓ |
0.x | ❌ |
Install
$ npm i egg-real-mysql --save
Usage
// {app_root}/config/plugin.jsexportsrealMysql = enable: true package: 'egg-real-mysql';
Configuration
// {app_root}/config/config.default.jsexportsmysql = client: host: '127.0.0.1' port: '3306' user: 'root' password: 'root' database: 'example' app: true agent: false;
see config/config.default.js for more detail.
use on service
module { return Service async { let data = id: '' name: name ; const result = await thisappmysql; return result; } ;};
Questions & Suggestions
Please open an issue