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

Method sqlCount

ent/user_query.go:1027–1034  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1025}
1026
1027func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) {
1028 _spec := uq.querySpec()
1029 _spec.Node.Columns = uq.ctx.Fields
1030 if len(uq.ctx.Fields) > 0 {
1031 _spec.Unique = uq.ctx.Unique != nil && *uq.ctx.Unique
1032 }
1033 return sqlgraph.CountNodes(ctx, uq.driver, _spec)
1034}
1035
1036func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec {
1037 _spec := sqlgraph.NewQuerySpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected