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

Method GroupBy

app/controlplane/pkg/data/ent/user_query.go:350–357  ·  view source on GitHub ↗

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum. Example: var v []struct { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail)

(field string, fields ...string)

Source from the content-addressed store, hash-verified

348// Aggregate(ent.Count()).
349// Scan(ctx, &v)
350func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy {
351 _q.ctx.Fields = append([]string{field}, fields...)
352 grbuild := &UserGroupBy{build: _q}
353 grbuild.flds = &_q.ctx.Fields
354 grbuild.label = user.Label
355 grbuild.scan = grbuild.Scan
356 return grbuild
357}
358
359// Select allows the selection one or more fields/columns for the given query,
360// instead of selecting all fields in the entity.

Callers 5

RunsByStatusTotalMethod · 0.45
RunsByRunnerTypeTotalMethod · 0.45
DailyRunsCountMethod · 0.45
sqlScanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected