MCPcopy Create free account
hub / github.com/efectn/go-orm-benchmarks / Count

Method Count

bench/ent/model_query.go:201–207  ·  view source on GitHub ↗

Count returns the count of the given query.

(ctx context.Context)

Source from the content-addressed store, hash-verified

199
200// Count returns the count of the given query.
201func (mq *ModelQuery) Count(ctx context.Context) (int, error) {
202 ctx = setContextOp(ctx, mq.ctx, "Count")
203 if err := mq.prepareQuery(ctx); err != nil {
204 return 0, err
205 }
206 return withInterceptors[int](ctx, mq, querierCount[*ModelQuery](), mq.inters)
207}
208
209// CountX is like Count, but panics if an error occurs.
210func (mq *ModelQuery) CountX(ctx context.Context) int {

Callers 2

CountXMethod · 0.95
CountFunction · 0.45

Calls 2

prepareQueryMethod · 0.95
setContextOpFunction · 0.85

Tested by

no test coverage detected