1.0.4 • Published 7 years ago

@reinjs/rein-dbo v1.0.4

Weekly downloads
1
License
-
Repository
github
Last release
7 years ago

@reinjs/rein-dbo

The dbo plugin of rein

Install

npm i @reinjs/rein-dbo

Usage

rc i @reinjs/rein-dbo

Worker Usage

// in controller
// e.g. /app/controller/home.js
const mySQLResult = await this.ctx.dbo.mysql.exec(`SELECT * FROM ??`, 'table');
const redisResult = await this.ctx.dbo.redis.get('test');

Agent Usage

app.receive('test', async () => {
  return await app.dbo.until(async way => {
    const value = await way.redis.get('test');
    const user = await way.mysql.exec(`SELECT * FROM ?? WHERE account=?`, 'table', 'someone');
    return {
      me: user[0],
      value
    };
  });
});

License

It is MIT licensed.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago