Skip to main content
Glama

GoSQLX

Analiza SQL a la velocidad de Go

Go Version Release License PRs Welcome

Website VS Code MCP Glama MCP Server Lint Action

Tests Go Report GoDoc Stars OpenSSF Scorecard

🌐 Prueba el Playground  ·  📖 Lee la documentación  ·  🚀 Primeros pasos  ·  📊 Benchmarks

Más de 1,38M ops/seg

Latencia <1μs

85% SQL-99

8 dialectos

0 condiciones de carrera

¿Qué es GoSQLX?

GoSQLX es un SDK de análisis de SQL listo para producción para Go. Tokeniza, analiza y genera AST a partir de SQL con optimizaciones de copia cero (zero-copy) y agrupación inteligente de objetos, manejando más de 1,38 millones de operaciones por segundo con una latencia inferior a un microsegundo.

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

¿Por qué GoSQLX?

  • No es un ORM, es un analizador. Obtienes el AST, tú decides qué hacer con él.

  • No es lento: tokenización de copia cero, reciclaje con sync.Pool, sin asignaciones en rutas críticas.

  • No está limitado: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. CTE, funciones de ventana, MERGE, operaciones de conjunto.

  • No es solo una biblioteca: CLI, extensión de VS Code, GitHub Action, servidor MCP, playground WASM, enlaces para Python.

Related MCP server: mcp-server-duckdb

Primeros pasos en 60 segundos

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

Instálalo en todas partes

📦 Biblioteca Go

go get github.com/ajitpratap0/GoSQLX

🖥️ Herramienta CLI

go install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest
gosqlx validate "SELECT * FROM users"
gosqlx format query.sql
gosqlx lint query.sql

💻 Extensión de VS Code

code --install-extension ajitpratap0.gosqlx

Incluye el binario: configuración cero. Más información →

🤖 Servidor MCP (Integración con IA)

claude mcp add --transport http gosqlx \
  https://mcp.gosqlx.dev/mcp

7 herramientas SQL en Claude, Cursor o cualquier cliente MCP. Guía →

Características de un vistazo

Documentación

Recurso

Descripción

🌐

gosqlx.dev

Sitio web con playground interactivo

🚀

Primeros pasos

Analiza tu primer SQL en 5 minutos

📖

Guía de uso

Patrones y ejemplos completos

📄

Referencia de API

Documentación completa de la API

🖥️

Guía de CLI

Referencia de la herramienta de línea de comandos

🌍

Compatibilidad SQL

Matriz de soporte de dialectos

🤖

Guía de MCP

Integración con asistente de IA

🏗️

Arquitectura

Análisis profundo del diseño del sistema

📊

Benchmarks

Datos y metodología de rendimiento

📝

Notas de la versión

Novedades en cada versión

Contribuyendo

GoSQLX está construido por colaboradores como tú. Ya sea una corrección de errores, una nueva funcionalidad, una mejora en la documentación o simplemente un error tipográfico, cada contribución cuenta.

git clone https://github.com/ajitpratap0/GoSQLX.git && cd GoSQLX
task check    # fmt → vet → lint → test (with race detection)
  1. Haz un fork y crea una rama desde main

  2. Escribe pruebas: usamos TDD y requerimos código libre de condiciones de carrera

  3. Ejecuta task check: debe pasar antes del PR

  4. Abre un PR: revisamos en un plazo de 24 horas

📋 Guía de contribución · 📜 Código de conducta · 🏛️ Gobernanza

¿Quién usa GoSQLX?

GoSQLX es descargado y clonado por desarrolladores de todo el mundo: 595 clonadores únicos en solo 14 días. Si estás usando GoSQLX en tu proyecto u organización, ¡nos encantaría saberlo!

Proyecto / Empresa

Caso de uso

Tu proyecto aquí

Añádete mediante un PR o cuéntanos en Discussions

¿Usas GoSQLX en el trabajo? ¿Estás construyendo algo genial con él? Comparte tu historia en GitHub Discussions: ayuda a que la comunidad crezca y motiva el desarrollo continuo.

Comunidad

¿Tienes preguntas? ¿Ideas? ¿Encontraste un error?

Licencia

Licencia Apache 2.0: consulta LICENSE para más detalles.


Construido con ❤️ por la comunidad de GoSQLX

gosqlx.dev · Playground · Docs · Servidor MCP · VS Code

Si GoSQLX ayuda a tu proyecto, considera darle una ⭐

Available Tools

7 tools
analyze_sqlA
Read-onlyIdempotent

Run all 6 analysis tools concurrently and return a composite report (validate, parse, metadata, security, lint, format).

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL string to analyze

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnly, idempotent), the description adds that it runs six tools concurrently and returns a composite report, though it doesn't detail error handling or report structure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, well-structured sentence that conveys the essential purpose and behavior without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description adequately covers the tool's purpose and behavior given the simple parameter set and safety annotations, but lacks details about the composite report format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description adds no additional meaning to the 'sql' parameter beyond the schema's description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'run' and the resource 'all 6 analysis tools concurrently', distinguishing itself from sibling tools that perform individual analyses.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Describes when to use (concurrent analysis), but does not explicitly state when not to use or name alternatives; however, sibling tool list provides implicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_metadataA
Read-onlyIdempotent

Extract tables, columns, and functions referenced in SQL.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL string to analyze

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool as read-only and idempotent. The description adds that it extracts specific SQL elements but does not detail error handling or output behavior, adding modest value beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no superfluous words, effectively conveying the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of an output schema, the description hints at what is returned (tables, columns, functions), which is sufficient for a focused extraction tool, though more detail on output structure would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description adds some meaning by listing extracted items but no additional detail on parameter formatting or constraints beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool extracts tables, columns, and functions from SQL, which is specific and distinct from sibling tools like format_sql or security_scan.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as parse_sql or analyze_sql, leaving the agent to infer context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

format_sqlA
Read-onlyIdempotent

Format SQL with configurable indentation and keyword casing.

ParametersJSON Schema
NameRequiredDescriptionDefault
add_semicolonNoAppend a trailing semicolon (default: false)
indent_sizeNoSpaces per indent level (default: 2)
sqlYesThe SQL string to format
uppercase_keywordsNoUppercase SQL keywords (default: false)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool as read-only (readOnlyHint=true), non-destructive, and idempotent. The description adds no further behavioral details beyond what parameters suggest. No contradiction, but also no extra context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence that efficiently conveys the tool's purpose. No extraneous words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description, together with the schema and annotations, covers most aspects. However, since there is no output schema, it would be helpful to mention that the tool returns the formatted SQL string. Minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage for all 4 parameters. The description merely summarizes the parameters without adding new meaning beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Format SQL with configurable indentation and keyword casing,' using a specific verb and resource. This distinguishes it from sibling tools like analyze_sql, lint_sql, and parse_sql.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for formatting SQL but does not explicitly state when to use this tool versus alternatives, nor does it mention any when-not-to-use scenarios. Usage is clear from context but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lint_sqlA
Read-onlyIdempotent

Lint SQL against all 10 GoSQLX style rules (L001–L010).

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL string to lint

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations (readOnlyHint, destructiveHint, idempotentHint) already declare safe, read-only, idempotent behavior. The description adds the specific rule coverage but no additional behavioral traits like output format or side effects, providing limited extra transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence that efficiently conveys the tool's purpose without any redundant information. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description lacks details about the return format (e.g., list of issues, pass/fail). Given the tool's simplicity, this is a notable gap, but annotations partially compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a clear description for the single 'sql' parameter. The description does not add further meaning beyond what the schema already provides, so a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Lint SQL against all 10 GoSQLX style rules (L001–L010).' It specifies the exact verb (lint), resource (SQL), and rule set, distinguishing it from siblings like format_sql or security_scan.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through the rule set (GoSQLX), but no explicit when-to-use, when-not-to-use, or alternative tools are mentioned. The description lacks guidance on choosing this over siblings like analyze_sql or validate_sql.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

parse_sqlA
Read-onlyIdempotent

