convez.ai
PluginDados & AnalyticsIntermediário
ajitpratap0

GoSQLX

ajitpratap0/GoSQLX

Parser SQL ultra-rápido para Go: 1.38M ops/sec, zero-copy, 8 dialetos

Ver no GitHub
Muito bomPluginScore · de 0 a 100

Parser SQL de alta performance para Go que tokeniza, analisa e gera ASTs com otimizações zero-copy, suportando múltiplos dialetos e processando 1.38M+ operações por segundo. Inclui formatador, linter e scanner de segurança integrados, ideal para pipelines de dados e análise de queries em aplicações críticas.

Instalação

$npx convez-ai ajitpratap0/GoSQLX

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
127
Forks
16
Acompanhando
2
Saúde
100%
Último commit
há 2 dias
Versão
v1.17.0
Issues abertas
17
Contribuidores
4

Casos de uso

  • Análise e validação de queries SQL em pipelines de CI/CD
  • Detecção de vulnerabilidades SQL e padrões inseguros
  • Formatação e linting de SQL em IDEs e ferramentas de desenvolvimento
  • Processamento de metadados de queries em data warehouses

Veredito

Ferramenta especializada e bem-engineered para parsing SQL em Go, com benchmarks sólidos e suporte a múltiplos dialetos. Essencial para quem precisa processar SQL programaticamente em Go com performance de produção; não substitui ORMs, mas complementa pipelines de análise e validação.

README

A tradução para o português deste README ainda está na fila.

GoSQLX

Parse SQL at the speed of Go

Go Version Release License PRs Welcome

Website VS Code MCP Glama MCP Server Lint Action

Tests Go Report GoDoc Stars OpenSSF Scorecard

🌐 Try the Playground  ·  📖 Read the Docs  ·  🚀 Get Started  ·  📊 Benchmarks

1.38M+ ops/sec<1μs latency85% SQL-998 dialects0 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.

// 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.

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.
}

Install Everywhere

📦 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

💻 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 →

Features at a Glance

Documentation

ResourceDescription
🌐gosqlx.devWebsite with interactive playground
🚀Getting StartedParse your first SQL in 5 minutes
📖Usage GuideComprehensive patterns and examples
📄API ReferenceComplete API documentation
🖥️CLI GuideCommand-line tool reference
🌍SQL CompatibilityDialect support matrix
🤖MCP GuideAI assistant integration
🏗️ArchitectureSystem design deep-dive
📊BenchmarksPerformance data and methodology
📝Release NotesWhat'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)
  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

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 / CompanyUse Case
Your project hereAdd 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

Got questions? Ideas? Found a bug?

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 ⭐

Ver o original no GitHub

Bom para

Relacionados