diff --git a/DB.go b/DB.go index 85cbf9e..61a219c 100644 --- a/DB.go +++ b/DB.go @@ -104,6 +104,17 @@ func (this *WikiDB) GetLatestVersion(title string) (*Article, error) { return this.parseArticle(row) } +func (this *WikiDB) TotalRevisions() (int64, error) { + row := this.db.QueryRow(`SELECT COUNT(*) c FROM articles`) + var ret int64 + err := row.Scan(&ret) + if err != nil { + return 0, err + } + + return ret, nil +} + func (this *WikiDB) ListTitles() ([]string, error) { rows, err := this.db.Query(`SELECT title FROM titles ORDER BY title ASC`) if err != nil {