Add a function to get a count of Guix revisions
This commit is contained in:
parent
77397538f7
commit
0c72ee747c
1 changed files with 9 additions and 1 deletions
|
|
@ -1,11 +1,19 @@
|
||||||
(define-module (guix-data-service model guix-revision)
|
(define-module (guix-data-service model guix-revision)
|
||||||
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:use-module (squee)
|
#:use-module (squee)
|
||||||
#:export (most-recent-n-guix-revisions
|
#:export (count-guix-revisions
|
||||||
|
most-recent-n-guix-revisions
|
||||||
commit->revision-id
|
commit->revision-id
|
||||||
insert-guix-revision
|
insert-guix-revision
|
||||||
guix-revision-exists?))
|
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)
|
(define (most-recent-n-guix-revisions conn n)
|
||||||
(exec-query conn "SELECT * FROM guix_revisions ORDER BY id DESC LIMIT 10"))
|
(exec-query conn "SELECT * FROM guix_revisions ORDER BY id DESC LIMIT 10"))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue