aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-14 21:32:34 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-14 21:32:34 +0000
commita2bbc0ee0d0c388e95d971d47e4cbf6b42e7dbfc (patch)
treef572e75f7b8ea84df68e1146eda177a1d2b98314
parent5fbfc648fdf22bdfaa701c9c8ff6bd7a713a2d40 (diff)
downloaddata-service-a2bbc0ee0d0c388e95d971d47e4cbf6b42e7dbfc.tar
data-service-a2bbc0ee0d0c388e95d971d47e4cbf6b42e7dbfc.tar.gz
Add a function for selecting derivation source files
-rw-r--r--guix-data-service/model/derivation.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 98b89b8..2e2cdd8 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -14,6 +14,7 @@
select-derivation-by-file-name
select-derivation-outputs-by-derivation-id
select-derivation-sources-by-derivation-id
+ select-derivation-source-file-by-store-path
select-derivation-by-output-filename
select-derivations-using-output
select-derivations-by-revision-name-and-version
@@ -293,6 +294,15 @@ ORDER BY 1"))
(map first
(exec-query conn query (list (number->string id)))))
+(define (select-derivation-source-file-by-store-path conn store-path)
+ (define query
+ "
+SELECT id
+FROM derivation_source_files
+WHERE store_path = $1")
+
+ (map car (exec-query conn query (list store-path))))
+
(define (insert-derivation-inputs conn derivation-id derivation-inputs)
(define (insert-into-derivation-inputs output-ids)
(string-append "INSERT INTO derivation_inputs "