MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / GroupBy

Method GroupBy

ent/setting_query.go:272–279  ·  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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Setting.Query(). GroupBy(s

(field string, fields ...string)

Source from the content-addressed store, hash-verified

270// Aggregate(ent.Count()).
271// Scan(ctx, &v)
272func (sq *SettingQuery) GroupBy(field string, fields ...string) *SettingGroupBy {
273 sq.ctx.Fields = append([]string{field}, fields...)
274 grbuild := &SettingGroupBy{build: sq}
275 grbuild.flds = &sq.ctx.Fields
276 grbuild.label = setting.Label
277 grbuild.scan = grbuild.Scan
278 return grbuild
279}
280
281// Select allows the selection one or more fields/columns for the given query,
282// instead of selecting all fields in the entity.

Callers 1

sqlScanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected