1.1.0 • Published 6 years ago

nano-mysql v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Nano-MySQL

MySQL Driver for Nano SQL

NPM

Documentation

Installation

npm i --save nano-mysql

Usage

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.

API

When you call new MySQLAdapter the adapter internally calls mysql.createPool() from the mysql package.

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 for an exaustive list of options.