fix: use clickhouse-connect HTTP host/port instead of a native-protocol DSN string
This commit is contained in:
parent
0b8a10481b
commit
244c2ef14a
3 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
CLICKHOUSE_URL=
|
||||
CLICKHOUSE_HOST=
|
||||
CLICKHOUSE_PORT=8123
|
||||
CLICKHOUSE_USER=default
|
||||
CLICKHOUSE_PASSWORD=
|
||||
CLICKHOUSE_DATABASE=intelligence
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ from app.config import settings
|
|||
|
||||
def get_client():
|
||||
return clickhouse_connect.get_client(
|
||||
dsn=settings.clickhouse_url,
|
||||
host=settings.clickhouse_host,
|
||||
port=settings.clickhouse_port,
|
||||
username=settings.clickhouse_user,
|
||||
password=settings.clickhouse_password,
|
||||
database=settings.clickhouse_database,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ from pydantic_settings import BaseSettings
|
|||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
clickhouse_url: str = ""
|
||||
clickhouse_host: str = "localhost"
|
||||
clickhouse_port: int = 8123
|
||||
clickhouse_user: str = "default"
|
||||
clickhouse_password: str = ""
|
||||
clickhouse_database: str = "intelligence"
|
||||
|
|
|
|||
Loading…
Reference in a new issue