From 77397538f703abe6621b89fe8bc0bb023ec01467 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 8 Apr 2019 21:03:29 +0100 Subject: Add a function to get a count of derivations --- guix-data-service/model/derivation.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix-data-service/model/derivation.scm') diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index 84801a9..e5de539 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -9,6 +9,7 @@ #:use-module (guix derivations) #:use-module (guix-data-service model utils) #:export (valid-systems + count-derivations select-derivation-by-file-name select-derivation-outputs-by-derivation-id select-derivation-by-output-filename @@ -27,6 +28,12 @@ conn "SELECT DISTINCT system FROM derivations ORDER BY 1"))) +(define (count-derivations conn) + (first + (exec-query + conn + "SELECT COUNT(*) FROM derivations"))) + (define (select-existing-derivations file-names) (string-append "SELECT id, file_name " "FROM derivations " -- cgit v1.2.3