QueryOwner queries the owner edge of a File.
(f *File)
| 926 | |
| 927 | // QueryOwner queries the owner edge of a File. |
| 928 | func (c *FileClient) QueryOwner(f *File) *UserQuery { |
| 929 | query := (&UserClient{config: c.config}).Query() |
| 930 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 931 | id := f.ID |
| 932 | step := sqlgraph.NewStep( |
| 933 | sqlgraph.From(file.Table, file.FieldID, id), |
| 934 | sqlgraph.To(user.Table, user.FieldID), |
| 935 | sqlgraph.Edge(sqlgraph.M2O, true, file.OwnerTable, file.OwnerColumn), |
| 936 | ) |
| 937 | fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) |
| 938 | return fromV, nil |
| 939 | } |
| 940 | return query |
| 941 | } |
| 942 | |
| 943 | // QueryStoragePolicies queries the storage_policies edge of a File. |
| 944 | func (c *FileClient) QueryStoragePolicies(f *File) *StoragePolicyQuery { |