https://github.com/hungtcs/clickhouse-sql-parser
https://github.com/hungtcs/clickhouse-sql-parser
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hungtcs/clickhouse-sql-parser
- Owner: hungtcs
- License: apache-2.0
- Created: 2024-08-23T03:48:42.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T02:00:36.000Z (almost 2 years ago)
- Last Synced: 2025-10-09T12:32:02.800Z (10 months ago)
- Language: Go
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clickhouse SQL Parser
This is a Go [Clickhouse](https://clickhouse.com) SQL Parser built with [Antlr4](https://www.antlr.org).
The original antlr4 grammar files are from the [official clickhouse repository](https://github.com/ClickHouse/ClickHouse/tree/master/utils/antlr), although the maintainers of clickhouse have stated that this is unsupported, but this is still the easiest way to quickly build a clickhouse sql parser with as robust as possible.
The original antlr4 grammar files contain a little bit of C++ code, but this can be replaced with Go easily, you can see the current grammar file [here](./grammar/).
## Installation
Before using this library, you should know and agree with the following points:
1. **This library has not undergone any security testing, and you need to take full responsibility for any potential risks, including data loss.**
2. **We are currently in the early stages of development and may change some APIs at any time without prior notice.**
Now, you can install this library with the following command.
```shell
go get github.com/hungtcs/clickhouse-sql-parser@master
```
## Roadmap
- [ ] Cover Antlr4 CST to AST
- [ ] Implement AST Visitor
- [ ] AST Serialize to SQL