# mysql2-nestjs

> NestJS package for mysql2

Latest version **0.1.1** (published 2020-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install mysql2-nestjs
pnpm add mysql2-nestjs
yarn add mysql2-nestjs
bun add mysql2-nestjs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-10-20 |
| First published | 2020-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | golkhandani |
| Maintainers | golkhandani |
| Keywords | nestjs, raw query, mysql, mysql2, nest, typescript |

## Links

- npm: https://www.npmjs.com/package/mysql2-nestjs
- Repository: https://github.com/golkhandani/mysql2-nestjs
- Homepage: https://github.com/golkhandani/mysql2-nestjs#readme
- Issues: https://github.com/golkhandani/mysql2-nestjs/issues
- npm.io page: https://npm.io/package/mysql2-nestjs

## Dependencies (1)

- [mysql2](https://npm.io/package/mysql2.md) ^2.2.5

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-10-20

## README

# MySql2 Combined with nestjs

For more detail look at [MySql2](https://www.npmjs.com/package/mysql2#using-connection-pools)


```javascript
@Module({
  imports: [
    NestMysql2Module.register({
      host: "localhost",
      port: 30006,
      user: "root",
      password: "example"
    })
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
```


Then in your `controller`:

```javascript
constructor(
    @InjectMysql()
    private readonly mysql: Mysql
  ) { }
```


```javascript
const [result, fields] = await this.mysql.query("SELECT 1+2");

```

---
_Source: https://npm.io/package/mysql2-nestjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
