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 { CreateTime time.Time `json:"create_time,omitempty"` } client.GitCommit.Query(). Select(gitcommit.FieldCreateTime). Scan(ctx, &v)
(fields ...string)
| 333 | // Select(gitcommit.FieldCreateTime). |
| 334 | // Scan(ctx, &v) |
| 335 | func (gcq *GitCommitQuery) Select(fields ...string) *GitCommitSelect { |
| 336 | gcq.ctx.Fields = append(gcq.ctx.Fields, fields...) |
| 337 | sbuild := &GitCommitSelect{GitCommitQuery: gcq} |
| 338 | sbuild.label = gitcommit.Label |
| 339 | sbuild.flds, sbuild.scan = &gcq.ctx.Fields, sbuild.Scan |
| 340 | return sbuild |
| 341 | } |
| 342 | |
| 343 | // Aggregate returns a GitCommitSelect configured with the given aggregations. |
| 344 | func (gcq *GitCommitQuery) Aggregate(fns ...AggregateFunc) *GitCommitSelect { |