NAME
GoSQLX โ High-performance SQL parser, formatter, linter & security scanner for Go - 1.5M+ ops/sec, multi-dialect, zero-copy,โฆ
SYNOPSIS
go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latestINFO
DESCRIPTION
High-performance SQL parser, formatter, linter & security scanner for Go - 1.5M+ ops/sec, multi-dialect, zero-copy, race-free
README
GoSQLX
Parse SQL at the speed of Go
๐ Try the Playground ย ยทย ๐ Read the Docs ย ยทย ๐ Get Started ย ยทย ๐ Benchmarks
| 1.38M+ ops/sec | <1ฮผs latency | 85% SQL-99 | 8 dialects | 0 race conditions |
|---|
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 - handling 1.38M+ operations per second with sub-microsecond latency.
ast, _ := gosqlx.Parse("SELECT u.name, COUNT(*) FROM users u JOIN orders o ON u.id = o.user_id GROUP BY u.name")
// โ Full AST with statements, columns, joins, grouping - ready for analysis, transformation, or formatting
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.
Get Started in 60 Seconds
go get github.com/ajitpratap0/GoSQLX
package mainimport ( "fmt" "github.com/ajitpratap0/GoSQLX/pkg/gosqlx" )
func main() { // Parse any SQL dialect ast, _ := gosqlx.Parse("SELECT * FROM users WHERE active = true") fmt.Printf("%d statement(s)\n", len(ast.Statements))
// Format messy SQL clean, _ := gosqlx.Format("select id,name from users where id=1", gosqlx.DefaultFormatOptions()) fmt.Println(clean) // SELECT // id, // name // FROM users // WHERE id = 1 // Catch errors before production if err := gosqlx.Validate("SELECT * FROM"); err != nil { fmt.Println(err) // โ expected table name }
}
Install Everywhere
๐ฆ Go Library
๐ฅ๏ธ CLI Tool
|
๐ป VS Code Extension
Bundles the binary - zero setup. Learn more โ ๐ค MCP Server (AI Integration)
7 SQL tools in Claude, Cursor, or any MCP client. Guide โ |
Features at a Glance
โก ParserZero-copy tokenizerRecursive descent parser Full AST generation Multi-dialect engine | ๐ก๏ธ AnalysisSQL injection scanner30 lint rules (L001โL030) 20 optimizer rules Metadata extraction | ๐ง ToolingAST-based formatterQuery transforms API VS Code extension GitHub Action |
๐ Multi-DialectPostgreSQL ยท MySQL ยท MariaDBSQL Server ยท Oracle SQLite ยท Snowflake ยท ClickHouse | ๐ค AI-ReadyMCP server (7 tools)Public remote endpoint Streamable HTTP | ๐งช Battle-Tested20K+ concurrent opsZero race conditions ~85% SQL-99 compliance |
Documentation
| Resource | Description | |
|---|---|---|
| ๐ | gosqlx.dev | Website with interactive playground |
| ๐ | 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 |
| ๐๏ธ | Architecture | System design deep-dive |
| ๐ | Benchmarks | Performance data and methodology |
| ๐ | Release Notes | What's new in each version |
Contributing
GoSQLX is built by contributors like you. Whether it's a bug fix, new feature, documentation improvement, or just a typo - every contribution matters.
git clone https://github.com/ajitpratap0/GoSQLX.git && cd GoSQLX
task check # fmt โ vet โ lint โ test (with race detection)
- Fork & branch from
main - Write tests - we use TDD and require race-free code
- Run
task check- must pass before PR - Open a PR - we review within 24 hours
๐ Contributing Guide ยท ๐ Code of Conduct ยท ๐๏ธ Governance
Who's Using GoSQLX?
GoSQLX is downloaded and cloned by developers worldwide -- 595 unique cloners in just 14 days. If you're using GoSQLX in your project or organization, we'd love to hear about it!
| Project / Company | Use Case |
|---|---|
| Your project here | Add yourself via PR or tell us in Discussions |
Using GoSQLX at work? Building something cool with it? Share your story in GitHub Discussions -- it helps the community grow and motivates continued development.
Community
License
Apache License 2.0 - see LICENSE for details.
Built with โค๏ธ by the GoSQLX community
gosqlx.dev ยท Playground ยท Docs ยท MCP Server ยท VS Code
If GoSQLX helps your project, consider giving it a โญ