dialect/sql/sqlgraph: ignore ORDER BY clauses in COUNT queries (#3226)

This commit is contained in:
Ariel Mashraki
2023-01-10 14:03:29 +02:00
committed by GitHub
parent 27a9db528b
commit fa1cf83fdd
4 changed files with 105 additions and 83 deletions

View File

@@ -2744,6 +2744,12 @@ func (s *Selector) OrderExpr(exprs ...Querier) *Selector {
return s
}
// ClearOrder clears the ORDER BY clause to be empty.
func (s *Selector) ClearOrder() *Selector {
s.order = nil
return s
}
// GroupBy appends the `GROUP BY` clause to the `SELECT` statement.
func (s *Selector) GroupBy(columns ...string) *Selector {
s.group = append(s.group, columns...)