0.1.1 • Published 4 years ago
mysql2-nestjs v0.1.1
MySql2 Combined with nestjs
For more detail look at MySql2
@Module({
imports: [
NestMysql2Module.register({
host: "localhost",
port: 30006,
user: "root",
password: "example"
})
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule { }
Then in your controller
:
constructor(
@InjectMysql()
private readonly mysql: Mysql
) { }
const [result, fields] = await this.mysql.query("SELECT 1+2");
0.1.1
4 years ago