QueryFile queries the file edge of a DirectLink.
(dl *DirectLink)
| 592 | |
| 593 | // QueryFile queries the file edge of a DirectLink. |
| 594 | func (c *DirectLinkClient) QueryFile(dl *DirectLink) *FileQuery { |
| 595 | query := (&FileClient{config: c.config}).Query() |
| 596 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 597 | id := dl.ID |
| 598 | step := sqlgraph.NewStep( |
| 599 | sqlgraph.From(directlink.Table, directlink.FieldID, id), |
| 600 | sqlgraph.To(file.Table, file.FieldID), |
| 601 | sqlgraph.Edge(sqlgraph.M2O, true, directlink.FileTable, directlink.FileColumn), |
| 602 | ) |
| 603 | fromV = sqlgraph.Neighbors(dl.driver.Dialect(), step) |
| 604 | return fromV, nil |
| 605 | } |
| 606 | return query |
| 607 | } |
| 608 | |
| 609 | // Hooks returns the client hooks. |
| 610 | func (c *DirectLinkClient) Hooks() []Hook { |