MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / sqlCount

Method sqlCount

ent/entity_query.go:611–618  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

609}
610
611func (eq *EntityQuery) sqlCount(ctx context.Context) (int, error) {
612 _spec := eq.querySpec()
613 _spec.Node.Columns = eq.ctx.Fields
614 if len(eq.ctx.Fields) > 0 {
615 _spec.Unique = eq.ctx.Unique != nil && *eq.ctx.Unique
616 }
617 return sqlgraph.CountNodes(ctx, eq.driver, _spec)
618}
619
620func (eq *EntityQuery) querySpec() *sqlgraph.QuerySpec {
621 _spec := sqlgraph.NewQuerySpec(entity.Table, entity.Columns, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected