mysql2-nestjs
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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");
 

/mysql2-nestjs/

    Package Sidebar

    Install

    npm i mysql2-nestjs

    Weekly Downloads

    15

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    11.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • golkhandani