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

Method QueryUser

ent/client.go:2780–2793  ·  view source on GitHub ↗

QueryUser queries the user edge of a Task.

(t *Task)

Source from the content-addressed store, hash-verified

2778
2779// QueryUser queries the user edge of a Task.
2780func (c *TaskClient) QueryUser(t *Task) *UserQuery {
2781 query := (&UserClient{config: c.config}).Query()
2782 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
2783 id := t.ID
2784 step := sqlgraph.NewStep(
2785 sqlgraph.From(task.Table, task.FieldID, id),
2786 sqlgraph.To(user.Table, user.FieldID),
2787 sqlgraph.Edge(sqlgraph.M2O, true, task.UserTable, task.UserColumn),
2788 )
2789 fromV = sqlgraph.Neighbors(t.driver.Dialect(), step)
2790 return fromV, nil
2791 }
2792 return query
2793}
2794
2795// Hooks returns the client hooks.
2796func (c *TaskClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected