QueryFile chains the current query on the "file" edge.
()
| 61 | |
| 62 | // QueryFile chains the current query on the "file" edge. |
| 63 | func (mq *MetadataQuery) QueryFile() *FileQuery { |
| 64 | query := (&FileClient{config: mq.config}).Query() |
| 65 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 66 | if err := mq.prepareQuery(ctx); err != nil { |
| 67 | return nil, err |
| 68 | } |
| 69 | selector := mq.sqlQuery(ctx) |
| 70 | if err := selector.Err(); err != nil { |
| 71 | return nil, err |
| 72 | } |
| 73 | step := sqlgraph.NewStep( |
| 74 | sqlgraph.From(metadata.Table, metadata.FieldID, selector), |
| 75 | sqlgraph.To(file.Table, file.FieldID), |
| 76 | sqlgraph.Edge(sqlgraph.M2O, true, metadata.FileTable, metadata.FileColumn), |
| 77 | ) |
| 78 | fromU = sqlgraph.SetNeighbors(mq.driver.Dialect(), step) |
| 79 | return fromU, nil |
| 80 | } |
| 81 | return query |
| 82 | } |
| 83 | |
| 84 | // First returns the first Metadata entity from the query. |
| 85 | // Returns a *NotFoundError when no Metadata was found. |
nothing calls this directly
no test coverage detected