QueryDirectLinks queries the direct_links edge of a File.
(f *File)
| 1038 | |
| 1039 | // QueryDirectLinks queries the direct_links edge of a File. |
| 1040 | func (c *FileClient) QueryDirectLinks(f *File) *DirectLinkQuery { |
| 1041 | query := (&DirectLinkClient{config: c.config}).Query() |
| 1042 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1043 | id := f.ID |
| 1044 | step := sqlgraph.NewStep( |
| 1045 | sqlgraph.From(file.Table, file.FieldID, id), |
| 1046 | sqlgraph.To(directlink.Table, directlink.FieldID), |
| 1047 | sqlgraph.Edge(sqlgraph.O2M, false, file.DirectLinksTable, file.DirectLinksColumn), |
| 1048 | ) |
| 1049 | fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) |
| 1050 | return fromV, nil |
| 1051 | } |
| 1052 | return query |
| 1053 | } |
| 1054 | |
| 1055 | // Hooks returns the client hooks. |
| 1056 | func (c *FileClient) Hooks() []Hook { |