🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

runsv-mysql-pool

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

runsv-mysql-pool

runsv service wrapper around mysql module

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

runsv-mysql-pool

pipeline status coverage report

runsv service wrapper around the great mysql module.

Install

If you have already installed mysql

$ npm install runsv-mysql-pool

Otherwise

$ npm install mysql runsv-mysql-pool

mysql is a peer dependency of this module

Usage

Create a MySQL connection pool

const runsv = require('runsv')();
// Pool options. Same as https://www.npmjs.com/package/mysql#pool-options
const poolOptions = { /*...*/}
const createMySQLPoolService = require('runsv-mysql-pool');
const poolClientName = 'myPool';
const poolService = createMySQLPoolService(poolOptions, poolClientName);
runsv.addService(mysql);
runsv.start(function(err){
	const {myPool} = runsv.getClients();
	// myPool is the same object you will get with mysql.createPool(...)
	myPool.query('SELECT ...', function (err, rows) {
	/* ... */
	});
});
/* ... other application logic */

API

  • createMySQLPoolService(options, name='mysql') this function will create the service wrapper.

Keywords

runsv

FAQs

Package last updated on 18 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts