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

Method QueryUsers

ent/group_query.go:66–85  ·  view source on GitHub ↗

QueryUsers chains the current query on the "users" edge.

()

Source from the content-addressed store, hash-verified

64
65// QueryUsers chains the current query on the "users" edge.
66func (gq *GroupQuery) QueryUsers() *UserQuery {
67 query := (&UserClient{config: gq.config}).Query()
68 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
69 if err := gq.prepareQuery(ctx); err != nil {
70 return nil, err
71 }
72 selector := gq.sqlQuery(ctx)
73 if err := selector.Err(); err != nil {
74 return nil, err
75 }
76 step := sqlgraph.NewStep(
77 sqlgraph.From(group.Table, group.FieldID, selector),
78 sqlgraph.To(user.Table, user.FieldID),
79 sqlgraph.Edge(sqlgraph.O2M, false, group.UsersTable, group.UsersColumn),
80 )
81 fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step)
82 return fromU, nil
83 }
84 return query
85}
86
87// QueryStoragePolicies chains the current query on the "storage_policies" edge.
88func (gq *GroupQuery) QueryStoragePolicies() *StoragePolicyQuery {

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