MCPcopy Create free account
hub / github.com/crowdsecurity/crowdsec / QueryOwner

Method QueryOwner

pkg/database/ent/alert_query.go:72–91  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

70
71// QueryOwner chains the current query on the "owner" edge.
72func (_q *AlertQuery) QueryOwner() *MachineQuery {
73 query := (&MachineClient{config: _q.config}).Query()
74 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
75 if err := _q.prepareQuery(ctx); err != nil {
76 return nil, err
77 }
78 selector := _q.sqlQuery(ctx)
79 if err := selector.Err(); err != nil {
80 return nil, err
81 }
82 step := sqlgraph.NewStep(
83 sqlgraph.From(alert.Table, alert.FieldID, selector),
84 sqlgraph.To(machine.Table, machine.FieldID),
85 sqlgraph.Edge(sqlgraph.M2O, true, alert.OwnerTable, alert.OwnerColumn),
86 )
87 fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step)
88 return fromU, nil
89 }
90 return query
91}
92
93// QueryDecisions chains the current query on the "decisions" edge.
94func (_q *AlertQuery) QueryDecisions() *DecisionQuery {

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