Registry / database / mysqlpool

mysqlpool

JSON →
library0.0.9jsnpmunverified

MySQL connection pool using round-robin distribution for node-mysql. This package (v0.0.9) provides a simple pool implementation that distributes connections in a round-robin fashion. It is a very early-stage package with minimal features and no active maintenance. Compared to more robust solutions like mysql2 or generic-pool, this package lacks advanced pooling features, error handling, and performance optimizations.

npm install mysqlpool
INSTALL
IMPORT
SIG · MYSQLPOOL
M
mysqlpool
databasejavascriptv0.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mysqlPool
import mysqlPool from 'mysqlpool'
const mysqlPool = require('mysqlpool')
Default export only; ESM import requires Node ≥12 or transpilation.
MysqlPool
import MysqlPool from 'mysqlpool'
import { MysqlPool } from 'mysqlpool'
No named export 'MysqlPool'; the default export is the constructor.

Creates a pool, connects a MySQL client, performs a query, and releases the connection back to the pool.

import mysqlPool from 'mysqlpool'; import mysql from 'mysql'; const pool = new mysqlPool(); const connection = mysql.createConnection({ host: process.env.MYSQL_HOST ?? 'localhost', user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', database: process.env.MYSQL_DATABASE ?? 'test' }); const client = pool.connect(connection); client.query('SELECT 1 + 1 AS solution', (err, results) => { if (err) throw err; console.log(results[0].solution); client.release(); });
Debug
Known issues
deprecatedPackage is no longer maintained; use mysql2 or generic-pool instead.
fix
Migrate to mysql2 or another actively maintained connection pool.
affects: >=0.0.0
gotchaThe pool does not handle connection errors or reconnection automatically.
fix
Implement manual error handling and reconnect logic.
affects: >=0.0.0
gotchapool.connect() expects a connection object, not a config; it does not create connections itself.
fix
First create a connection via mysql.createConnection(), then pass to pool.connect().
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: pool.connect is not a function
Incorrect import or instantiation; default import may be undefined if using CommonJS require incorrectly.
fix
Use import mysqlPool from 'mysqlpool' or const mysqlPool = require('mysqlpool').default
Error: Cannot find module 'mysql'
Missing required peer dependency 'mysql'.
fix
Run: npm install mysql
Upgrade
Version history
0.0.9latest on npm
Audit
Dependencies
mysqlrequiredPeer dependency for MySQL client; this package wraps node-mysql connections.
Agent activity
2 hits · last 30 days
node
2
Resources
mysqlpool — npm install mysqlpool · libregistry