We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eb7428 commit 28c2627Copy full SHA for 28c2627
1 file changed
packages/knex/src/adapter.ts
@@ -181,7 +181,7 @@ export class KnexAdapter<
181
}
182
183
// provide default sorting if its not set
184
- if (!filters.$sort) {
+ if (!filters.$sort && builder.client.driverName === 'mssql') {
185
builder.orderBy(`${name}.${id}`, 'asc')
186
187
@@ -238,7 +238,7 @@ export class KnexAdapter<
238
return Promise.all(data.map((current) => this._create(current, params)))
239
240
241
- const client = this.db(params).client.config.client
+ const { client } = this.db(params).client.config
242
const returning = RETURNING_CLIENTS.includes(client as string) ? [this.id] : []
243
const rows: any = await this.db(params).insert(data, returning).catch(errorHandler)
244
const id = data[this.id] || rows[0][this.id] || rows[0]
0 commit comments