mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: sort results correctly when using postgres (#46466)
* Search: sort results correctly when using postgres postgresql puts nulls first while both mysql and sqlite puts them last * linting
This commit is contained in:
@@ -140,7 +140,12 @@ func (b *Builder) applyFilters() (ordering string) {
|
||||
b.params = append(b.params, groupParams...)
|
||||
}
|
||||
|
||||
orderBy := fmt.Sprintf(" ORDER BY %s", strings.Join(orders, ", "))
|
||||
orderByCols := []string{}
|
||||
for _, o := range orders {
|
||||
orderByCols = append(orderByCols, b.Dialect.OrderBy(o))
|
||||
}
|
||||
|
||||
orderBy := fmt.Sprintf(" ORDER BY %s", strings.Join(orderByCols, ", "))
|
||||
b.sql.WriteString(orderBy)
|
||||
|
||||
order := strings.Join(orderJoins, "")
|
||||
|
||||
Reference in New Issue
Block a user