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

Method sqlCount

ent/storagepolicy_query.go:656–663  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

654}
655
656func (spq *StoragePolicyQuery) sqlCount(ctx context.Context) (int, error) {
657 _spec := spq.querySpec()
658 _spec.Node.Columns = spq.ctx.Fields
659 if len(spq.ctx.Fields) > 0 {
660 _spec.Unique = spq.ctx.Unique != nil && *spq.ctx.Unique
661 }
662 return sqlgraph.CountNodes(ctx, spq.driver, _spec)
663}
664
665func (spq *StoragePolicyQuery) querySpec() *sqlgraph.QuerySpec {
666 _spec := sqlgraph.NewQuerySpec(storagepolicy.Table, storagepolicy.Columns, sqlgraph.NewFieldSpec(storagepolicy.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected