/clickhouse_bundle

Clickhouse support for applauncher

Primary LanguagePythonApache License 2.0Apache-2.0

Clickhouse Bundle

Just a clickhouse client provider for applauncher

Installation

pip install clickhouse_bundle  

Then add to your main.py

import clickhouse_bundle

bundle_list = [
    clickhouse_bundle.ClickhouseBundle(),
]

Configuration

Currently just the connection uri, for example

clickhouse:
  connection_uri: 'clickhouse://localhost:9000/default'

Usage

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/