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

Method Select

ent/setting_query.go:293–299  ·  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.Setting.Query(). Select(setting.FieldCreatedAt). Scan(ctx, &v)

(fields ...string)

Source from the content-addressed store, hash-verified

291// Select(setting.FieldCreatedAt).
292// Scan(ctx, &v)
293func (sq *SettingQuery) Select(fields ...string) *SettingSelect {
294 sq.ctx.Fields = append(sq.ctx.Fields, fields...)
295 sbuild := &SettingSelect{SettingQuery: sq}
296 sbuild.label = setting.Label
297 sbuild.flds, sbuild.scan = &sq.ctx.Fields, sbuild.Scan
298 return sbuild
299}
300
301// Aggregate returns a SettingSelect configured with the given aggregations.
302func (sq *SettingQuery) Aggregate(fns ...AggregateFunc) *SettingSelect {

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