community[minor]: clickhouse -- ability to use secure connection (#22108)

- **Description:** this PR gives clickhouse client the ability to use a
secure connection to the clickhosue server
- **Issue:** fixes #22082
- **Dependencies:** -
- **Twitter handle:** `_codingcoffee_`

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
Co-authored-by: Shresth Rana <shresth@grapevine.in>
This commit is contained in:
Ameya Shenoy 2024-05-24 23:00:22 +05:30 committed by GitHub
parent 9a010fb761
commit 8ba492ed6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,6 +39,7 @@ class ClickhouseSettings(BaseSettings):
port (int) : URL port to connect with HTTP. Defaults to 8443.
username (str) : Username to login. Defaults to None.
password (str) : Password to login. Defaults to None.
secure (bool) : Connect to server over secure connection. Defaults to False.
index_type (str): index type string.
index_param (list): index build parameter.
index_query_params(dict): index query parameters.
@ -72,6 +73,8 @@ class ClickhouseSettings(BaseSettings):
username: Optional[str] = None
password: Optional[str] = None
secure: bool = False
index_type: Optional[str] = "annoy"
# Annoy supports L2Distance and cosineDistance.
index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100]
@ -193,6 +196,7 @@ class Clickhouse(VectorStore):
port=self.config.port,
username=self.config.username,
password=self.config.password,
secure=self.config.secure,
**kwargs,
)
# Enable JSON type