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

Method sqlCount

pkg/database/ent/allowlist_query.go:468–475  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

466}
467
468func (_q *AllowListQuery) sqlCount(ctx context.Context) (int, error) {
469 _spec := _q.querySpec()
470 _spec.Node.Columns = _q.ctx.Fields
471 if len(_q.ctx.Fields) > 0 {
472 _spec.Unique = _q.ctx.Unique != nil && *_q.ctx.Unique
473 }
474 return sqlgraph.CountNodes(ctx, _q.driver, _spec)
475}
476
477func (_q *AllowListQuery) querySpec() *sqlgraph.QuerySpec {
478 _spec := sqlgraph.NewQuerySpec(allowlist.Table, allowlist.Columns, sqlgraph.NewFieldSpec(allowlist.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected