AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
High-performance, zero-copy SQL parsing SDK for Go. Thread-safe with multi-dialect support.
Developer toolsGo · TypeScriptGitHub @ajitpratap0OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
High-performance SQL parser, formatter, linter & security scanner for Go - 1.5M+ ops/sec, multi-dialect, zero-copy, race-free
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Parse SQL at the speed of Go 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. • 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 path [README 설치·사용 부분 발췌] Install EverywhereRead the full README ↗
Pure-Go SQL parser, formatter, linter and security scanner for 8 dialects.
Playground · Docs · Benchmarks · VS Code · MCP server
| ~2.9M parses/sec† | 349 ns parse latency† | ~80–85% SQL-99 (est.) | 8 dialects | 0 race conditions |
|---|
† Parse stage only (pre-tokenized input to AST), SELECT id, name FROM users, Apple M4, Go 1.27, median of 20 runs of BenchmarkPerformanceBaseline. Complex queries take longer (see performance_baselines.json). Reproduce: go test -run ^$ -bench BenchmarkPerformanceBaseline -benchmem -count=20 ./pkg/sql/parser/.
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 - parsing a simple SELECT in about 349 ns (~2.9M parses/sec).
go get github.com/ajitpratap0/GoSQLX
go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
code --install-extension ajitpratap0.gosqlx
The extension bundles the binary, so there is no extra setup. Learn more.
claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp
7 SQL tools in Claude, Cursor, or any MCP client. MCP guide.
Claude Code plugin (skills, slash commands, SQL reviewer agent): /plugin marketplace add ajitpratap0/GoSQLX then /plugin install gosqlx@gosqlx - details.
ChatGPT app: add https://mcp.gosqlx.dev/mcp as a connector in developer mode for an interactive analysis widget - details.
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
validate: true
Source: examples/readme_quickstart/main.go, compiled in CI against HEAD and the latest release.
package main
import (
"context"
"errors"
"fmt"
"log"
"github.com/ajitpratap0/GoSQLX/pkg/gosqlx"
"github.com/ajitpratap0/GoSQLX/pkg/sql/ast"
)
func main() {
ctx := context.Background()
// ParseTree is the recommended entry point. It returns an
// opaque handle with built-in helpers.
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.
}
Output:
Tables: [users]
SELECT id, name
FROM users
WHERE active = true
SELECT with 2 columns
Formatting turns one-line SQL into a readable query:
gosqlx highlight query.sql or gosqlx.HighlightANSI(sql).--dialect flag and WithDialect accept 11 names: those 8 (postgresql, mysql, mariadb, sqlserver, oracle, sqlite, snowflake, clickhouse) plus generic, bigquery and redshift. BigQuery and Redshift have no dialect-specific keyword set (they use the generic keywords) and only capability-gated grammar, such as BigQuery's QUALIFY, PIVOT/UNPIVOT, UNNEST in FROM and (struct).field access.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)
maintask check - must pass before PRContributing Guide · Code of Conduct · Governance
Questions or ideas: Discussions. Found a bug or want a feature: Issues.
Apache License 2.0 - see LICENSE for details.
gosqlx.dev · Playground · Docs · MCP Server · VS Code