QueryGroups chains the current query on the "groups" edge.
()
| 68 | |
| 69 | // QueryGroups chains the current query on the "groups" edge. |
| 70 | func (spq *StoragePolicyQuery) QueryGroups() *GroupQuery { |
| 71 | query := (&GroupClient{config: spq.config}).Query() |
| 72 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 73 | if err := spq.prepareQuery(ctx); err != nil { |
| 74 | return nil, err |
| 75 | } |
| 76 | selector := spq.sqlQuery(ctx) |
| 77 | if err := selector.Err(); err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | step := sqlgraph.NewStep( |
| 81 | sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, selector), |
| 82 | sqlgraph.To(group.Table, group.FieldID), |
| 83 | sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.GroupsTable, storagepolicy.GroupsColumn), |
| 84 | ) |
| 85 | fromU = sqlgraph.SetNeighbors(spq.driver.Dialect(), step) |
| 86 | return fromU, nil |
| 87 | } |
| 88 | return query |
| 89 | } |
| 90 | |
| 91 | // QueryFiles chains the current query on the "files" edge. |
| 92 | func (spq *StoragePolicyQuery) QueryFiles() *FileQuery { |
nothing calls this directly
no test coverage detected