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

Method sqlCount

ent/share_query.go:519–526  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

517}
518
519func (sq *ShareQuery) sqlCount(ctx context.Context) (int, error) {
520 _spec := sq.querySpec()
521 _spec.Node.Columns = sq.ctx.Fields
522 if len(sq.ctx.Fields) > 0 {
523 _spec.Unique = sq.ctx.Unique != nil && *sq.ctx.Unique
524 }
525 return sqlgraph.CountNodes(ctx, sq.driver, _spec)
526}
527
528func (sq *ShareQuery) querySpec() *sqlgraph.QuerySpec {
529 _spec := sqlgraph.NewQuerySpec(share.Table, share.Columns, sqlgraph.NewFieldSpec(share.FieldID, field.TypeInt))

Callers

nothing calls this directly

Calls 1

querySpecMethod · 0.95

Tested by

no test coverage detected