MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Max

Function Max

app/controlplane/pkg/data/ent/ent.go:166–174  ·  view source on GitHub ↗

Max applies the "max" aggregation function on the given field of each group.

(field string)

Source from the content-addressed store, hash-verified

164
165// Max applies the "max" aggregation function on the given field of each group.
166func 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.
177func Mean(field string) AggregateFunc {

Callers

nothing calls this directly

Calls 2

checkColumnFunction · 0.85
AddErrorMethod · 0.80

Tested by

no test coverage detected