Fix insert-build when derivation_output_details_set_id is NULL
I can't figure out how to insert NULL through a param, so just construct a query to insert the values directly.
This commit is contained in:
parent
54baf32be6
commit
bd52629674
1 changed files with 16 additions and 11 deletions
|
|
@ -382,19 +382,24 @@ UPDATE builds SET derivation_output_details_set_id = (
|
||||||
(define (insert-build conn build-server-id derivation-file-name)
|
(define (insert-build conn build-server-id derivation-file-name)
|
||||||
(match (exec-query
|
(match (exec-query
|
||||||
conn
|
conn
|
||||||
"
|
(string-append
|
||||||
|
"
|
||||||
INSERT INTO builds
|
INSERT INTO builds
|
||||||
(build_server_id, derivation_file_name, derivation_output_details_set_id)
|
(build_server_id, derivation_file_name, derivation_output_details_set_id)
|
||||||
VALUES ($1, $2, $3)
|
VALUES ("
|
||||||
RETURNING (id)"
|
(number->string build-server-id)
|
||||||
(list (number->string build-server-id)
|
", "
|
||||||
derivation-file-name
|
(quote-string derivation-file-name)
|
||||||
(or
|
", "
|
||||||
(and=> (select-derivations-by-output-details-set-id-by-derivation-file-name
|
(or
|
||||||
conn
|
(and=>
|
||||||
derivation-file-name)
|
(select-derivations-by-output-details-set-id-by-derivation-file-name
|
||||||
number->string)
|
conn
|
||||||
"NULL")))
|
derivation-file-name)
|
||||||
|
number->string)
|
||||||
|
"NULL")
|
||||||
|
")
|
||||||
|
RETURNING (id)"))
|
||||||
(((id))
|
(((id))
|
||||||
(string->number id))))
|
(string->number id))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue