QueryFile queries the file edge of a Share.
(s *Share)
| 2428 | |
| 2429 | // QueryFile queries the file edge of a Share. |
| 2430 | func (c *ShareClient) QueryFile(s *Share) *FileQuery { |
| 2431 | query := (&FileClient{config: c.config}).Query() |
| 2432 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 2433 | id := s.ID |
| 2434 | step := sqlgraph.NewStep( |
| 2435 | sqlgraph.From(share.Table, share.FieldID, id), |
| 2436 | sqlgraph.To(file.Table, file.FieldID), |
| 2437 | sqlgraph.Edge(sqlgraph.M2O, true, share.FileTable, share.FileColumn), |
| 2438 | ) |
| 2439 | fromV = sqlgraph.Neighbors(s.driver.Dialect(), step) |
| 2440 | return fromV, nil |
| 2441 | } |
| 2442 | return query |
| 2443 | } |
| 2444 | |
| 2445 | // Hooks returns the client hooks. |
| 2446 | func (c *ShareClient) Hooks() []Hook { |