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

Method QueryOauthGrants

ent/client.go:3059–3072  ·  view source on GitHub ↗

QueryOauthGrants queries the oauth_grants edge of a User.

(u *User)

Source from the content-addressed store, hash-verified

3057
3058// QueryOauthGrants queries the oauth_grants edge of a User.
3059func (c *UserClient) QueryOauthGrants(u *User) *OAuthGrantQuery {
3060 query := (&OAuthGrantClient{config: c.config}).Query()
3061 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
3062 id := u.ID
3063 step := sqlgraph.NewStep(
3064 sqlgraph.From(user.Table, user.FieldID, id),
3065 sqlgraph.To(oauthgrant.Table, oauthgrant.FieldID),
3066 sqlgraph.Edge(sqlgraph.O2M, false, user.OauthGrantsTable, user.OauthGrantsColumn),
3067 )
3068 fromV = sqlgraph.Neighbors(u.driver.Dialect(), step)
3069 return fromV, nil
3070 }
3071 return query
3072}
3073
3074// Hooks returns the client hooks.
3075func (c *UserClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected