Thank you for your interest in contributing to ClickGraph! This document explains how to get started.
Open an issue when you encounter one of the following siturations.
- A real bug that you confirmed and could not fix.
- A feature request/proposal with a design - better with rationale and use cases.
- Security vulnerabilities must follow SECURITY.md - not GitHub issues.
- Rust 1.85+ (stable)
- Docker (for ClickHouse test instance)
- ClickHouse 24.8+ (via Docker or native install)
# Clone the repository
git clone https://github.com/genezhang/clickgraph.git
cd clickgraph
# Start ClickHouse for testing
docker-compose up -d clickhouse-service
# Build
cargo build
# Run tests (all 1,600+ must pass)
cargo test
# Format and lint (required before submitting)
cargo fmt --all
cargo clippy --all-targetsexport CLICKHOUSE_URL="http://localhost:8123"
export CLICKHOUSE_USER="test_user"
export CLICKHOUSE_PASSWORD="test_pass"
export GRAPH_CONFIG_PATH="./benchmarks/social_network/schemas/social_benchmark.yaml"
cargo run --bin clickgraphUse these prefixes:
| Prefix | Purpose |
|---|---|
fix/ |
Bug fixes |
feature/ |
New features |
refactor/ |
Code restructuring |
test/ |
Test additions or changes |
docs/ |
Documentation only |
perf/ |
Performance improvements |
- Create a branch from
mainwith the appropriate prefix - Make your changes — keep PRs focused on a single concern
- Run the full check suite before pushing:
cargo fmt --all && cargo clippy --all-targets && cargo test
- Push and create a PR against
main - All CI checks must pass — formatting, clippy, tests, security audit
- PRs require review before merging — direct pushes to
mainare blocked
Use conventional commit style:
fix: description of the bug fix
feature: description of the new feature
refactor: description of the restructuring
test: description of test changes
docs: description of documentation changes
perf: description of performance improvement
Keep the first line under 72 characters. Add a body for context when the change is non-trivial.
Cypher Query -> Parse -> Plan -> Optimize -> Render -> Generate SQL -> Execute
| Stage | Module | Purpose |
|---|---|---|
| Parse | src/open_cypher_parser/ |
Cypher to AST (nom combinators) |
| Plan | src/query_planner/ |
AST to LogicalPlan |
| Optimize | src/query_planner/optimizer/ |
Projection/filter push-down |
| Render | src/render_plan/ |
LogicalPlan to RenderPlan (CTEs, JOINs) |
| Generate | src/clickhouse_query_generator/ |
RenderPlan to ClickHouse SQL |
| Execute | src/server/ |
HTTP + Bolt servers |
| Crate | Purpose |
|---|---|
clickgraph |
Core engine (parser, planner, SQL generator, server) |
clickgraph-embedded |
Embedded mode via chdb |
clickgraph-ffi |
UniFFI FFI layer for Go/Python bindings |
clickgraph-client |
CLI client |
clickgraph-go |
Go bindings |
clickgraph-py |
Python bindings |
- Never change query semantics — honestly return what is asked, no more, no less
- No shortcuts — fully understand the processing flow before making changes
- Quality over speed — this is a late-stage project; reuse existing code before writing new
- Add regression tests for every bug fix
- Run the full test suite after every change to
render_plan/plan_builder_utils.rs— most regressions originate there
Look for issues labeled good first issue on GitHub.
- Issue fix verification - verify issues are addressed properly
- Test coverage — especially integration tests for edge cases
- Documentation — schema examples, wiki pages, inline doc comments
- Performance — query optimization, caching improvements
- Cypher coverage — new Cypher features or syntax support
- Language bindings — improvements to Go and Python wrappers
# All Rust tests (~1,600)
cargo test
# Single test
cargo test test_name
# With output
cargo test -- --nocapture
# Integration tests (requires running ClickHouse + ClickGraph server)
pytest tests/integration/
# Go binding tests
cd clickgraph-go && CGO_LDFLAGS="-L../target/debug" LD_LIBRARY_PATH="../target/debug" go test -v
# Python binding tests
cd clickgraph-py && LD_LIBRARY_PATH="../target/debug" python3 -m pytest tests/ -v- Unit tests go in the same file as the code (
#[cfg(test)] mod tests) - Integration tests go in
tests/rust/integration/ - SQL generation tests use the
generate_sqlhelper pattern from existing tests - Schema test data uses schemas in
schemas/test/orbenchmarks/
| Document | Purpose |
|---|---|
CLAUDE.md |
AI assistant guidance and architecture details |
STATUS.md |
Current project state |
CHANGELOG.md |
Release history |
DEV_QUICK_START.md |
Essential developer workflow |
DEVELOPMENT_PROCESS.md |
Detailed 6-phase development process |
docs/wiki/ |
User-facing documentation |
*/AGENTS.md |
Module-level architecture guides |
By contributing to ClickGraph, you agree that your contributions will be licensed under the Apache License 2.0.
- Open a GitHub issue for bugs or feature requests
- Check existing AGENTS.md files for module-specific architecture context