How to use knex-dynamic-connection - 2 common examples

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 5 months ago

Package Health Score

64 / 100
Full package analysis

Popular knex-dynamic-connection functions