2.3.1 • Published 5 months ago

@tadashi/mysql-pool v2.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 months ago

mysql-pool

NPM version Build Status Coverage Status

Make pooling connections with MySQL

Install

$ npm i @tadashi/mysql-pool

Environment variable

VariableTypeRequiredDefaultDescription
MYHOSTstringnolocalhostHostname or server address
MYPORTnumberno3306Port number for the connection
MYUSERstringnorootUser authentication
MYPASSstringnoAuthentication password
MYLIMITnumberno5Limit or threshold value
MYCONNECTTIMEOUTnumberno30000Connection timeout in milliseconds
MYACQUIRETIMEOUTnumberno30000Resource acquisition timeout in milliseconds
MYMULTIPLEbooleannotrueAllowing multiple statements
MYWAITFORCONNECTIONSbooleannotrueWaiting for available connections
MYENCODEnumberno0MYUSER and MYPASS encoded in base64

Usage

import MysqlPool from '@tadashi/mysql-pool'

const pool = new MysqlPool() // => https://github.com/mysqljs/mysql#connection-options
const {results: [{total}]} = await pool.query('SELECT 1 + ? as total', [1])
// => 2

// Closing all the connections in a pool
await pool.end()

License

MIT © Thiago Lagden

2.3.1

5 months ago

2.3.0

9 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.2.2

11 months ago

2.1.0

2 years ago

2.0.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago