3.0.0 • Published 4 months ago
@tadashi/mysql-pool v3.0.0
mysql-pool
Make pooling connections with MySQL
Install
$ npm i @tadashi/mysql-pool
Environment variable
Variable | Type | Required | Default | Description |
---|---|---|---|---|
MYHOST | string | no | localhost | Hostname or server address |
MYPORT | number | no | 3306 | Port number for the connection |
MYUSER | string | no | root | User authentication |
MYPASS | string | no | Authentication password | |
MYLIMIT | number | no | 5 | Limit or threshold value |
MYCONNECTTIMEOUT | number | no | 30000 | Connection timeout in milliseconds |
MYMULTIPLE | boolean | no | true | Allowing multiple statements |
MYWAITFORCONNECTIONS | boolean | no | true | Waiting for available connections |
MYENCODE | number | no | 0 | MYUSER and MYPASS encoded in base64 |
Usage
import MysqlPool from '@tadashi/mysql-pool'
const pool = new MysqlPool() // => https://sidorares.github.io/node-mysql2/docs/examples/connections/create-pool
const { results: [{ total }] } = await pool.query('SELECT 1 + ? as total', [1])
// => 2
// Closing all the connections in a pool
await pool.end()
Team
!IMPORTANT\ Buy me a coffee!\ BTC:
bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4
License
MIT © Thiago Lagden
3.0.0
4 months ago
2.3.1
2 years ago
2.3.0
2 years ago
2.2.1
2 years ago
2.2.0
2 years ago
2.2.2
2 years ago
2.1.0
3 years ago
2.0.0
4 years ago
1.5.1
4 years ago
1.5.0
4 years ago
1.4.0
5 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.2
7 years ago
1.0.1
8 years ago
1.0.0
8 years ago