New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-mysql-pool

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-mysql-pool - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

11

lib/express-mysql-pool.js

@@ -12,20 +12,19 @@ var _pool, // Pool singleton

return function(req, res, next) {
var poolConn = null;
// Returning cached connection from a pool, caching is on request level
if(req.__expressMysqlConnectionCache__) {
req.getConnection = function (callback) {
pollConn = req.__expressMysqlConnectionCache__;
callback(null, poolConn);
callback(null, req.__expressMysqlConnectionCache__);
}
closeConnection(res, req.__expressMysqlConnectionCache__);
}else {
// Getting connection from a pool
req.getConnection = function (callback) {
_pool.getConnection(function (err, connection) {
_pool.getConnection(function (err, poolConn) {
if (err) return callback(err);
poolConn = req.__expressMysqlConnectionCache__ = connection;
req.__expressMysqlConnectionCache__ = poolConn;
callback(null, poolConn);
closeConnection(res, poolConn);
});
}
}
closeConnection(res, poolConn);
next();

@@ -32,0 +31,0 @@ };

{
"name": "express-mysql-pool",
"version": "1.0.2",
"version": "1.0.3",
"description": "express-mysql-connection middleware (pooling connection)",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc