UserCount returns the total number of registered users.
()
| 571 | |
| 572 | // UserCount returns the total number of registered users. |
| 573 | func (s *Store) UserCount() (int, error) { |
| 574 | var count int |
| 575 | err := s.db.QueryRow(s.q("SELECT COUNT(*) FROM users")).Scan(&count) |
| 576 | if err != nil { |
| 577 | return 0, fmt.Errorf("count users: %w", err) |
| 578 | } |
| 579 | return count, nil |
| 580 | } |
| 581 | |
| 582 | // BillingAggregates is the set of users-table aggregates returned by |
| 583 | // CountBillingAggregates: per-plan customer counts and the number of |