MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / GroupBy

Method GroupBy

ent/gitcommit_query.go:314–321  ·  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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.GitCommit.Query(). Group

(field string, fields ...string)

Source from the content-addressed store, hash-verified

312// Aggregate(ent.Count()).
313// Scan(ctx, &v)
314func (gcq *GitCommitQuery) GroupBy(field string, fields ...string) *GitCommitGroupBy {
315 gcq.ctx.Fields = append([]string{field}, fields...)
316 grbuild := &GitCommitGroupBy{build: gcq}
317 grbuild.flds = &gcq.ctx.Fields
318 grbuild.label = gitcommit.Label
319 grbuild.scan = grbuild.Scan
320 return grbuild
321}
322
323// Select allows the selection one or more fields/columns for the given query,
324// instead of selecting all fields in the entity.

Callers 1

sqlScanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected