QueryFile chains the current query on the "file" edge.
()
| 86 | |
| 87 | // QueryFile chains the current query on the "file" edge. |
| 88 | func (sq *ShareQuery) QueryFile() *FileQuery { |
| 89 | query := (&FileClient{config: sq.config}).Query() |
| 90 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 91 | if err := sq.prepareQuery(ctx); err != nil { |
| 92 | return nil, err |
| 93 | } |
| 94 | selector := sq.sqlQuery(ctx) |
| 95 | if err := selector.Err(); err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | step := sqlgraph.NewStep( |
| 99 | sqlgraph.From(share.Table, share.FieldID, selector), |
| 100 | sqlgraph.To(file.Table, file.FieldID), |
| 101 | sqlgraph.Edge(sqlgraph.M2O, true, share.FileTable, share.FileColumn), |
| 102 | ) |
| 103 | fromU = sqlgraph.SetNeighbors(sq.driver.Dialect(), step) |
| 104 | return fromU, nil |
| 105 | } |
| 106 | return query |
| 107 | } |
| 108 | |
| 109 | // First returns the first Share entity from the query. |
| 110 | // Returns a *NotFoundError when no Share was found. |
nothing calls this directly
no test coverage detected