mysql-ssh-pool

1.0.6 • Public • Published

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)

  • sshConfig should be an object according to the ssh2 package.
  • dbConfig should be an object according to the mysql2 package.
  • Returns a Promise, containing a PoolConnection from the mysql2 package.

Usage

Don't forget to .closePool() the connection when you're done querying the database.

Readme

Keywords

Package Sidebar

Install

npm i mysql-ssh-pool

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

21.3 kB

Total Files

10

Last publish

Collaborators

  • ghyslainbruno