QueryShares queries the shares edge of a File.
(f *File)
| 1022 | |
| 1023 | // QueryShares queries the shares edge of a File. |
| 1024 | func (c *FileClient) QueryShares(f *File) *ShareQuery { |
| 1025 | query := (&ShareClient{config: c.config}).Query() |
| 1026 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1027 | id := f.ID |
| 1028 | step := sqlgraph.NewStep( |
| 1029 | sqlgraph.From(file.Table, file.FieldID, id), |
| 1030 | sqlgraph.To(share.Table, share.FieldID), |
| 1031 | sqlgraph.Edge(sqlgraph.O2M, false, file.SharesTable, file.SharesColumn), |
| 1032 | ) |
| 1033 | fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) |
| 1034 | return fromV, nil |
| 1035 | } |
| 1036 | return query |
| 1037 | } |
| 1038 | |
| 1039 | // QueryDirectLinks queries the direct_links edge of a File. |
| 1040 | func (c *FileClient) QueryDirectLinks(f *File) *DirectLinkQuery { |