Min applies the "min" aggregation function on the given field of each group.
(field string)
| 186 | |
| 187 | // Min applies the "min" aggregation function on the given field of each group. |
| 188 | func Min(field string) AggregateFunc { |
| 189 | return func(s *sql.Selector) string { |
| 190 | if err := checkColumn(s.TableName(), field); err != nil { |
| 191 | s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)}) |
| 192 | return "" |
| 193 | } |
| 194 | return sql.Min(s.C(field)) |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // Sum applies the "sum" aggregation function on the given field of each group. |
| 199 | func Sum(field string) AggregateFunc { |
nothing calls this directly
no test coverage detected