Skip to content

ajitpratap0/GoSQLX

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

281 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

GoSQLX

GoSQLX Logo

Parse SQL at the speed of Go

Go Version Release License PRs Welcome

Website VS Code MCP Lint Action

Tests Go Report GoDoc Stars


🌐 Try the Playground Β Β·Β  πŸ“– Read the Docs Β Β·Β  πŸš€ Get Started Β Β·Β  πŸ“Š Benchmarks


1.25M+ ops/sec <1ΞΌs latency 85% SQL-99 6 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.25M+ 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, SQL Server, Oracle, SQLite, Snowflake. 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
    }
}

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

⚑ Parser

Zero-copy tokenizer
Recursive descent parser
Full AST generation
Multi-dialect engine

πŸ›‘οΈ Analysis

SQL injection scanner
10 lint rules (L001–L010)
Query complexity scoring
Metadata extraction

πŸ”§ Tooling

AST-based formatter
Query transforms API
VS Code extension
GitHub Action

🌐 Multi-Dialect

PostgreSQL Β· MySQL
SQL Server Β· Oracle
SQLite Β· Snowflake

πŸ€– AI-Ready

MCP server (7 tools)
Public remote endpoint
Streamable HTTP

πŸ§ͺ Battle-Tested

20K+ concurrent ops
Zero 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)
  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


Community

Got questions? Ideas? Found a bug?

Discussions Issues Blog


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 ⭐

About

High-performance SQL parser, formatter, linter & security scanner for Go - 1.5M+ ops/sec, multi-dialect, zero-copy, race-free

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors