guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: Use the config options when creating the default paramstring


From: Christopher Baines
Subject: 01/04: Use the config options when creating the default paramstring
Date: Tue, 7 Apr 2020 16:21:29 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 8e9f1af89b42fa073e84ef972ede9bfdd86e3caf
Author: Christopher Baines <address@hidden>
AuthorDate: Tue Apr 7 17:37:03 2020 +0100

    Use the config options when creating the default paramstring
---
 guix-data-service/database.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm
index 448f16f..455ce82 100644
--- a/guix-data-service/database.scm
+++ b/guix-data-service/database.scm
@@ -19,6 +19,7 @@
   #:use-module (system foreign)
   #:use-module (ice-9 match)
   #:use-module (squee)
+  #:use-module (guix-data-service config)
   #:export (with-postgresql-connection
             with-postgresql-transaction
 
@@ -37,7 +38,10 @@
   (define paramstring
     (string-append
      (or (getenv "GUIX_DATA_SERVICE_DATABASE_PARAMSTRING")
-         "dbname=guix_data_service user=guix_data_service")
+         (simple-format
+          #f "dbname=~A user=~A"
+          (%config 'database-name)
+          (%config 'database-user)))
      " application_name='guix-data-service " name "'"))
 
   (let* ((conn (connect-to-postgres-paramstring



reply via email to

[Prev in Thread] Current Thread [Next in Thread]