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 { Email string `json:"email,omitempty"` } client.User.Query(). Select(user.FieldEmail). Scan(ctx, &v)
(fields ...string)
| 369 | // Select(user.FieldEmail). |
| 370 | // Scan(ctx, &v) |
| 371 | func (_q *UserQuery) Select(fields ...string) *UserSelect { |
| 372 | _q.ctx.Fields = append(_q.ctx.Fields, fields...) |
| 373 | sbuild := &UserSelect{UserQuery: _q} |
| 374 | sbuild.label = user.Label |
| 375 | sbuild.flds, sbuild.scan = &_q.ctx.Fields, sbuild.Scan |
| 376 | return sbuild |
| 377 | } |
| 378 | |
| 379 | // Aggregate returns a UserSelect configured with the given aggregations. |
| 380 | func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect { |
no outgoing calls
no test coverage detected