diff options
-rw-r--r-- | guix-data-service/model/derivation.scm | 10 |
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 " |