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

Method QueryOwner

pkg/database/ent/client.go:1309–1322  ·  view source on GitHub ↗

QueryOwner queries the owner edge of a Event.

(_m *Event)

Source from the content-addressed store, hash-verified

1307
1308// QueryOwner queries the owner edge of a Event.
1309func (c *EventClient) QueryOwner(_m *Event) *AlertQuery {
1310 query := (&AlertClient{config: c.config}).Query()
1311 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1312 id := _m.ID
1313 step := sqlgraph.NewStep(
1314 sqlgraph.From(event.Table, event.FieldID, id),
1315 sqlgraph.To(alert.Table, alert.FieldID),
1316 sqlgraph.Edge(sqlgraph.M2O, true, event.OwnerTable, event.OwnerColumn),
1317 )
1318 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
1319 return fromV, nil
1320 }
1321 return query
1322}
1323
1324// Hooks returns the client hooks.
1325func (c *EventClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected