Add #:create-if-missing? to ‘git-repository-url->git-repository-id’.
This commit is contained in:
parent
30b2d91bfb
commit
8e7da32f55
1 changed files with 12 additions and 9 deletions
|
|
@ -226,7 +226,9 @@ FROM git_repositories WHERE id = $1"
|
||||||
(string->number id))))
|
(string->number id))))
|
||||||
|
|
||||||
(define* (git-repository-url->git-repository-id conn url
|
(define* (git-repository-url->git-repository-id conn url
|
||||||
#:key (authenticate? #t))
|
#:key
|
||||||
|
(create-if-missing? #t)
|
||||||
|
(authenticate? #t))
|
||||||
(define (->boolean value)
|
(define (->boolean value)
|
||||||
(if value "TRUE" "FALSE"))
|
(if value "TRUE" "FALSE"))
|
||||||
|
|
||||||
|
|
@ -245,14 +247,15 @@ SET fetch_with_authentication = "
|
||||||
" WHERE id = " id ";"))
|
" WHERE id = " id ";"))
|
||||||
id)
|
id)
|
||||||
(()
|
(()
|
||||||
(caar
|
(and create-if-missing?
|
||||||
(exec-query conn
|
(caar
|
||||||
(string-append
|
(exec-query conn
|
||||||
"INSERT INTO git_repositories "
|
(string-append
|
||||||
"(url, fetch_with_authentication) "
|
"INSERT INTO git_repositories "
|
||||||
"VALUES "
|
"(url, fetch_with_authentication) "
|
||||||
"('" url "', " (->boolean authenticate?) ") "
|
"VALUES "
|
||||||
"RETURNING id"))))))))
|
"('" url "', " (->boolean authenticate?) ") "
|
||||||
|
"RETURNING id")))))))))
|
||||||
|
|
||||||
(define (guix-revisions-and-jobs-for-git-repository conn git-repository-id)
|
(define (guix-revisions-and-jobs-for-git-repository conn git-repository-id)
|
||||||
(define query
|
(define query
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue