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

Method QueryStoragePolicies

ent/client.go:944–957  ·  view source on GitHub ↗

QueryStoragePolicies queries the storage_policies edge of a File.

(f *File)

Source from the content-addressed store, hash-verified

942
943// QueryStoragePolicies queries the storage_policies edge of a File.
944func (c *FileClient) QueryStoragePolicies(f *File) *StoragePolicyQuery {
945 query := (&StoragePolicyClient{config: c.config}).Query()
946 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
947 id := f.ID
948 step := sqlgraph.NewStep(
949 sqlgraph.From(file.Table, file.FieldID, id),
950 sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID),
951 sqlgraph.Edge(sqlgraph.M2O, true, file.StoragePoliciesTable, file.StoragePoliciesColumn),
952 )
953 fromV = sqlgraph.Neighbors(f.driver.Dialect(), step)
954 return fromV, nil
955 }
956 return query
957}
958
959// QueryParent queries the parent edge of a File.
960func (c *FileClient) QueryParent(f *File) *FileQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected