Skip to content

Commit

Permalink
fix(knex): use driver name to identify client
Browse files Browse the repository at this point in the history
Use the `client.driverName` property to identify the clients that can return fields instead of the client config as a string.
  • Loading branch information
jawadst authored Aug 28, 2024
1 parent 6330134 commit c553e78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/knex/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c553e78

Please sign in to comment.