QueryFile queries the file edge of a Metadata.
(m *Metadata)
| 1506 | |
| 1507 | // QueryFile queries the file edge of a Metadata. |
| 1508 | func (c *MetadataClient) QueryFile(m *Metadata) *FileQuery { |
| 1509 | query := (&FileClient{config: c.config}).Query() |
| 1510 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1511 | id := m.ID |
| 1512 | step := sqlgraph.NewStep( |
| 1513 | sqlgraph.From(metadata.Table, metadata.FieldID, id), |
| 1514 | sqlgraph.To(file.Table, file.FieldID), |
| 1515 | sqlgraph.Edge(sqlgraph.M2O, true, metadata.FileTable, metadata.FileColumn), |
| 1516 | ) |
| 1517 | fromV = sqlgraph.Neighbors(m.driver.Dialect(), step) |
| 1518 | return fromV, nil |
| 1519 | } |
| 1520 | return query |
| 1521 | } |
| 1522 | |
| 1523 | // Hooks returns the client hooks. |
| 1524 | func (c *MetadataClient) Hooks() []Hook { |