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

Method sqlCount

pkg/database/ent/alert_query.go:668–675  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

666}
667
668func (_q *AlertQuery) sqlCount(ctx context.Context) (int, error) {
669 _spec := _q.querySpec()
670 _spec.Node.Columns = _q.ctx.Fields
671 if len(_q.ctx.Fields) > 0 {
672 _spec.Unique = _q.ctx.Unique != nil && *_q.ctx.Unique
673 }
674 return sqlgraph.CountNodes(ctx, _q.driver, _spec)
675}
676
677func (_q *AlertQuery) querySpec() *sqlgraph.QuerySpec {
678 _spec := sqlgraph.NewQuerySpec(alert.Table, alert.Columns, sqlgraph.NewFieldSpec(alert.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected