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.
Install
Section titled “Install”ClickHouse is an optional plugin, not in the default selection. Add it to an application that already has a plugin selection:
reflow init --upgrade ClickHouse --collection <collection-id>See Install for an application without a selection, and for teammates and CI.
Connect
Section titled “Connect”Declare it in the flow:
providers: ch: ClickHouseSave 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" } }}chmod 600 /absolute/path/to/bindings.jsonreflow target --group database-tests --collection <collection-id> --bindings /absolute/path/to/bindings.jsonch.query sql="SELECT count() AS n FROM events WHERE name = 'tool_call'" expect="{\"json\":[{\"pointer\":\"/0/n\",\"greaterThan\":0}]}" checkpoint="tool-calls"Read next
Section titled “Read next”- ClickHouse connection: every binding
field,
passwordFile, HTTPS and read-only users. - Check rows with expect, waits and branches and ch.value.
- Setup writes with execute.
- How the engines differ: the
readonly=1rule, one statement perexecute, synchronous inserts, error text and value types.