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

Function Min

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

Min applies the "min" aggregation function on the given field of each group.

(field string)

Source from the content-addressed store, hash-verified

186
187// Min applies the "min" aggregation function on the given field of each group.
188func 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.
199func Sum(field string) AggregateFunc {

Callers

nothing calls this directly

Calls 2

checkColumnFunction · 0.85
AddErrorMethod · 0.80

Tested by

no test coverage detected