A Go library for parsing ClickHouse SQL statements.
🛠️ This is a maintained fork of
AfterShip/clickhouse-sql-parser, with improvements and customizations by Hydrolix.
- Converts ClickHouse SQL into an abstract syntax tree (AST)
- Lightweight and easy to embed in Go applications
You can use it as your Go library
go get github.com/hydrolix/clickhouse-sql-parser@latestimport "github.com/hydrolix/clickhouse-sql-parser/parser"
input := "SELECT count() FROM events"
ast, err := parser.Parse(input)
if err != nil {
log.Fatalf("parse error: %v", err)
}
// Use AST...Licensed under the MIT License, same as the original project.
Originally created by AfterShip. Forked and maintained by Hydrolix.