MCPcopy
hub / github.com/crowdsecurity/crowdsec / QueryOwner

Method QueryOwner

pkg/database/ent/meta_query.go:64–83  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

prepareQueryMethod · 0.95
sqlQueryMethod · 0.95
ErrMethod · 0.80
DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected