MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / sqlCount

Method sqlCount

ent/node_query.go:436–443  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

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

Callers 1

querierCountFunction · 0.45

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected