remove nulls for raw and rely on defaults
This commit is contained in:
parent
c077f7e84c
commit
3bd56bdca7
|
@ -1167,17 +1167,15 @@ class InternalBuilder {
|
||||||
let nulls: "first" | "last" | undefined = undefined
|
let nulls: "first" | "last" | undefined = undefined
|
||||||
if (
|
if (
|
||||||
this.client === SqlClient.POSTGRES ||
|
this.client === SqlClient.POSTGRES ||
|
||||||
this.client === SqlClient.ORACLE ||
|
this.client === SqlClient.ORACLE
|
||||||
this.client === SqlClient.SQL_LITE
|
|
||||||
) {
|
) {
|
||||||
nulls = value.direction === SortOrder.ASCENDING ? "first" : "last"
|
nulls = value.direction === SortOrder.ASCENDING ? "first" : "last"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isAggregateField(key)) {
|
if (this.isAggregateField(key)) {
|
||||||
query = query.orderByRaw(`?? ?? nulls ??`, [
|
query = query.orderByRaw(`?? ??`, [
|
||||||
this.rawQuotedIdentifier(key),
|
this.rawQuotedIdentifier(key),
|
||||||
this.knex.raw(direction),
|
this.knex.raw(direction),
|
||||||
this.knex.raw(nulls as string),
|
|
||||||
])
|
])
|
||||||
} else {
|
} else {
|
||||||
let composite = `${aliased}.${key}`
|
let composite = `${aliased}.${key}`
|
||||||
|
@ -1188,10 +1186,9 @@ class InternalBuilder {
|
||||||
this.knex.raw(nulls as string),
|
this.knex.raw(nulls as string),
|
||||||
])
|
])
|
||||||
} else {
|
} else {
|
||||||
query = query.orderByRaw(`?? ?? nulls ??`, [
|
query = query.orderByRaw(`?? ??`, [
|
||||||
this.rawQuotedIdentifier(composite),
|
this.rawQuotedIdentifier(composite),
|
||||||
this.knex.raw(direction),
|
this.knex.raw(direction),
|
||||||
this.knex.raw(nulls as string),
|
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue