Skip to content
Back to search

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.

Checked today

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ajitpratap0--gosqlx/badge.svg)](/listings/ajitpratap0--gosqlx)

HTML

<a href="/listings/ajitpratap0--gosqlx"><img src="/api/listings/ajitpratap0--gosqlx/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

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.

  1. {
  2. "name": "gosqlx",
  3. "description": "Official GoSQLX plugins for Claude Code: SQL validation, formatting, linting, security scanning and analysis.",
  4. "owner": {
  5. "name": "Ajit Pratap Singh",
  6. "url": "https://github.com/ajitpratap0"
  7. },
  8. "plugins": [
  9. {
  10. "name": "gosqlx",
  11. "source": "./plugins/gosqlx",
  12. "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).",
  13. "version": "1.17.0",
  14. "category": "development",
  15. "tags": ["sql", "database", "linting", "formatting", "security", "mcp"],
  16. "homepage": "https://gosqlx.dev",
  17. "repository": "https://github.com/ajitpratap0/GoSQLX",
  18. "license": "Apache-2.0"
  19. }
  20. ]
  21. }
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.

  1. <div align="center">
  2. <img src=".github/assets/logo.png" alt="GoSQLX: a gopher mascot with a magnifying glass, a database and a rising arrow" width="240">
  3. # GoSQLX
  4. **Pure-Go SQL parser, formatter, linter and security scanner for 8 dialects.**
  5. [![CI](https://img.shields.io/github/actions/workflow/status/ajitpratap0/GoSQLX/test.yml?branch=main&label=CI&style=flat-square)](https://github.com/ajitpratap0/GoSQLX/actions/workflows/test.yml)
  6. [![Go Reference](https://img.shields.io/badge/pkg.go.dev-reference-007d9c?style=flat-square&logo=go&logoColor=white)](https://pkg.go.dev/github.com/ajitpratap0/GoSQLX)
  7. [![Release](https://img.shields.io/github/v/release/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/releases)
  8. [![License](https://img.shields.io/github/license/ajitpratap0/GoSQLX?style=flat-square)](LICENSE)
  9. [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/ajitpratap0/GoSQLX?style=flat-square&label=OpenSSF%20Scorecard)](https://securityscorecards.dev/viewer/?uri=github.com/ajitpratap0/GoSQLX)
  10. **[Playground](https://gosqlx.dev/playground/)** &nbsp;·&nbsp; **[Docs](https://gosqlx.dev/docs/)** &nbsp;·&nbsp; **[Benchmarks](https://gosqlx.dev/benchmarks/)** &nbsp;·&nbsp; **[VS Code](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx)** &nbsp;·&nbsp; **[MCP server](#mcp-server)**
  11. <br/>
  12. <!-- metrics:start -->
  13. | **~2.8M parses/sec†** | **363 ns parse latency†** | **~80–85% SQL-99 (est.)** | **8 dialects** | **0 race conditions** |
  14. |:---:|:---:|:---:|:---:|:---:|
  15. <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>
  16. <!-- metrics:end -->
  17. <br/>
  18. <img src=".github/assets/demo.gif" alt="Terminal demo: gosqlx validate, format and lint on one query, then the WASM playground" width="720">
  19. </div>
  20. <br/>
  21. ## What is GoSQLX?
  22. 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 -->.
  23. ### Why GoSQLX?
  24. - **Not an ORM** - a parser. You get the AST, you decide what to do with it.
  25. - **Not slow** - zero-copy tokenization, sync.Pool recycling, no allocations on hot paths.
  26. - **Not limited** - PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. CTEs, window functions, MERGE, set operations.
  27. - **Not just a library** - CLI, VS Code extension, GitHub Action, MCP server, WASM playground, Python bindings.
  28. <br/>
  29. ## Install
  30. ### Go library
  31. ```bash
  32. go get github.com/ajitpratap0/GoSQLX
  33. ```
  34. ### CLI
  35. ```bash
  36. go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
  37. ```
  38. ### VS Code
  39. ```bash
  40. code --install-extension ajitpratap0.gosqlx
  41. ```
  42. The extension bundles the binary, so there is no extra setup. [Learn more](https://gosqlx.dev/vscode/).
  43. ### MCP server
  44. ```bash
  45. claude mcp add --transport http gosqlx https://mcp.gosqlx.dev/mcp
  46. ```
  47. 7 SQL tools in Claude, Cursor, or any MCP client. [MCP guide](https://gosqlx.dev/docs/integrations/mcp/).
  48. **Claude Code plugin** (skills, slash commands, SQL reviewer agent): `/plugin marketplace add ajitpratap0/GoSQLX` then `/plugin install gosqlx@gosqlx` - [details](plugins/gosqlx/README.md).
  49. **ChatGPT app**: add `https://mcp.gosqlx.dev/mcp` as a connector in developer mode for an interactive analysis widget - [details](integrations/chatgpt/README.md).
  50. [![MCP](https://img.shields.io/badge/MCP-Remote%20Server-blue?style=flat-square)](https://mcp.gosqlx.dev/health)
  51. [![Glama MCP Server](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX/badges/score.svg)](https://glama.ai/mcp/servers/ajitpratap0/GoSQLX)
  52. ### GitHub Action
  53. ```yaml
  54. - uses: ajitpratap0/GoSQLX@v1
  55. with:
  56. files: '**/*.sql'
  57. validate: true
  58. ```
  59. <br/>
  60. ## Quick start
  61. Source: [`examples/readme_quickstart/main.go`](examples/readme_quickstart/main.go), compiled in CI against HEAD and the latest release.
  62. ```go
  63. package main
  64. import (
  65. "context"
  66. "errors"
  67. "fmt"
  68. "log"
  69. "github.com/ajitpratap0/GoSQLX/pkg/gosqlx"
  70. "github.com/ajitpratap0/GoSQLX/pkg/sql/ast"
  71. )
  72. func main() {
  73. ctx := context.Background()
  74. // ParseTree is the recommended entry point. It returns an
  75. // opaque handle with built-in helpers.
  76. tree, err := gosqlx.ParseTree(ctx, "SELECT id, name FROM users WHERE active = true",
  77. gosqlx.WithDialect("postgresql"))
  78. if err != nil {
  79. // Sentinel errors work with errors.Is
  80. if errors.Is(err, gosqlx.ErrSyntax) {
  81. log.Fatalf("syntax error: %v", err)
  82. }
  83. log.Fatal(err)
  84. }
  85. fmt.Println("Tables:", tree.Tables())
  86. fmt.Println(tree.Format(gosqlx.WithIndent(2), gosqlx.WithUppercaseKeywords(true)))
  87. // Walk the AST - typed walkers avoid the type-assertion dance:
  88. tree.WalkSelects(func(s *ast.SelectStatement) bool {
  89. fmt.Printf(" SELECT with %d columns\n", len(s.Columns))
  90. return true
  91. })
  92. // The legacy Parse/Format/Validate API still works for v1.x code.
  93. // See docs/MIGRATION.md for the Tree migration guide.
  94. }
  95. ```
  96. Output:
  97. ```text
  98. Tables: [users]
  99. SELECT id, name
  100. FROM users
  101. WHERE active = true
  102. SELECT with 2 columns
  103. ```
  104. Formatting turns one-line SQL into a readable query:
  105. <picture>
  106. <source media="(prefers-color-scheme: dark)" srcset=".github/assets/format-before-after-dark.png">
  107. <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">
  108. </picture>
  109. <br/>
  110. ## Features
  111. <picture>
  112. <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">
  113. </picture>
  114. - **[Parser](https://gosqlx.dev/docs/concepts/architecture/)** - zero-copy tokenizer, recursive descent parser and full AST generation.
  115. - **[Analysis](https://gosqlx.dev/docs/reference/linting-rules/)** - SQL injection scanner, 30 lint rules (L001-L030), 20 optimizer rules and metadata extraction.
  116. - **[Tooling](https://gosqlx.dev/docs/cli-guide/)** - AST-based formatter, query transforms API, VS Code extension and GitHub Action.
  117. - **[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)`.
  118. - **[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.
  119. - **[AI-ready](https://gosqlx.dev/docs/integrations/mcp/)** - MCP server with 7 tools, public remote endpoint, Streamable HTTP.
  120. - **[Tested](https://gosqlx.dev/docs/reference/sql-compatibility/)** - race-detector clean in CI, ~80-85% SQL-99 (estimated).
  121. <br/>
  122. ## Documentation
  123. - **[Getting Started](https://gosqlx.dev/docs/getting-started/)** - parse your first SQL in 5 minutes
  124. - **[Usage Guide](https://gosqlx.dev/docs/usage-guide/)** - comprehensive patterns and examples
  125. - **[API Reference](https://gosqlx.dev/docs/reference/api/)** - complete API documentation
  126. - **[CLI Guide](https://gosqlx.dev/docs/cli-guide/)** - command-line tool reference
  127. - **[SQL Compatibility](https://gosqlx.dev/docs/reference/sql-compatibility/)** - dialect support matrix
  128. - **[MCP Guide](https://gosqlx.dev/docs/integrations/mcp/)** - AI assistant integration
  129. - **[Architecture](https://gosqlx.dev/docs/concepts/architecture/)** - system design deep-dive
  130. - **[Benchmarks](https://gosqlx.dev/benchmarks/)** - performance data and methodology
  131. - **[Changelog](CHANGELOG.md)** - what changed in each version
  132. <br/>
  133. ## Contributing
  134. GoSQLX is built by contributors like you. Whether it's a bug fix, new feature, documentation improvement, or just a typo - every contribution matters.
  135. ```bash
  136. git clone https://github.com/ajitpratap0/GoSQLX.git && cd GoSQLX
  137. task check # fmt → vet → lint → test (with race detection)
  138. ```
  139. 1. **Fork & branch** from `main`
  140. 2. **Write tests** - we use TDD and require race-free code
  141. 3. **Run `task check`** - must pass before PR
  142. 4. **Open a PR** - we review within 24 hours
  143. [Contributing Guide](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md) · [Governance](GOVERNANCE.md)
  144. <br/>
  145. ## Community
  146. 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).
  147. <br/>
  148. ## License
  149. Apache License 2.0 - see [LICENSE](LICENSE) for details.
  150. ---
  151. <div align="center">
  152. **[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)**
  153. </div>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.