From c553e7868c3002d2faed640d242bab9e413f53cb Mon Sep 17 00:00:00 2001 From: Jawad Date: Wed, 28 Aug 2024 13:33:33 +0100 Subject: [PATCH] fix(knex): use driver name to identify client Use the `client.driverName` property to identify the clients that can return fields instead of the client config as a string. --- packages/knex/src/adapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/knex/src/adapter.ts b/packages/knex/src/adapter.ts index 8e6c6cb0b0..7e559f53c2 100644 --- a/packages/knex/src/adapter.ts +++ b/packages/knex/src/adapter.ts @@ -239,8 +239,8 @@ export class KnexAdapter< return Promise.all(data.map((current) => this._create(current, params))) } - const { client } = this.db(params).client.config - const returning = RETURNING_CLIENTS.includes(client as string) ? [this.id] : [] + const { client } = this.db(params) + const returning = RETURNING_CLIENTS.includes(client.driverName) ? [this.id] : [] const rows: any = await this.db(params) .insert(data, returning, { includeTriggerModifications: true }) .catch(errorHandler)