gosqlx
Official GoSQLX plugins for Claude Code: SQL validation, formatting, linting, security scanning and analysis.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/ajitpratap0/GoSQLX with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/ajitpratap0/GoSQLX'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/ajitpratap0--gosqlx)HTML
<a href="/listings/ajitpratap0--gosqlx"><img src="/api/listings/ajitpratap0--gosqlx/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Go library
go get github.com/ajitpratap0/GoSQLX
CLI
go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
VS Code
code --install-extension ajitpratap0.gosqlx
The extension bundles the binary, so there is no extra setup. [Learn more](https://gosqlx.dev/vscode/).
MCP server
claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp
7 SQL tools in Claude, Cursor, or any MCP client. [MCP guide](https://gosqlx.dev/docs/integrations/mcp/).
**Claude Code plugin** (skills, slash commands, SQL reviewer agent): `/plugin marketplace add ajitpratap0/GoSQLX` then `/plugin install gosqlx@gosqlx` - [details](plugins/gosqlx/README.md).
**ChatGPT app**: add `https://mcp.gosqlx.dev/mcp` as a connector in developer mode for an interactive analysis widget - [details](integrations/chatgpt/README.md).
GitHub Action
- uses: ajitpratap0/GoSQLX@v1
with:
files: '**/*.sql'
validate: true<br/>
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 21 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "name": "gosqlx",
- "description": "Official GoSQLX plugins for Claude Code: SQL validation, formatting, linting, security scanning and analysis.",
- "owner": {
- "name": "Ajit Pratap Singh",
- "url": "https://github.com/ajitpratap0"
- },
- "plugins": [
- {
- "name": "gosqlx",
- "source": "./plugins/gosqlx",
- "description": "Validate, format, lint, analyze and security-scan SQL with GoSQLX (MCP tools, skills, slash commands, a SQL reviewer agent and a .sql validation hook).",
- "version": "1.17.0",
- "category": "development",
- "tags": ["sql", "database", "linting", "formatting", "security", "mcp"],
- "homepage": "https://gosqlx.dev",
- "repository": "https://github.com/ajitpratap0/GoSQLX",
- "license": "Apache-2.0"
- }
- ]
- }
README.md · README · 223 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <div align="center">
- <img src=".github/assets/logo.png" alt="GoSQLX: a gopher mascot with a magnifying glass, a database and a rising arrow" width="240">
- # GoSQLX
- **Pure-Go SQL parser, formatter, linter and security scanner for 8 dialects.**
- [](https://github.com/ajitpratap0/GoSQLX/actions/workflows/test.yml)
- [](https://pkg.go.dev/github.com/ajitpratap0/GoSQLX)
- [](https://github.com/ajitpratap0/GoSQLX/releases)
- [](LICENSE)
- [](https://securityscorecards.dev/viewer/?uri=github.com/ajitpratap0/GoSQLX)
- **[Playground](https://gosqlx.dev/playground/)** · **[Docs](https://gosqlx.dev/docs/)** · **[Benchmarks](https://gosqlx.dev/benchmarks/)** · **[VS Code](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx)** · **[MCP server](#mcp-server)**
- <br/>
- <!-- metrics:start -->
- | **~2.8M parses/sec†** | **363 ns parse latency†** | **~80–85% SQL-99 (est.)** | **8 dialects** | **0 race conditions** |
- |:---:|:---:|:---:|:---:|:---:|
- <sub>† 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/`.</sub>
- <!-- metrics:end -->
- <br/>
- <img src=".github/assets/demo.gif" alt="Terminal demo: gosqlx validate, format and lint on one query, then the WASM playground" width="720">
- </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 - parsing a simple SELECT in about <!-- metrics-inline:start -->**363 ns (~2.8M parses/sec)**<!-- metrics-inline:end -->.
- ### 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/>
- ## Install
- ### Go library
- ```bash
- go get github.com/ajitpratap0/GoSQLX
- ```
- ### CLI
- ```bash
- go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
- ```
- ### VS Code
- ```bash
- code --install-extension ajitpratap0.gosqlx
- ```
- The extension bundles the binary, so there is no extra setup. [Learn more](https://gosqlx.dev/vscode/).
- ### MCP server
- ```bash
- claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp
- ```
- 7 SQL tools in Claude, Cursor, or any MCP client. [MCP guide](https://gosqlx.dev/docs/integrations/mcp/).
- **Claude Code plugin** (skills, slash commands, SQL reviewer agent): `/plugin marketplace add ajitpratap0/GoSQLX` then `/plugin install gosqlx@gosqlx` - [details](plugins/gosqlx/README.md).
- **ChatGPT app**: add `https://mcp.gosqlx.dev/mcp` as a connector in developer mode for an interactive analysis widget - [details](integrations/chatgpt/README.md).
- [](https://mcp.gosqlx.dev/health)
- [](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX)
- ### GitHub Action
- ```yaml
- - uses: ajitpratap0/GoSQLX@v1
- with:
- files: '**/*.sql'
- validate: true
- ```
- <br/>
- ## Quick start
- Source: [`examples/readme_quickstart/main.go`](examples/readme_quickstart/main.go), compiled in CI against HEAD and the latest release.
- ```go
- 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:
- ```text
- Tables: [users]
- SELECT id, name
- FROM users
- WHERE active = true
- SELECT with 2 columns
- ```
- Formatting turns one-line SQL into a readable query:
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset=".github/assets/format-before-after-dark.png">
- <img src=".github/assets/format-before-after.png" alt="Before: one-line lowercase SQL. After gosqlx format: SELECT, FROM, INNER JOIN, WHERE, GROUP BY, HAVING, ORDER BY and LIMIT each on their own line" width="900">
- </picture>
- <br/>
- ## Features
- <picture>
- <img src=".github/assets/architecture.svg" alt="Architecture: SQL bytes go through the tokenizer to TokenWithSpan, the parser builds an AST, and the formatter, linter, security scanner, transpiler and fingerprinter consume it" width="900">
- </picture>
- - **[Parser](https://gosqlx.dev/docs/concepts/architecture/)** - zero-copy tokenizer, recursive descent parser and full AST generation.
- - **[Analysis](https://gosqlx.dev/docs/reference/linting-rules/)** - SQL injection scanner, 30 lint rules (L001-L030), 20 optimizer rules and metadata extraction.
- - **[Tooling](https://gosqlx.dev/docs/cli-guide/)** - AST-based formatter, query transforms API, VS Code extension and GitHub Action.
- - **[Syntax highlighting](docs/HIGHLIGHTING.md)** - dialect-aware highlighting for terminals (ANSI), HTML/CSS, JSON spans, LSP semantic tokens and WASM; `gosqlx highlight query.sql` or `gosqlx.HighlightANSI(sql)`.
- - **[Multi-dialect](https://gosqlx.dev/docs/reference/sql-compatibility/)** - 8 dialects with dedicated grammar support: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. The `--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.
- - **[AI-ready](https://gosqlx.dev/docs/integrations/mcp/)** - MCP server with 7 tools, public remote endpoint, Streamable HTTP.
- - **[Tested](https://gosqlx.dev/docs/reference/sql-compatibility/)** - race-detector clean in CI, ~80-85% SQL-99 (estimated).
- <br/>
- ## Documentation
- - **[Getting Started](https://gosqlx.dev/docs/getting-started/)** - parse your first SQL in 5 minutes
- - **[Usage Guide](https://gosqlx.dev/docs/usage-guide/)** - comprehensive patterns and examples
- - **[API Reference](https://gosqlx.dev/docs/reference/api/)** - complete API documentation
- - **[CLI Guide](https://gosqlx.dev/docs/cli-guide/)** - command-line tool reference
- - **[SQL Compatibility](https://gosqlx.dev/docs/reference/sql-compatibility/)** - dialect support matrix
- - **[MCP Guide](https://gosqlx.dev/docs/integrations/mcp/)** - AI assistant integration
- - **[Architecture](https://gosqlx.dev/docs/concepts/architecture/)** - system design deep-dive
- - **[Benchmarks](https://gosqlx.dev/benchmarks/)** - performance data and methodology
- - **[Changelog](CHANGELOG.md)** - what changed 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.
- ```bash
- 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](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md) · [Governance](GOVERNANCE.md)
- <br/>
- ## Community
- Questions or ideas: [Discussions](https://github.com/ajitpratap0/GoSQLX/discussions). Found a bug or want a feature: [Issues](https://github.com/ajitpratap0/GoSQLX/issues/new/choose).
- <br/>
- ## License
- Apache License 2.0 - see [LICENSE](LICENSE) for details.
- ---
- <div align="center">
- **[gosqlx.dev](https://gosqlx.dev)** · **[Playground](https://gosqlx.dev/playground/)** · **[Docs](https://gosqlx.dev/docs/)** · **[MCP Server](https://gosqlx.dev/docs/integrations/mcp/)** · **[VS Code](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx)**
- </div>
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.