Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

drover-ch-optimiser

Status: active

Status, checked 18 Nov 2026: ACTIVE. ClickHouse schema and query auditor with an MCP server (cmd/drover-ch-mcp). Tagged v0.1.0. Last change 10 Nov 2026 (CI repair). Outside the gap program.

Clean-clone check: go build ./... and go test -short ./... pass.

Roadmap: ROADMAP.md. Program tracking: Drover gap program (M0 to M4).

ClickHouse warehouse auditor and dependency-graph visualizer — part of the Drover family.

Runs the official ClickHouse best-practices rules against your schemas and query history, then produces Markdown, HTML, or JSON reports with an interactive Mermaid graph.

Install

Method Command
Go go install github.com/cloud-shuttle/drover-ch-optimiser/cmd/drover-ch@latest
Release GitHub Releases — drover-ch binaries for linux/darwin/windows
Homebrew brew install ./packaging/homebrew/drover-ch.rb (update sha after first tag)
MCP drover-ch-mcp — stdio server with clickhouse_audit tool (see v1.1 roadmap)

Docs: cloud-shuttle.github.io/drover-ch-optimiser (GitHub Pages from main).

Testing

# Unit tests (no Docker) — includes golden HTML report diff
make test
make test-cover

# Regenerate golden report after template changes
go test ./internal/report -update

# Integration + e2e (requires Docker)
make ch-up
make test-integration
make test-e2e
make test-all
make ch-down

CI runs unit, integration, and e2e jobs on every push (.github/workflows/test.yml).
Integration tests use ClickHouse on port 19000 (docker-compose.test.yml) and fixtures in testdata/clickhouse/init.sql.

Documentation

Full Diátaxis-structured docs in docs/.

make docs-serve    # mkdocs serve
make docs-build    # site/ output
make docs-deploy   # mkdocs gh-deploy (maintainers)

Quick start

go build -o drover-ch ./cmd/drover-ch

# Configure (~/.drover/ch-optimiser.yaml or env vars)
export CLICKHOUSE_HOST=localhost
export CLICKHOUSE_PORT=9000

./drover-ch audit --format html -o audit.html
./drover-ch graph --focus default.events
./drover-ch rules

Sample config

# ~/.drover/ch-optimiser.yaml
clickhouse:
  host: localhost
  port: 9000
  database: default
  username: default
  password: ""
  secure: false

Commands

Command Description
audit Full scan + rules + report
graph Dependency / query graph only
rules List embedded rule IDs
suggest [db.table] Focused audit on one table

Flags

  • --format / -f: markdown (default), html, json
  • --output / -o: output file path
  • --focus: limit graph to a table and its edges
  • --days: query_log lookback (default 30)
  • --database: scan a single database
  • --exclude: skip databases/tables (repeatable; e.g. otel, default.temp_*, peerdb*)

Project tracking

Backlog lives in .beads/issues.jsonl (Beads / bd).

bd ready --json
bd start drover-ch-005

See .beads/README.md for current status.

Architecture

See DESIGN.md for the full design document.

cmd/drover-ch          CLI
internal/chclient      ClickHouse connection
internal/graph         Discovery, edges, Mermaid
internal/analyzer      YAML rules + evaluators
internal/report        Markdown / HTML / JSON

Requirements

  • Go 1.26 (see go.mod)
  • ClickHouse with read access to system.* and target databases
  • system.query_log optional (enables query-weighted edges)

License

Intended: Apache-2.0. No LICENSE file is committed yet, so this public repo is not yet under an open source licence. Committing one is tracked in an M0 issue.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages