mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
feat: show size of DB on the about page
This commit is contained in:
parent
ad02f21d04
commit
173ec497a2
22 changed files with 175 additions and 135 deletions
|
@ -42,3 +42,15 @@ func (s *Storage) Ping() error {
|
|||
func (s *Storage) DBStats() sql.DBStats {
|
||||
return s.db.Stats()
|
||||
}
|
||||
|
||||
// DBSize returns how much size the database is using in a pretty way.
|
||||
func (s *Storage) DBSize() (string, error) {
|
||||
var size string
|
||||
|
||||
err := s.db.QueryRow("SELECT pg_size_pretty(pg_database_size(current_database()))").Scan(&size)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return size, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue