Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
any-db-pool
Advanced tools
var ConnectionPool = require('any-db-pool')
var mysql = require('mysql')
var adapter = {
createConnection: function (opts, callback) {
var conn = mysql.createConnection(opts, callback)
conn.connect(function (err) {
if (err) callback(err)
else callback(null, conn)
})
return conn
},
createQuery: mysql.createQuery
}
var pool = new ConnectionPool(adapter, {user: 'scott', password: 'tiger'}, {
min: 5,
max: 15,
reset: function (conn, done) { conn.query('ROLLBACK', done) }
})
// Proxies to mysql's connection.query
var q = pool.query('SELECT 1', function (err, res) { })
This module contains a database connection pool that can be used with any driver, though it is designed to integrate well with any-db, a minimal database abstraction layer. If you are writing a library that needs to support multiple database backends (e.g. SQLite3 or Postgres or MySQL) then it's highly encouraged that you use any-db and not this module.
If, on the other hand, you just need a connection pool for your application this should work for you with very little fuss.
generic-pool
?generic-pool is awesome, but it's very generic. This is a Good Thing
for a library with "generic" in the name, but not so good for the very common
but slightly more specialized case of pooling stateful database connection. This
library uses generic-pool
and simply augments it with some added niceties:
query
method that allows queries to be performed without the user needing
a reference to a connection object (and potentially leaking that reference).npm install any-db-pool
You can find the API documentation for this connection pool inclued in the rest of the any-db API docs here.
MIT
FAQs
Any-DB connection pool
The npm package any-db-pool receives a total of 1,984 weekly downloads. As such, any-db-pool popularity was classified as popular.
We found that any-db-pool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.