Skip to content

ClickHouse plugin

ClickHouse is the plugin for checking a ClickHouse server: telemetry, events, logs or usage records your application writes there. It has the same commands as the PostgreSQL plugin (query, value, execute), with the same expect, waits and setup writes, all described once on SQL: PostgreSQL and ClickHouse. No clickhouse-client and no docker exec is needed: the plugin speaks the server’s HTTP interface.

ClickHouse is an optional plugin, not in the default selection. Add it to an application that already has a plugin selection:

Terminal window
reflow init --upgrade ClickHouse --collection <collection-id>

See Install for an application without a selection, and for teammates and CI.

Declare it in the flow:

providers:
ch: ClickHouse

Save a private bindings.json, keyed by the alias, and keep it out of Git:

{
"ch": {
"provider": "ClickHouse",
"configuration": {
"host": "127.0.0.1",
"port": 8123,
"database": "default",
"user": "test_user",
"password": "replace-me"
}
}
}
Terminal window
chmod 600 /absolute/path/to/bindings.json
reflow target --group database-tests --collection <collection-id> --bindings /absolute/path/to/bindings.json
ch.query sql="SELECT count() AS n FROM events WHERE name = 'tool_call'" expect="{\"json\":[{\"pointer\":\"/0/n\",\"greaterThan\":0}]}" checkpoint="tool-calls"