aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/guix-revision-package-derivation.scm
blob: 733dad2197545f997513e1290468d7eebccb851c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(define-module (guix-data-service model guix-revision-package-derivation)
  #:use-module (squee)
  #:export (insert-guix-revision-package-derivations))

(define (insert-guix-revision-package-derivations
         conn guix-revision-id package-derivation-ids)
  (define insert
    (string-append "INSERT INTO guix_revision_package_derivations "
                   "(revision_id, package_derivation_id) "
                   "VALUES "
                   (string-join (map (lambda (package-derivation-id)
                                       (simple-format
                                        #f "(~A, ~A)"
                                        guix-revision-id
                                        package-derivation-id))
                                     package-derivation-ids)
                                ", ")
                   ";"))

  (exec-query conn insert))