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

Method sqlCount

ent/file_query.go:978–985  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

976}
977
978func (fq *FileQuery) sqlCount(ctx context.Context) (int, error) {
979 _spec := fq.querySpec()
980 _spec.Node.Columns = fq.ctx.Fields
981 if len(fq.ctx.Fields) > 0 {
982 _spec.Unique = fq.ctx.Unique != nil && *fq.ctx.Unique
983 }
984 return sqlgraph.CountNodes(ctx, fq.driver, _spec)
985}
986
987func (fq *FileQuery) querySpec() *sqlgraph.QuerySpec {
988 _spec := sqlgraph.NewQuerySpec(file.Table, file.Columns, sqlgraph.NewFieldSpec(file.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected