MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / QueryOwner

Method QueryOwner

ent/client.go:928–941  ·  view source on GitHub ↗

QueryOwner queries the owner edge of a File.

(f *File)

Source from the content-addressed store, hash-verified

926
927// QueryOwner queries the owner edge of a File.
928func (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.
944func (c *FileClient) QueryStoragePolicies(f *File) *StoragePolicyQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected