How to use the knex-dynamic-connection.patchKnex function in knex-dynamic-connection

To help you get started, we’ve selected a few knex-dynamic-connection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adonisjs / adonis-lucid / src / Connection / index.ts View on Github external
private _setupReadConnection () {
    if (!this.hasReadWriteReplicas) {
      this.readClient = this.client
      return
    }

    this._logger.trace({ connection: this.name }, 'setting up read/write replicas')

    this.readClient = knex(this._getReadConfig())
    patchKnex(this.readClient, this._readConfigResolver.bind(this))
  }
github adonisjs / adonis-lucid / src / Connection / index.ts View on Github external
private _setupWriteConnection () {
    this.client = knex(this._getWriteConfig())
    patchKnex(this.client, this._writeConfigResolver.bind(this))
  }

knex-dynamic-connection

Adds support for dynamically returning connection config for knex queries

MIT
Latest version published 6 months ago

Package Health Score

61 / 100
Full package analysis

Popular knex-dynamic-connection functions