aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-02-01 13:59:41 +0100
committerChristopher Baines <mail@cbaines.net>2020-02-01 13:59:41 +0100
commit671a85f798ace3b606bd0f83f90774c01e3f97de (patch)
tree8057ed8a16e3ae4e3a99a3440e1836ca06217200 /guix-data-service
parent744ab9366b6d64065137868c89fda24882250edd (diff)
downloaddata-service-671a85f798ace3b606bd0f83f90774c01e3f97de.tar
data-service-671a85f798ace3b606bd0f83f90774c01e3f97de.tar.gz
Add a function to check how many repositories have x_git_repo_header
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/git-repository.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix-data-service/model/git-repository.scm b/guix-data-service/model/git-repository.scm
index 5b6997c..6873ab6 100644
--- a/guix-data-service/model/git-repository.scm
+++ b/guix-data-service/model/git-repository.scm
@@ -22,6 +22,7 @@
#:export (all-git-repositories
select-git-repository
git-repository-id->url
+ count-git-repositories-with-x-git-repo-header-values
git-repository-x-git-repo-header->git-repository-id
git-repository-url->git-repository-id
git-repositories-containing-commit
@@ -60,6 +61,13 @@
(list id))
(((url)) url)))
+(define (count-git-repositories-with-x-git-repo-header-values conn)
+ (match (exec-query
+ conn
+ "SELECT COUNT(*) FROM git_repositories WHERE x_git_repo_header IS NOT NULL")
+ (((count))
+ (string->number count))))
+
(define (git-repository-x-git-repo-header->git-repository-id conn header)
(match
(exec-query