blob: 26efde1adea5d94002830440c5d1a242ee05e9b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
(define-module (guix-data-service model build-status)
#:use-module (squee)
#:export (build-statuses
build-status-strings
insert-build-status))
(define build-statuses
'((-2 . "scheduled")
(-1 . "started")
(0 . "succeeded")
(1 . "failed")
(2 . "failed-dependency")
(3 . "failed-other")
(4 . "canceled")))
(define build-status-strings
(map cdr build-statuses))
(define (insert-build-status conn internal-build-id
starttime stoptime status)
(exec-query conn
(string-append
"INSERT INTO build_status "
"(internal_build_id, starttime, stoptime, status) "
"VALUES "
"(" internal-build-id ", "
(if (eq? starttime 0)
"NULL"
(string-append "to_timestamp("
(number->string starttime)
")"))
", "
(if (eq? stoptime 0)
"NULL"
(string-append "to_timestamp("
(number->string stoptime)
")"))
", "
"'" status "'"
")")))
|