Featured

Deploy OpenClaw in 60 seconds β€” 20% off logoDeploy OpenClaw in 60 seconds β€” 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger β†’
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger β†’
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free β†’
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now β†’
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data β€” no proxies, no parsers, no maintenance.

Start building free β†’
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it β€” secured from day one.

Get it set up for you β†’
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free β†’
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here β†’

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

ajitpratap0/GoSQLX MCP server](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX/badges/score.svg)](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX) 🏎️ ☁️ 🏠 - 7 SQL tools (validate, format, parse, lint, security scan, metadata extraction, full analysis)...

README.md

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

![Go Version](https://go.dev) ![Release](https://github.com/ajitpratap0/GoSQLX/releases) ![License](LICENSE) ![PRs Welcome](http://makeapullrequest.com)

![Website](https://gosqlx.dev) ![VS Code](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx) ![MCP](https://mcp.gosqlx.dev/health) ![Glama MCP Server](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX) ![Lint Action](https://github.com/marketplace/actions/gosqlx-lint-action)

![Tests](https://github.com/ajitpratap0/GoSQLX/actions) ![Go Report](https://goreportcard.com/report/github.com/ajitpratap0/GoSQLX) ![GoDoc](https://pkg.go.dev/github.com/ajitpratap0/GoSQLX) ![Stars](https://github.com/ajitpratap0/GoSQLX) ![OpenSSF Scorecard](https://securityscorecards.dev/viewer/?uri=github.com/ajitpratap0/GoSQLX)

<br/>

🌐 Try the Playground &nbsp;Β·&nbsp; πŸ“– Read the Docs &nbsp;Β·&nbsp; πŸš€ Get Started &nbsp;Β·&nbsp; πŸ“Š 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.

// v1.15+ recommended entry point: ParseTree returns an opaque Tree,
// so you don't need to import pkg/sql/ast just to get started.
tree, _ := gosqlx.ParseTree(ctx, "SELECT u.name, COUNT(*) FROM users u JOIN orders o ON u.id = o.user_id GROUP BY u.name",
    gosqlx.WithDialect("postgresql"))
fmt.Println("Tables:", tree.Tables())
fmt.Println(tree.Format(gosqlx.WithIndent(2), gosqlx.WithUppercaseKeywords(true)))

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.

<br/>

Get Started in 60 Seconds

go get github.com/ajitpratap0/GoSQLX
package main

import (
    "fmt"
    "github.com/ajitpratap0/GoSQLX/pkg/gosqlx"
)

func main() {
    ctx := context.Background()

    // ParseTree (v1.15+) is the recommended entry point. It returns an
    // opaque handle with built-in helpers β€” no need to import pkg/sql/ast.
    tree, err := gosqlx.ParseTree(ctx, "SELECT id, name FROM users WHERE active = true",
        gosqlx.WithDialect("postgresql"))
    if err != nil {
        // Sentinel errors work with errors.Is
        if errors.Is(err, gosqlx.ErrSyntax) {
            log.Fatalf("syntax error: %v", err)
        }
        log.Fatal(err)
    }
    fmt.Println("Tables:", tree.Tables())
    fmt.Println(tree.Format(gosqlx.WithIndent(2), gosqlx.WithUppercaseKeywords(true)))

    // Walk the AST β€” typed walkers avoid the type-assertion dance:
    tree.WalkSelects(func(s *ast.SelectStatement) bool {
        fmt.Printf("  SELECT with %d columns\n", len(s.Columns))
        return true
    })

    // The legacy Parse/Format/Validate API still works for v1.x code.
    // See docs/MIGRATION.md for the Tree migration guide.
}

<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/>30 lint rules (L001–L030)<br/>20 optimizer rules<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)
  1. Fork & branch from main
  2. Write tests - we use TDD and require race-free code
  3. Run task check - must pass before PR
  4. 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>

See related servers & alternatives β†’

Related MCP servers

Browse all β†’

Related guides

Hand-picked reading to help you choose and use Databases servers.