skyer-mysql-client-component

Skyer mysql client component

Usage no npm install needed!

<script type="module">
  import skyerMysqlClientComponent from 'https://cdn.skypack.dev/skyer-mysql-client-component';
</script>

README

skyer-mysql-client-component

npm version

Skyer mysql client component.

Install

NPM

$ 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)

Licences

MIT