# nano-mysql

> MySQL Adapter for NanoSQL

Latest version **1.1.0** (published 2018-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install nano-mysql
pnpm add nano-mysql
yarn add nano-mysql
bun add nano-mysql
```

## Health

**Score 35/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-07-20 |
| First published | 2018-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 24.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 789 |
| Author | Scott Lott |
| Maintainers | clicksimply |

## Links

- npm: https://www.npmjs.com/package/nano-mysql
- Repository: https://github.com/ClickSimply/Nano-SQL
- Homepage: https://nanosql.io
- Issues: https://github.com/ClickSimply/Nano-SQL/issues
- npm.io page: https://npm.io/package/nano-mysql

## Dependencies (5)

- [mysql](https://npm.io/package/mysql.md) ^2.15.0
- [redis](https://npm.io/package/redis.md) ^2.8.0
- [nano-sql](https://npm.io/package/nano-sql.md) ^1.6.3
- [@types/mysql](https://npm.io/package/@types/mysql.md) ^2.15.4
- [@types/redis](https://npm.io/package/@types/redis.md) ^2.8.6

## Recent versions

- 1.1.0 (latest) — 2018-07-20
- 1.0.2 — 2018-05-28
- 1.0.1 — 2018-04-17
- 1.0.0 — 2018-04-17

## README

# Nano-MySQL
MySQL Driver for [Nano SQL](https://nanosql.io/)

<img src="https://raw.githubusercontent.com/ClickSimply/Nano-SQL/master/logo.png" alt="nanoSQL Logo">

[![NPM](https://nodei.co/npm/nano-mysql.png?downloads=true&stars=true)](https://nodei.co/npm/nano-mysql/)

## [Documentation](https://docs.nanosql.io/)

## Installation
```sh
npm i --save nano-mysql
```

## Usage
```ts
import { nSQL } from "nano-sql";
import { MySQLAdapter } from "nano-mysql";

nSQL("table")
.model([...])
.config({
    mode: new MySQLAdapter({ // required
            host: "localhost",
            database: "test",
            user: "root",
            password: "secret"
    }),
    ...other config options
}).connect()...
```

That's it, now everything NanoSQL can do you can do with MySQL.

Read about NanoSQL [here](https://nanosql.io/).

# API

When you call `new MySQLAdapter` the adapter internally calls `mysql.createPool()` from the [mysql package](https://www.npmjs.com/package/mysql#pooling-connections).

The default pool size is 20, you can modify this with the `connectionLimit` property.  All of the typical configuration options you would use are in the example above, refer the [mysql package documentation](https://www.npmjs.com/package/mysql#pooling-connections) for an exaustive list of options.

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