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

Method sqlCount

pkg/database/ent/meta_query.go:434–441  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

432}
433
434func (_q *MetaQuery) sqlCount(ctx context.Context) (int, error) {
435 _spec := _q.querySpec()
436 _spec.Node.Columns = _q.ctx.Fields
437 if len(_q.ctx.Fields) > 0 {
438 _spec.Unique = _q.ctx.Unique != nil && *_q.ctx.Unique
439 }
440 return sqlgraph.CountNodes(ctx, _q.driver, _spec)
441}
442
443func (_q *MetaQuery) querySpec() *sqlgraph.QuerySpec {
444 _spec := sqlgraph.NewQuerySpec(meta.Table, meta.Columns, sqlgraph.NewFieldSpec(meta.FieldID, field.TypeInt))

Callers 1

querierCountFunction · 0.45

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected