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.Event.Query(). Select(event.FieldCreatedAt). Scan(ctx, &v)
(fields ...string)
| 328 | // Select(event.FieldCreatedAt). |
| 329 | // Scan(ctx, &v) |
| 330 | func (_q *EventQuery) Select(fields ...string) *EventSelect { |
| 331 | _q.ctx.Fields = append(_q.ctx.Fields, fields...) |
| 332 | sbuild := &EventSelect{EventQuery: _q} |
| 333 | sbuild.label = event.Label |
| 334 | sbuild.flds, sbuild.scan = &_q.ctx.Fields, sbuild.Scan |
| 335 | return sbuild |
| 336 | } |
| 337 | |
| 338 | // Aggregate returns a EventSelect configured with the given aggregations. |
| 339 | func (_q *EventQuery) Aggregate(fns ...AggregateFunc) *EventSelect { |