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

Method QueryOwner

pkg/database/ent/client.go:1160–1173  ·  view source on GitHub ↗

QueryOwner queries the owner edge of a Decision.

(_m *Decision)

Source from the content-addressed store, hash-verified

1158
1159// QueryOwner queries the owner edge of a Decision.
1160func (c *DecisionClient) QueryOwner(_m *Decision) *AlertQuery {
1161 query := (&AlertClient{config: c.config}).Query()
1162 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1163 id := _m.ID
1164 step := sqlgraph.NewStep(
1165 sqlgraph.From(decision.Table, decision.FieldID, id),
1166 sqlgraph.To(alert.Table, alert.FieldID),
1167 sqlgraph.Edge(sqlgraph.M2O, true, decision.OwnerTable, decision.OwnerColumn),
1168 )
1169 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
1170 return fromV, nil
1171 }
1172 return query
1173}
1174
1175// Hooks returns the client hooks.
1176func (c *DecisionClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected