MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / QueryOwner

Method QueryOwner

ent/davaccount_query.go:63–82  ·  view source on GitHub ↗

QueryOwner chains the current query on the "owner" edge.

()

Source from the content-addressed store, hash-verified

61
62// QueryOwner chains the current query on the "owner" edge.
63func (daq *DavAccountQuery) QueryOwner() *UserQuery {
64 query := (&UserClient{config: daq.config}).Query()
65 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
66 if err := daq.prepareQuery(ctx); err != nil {
67 return nil, err
68 }
69 selector := daq.sqlQuery(ctx)
70 if err := selector.Err(); err != nil {
71 return nil, err
72 }
73 step := sqlgraph.NewStep(
74 sqlgraph.From(davaccount.Table, davaccount.FieldID, selector),
75 sqlgraph.To(user.Table, user.FieldID),
76 sqlgraph.Edge(sqlgraph.M2O, true, davaccount.OwnerTable, davaccount.OwnerColumn),
77 )
78 fromU = sqlgraph.SetNeighbors(daq.driver.Dialect(), step)
79 return fromU, nil
80 }
81 return query
82}
83
84// First returns the first DavAccount entity from the query.
85// Returns a *NotFoundError when no DavAccount was found.

Callers

nothing calls this directly

Calls 5

prepareQueryMethod · 0.95
sqlQueryMethod · 0.95
DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected