aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-09-14 15:42:16 +0100
committerChristopher Baines <mail@cbaines.net>2022-09-14 15:42:16 +0100
commitd791c2bd8a53607b4b0e8db33edc3f21fdcf97a3 (patch)
tree469d1b069ca7cb08feed084ce1d803cac21ac4ad /guix-data-service
parentf41bfcf8b6895ea2847b4c2873766b7cd09a56de (diff)
downloaddata-service-d791c2bd8a53607b4b0e8db33edc3f21fdcf97a3.tar
data-service-d791c2bd8a53607b4b0e8db33edc3f21fdcf97a3.tar.gz
Format some queries generated in insert-missing-data-and-return-all-ids
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/utils.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/guix-data-service/model/utils.scm b/guix-data-service/model/utils.scm
index b11cee5..4a0e5d8 100644
--- a/guix-data-service/model/utils.scm
+++ b/guix-data-service/model/utils.scm
@@ -196,11 +196,11 @@ WHERE table_name = $1"
(define select-query
(string-append
- "SELECT id, "
+ "SELECT id,\n"
(string-join (map (lambda (field)
(string-append table-name "." field))
field-strings)
- ", ")
+ ",\n")
" FROM " table-name
" JOIN (VALUES "
(string-join
@@ -215,7 +215,7 @@ WHERE table_name = $1"
(concatenate data))
data))
", ")
- ") AS vals (" (string-join field-strings ", ") ") "
+ ")\n AS vals (" (string-join field-strings ", ") ") "
"ON "
(string-join
(map (lambda (field)
@@ -229,7 +229,7 @@ WHERE table_name = $1"
'())
")")))
field-strings)
- " AND ")))
+ " AND\n ")))
(define (temp-table-select-query temp-table-name)
(string-append
@@ -261,8 +261,8 @@ WHERE table_name = $1"
#:key
(table-name table-name))
(string-append
- "INSERT INTO " table-name " ("
- (string-join field-strings ", ")
+ "INSERT INTO " table-name " (\n"
+ (string-join field-strings ",\n")
") VALUES "
(string-join
(map (lambda (field-values)