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

Method QueryGroup

ent/client.go:2931–2944  ·  view source on GitHub ↗

QueryGroup queries the group edge of a User.

(u *User)

Source from the content-addressed store, hash-verified

2929
2930// QueryGroup queries the group edge of a User.
2931func (c *UserClient) QueryGroup(u *User) *GroupQuery {
2932 query := (&GroupClient{config: c.config}).Query()
2933 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
2934 id := u.ID
2935 step := sqlgraph.NewStep(
2936 sqlgraph.From(user.Table, user.FieldID, id),
2937 sqlgraph.To(group.Table, group.FieldID),
2938 sqlgraph.Edge(sqlgraph.M2O, true, user.GroupTable, user.GroupColumn),
2939 )
2940 fromV = sqlgraph.Neighbors(u.driver.Dialect(), step)
2941 return fromV, nil
2942 }
2943 return query
2944}
2945
2946// QueryFiles queries the files edge of a User.
2947func (c *UserClient) QueryFiles(u *User) *FileQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected