@reinjs/rein-dbo
v1.0.4
Published
The dbo plugin of rein
Downloads
6
Readme
@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.