ys-dbo-mysql

1.0.6 • Public • Published

ys-dbo-mysql

ys-dbo的插件之mysql数据处理。

Install

npm i ys-dbo-mysql --save

Usage

const DBO = require('ys-dbo');
const mysql = require('ys-dbo-mysql');
const dbo = new DBO([
  new mysql('mysql', {
    // mysql 配置参数
    pool: true | false, // 是否使用pool
    logger: console
  });
])

注意:我们用way表示线程对像,之后类同

Code

await way.mysql.get();
await way.mysql.begin();
await way.mysql.exec('select * from a where a=?', 1);
await way.mysql.insert(table, data); // data: array or json
await way.mysql.update(table, data, where, wheres);
await way.mysql.delete(table, where, wheres);
await way.mysql.commit();
await way.mysql.rollback();
await way.mysql.release();

License

It is MIT licensed.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ys-dbo-mysql

    Weekly Downloads

    10

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    6.57 kB

    Total Files

    4

    Last publish

    Collaborators

    • evio
    • spikef