Provides retry capabilities for node-mysql queries that fail with MySQL deadlock errors (errno 1205-1213, ER_LOCK_DEADLOCK, ERR_LOCK_WAIT_TIMEOUT). It proxies the connection's query method, retrying failed queries up to a configurable number of times with random sleep intervals between retries. Version 2.0.5, stable, low release cadence (last update 2017). Differentiator: simple, focused deadlock handling for the node-mysql driver, vs. generic retry libraries.
npm install node-mysql-deadlock-retriesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs and uses node-mysql-deadlock-retries to add deadlock retry logic to a MySQL connection, then runs a simple query.
npm install mysql
Review the behavior change in retry handling.
Use 'var retries = 5;' in JavaScript.
dbPool.on('connection', function(connection) { proxyDeadlock(connection, ...); });Use 'mysql' instead of 'mysql2'.
npm install node-mysql-deadlock-retries --save
Call proxyDeadlock(connection, ...) after connection is created but before first use.
Use const proxyMysqlDeadlockRetries = require('node-mysql-deadlock-retries');Increase retries/minMillis/maxMillis or optimize queries.
No dependency data recorded yet.