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

Method QueryOwner

pkg/database/ent/client.go:1740–1753  ·  view source on GitHub ↗

QueryOwner queries the owner edge of a Meta.

(_m *Meta)

Source from the content-addressed store, hash-verified

1738
1739// QueryOwner queries the owner edge of a Meta.
1740func (c *MetaClient) QueryOwner(_m *Meta) *AlertQuery {
1741 query := (&AlertClient{config: c.config}).Query()
1742 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1743 id := _m.ID
1744 step := sqlgraph.NewStep(
1745 sqlgraph.From(meta.Table, meta.FieldID, id),
1746 sqlgraph.To(alert.Table, alert.FieldID),
1747 sqlgraph.Edge(sqlgraph.M2O, true, meta.OwnerTable, meta.OwnerColumn),
1748 )
1749 fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step)
1750 return fromV, nil
1751 }
1752 return query
1753}
1754
1755// Hooks returns the client hooks.
1756func (c *MetaClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 2

DialectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected