Just a clickhouse client provider for applauncher
pip install clickhouse_bundle
Then add to your main.py
import clickhouse_bundle
bundle_list = [
clickhouse_bundle.ClickhouseBundle(),
]
Currently just the connection uri, for example
clickhouse:
connection_uri: 'clickhouse://localhost:9000/default'
Just inject and use it as a regular clichouse client
import inject
from clickhouse_driver import Client
client = inject.instance(Client)
query = f"SELECT name FROM fruits limit %(limit)s"
params = {
"limit": 10
}
result = client.execute(query, params)
More information about clickhouse sql syntax here https://clickhouse.tech/docs/es/sql-reference/syntax/