knex-mysql2-deadlock

1.0.2 • Public • Published

knex-mysql2-deadlock

An enhanced version of knex-mysql-deadlock for mysql2. In addition to supporting mysql2 clients, this module addresses an issue with the original implementation regarding support for ER_LOCK_DEADLOCK and provides additional flexibility around retries.

Install

npm install knex mysql2 knex-mysql2-deadlock

Usage

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.

/knex-mysql2-deadlock/

    Package Sidebar

    Install

    npm i knex-mysql2-deadlock

    Weekly Downloads

    53

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    4.37 kB

    Total Files

    4

    Last publish

    Collaborators

    • davidfifer