# knex-mysql2-deadlock

> An enhanced version of knex-mysql-deadlock for mysql2

Latest version **1.0.2** (published 2019-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install knex-mysql2-deadlock
pnpm add knex-mysql2-deadlock
yarn add knex-mysql2-deadlock
bun add knex-mysql2-deadlock
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-10-22 |
| First published | 2019-04-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Fifer |
| Maintainers | davidfifer |

## Links

- npm: https://www.npmjs.com/package/knex-mysql2-deadlock
- Repository: https://github.com/fiferdc/knex-mysql2-deadlock
- Homepage: https://github.com/fiferdc/knex-mysql2-deadlock#readme
- Issues: https://github.com/fiferdc/knex-mysql2-deadlock/issues
- npm.io page: https://npm.io/package/knex-mysql2-deadlock

## Recent versions

- 1.0.2 (latest) — 2019-10-22
- 1.0.1 — 2019-04-16
- 1.0.0 — 2019-04-16

## README

# knex-mysql2-deadlock
An enhanced version of [`knex-mysql-deadlock`](https://github.com/Mindflash/knex-mysql-deadlock/) for mysql2.  In addition to supporting mysql2 clients, this module addresses [an issue](https://github.com/Mindflash/knex-mysql-deadlock/issues/5) with the original implementation regarding support for ER_LOCK_DEADLOCK and provides additional flexibility around retries.

## Install

```bash
npm install knex mysql2 knex-mysql2-deadlock
```

## Usage

```js
const knex = require('knex')({
  client: require('knex-mysql2-deadlock'),
  connection: mysqlConfig,
  options: {
    // See below
  }
});
```

The following options are supported:

* `deadlockRetries` - Specifies the number retries that should be attempted upon receiving a deadlock.  Default is 5.
* `deadlockRetryDelay` - Specifies the delay between retries, in ms.
* `logger` - An alternative logger.  Default is console.

---
_Source: https://npm.io/package/knex-mysql2-deadlock · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
