https://github.com/clickhouse/clickhouse-analyzer
SQL analyzer for ClickHouse SQL
https://github.com/clickhouse/clickhouse-analyzer
Last synced: 9 months ago
JSON representation
SQL analyzer for ClickHouse SQL
- Host: GitHub
- URL: https://github.com/clickhouse/clickhouse-analyzer
- Owner: ClickHouse
- License: apache-2.0
- Created: 2025-04-22T17:55:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-08T03:10:40.000Z (9 months ago)
- Last Synced: 2025-10-08T05:33:44.768Z (9 months ago)
- Language: Rust
- Size: 49.8 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ClickHouse Analyzer
An analyzer for ClickHouse SQL.
## Goal
The idea for this project is to have a tool like [rust-analyzer](https://rust-analyzer.github.io) for ClickHouse SQL (LSP, auto-complete, formatting, code suggestions, analysis, node extraction, etc.)
## Contributing
There's not much code here, it is only able to parse some elements of a `SELECT` query.
Feel free to modify and restructure the project as needed.
To learn more about the theory for this parser, read [this blog post](https://matklad.github.io/2023/05/21/resilient-ll-parsing-tutorial.html).
The code has some sample WASM functions. If you want to build the WASM you can follow [this guide from MDN](https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/Rust_to_Wasm#rust_environment_setup).
## Example output
See `example_output.txt` for example of what the tree looks like.