()
| 181 | } |
| 182 | |
| 183 | func (s *AccessLogStore) Count() (int64, error) { |
| 184 | ctx := context.Background() |
| 185 | var n int64 |
| 186 | err := s.db.QueryRow(ctx, `SELECT COUNT(*) FROM access_logs`).Scan(&n) |
| 187 | if err != nil { |
| 188 | return 0, fmt.Errorf("count access logs: %w", err) |
| 189 | } |
| 190 | return n, nil |
| 191 | } |
| 192 | |
| 193 | func (s *AccessLogStore) DeleteOlderThan(t time.Time) (int64, error) { |
| 194 | ctx := context.Background() |