README
skyer-mysql-client-component
Skyer mysql client component.
Install
$ npm i --save skyer-mysql-client-component
Register
/app/components/mysql_client.component.js
module.exports = require('skyer-mysql-client-component');
Usage
const mysqlClient = skyer.componentManager.getComponent('mysqlClient');
const sql = 'SELECT * FROM users WHERE is_vip=1 limit 0,20;';
const results = yield mysqlClient.query(sql);
const users = results[0];
Options
See mysql
connection options (https://www.npmjs.com/package/mysql#connection-options)