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

Method QueryMetas

pkg/database/ent/client.go:447–460  ·  view source on GitHub ↗

QueryMetas queries the metas edge of a Alert.

(_m *Alert)

Source from the content-addressed store, hash-verified

445
446// QueryMetas queries the metas edge of a Alert.
447func (c *AlertClient) QueryMetas(_m *Alert) *MetaQuery {
448 query := (&MetaClient{config: c.config}).Query()
449 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
450 id := _m.ID
451 step := sqlgraph.NewStep(
452 sqlgraph.From(alert.Table, alert.FieldID, id),
453 sqlgraph.To(meta.Table, meta.FieldID),
454 sqlgraph.Edge(sqlgraph.O2M, false, alert.MetasTable, alert.MetasColumn),
455 )
456 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
457 return fromV, nil
458 }
459 return query
460}
461
462// Hooks returns the client hooks.
463func (c *AlertClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected