GoSQLX
High-performance SQL parser, formatter, linter & security scanner for Go - 1.5M+ ops/sec, multi-dialect, zero-copy, race-free
Install / Use
/learn @ajitpratap0/GoSQLXREADME
GoSQLX
<div align="center"> <img src="https://raw.githubusercontent.com/ajitpratap0/GoSQLX/main/.github/logo.png" alt="GoSQLX Logo" width="180"/>Parse SQL at the speed of Go
<br/>🌐 Try the Playground · 📖 Read the Docs · 🚀 Get Started · 📊 Benchmarks
<br/>| 1.38M+ ops/sec | <1μs latency | 85% SQL-99 | 8 dialects | 0 race conditions | |:---:|:---:|:---:|:---:|:---:|
</div> <br/>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 main
import (
"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
}
}
<br/>
Install Everywhere
<table> <tr> <td width="50%">📦 Go Library
go get github.com/ajitpratap0/GoSQLX
🖥️ CLI Tool
go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
gosqlx validate "SELECT * FROM users"
gosqlx format query.sql
gosqlx lint query.sql
</td>
<td width="50%">
💻 VS Code Extension
code --install-extension ajitpratap0.gosqlx
Bundles the binary - zero setup. Learn more →
🤖 MCP Server (AI Integration)
claude mcp add --transport http gosqlx \
https://mcp.gosqlx.dev/mcp
7 SQL tools in Claude, Cursor, or any MCP client. Guide →
</td> </tr> </table> <br/>Features at a Glance
<table> <tr> <td align="center" width="33%"><h3>⚡ Parser</h3>Zero-copy tokenizer<br/>Recursive descent parser<br/>Full AST generation<br/>Multi-dialect engine</td> <td align="center" width="33%"><h3>🛡️ Analysis</h3>SQL injection scanner<br/>10 lint rules (L001–L010)<br/>Query complexity scoring<br/>Metadata extraction</td> <td align="center" width="33%"><h3>🔧 Tooling</h3>AST-based formatter<br/>Query transforms API<br/>VS Code extension<br/>GitHub Action</td> </tr> <tr> <td align="center"><h3>🌐 Multi-Dialect</h3>PostgreSQL · MySQL · MariaDB<br/>SQL Server · Oracle<br/>SQLite · Snowflake · ClickHouse</td> <td align="center"><h3>🤖 AI-Ready</h3>MCP server (7 tools)<br/>Public remote endpoint<br/>Streamable HTTP</td> <td align="center"><h3>🧪 Battle-Tested</h3>20K+ concurrent ops<br/>Zero race conditions<br/>~85% SQL-99 compliance</td> </tr> </table> <br/>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 |
<br/>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
<br/>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.
<br/>Community
<div align="center">Got questions? Ideas? Found a bug?
<a href="https://github.com/ajitpratap0/GoSQLX/discussions"><img src="https://img.shields.io/badge/💬_Discussions-Ask_&_Share-purple?style=for-the-badge" alt="Discussions"></a> <a href="https://github.com/ajitpratap0/GoSQLX/issues/new/choose"><img src="https://img.shields.io/badge/🐛_Issues-Report_&_Request-red?style=for-the-badge" alt="Issues"></a> <a href="https://gosqlx.dev/blog/"><img src="https://img.shields.io/badge/📝_Blog-Release_Notes-green?style=for-the-badge" alt="Blog"></a>
</div> <br/>License
Apache License 2.0 - see LICENSE for details.
<div align="center">
<sub>Built with ❤️ by the GoSQLX community</sub>
gosqlx.dev · Playground · Docs · MCP Server · VS Code
<br/>If GoSQLX helps your project, consider giving it a ⭐
</div>Related Skills
healthcheck
351.8kHost security hardening and risk-tolerance configuration for OpenClaw deployments
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
351.8kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
xurl
351.8kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
