QueryGroup chains the current query on the "group" edge.
()
| 78 | |
| 79 | // QueryGroup chains the current query on the "group" edge. |
| 80 | func (uq *UserQuery) QueryGroup() *GroupQuery { |
| 81 | query := (&GroupClient{config: uq.config}).Query() |
| 82 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 83 | if err := uq.prepareQuery(ctx); err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | selector := uq.sqlQuery(ctx) |
| 87 | if err := selector.Err(); err != nil { |
| 88 | return nil, err |
| 89 | } |
| 90 | step := sqlgraph.NewStep( |
| 91 | sqlgraph.From(user.Table, user.FieldID, selector), |
| 92 | sqlgraph.To(group.Table, group.FieldID), |
| 93 | sqlgraph.Edge(sqlgraph.M2O, true, user.GroupTable, user.GroupColumn), |
| 94 | ) |
| 95 | fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) |
| 96 | return fromU, nil |
| 97 | } |
| 98 | return query |
| 99 | } |
| 100 | |
| 101 | // QueryFiles chains the current query on the "files" edge. |
| 102 | func (uq *UserQuery) QueryFiles() *FileQuery { |
nothing calls this directly
no test coverage detected