fix: use clickhouse-connect HTTP host/port instead of a native-protocol DSN string

This commit is contained in:
Claude 2026-07-21 01:05:43 +02:00
parent 0b8a10481b
commit 244c2ef14a
3 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,5 @@
CLICKHOUSE_URL= CLICKHOUSE_HOST=
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD= CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=intelligence CLICKHOUSE_DATABASE=intelligence

View file

@ -5,7 +5,8 @@ from app.config import settings
def get_client(): def get_client():
return clickhouse_connect.get_client( return clickhouse_connect.get_client(
dsn=settings.clickhouse_url, host=settings.clickhouse_host,
port=settings.clickhouse_port,
username=settings.clickhouse_user, username=settings.clickhouse_user,
password=settings.clickhouse_password, password=settings.clickhouse_password,
database=settings.clickhouse_database, database=settings.clickhouse_database,

View file

@ -2,7 +2,8 @@ from pydantic_settings import BaseSettings
class Settings(BaseSettings): class Settings(BaseSettings):
clickhouse_url: str = "" clickhouse_host: str = "localhost"
clickhouse_port: int = 8123
clickhouse_user: str = "default" clickhouse_user: str = "default"
clickhouse_password: str = "" clickhouse_password: str = ""
clickhouse_database: str = "intelligence" clickhouse_database: str = "intelligence"