MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / QueryGroups

Method QueryGroups

ent/storagepolicy_query.go:70–89  ·  view source on GitHub ↗

QueryGroups chains the current query on the "groups" edge.

()

Source from the content-addressed store, hash-verified

68
69// QueryGroups chains the current query on the "groups" edge.
70func (spq *StoragePolicyQuery) QueryGroups() *GroupQuery {
71 query := (&GroupClient{config: spq.config}).Query()
72 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
73 if err := spq.prepareQuery(ctx); err != nil {
74 return nil, err
75 }
76 selector := spq.sqlQuery(ctx)
77 if err := selector.Err(); err != nil {
78 return nil, err
79 }
80 step := sqlgraph.NewStep(
81 sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, selector),
82 sqlgraph.To(group.Table, group.FieldID),
83 sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.GroupsTable, storagepolicy.GroupsColumn),
84 )
85 fromU = sqlgraph.SetNeighbors(spq.driver.Dialect(), step)
86 return fromU, nil
87 }
88 return query
89}
90
91// QueryFiles chains the current query on the "files" edge.
92func (spq *StoragePolicyQuery) QueryFiles() *FileQuery {

Callers

nothing calls this directly

Calls 5

prepareQueryMethod · 0.95
sqlQueryMethod · 0.95
DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected