@quickts/nestjs-mysql
v1.0.2
Published
A quickts project
Downloads
16
Readme
nestjs-mysql
Installation
$ npm install @quickts/nestjs-mysql promise-mysql
Usage
import { MysqlPool } from "@quickts/nestjs-mysql";
import { Pool } from "promise-mysql";
@Injectable()
export class SomeClass implements OnMysqlPoolInit {
@MysqlPool() // 使用装饰器注入
pool: Pool;
onMysqlPoolInit(pool: Pool) {
this.pool = pool; // 实现接口自行赋值
}
}