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

Method QueryGroup

ent/user_query.go:80–99  ·  view source on GitHub ↗

QueryGroup chains the current query on the "group" edge.

()

Source from the content-addressed store, hash-verified

78
79// QueryGroup chains the current query on the "group" edge.
80func (uq *UserQuery) QueryGroup() *GroupQuery {
81 query := (&GroupClient{config: uq.config}).Query()
82 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
83 if err := uq.prepareQuery(ctx); err != nil {
84 return nil, err
85 }
86 selector := uq.sqlQuery(ctx)
87 if err := selector.Err(); err != nil {
88 return nil, err
89 }
90 step := sqlgraph.NewStep(
91 sqlgraph.From(user.Table, user.FieldID, selector),
92 sqlgraph.To(group.Table, group.FieldID),
93 sqlgraph.Edge(sqlgraph.M2O, true, user.GroupTable, user.GroupColumn),
94 )
95 fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step)
96 return fromU, nil
97 }
98 return query
99}
100
101// QueryFiles chains the current query on the "files" edge.
102func (uq *UserQuery) 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