GoSQLX
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Pure-Go SQL parser, formatter, linter and security scanner for 8 dialects.**
**Playground** · **Docs** · **Benchmarks** · **VS Code** · **MCP server**
| **~3.1M parses/sec†** | **318 ns parse latency†** | **~80–85% SQL-99 (est.)** | **8 dialects** | **0 race conditions** |
|:---:|:---:|:---:|:---:|:---:|
† Parse stage only (pre-tokenized input to AST), SELECT id, name FROM users, Apple M4, Go 1.27, median of 10 runs of BenchmarkPerformanceBaseline. Complex queries take longer (see performance_baselines.json). Reproduce: go test -run ^$ -bench BenchmarkPerformanceBaseline -benchmem -count=10 ./pkg/sql/parser/.
What is GoSQLX?
GoSQLX is a **production-ready SQL parsing SDK** for Go. It tokenizes, parses, and generates ASTs from SQL with zero-copy optimizations and intelligent object pooling - parsing a simple SELECT in about **318 ns (~3.1M parses/sec)** .
Why GoSQLX?
- **Not an ORM** - a parser. You get the AST, you decide what to do with it.
- **Not slow** - zero-copy tokenization, sync.Pool recycling, no allocations on hot paths.
- **Not limited** - PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. CTEs, window functions, MERGE, set operations.
- **Not just a library** - CLI, VS Code extension, GitHub Action, MCP server, WASM playground, Python bindings.
Install
Go library
CLI
VS Code
The extension bundles the binary, so there is no extra setup. Learn more.
MCP server
7 SQL tools in Claude, Cursor, or any MCP client. MCP guide.
GitHub Action
Quick start
Source: examples/readme_quickstart/main.go, compiled in CI against HEAD and the latest release.
Output:
Formatting turns one-line SQL into a readable query:
Features
- **Parser** - zero-copy tokenizer, recursive descent parser and full AST generation.
- **Analysis** - SQL injection scanner, 30 lint rules (L001-L030), 20 optimizer rules and metadata extraction.
- **Tooling** - AST-based formatter, query transforms API, VS Code extension and GitHub Action.
- **Multi-dialect** - PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse.
- **AI-ready** - MCP server with 7 tools, public remote endpoint, Streamable HTTP.
- **Tested** - race-detector clean in CI, ~80-85% SQL-99 (estimated).
Documentation
- **Getting Started** - parse your first SQL in 5 minutes
- **Usage Guide** - comprehensive patterns and examples
- **API Reference** - complete API documentation
- **CLI Guide** - command-line tool reference
- **SQL Compatibility** - dialect support matrix
- **MCP Guide** - AI assistant integration