aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-05 13:55:32 +0200
committerChristopher Baines <mail@cbaines.net>2019-09-05 16:07:23 +0200
commit2485da7cfcd8c7aa7c7da188158371ad34119e43 (patch)
tree9e0caea39e9d4beb34562568e87fe8deb2618d9e
parent2cb389037be7afe35a422179f44a8701aae7ea1d (diff)
downloaddata-service-2485da7cfcd8c7aa7c7da188158371ad34119e43.tar
data-service-2485da7cfcd8c7aa7c7da188158371ad34119e43.tar.gz
Use numbers for ids in the derivation model
As this is easier to handle when doing queries with PostgreSQL, as you can use the type information to determine how to handle the values.
-rw-r--r--guix-data-service/model/derivation.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 6b94384..3b121a1 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -419,7 +419,9 @@ ORDER BY derivations.system DESC,
#t "debug: insert-missing-derivations: inserting ~A derivations\n"
(length derivations))
(let ((derivation-ids
- (map car (exec-query conn (insert-into-derivations)))))
+ (map (lambda (result)
+ (string->number (car result)))
+ (exec-query conn (insert-into-derivations)))))
(simple-format
#t "debug: insert-missing-derivations: updating hash table\n")
@@ -580,7 +582,8 @@ WHERE " criteria ";"))
conn
(select-existing-derivations missing-file-names)
second ;; file_name
- first))) ;; id
+ (lambda (result)
+ (string->number (first result)))))) ;; id
(simple-format
#t "debug: derivation-file-names->vhash: adding ~A entries to the cache\n"
(vlist-length result-for-missing-file-names))