entc/gen: minor codegen improvements

This commit is contained in:
Ariel Mashraki
2021-11-08 14:13:24 +02:00
committed by Ariel Mashraki
parent e915765f3b
commit ab207c499a
118 changed files with 118 additions and 324 deletions

View File

@@ -43,9 +43,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlQuery() *sql.Selector {
for _, f := range {{ $receiver }}.fields {
columns = append(columns, selector.C(f))
}
for _, c := range aggregation {
columns = append(columns, c)
}
columns = append(columns, aggregation...)
selector.Select(columns...)
}
return selector.GroupBy(selector.Columns({{ $receiver }}.fields...)...)