mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
fix: clickhouse-connect engine SSH parameter (#32348)
This commit is contained in:
@@ -219,6 +219,10 @@ class ClickHouseParametersSchema(Schema):
|
||||
values=fields.Raw(),
|
||||
metadata={"description": __("Additional parameters")},
|
||||
)
|
||||
ssh = fields.Boolean(
|
||||
required=False,
|
||||
metadata={"description": __("Use an ssh tunnel connection to the database")},
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
@@ -312,8 +316,18 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
|
||||
url_params["query"] = query
|
||||
if not url_params.get("database"):
|
||||
url_params["database"] = "__default__"
|
||||
url_params.pop("encryption", None)
|
||||
return str(URL.create(f"{cls.engine}+{cls.default_driver}", **url_params))
|
||||
|
||||
return str(
|
||||
URL.create(
|
||||
f"{cls.engine}+{cls.default_driver}",
|
||||
username=url_params.get("username"),
|
||||
password=url_params.get("password"),
|
||||
host=url_params.get("host"),
|
||||
port=url_params.get("port"),
|
||||
database=url_params.get("database"),
|
||||
query=url_params.get("query"),
|
||||
)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_parameters_from_uri(
|
||||
|
||||
Reference in New Issue
Block a user