Skip to content

Commit 52ced95

Browse files
paddycareyjayvynl
authored andcommitted
fix: pass DSN to clickhouse-client if configured
1 parent 770eea8 commit 52ced95

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

clickhouse_backend/backend/client.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,23 @@ def settings_to_cmd_args_env(cls, settings_dict, parameters):
1717
user = settings_dict.get("USER")
1818
passwd = settings_dict.get("PASSWORD")
1919
secure = options.get("secure")
20+
dsn = options.get("dsn")
2021

21-
if host:
22-
args += ["-h", host]
23-
if port:
24-
args += ["--port", str(port)]
25-
if user:
26-
args += ["-u", user]
27-
if passwd:
28-
args += ["--password", passwd]
29-
if dbname:
30-
args += ["-d", dbname]
31-
if secure:
32-
args += ["--secure"]
22+
if dsn:
23+
args += [dsn]
24+
else:
25+
if host:
26+
args += ["-h", host]
27+
if port:
28+
args += ["--port", str(port)]
29+
if user:
30+
args += ["-u", user]
31+
if passwd:
32+
args += ["--password", passwd]
33+
if dbname:
34+
args += ["-d", dbname]
35+
if secure:
36+
args += ["--secure"]
3337
args.extend(parameters)
3438
return args, None
3539

0 commit comments

Comments
 (0)