
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@7digital/mysql2-timeout
Advanced tools
A wrapper for mysql2 connection pool query to support acquireTimeout and queryTimeout options
A wrapper for mysql2
connection pool query
to support connection acquiring and query timeout options.
npm install mysql2 @7digital/mysql2-timeout
Just use this instead of mysql2
and call connect
passing acquireTimeout
and defaultQueryTimeout
millisecond values. If not passed, each will default to 10 seconds. All other options will be passed directly to mysql2
.
If connection aquisition times out, a DatabaseTimeout
error will be thrown.
If querying times out, it will
DatabaseTimeout
errorYou can override the default query timeout on a per-query basis by specifying timeout
when calling query
with an object.
This only exposes the mysql2
connection pool promise interface.
const database = require('@7digital/mysql2-timeout');
async function main() {
const db = await database.connect({
host: 'localhost',
user: 'root',
database: 'test',
acquireTimeout: 2000,
defaultQueryTimeout: 5000
});
await db.query('SELECT 1');
await db.query({ sql: 'SELECT 2', timeout: 1000 });
}
Requirements:
make test
Spins up database and test containers, runs the tests once, and then stops the containers.
make watch
Spins up database and test containers, and runs the tests whenever the source or tests change.
FAQs
A wrapper for mysql2 connection pool query to support acquireTimeout and queryTimeout options
The npm package @7digital/mysql2-timeout receives a total of 4 weekly downloads. As such, @7digital/mysql2-timeout popularity was classified as not popular.
We found that @7digital/mysql2-timeout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.