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

Method Select

ent/task_query.go:329–335  ·  view source on GitHub ↗

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity. Example: var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Task.Query(). Select(task.FieldCreatedAt). Scan(ctx, &v)

(fields ...string)

Source from the content-addressed store, hash-verified

327// Select(task.FieldCreatedAt).
328// Scan(ctx, &v)
329func (tq *TaskQuery) Select(fields ...string) *TaskSelect {
330 tq.ctx.Fields = append(tq.ctx.Fields, fields...)
331 sbuild := &TaskSelect{TaskQuery: tq}
332 sbuild.label = task.Label
333 sbuild.flds, sbuild.scan = &tq.ctx.Fields, sbuild.Scan
334 return sbuild
335}
336
337// Aggregate returns a TaskSelect configured with the given aggregations.
338func (tq *TaskQuery) Aggregate(fns ...AggregateFunc) *TaskSelect {

Callers 5

IDsMethod · 0.95
AggregateMethod · 0.95
sqlQueryMethod · 0.45
sqlScanMethod · 0.45
sqlScanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected