From 447d9f7ba81e90b2a8a799c11eea59d47060da2c Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Fri, 22 Jul 2016 12:47:47 +0200 Subject: database: Add 'assq-refs' procedure. --- src/cuirass/database.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm index 8ce4153..d8d1ed2 100644 --- a/src/cuirass/database.scm +++ b/src/cuirass/database.scm @@ -21,6 +21,7 @@ #:use-module (ice-9 rdelim) #:use-module (sqlite3) #:export (;; Procedures. + assq-refs db-init db-open db-close @@ -93,6 +94,10 @@ database object." "Close database object DB." (sqlite-close db)) +(define* (assq-refs alst keys #:optional default-value) + (map (λ (key) (or (assq-ref alst key) default-value)) + keys)) + (define (db-add-evaluation db job) "Store a derivation result in database DB and return its ID." (sqlite-exec db "insert into build (job_spec, drv) values ('~A', '~A');" -- cgit v1.2.3