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

Method QueryEntities

ent/client.go:3043–3056  ·  view source on GitHub ↗

QueryEntities queries the entities edge of a User.

(u *User)

Source from the content-addressed store, hash-verified

3041
3042// QueryEntities queries the entities edge of a User.
3043func (c *UserClient) QueryEntities(u *User) *EntityQuery {
3044 query := (&EntityClient{config: c.config}).Query()
3045 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
3046 id := u.ID
3047 step := sqlgraph.NewStep(
3048 sqlgraph.From(user.Table, user.FieldID, id),
3049 sqlgraph.To(entity.Table, entity.FieldID),
3050 sqlgraph.Edge(sqlgraph.O2M, false, user.EntitiesTable, user.EntitiesColumn),
3051 )
3052 fromV = sqlgraph.Neighbors(u.driver.Dialect(), step)
3053 return fromV, nil
3054 }
3055 return query
3056}
3057
3058// QueryOauthGrants queries the oauth_grants edge of a User.
3059func (c *UserClient) QueryOauthGrants(u *User) *OAuthGrantQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected