Max applies the "max" aggregation function on the given field of each group.
(field string)
| 164 | |
| 165 | // Max applies the "max" aggregation function on the given field of each group. |
| 166 | func Max(field string) AggregateFunc { |
| 167 | return func(s *sql.Selector) string { |
| 168 | if err := checkColumn(s.TableName(), field); err != nil { |
| 169 | s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) |
| 170 | return "" |
| 171 | } |
| 172 | return sql.Max(s.C(field)) |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // Mean applies the "mean" aggregation function on the given field of each group. |
| 177 | func Mean(field string) AggregateFunc { |
nothing calls this directly
no test coverage detected