From 9b0dca6f5a6fec264b8277793288810947e9db30 Mon Sep 17 00:00:00 2001
From: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date: Tue, 29 Nov 2022 10:59:02 +0100
Subject: [PATCH] Make direct archive DSN a string instead of a dict

For consistency with other modules
---
 swh/provenance/archive/__init__.py |  2 +-
 swh/provenance/cli.py              | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/swh/provenance/archive/__init__.py b/swh/provenance/archive/__init__.py
index 6e0d2e7..4c5f1c3 100644
--- a/swh/provenance/archive/__init__.py
+++ b/swh/provenance/archive/__init__.py
@@ -34,7 +34,7 @@ def get_archive(cls: str, **kwargs) -> ArchiveInterface:
 
         from .postgresql import ArchivePostgreSQL
 
-        return ArchivePostgreSQL(BaseDb.connect(**kwargs["db"]).conn)
+        return ArchivePostgreSQL(BaseDb.connect(kwargs["db"]).conn)
 
     elif cls == "graph":
         try:
diff --git a/swh/provenance/cli.py b/swh/provenance/cli.py
index 40e8a6e..f73e2b9 100644
--- a/swh/provenance/cli.py
+++ b/swh/provenance/cli.py
@@ -41,12 +41,10 @@ DEFAULT_CONFIG: Dict[str, Any] = {
             # }
             # Direct access Archive object
             "cls": "direct",
-            "db": {
-                "host": "belvedere.internal.softwareheritage.org",
-                "port": 5432,
-                "dbname": "softwareheritage",
-                "user": "guest",
-            },
+            "db": (
+                "host=belvedere.internal.softwareheritage.org port=5432 "
+                "dbname=softwareheritage user=guest"
+            ),
         },
         "storage": {
             # Local PostgreSQL Storage
-- 
GitLab