aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-10-08 19:45:41 +0100
committerChristopher Baines <mail@cbaines.net>2019-10-08 19:45:41 +0100
commit356a5954b20700f817e9a98aa4a76a3d091bdfba (patch)
tree25db85a5681e9facf279faae1b3545749afa5fff
parentab8a02cf13e1c59867993c65a0504230e6950b8a (diff)
downloaddata-service-356a5954b20700f817e9a98aa4a76a3d091bdfba.tar
data-service-356a5954b20700f817e9a98aa4a76a3d091bdfba.tar.gz
Add support for using a database URI
As this is useful when working with pg_tmp.
-rw-r--r--guix-data-service/database.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm
index 0d6d61b..257d48b 100644
--- a/guix-data-service/database.scm
+++ b/guix-data-service/database.scm
@@ -37,7 +37,9 @@
"dbname=guix_data_service user=guix_data_service")
" application_name='guix-data-service " name "'"))
- (let* ((conn (connect-to-postgres-paramstring paramstring)))
+ (let* ((conn (connect-to-postgres-paramstring
+ (or (getenv "GUIX_DATA_SERVICE_DATABASE_URI")
+ paramstring))))
(with-throw-handler
#t
(lambda ()