1.0.6 • Published 6 years ago

ys-dbo-mysql v1.0.6

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

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.

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago