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

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

  (exec-query conn insert))