Improve the package and package-metadata modules

Add tests around the package module, extract out the use of the
inferior-package record assessors so that they aren't part of the tests, and
switch across the package-metadata module to use
insert-missing-data-and-return-all-ids.
This commit is contained in:
Christopher Baines 2019-09-04 19:28:48 +02:00
parent f29230e034
commit 1a55022524
5 changed files with 108 additions and 50 deletions

View file

@ -454,7 +454,10 @@ WHERE job_id = $1"
(log-time "getting package-ids"
(lambda ()
(inferior-packages->package-ids
conn packages packages-metadata-ids)))))
conn
(zip (map inferior-package-name packages)
(map inferior-package-version packages)
packages-metadata-ids))))))
(define (insert-lint-warnings conn inferior-package-id->package-database-id
lint-checker-ids
@ -883,7 +886,9 @@ RETURNING id;")
(match (exec-query conn
query
(list git-repository-id commit source))
(list (number->string git-repository-id)
commit
source))
((result)
result)
(() #f)))