1.0.6 • Published 7 years ago
mysql-ssh-pool v1.0.6
MySQL SSH POOL
This a personnal, quick & dirty 'fix' of MySQL SSH package, to use PoolConnections instead of an only one MySQL connection. Only for personnal purposes, but feel free to use it as you want (didn't create any test or anything else)
Aim of initial project : Sets up a MySQL connection inside an SSH tunnel. This is practical when you want to reach a database which is only accessible through a webserver. Even if the database server is not located on the webserver itself.
API
.connect(obj sshConfig, obj dbConfig)
sshConfigshould be an object according to thessh2package.dbConfigshould be an object according to themysql2package.- Returns a Promise, containing a PoolConnection from the
mysql2package.
Usage
Don't forget to .closePool() the connection when you're done querying the database.
1.0.6
7 years ago