Improve select-build-servers to convert strings to appropriate types
This commit is contained in:
parent
53652db9ca
commit
6fad559b32
2 changed files with 16 additions and 6 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
(for-each
|
(for-each
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((id url lookup-all-derivations?)
|
((id url lookup-all-derivations?)
|
||||||
(when (string=? lookup-all-derivations? "t")
|
(when lookup-all-derivations?
|
||||||
(query-build-server conn id url))))
|
(query-build-server conn id url))))
|
||||||
build-servers))))
|
build-servers))))
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
") "
|
") "
|
||||||
"LIMIT 1000"))
|
"LIMIT 1000"))
|
||||||
|
|
||||||
(exec-query conn query (list build-server-id)))
|
(exec-query conn query (list (number->string build-server-id))))
|
||||||
|
|
||||||
(define (select-derivations-with-no-known-build conn)
|
(define (select-derivations-with-no-known-build conn)
|
||||||
(define query
|
(define query
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,19 @@
|
||||||
(define-module (guix-data-service model build-server)
|
(define-module (guix-data-service model build-server)
|
||||||
|
#:use-module (ice-9 match)
|
||||||
#:use-module (squee)
|
#:use-module (squee)
|
||||||
#:export (select-build-servers))
|
#:export (select-build-servers))
|
||||||
|
|
||||||
(define (select-build-servers conn)
|
(define (select-build-servers conn)
|
||||||
(exec-query conn
|
(define query
|
||||||
(string-append
|
"
|
||||||
"SELECT id, url, lookup_all_derivations "
|
SELECT id, url, lookup_all_derivations
|
||||||
"FROM build_servers")))
|
FROM build_servers
|
||||||
|
ORDER BY id")
|
||||||
|
|
||||||
|
(map
|
||||||
|
(match-lambda
|
||||||
|
((id url lookup-all-derivations)
|
||||||
|
(list (string->number id)
|
||||||
|
url
|
||||||
|
(string=? lookup-all-derivations "t"))))
|
||||||
|
(exec-query conn query)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue