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

Method QueryGrants

ent/client.go:1810–1823  ·  view source on GitHub ↗

QueryGrants queries the grants edge of a OAuthClient.

(oc *OAuthClient)

Source from the content-addressed store, hash-verified

1808
1809// QueryGrants queries the grants edge of a OAuthClient.
1810func (c *OAuthClientClient) QueryGrants(oc *OAuthClient) *OAuthGrantQuery {
1811 query := (&OAuthGrantClient{config: c.config}).Query()
1812 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1813 id := oc.ID
1814 step := sqlgraph.NewStep(
1815 sqlgraph.From(oauthclient.Table, oauthclient.FieldID, id),
1816 sqlgraph.To(oauthgrant.Table, oauthgrant.FieldID),
1817 sqlgraph.Edge(sqlgraph.O2M, false, oauthclient.GrantsTable, oauthclient.GrantsColumn),
1818 )
1819 fromV = sqlgraph.Neighbors(oc.driver.Dialect(), step)
1820 return fromV, nil
1821 }
1822 return query
1823}
1824
1825// Hooks returns the client hooks.
1826func (c *OAuthClientClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected