Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
}
private _setupWriteConnection () {
this.client = knex(this._getWriteConfig())
patchKnex(this.client, this._writeConfigResolver.bind(this))
}