aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-data-service/model/guix-revision.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix-data-service/model/guix-revision.scm b/guix-data-service/model/guix-revision.scm
index 34df5e6..f03aa6d 100644
--- a/guix-data-service/model/guix-revision.scm
+++ b/guix-data-service/model/guix-revision.scm
@@ -1,11 +1,19 @@
(define-module (guix-data-service model guix-revision)
+ #:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (squee)
- #:export (most-recent-n-guix-revisions
+ #:export (count-guix-revisions
+ most-recent-n-guix-revisions
commit->revision-id
insert-guix-revision
guix-revision-exists?))
+(define (count-guix-revisions conn)
+ (first
+ (exec-query
+ conn
+ "SELECT COUNT(*) FROM guix_revisions")))
+
(define (most-recent-n-guix-revisions conn n)
(exec-query conn "SELECT * FROM guix_revisions ORDER BY id DESC LIMIT 10"))