GoSQLX
GoSQLX
SQL parsen mit der Geschwindigkeit von Go
🌐 Playground ausprobieren · 📖 Dokumentation lesen · 🚀 Erste Schritte · 📊 Benchmarks
1,38 Mio.+ Ops/Sek. | <1μs Latenz | 85% SQL-99 | 8 Dialekte | 0 Race Conditions |
Was ist GoSQLX?
GoSQLX ist ein produktionsreifes SQL-Parsing-SDK für Go. Es tokenisiert, parst und generiert ASTs aus SQL mit Zero-Copy-Optimierungen und intelligentem Objekt-Pooling – und bewältigt dabei über 1,38 Millionen Operationen pro Sekunde bei einer Latenz im Sub-Mikrosekundenbereich.
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 formattingWarum GoSQLX?
Kein ORM – sondern ein Parser. Sie erhalten den AST und entscheiden, was damit geschehen soll.
Nicht langsam – Zero-Copy-Tokenisierung, sync.Pool-Recycling, keine Allokationen auf kritischen Pfaden.
Nicht eingeschränkt – PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse. CTEs, Window-Funktionen, MERGE, Mengenoperationen.
Nicht nur eine Bibliothek – CLI, VS Code-Erweiterung, GitHub Action, MCP-Server, WASM-Playground, Python-Bindings.
Related MCP server: mcp-server-duckdb
Erste Schritte in 60 Sekunden
go get github.com/ajitpratap0/GoSQLXpackage 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
}
}Überall installieren
📦 Go-Bibliothek
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-Erweiterung
code --install-extension ajitpratap0.gosqlxEnthält die Binärdatei – keine Einrichtung erforderlich. Mehr erfahren →
🤖 MCP-Server (KI-Integration)
claude mcp add --transport http gosqlx \
https://mcp.gosqlx.dev/mcp7 SQL-Tools in Claude, Cursor oder jedem MCP-Client. Anleitung →
Funktionen auf einen Blick
Dokumentation
Ressource | Beschreibung | |
🌐 | Website mit interaktivem Playground | |
🚀 | Parsen Sie Ihr erstes SQL in 5 Minuten | |
📖 | Umfassende Muster und Beispiele | |
📄 | Vollständige API-Dokumentation | |
🖥️ | Referenz für das Befehlszeilentool | |
🌍 | Matrix der Dialektunterstützung | |
🤖 | Integration für KI-Assistenten | |
🏗️ | Detaillierter Einblick in das Systemdesign | |
📊 | Leistungsdaten und Methodik | |
📝 | Was ist neu in jeder Version |
Mitwirken
GoSQLX wird von Mitwirkenden wie Ihnen entwickelt. Ob Fehlerbehebung, neue Funktionen, Dokumentationsverbesserungen oder nur ein Tippfehler – jeder Beitrag zählt.
git clone https://github.com/ajitpratap0/GoSQLX.git && cd GoSQLX
task check # fmt → vet → lint → test (with race detection)Forken & Branch erstellen von
mainTests schreiben – wir nutzen TDD und benötigen Race-freien Code
task checkausführen – muss vor dem PR bestanden werdenPR öffnen – wir prüfen innerhalb von 24 Stunden
📋 Leitfaden für Mitwirkende · 📜 Verhaltenskodex · 🏛️ Governance
Wer nutzt GoSQLX?
GoSQLX wird weltweit von Entwicklern heruntergeladen und geklont – 595 eindeutige Nutzer in nur 14 Tagen. Wenn Sie GoSQLX in Ihrem Projekt oder Unternehmen verwenden, würden wir uns freuen, davon zu hören!
Projekt / Unternehmen | Anwendungsfall |
Ihr Projekt hier | Fügen Sie sich per PR hinzu oder berichten Sie uns in den Diskussionen |
Nutzen Sie GoSQLX bei der Arbeit? Bauen Sie etwas Cooles damit? Teilen Sie Ihre Geschichte in den GitHub-Diskussionen – das hilft der Community zu wachsen und motiviert zur kontinuierlichen Weiterentwicklung.
Community
Haben Sie Fragen? Ideen? Einen Fehler gefunden?
Lizenz
Apache License 2.0 – siehe LICENSE für Details.
Erstellt mit ❤️ von der GoSQLX-Community
gosqlx.dev · Playground · Dokumentation · MCP-Server · VS Code
Wenn GoSQLX Ihrem Projekt hilft, ziehen Sie in Betracht, einen ⭐ zu vergeben
Available Tools
7 toolsanalyze_sqlARead-onlyIdempotent
Run all 6 analysis tools concurrently and return a composite report (validate, parse, metadata, security, lint, format).
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to analyze |
TDQS
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.
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.
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.
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.
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.
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_metadataARead-onlyIdempotent
Extract tables, columns, and functions referenced in SQL.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to analyze |
TDQS
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.
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.
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.
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.
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.
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_sqlARead-onlyIdempotent
Format SQL with configurable indentation and keyword casing.
| Name | Required | Description | Default |
|---|---|---|---|
| add_semicolon | No | Append a trailing semicolon (default: false) | |
| indent_size | No | Spaces per indent level (default: 2) | |
| sql | Yes | The SQL string to format | |
| uppercase_keywords | No | Uppercase SQL keywords (default: false) |
TDQS
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.
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.
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.
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.
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.
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_sqlARead-onlyIdempotent
Lint SQL against all 10 GoSQLX style rules (L001–L010).
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to lint |
TDQS
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.
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.
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.
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.
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.
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_sqlARead-onlyIdempotent
Parse SQL and return an AST summary: statement count and types.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to parse |
TDQS
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.
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.
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.
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.
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.
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_scanARead-onlyIdempotent
Scan SQL for injection patterns: tautologies, UNION attacks, stacked queries, comment bypasses, and more.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL string to scan |
TDQS
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.
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.
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.
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.
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.
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_sqlARead-onlyIdempotent
Validate SQL syntax. Returns {valid: bool, error?: string, dialect?: string}.
| Name | Required | Description | Default |
|---|---|---|---|
| dialect | No | SQL dialect: generic, mysql, postgresql, sqlite, sqlserver, oracle, snowflake | |
| sql | Yes | The SQL string to validate |
TDQS
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.
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.
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.
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.
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.
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.
7 tool updates
v1.12.1- First observed
analyze_sql - First observed
extract_metadata - First observed
format_sql - First observed
lint_sql - First observed
parse_sql - First observed
security_scan - First observed
validate_sql
TDQS
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.
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.
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.
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
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
DBRE-grade SQL analysis inside any MCP client. No connection. No install. Paste a query.
- dataOAuthco.thinair
Read-only PostgreSQL, MySQL, SQL Server access via MCP — 24 dialect-aware hosted tools.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Related MCP Servers
- AlicenseAqualityAmaintenanceAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.31,374MIT
- AlicenseNot gradedqualityDmaintenanceA 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.178MIT

mcp-clickhouseofficial
AlicenseAqualityAmaintenanceClickHouse database integration with schema inspection and query capabilities3866Apache 2.0- AlicenseBqualityFmaintenanceAdded 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 conversion5248MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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