mysql2-nestjs
v0.1.1
Published
NestJS package for mysql2
Downloads
70
Maintainers
Readme
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");