Parse SQL and return an AST summary: statement count and types.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL string to parse

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already confirm read-only, non-destructive, idempotent. Description adds that output is an AST summary with count and types, which goes beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no redundancy, all information is useful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given simple tool and good annotations, description provides all needed context: input (SQL string) and output (AST summary). No output schema needed as description covers return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Single parameter 'sql' has description in schema. Description does not add additional meaning beyond the schema's description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Parse' and resource 'SQL', specifying output as 'AST summary: statement count and types'. Distinguishes from siblings like analyze_sql which likely does deeper analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance. Implies use for quick overview, but doesn't mention alternatives like analyze_sql for detailed analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

security_scanA
Read-onlyIdempotent

Scan SQL for injection patterns: tautologies, UNION attacks, stacked queries, comment bypasses, and more.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL string to scan

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description adds only that it detects injection patterns. No additional behavioral details (e.g., output format, blocking behavior) are provided, but annotations carry the safety burden.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no wasted words. Essential information is front-loaded and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple interface (1 required param, no output schema) and annotations covering safety, the description adequately explains the tool's purpose. However, it could mention the return format or highlight that it is a security-focused analysis.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage (the `sql` parameter has a description), so the description adds no extra meaning beyond listing patterns the scan looks for. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the action (scan) and resource (SQL) and lists specific injection patterns (tautologies, UNION attacks, etc.), making it distinct from sibling tools like analyze_sql or lint_sql.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like validate_sql or parse_sql. The description implies use for security scanning but does not state exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_sqlA
Read-onlyIdempotent

Validate SQL syntax. Returns {valid: bool, error?: string, dialect?: string}.

ParametersJSON Schema
NameRequiredDescriptionDefault
dialectNoSQL dialect: generic, mysql, postgresql, sqlite, sqlserver, oracle, snowflake
sqlYesThe SQL string to validate

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate this is a safe, idempotent read operation (readOnlyHint=true, destructiveHint=false, idempotentHint=true). The description adds the return value shape ({valid, error, dialect}) but does not disclose edge-case behaviors (e.g., handling of invalid dialect). This is adequate but not exceptional.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with the return type, perfectly concise and front-loaded. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, two well-documented parameters, and no output schema, the description is largely complete. It reveals the return shape, which compensates for the missing output schema. However, it omits any mention of error handling or usage context (e.g., 'use for quick syntax checks before execution').

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%: both 'sql' and 'dialect' have descriptions and the latter has an enum. The description does not add any additional semantic meaning beyond what the schema provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description concisely states 'Validate SQL syntax', which clearly identifies the verb and resource. It distinguishes this tool from siblings like lint_sql (style checking) and parse_sql (parsing into AST).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is given on when to use this tool versus alternatives (e.g., analyze_sql for deeper analysis, format_sql for formatting). The description only states what it does, not when it is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv1.12.1
    • First observedanalyze_sql
    • First observedextract_metadata
    • First observedformat_sql
    • First observedlint_sql
    • First observedparse_sql
    • First observedsecurity_scan
    • First observedvalidate_sql

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct SQL analysis function: syntax validation, AST parsing, metadata extraction, security scanning, linting, formatting, and a composite report. No overlaps exist.

Naming Consistency5/5

All tools follow a clear verb_noun pattern (e.g., validate_sql, format_sql). The one exception (extract_metadata) still uses a verb and clearly refers to SQL metadata, maintaining consistency.

Tool Count5/5

7 tools is well-scoped for SQL analysis, covering the core tasks without being too many or too few. Each tool has a clear purpose.

Completeness5/5

The tool set covers the full lifecycle of SQL analysis: validation, parsing, metadata extraction, security, linting, and formatting. The aggregate tool enhances usability. No obvious gaps for the intended domain.

Maintenance

ActivitySlowing
ResponsivenessWithin a week

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
    3
    1,374
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server implementation for DuckDB, providing database interaction capabilities through MCP tools. It would be interesting to have LLM analyze it. DuckDB is suitable for local analysis.
    178
    MIT
  • A
    license
    B
    quality
    F
    maintenance
    Added support for STDIO mode and SSE mode Added support for multiple SQL execution, separated by ";" Added ability to query database table names and fields based on table comments Added SQL Execution Plan Analysis Added Chinese field to pinyin conversion
    5
    248
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ajitpratap0/GoSQLX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server