1.1.0 • Published 7 years ago
nano-mysql v1.1.0
Nano-MySQL
MySQL Driver for Nano SQL
Documentation
Installation
npm i --save nano-mysqlUsage
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.
