{"id":34127264,"url":"https://github.com/ajitpratap0/gosqlx","last_synced_at":"2026-03-15T23:53:50.773Z","repository":{"id":277953501,"uuid":"934030994","full_name":"ajitpratap0/GoSQLX","owner":"ajitpratap0","description":"High-performance SQL parser, formatter, linter \u0026 security scanner for Go — 1.5M+ ops/sec, multi-dialect, zero-copy, race-free","archived":false,"fork":false,"pushed_at":"2026-03-08T09:13:22.000Z","size":9721,"stargazers_count":49,"open_issues_count":4,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-08T12:35:31.096Z","etag":null,"topics":["ast","cli","dialect","go","golang","lsp","mysql","parser","postgresql","query-analyzer","security","sql","sql-formatter","sql-injection","sql-linter","sql-parser","sql-validator","sqlite","wasm","zero-copy"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/ajitpratap0/GoSQLX","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajitpratap0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY_CHECKLIST.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-17T06:47:21.000Z","updated_at":"2026-03-08T09:13:17.000Z","dependencies_parsed_at":"2025-08-22T07:14:07.267Z","dependency_job_id":"ee865c1d-e5c7-4c4e-9727-1aef9d3a1db0","html_url":"https://github.com/ajitpratap0/GoSQLX","commit_stats":null,"previous_names":["ajitpratap0/gosqlx"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/ajitpratap0/GoSQLX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajitpratap0%2FGoSQLX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajitpratap0%2FGoSQLX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajitpratap0%2FGoSQLX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajitpratap0%2FGoSQLX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajitpratap0","download_url":"https://codeload.github.com/ajitpratap0/GoSQLX/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajitpratap0%2FGoSQLX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30477250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T20:45:58.186Z","status":"ssl_error","status_checked_at":"2026-03-13T20:45:20.133Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","cli","dialect","go","golang","lsp","mysql","parser","postgresql","query-analyzer","security","sql","sql-formatter","sql-injection","sql-linter","sql-parser","sql-validator","sqlite","wasm","zero-copy"],"created_at":"2025-12-14T23:58:41.634Z","updated_at":"2026-03-13T22:03:06.170Z","avatar_url":"https://github.com/ajitpratap0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoSQLX\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/ajitpratap0/GoSQLX/main/.github/logo.png\" alt=\"GoSQLX Logo\" width=\"200\" onerror=\"this.style.display='none'\"/\u003e\n\n\u003ch3\u003e⚡ High-Performance SQL Parser for Go ⚡\u003c/h3\u003e\n\n[![Go Version](https://img.shields.io/badge/Go-1.23+-00ADD8?style=for-the-badge\u0026logo=go)](https://go.dev)\n[![Release](https://img.shields.io/github/v/release/ajitpratap0/GoSQLX?style=for-the-badge\u0026color=orange)](https://github.com/ajitpratap0/GoSQLX/releases)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge)](http://makeapullrequest.com)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-GoSQLX%20Lint-blue?style=for-the-badge\u0026logo=github)](https://github.com/marketplace/actions/gosqlx-lint-action)\n[![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/ajitpratap0.gosqlx?style=for-the-badge\u0026logo=visual-studio-code\u0026label=VS%20Code)](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx)\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/ajitpratap0/GoSQLX/test.yml?branch=main\u0026label=Tests\u0026style=flat-square)](https://github.com/ajitpratap0/GoSQLX/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ajitpratap0/GoSQLX?style=flat-square)](https://goreportcard.com/report/github.com/ajitpratap0/GoSQLX)\n[![GoDoc](https://pkg.go.dev/badge/github.com/ajitpratap0/GoSQLX?style=flat-square)](https://pkg.go.dev/github.com/ajitpratap0/GoSQLX)\n\n[![GitHub Stars](https://img.shields.io/github/stars/ajitpratap0/GoSQLX?style=social)](https://github.com/ajitpratap0/GoSQLX/stargazers)\n[![GitHub Forks](https://img.shields.io/github/forks/ajitpratap0/GoSQLX?style=social)](https://github.com/ajitpratap0/GoSQLX/network/members)\n[![GitHub Watchers](https://img.shields.io/github/watchers/ajitpratap0/GoSQLX?style=social)](https://github.com/ajitpratap0/GoSQLX/watchers)\n\n**Production-ready, high-performance SQL parsing SDK for Go**\n*Zero-copy tokenization • Object pooling • Multi-dialect engine • Query transforms • WASM playground • [Python bindings](python/README.md)*\n\n### 🚀 **New to GoSQLX? [Get Started in 5 Minutes →](docs/GETTING_STARTED.md)**\n\n[📖 Installation](#-installation) • [⚡ Quick Start](#-quick-start) • [📚 Documentation](#-documentation) • [💡 Examples](#-examples) • [📊 Benchmarks](#-performance)\n\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/blob/main/docs/GETTING_STARTED.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/🚀_Getting_Started-00ADD8?style=for-the-badge\" alt=\"Getting Started\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/blob/main/docs/USAGE_GUIDE.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/📖_User_Guide-2ea44f?style=for-the-badge\" alt=\"User Guide\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/ajitpratap0/GoSQLX\"\u003e\u003cimg src=\"https://img.shields.io/badge/📄_API_Docs-blue?style=for-the-badge\" alt=\"API Docs\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/discussions\"\u003e\u003cimg src=\"https://img.shields.io/badge/💬_Discussions-purple?style=for-the-badge\" alt=\"Discussions\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/issues/new/choose\"\u003e\u003cimg src=\"https://img.shields.io/badge/🐛_Report_Bug-red?style=for-the-badge\" alt=\"Report Bug\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n---\n\n## Overview\n\nGoSQLX is a high-performance SQL parsing library designed for production use. It provides zero-copy tokenization, intelligent object pooling, and comprehensive SQL dialect support while maintaining a simple, idiomatic Go API.\n\n### Key Features\n\n- **Blazing Fast**: ~50% faster parsing via token type overhaul; 1.25M+ ops/sec peak throughput\n- **Memory Efficient**: 60-80% reduction through intelligent object pooling\n- **Thread-Safe**: Race-free, linear scaling to 128+ cores, 0 race conditions detected\n- **Multi-Dialect Engine** (v1.8.0): First-class dialect support with `ParseWithDialect()` — PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake\n- **MySQL Syntax** (v1.8.0): SHOW, DESCRIBE, REPLACE INTO, ON DUPLICATE KEY UPDATE, GROUP_CONCAT, MATCH AGAINST, REGEXP/RLIKE\n- **Query Transform API** (v1.8.0): Programmatic SQL rewriting — add WHERE clauses, columns, JOINs, pagination via composable rules (`pkg/transform/`)\n- **WASM Playground** (v1.8.0): Browser-based SQL parsing, formatting, linting via WebAssembly\n- **Comment Preservation** (v1.8.0): SQL comments survive parse-format round-trips\n- **AST-to-SQL Roundtrip** (v1.8.0): `SQL()` methods on all AST nodes for full serialization\n- **AST-based Formatter** (v1.8.0): Configurable SQL formatter with CompactStyle/ReadableStyle presets\n- **Error Recovery** (v1.8.0): Multi-error parsing with `ParseWithRecovery()` for IDE-quality diagnostics\n- **Complete JOIN Support**: All JOIN types (INNER/LEFT/RIGHT/FULL OUTER/CROSS/NATURAL) with proper tree logic\n- **Advanced SQL Features**: CTEs with RECURSIVE support, Set Operations (UNION/EXCEPT/INTERSECT)\n- **Window Functions**: Complete SQL-99 window function support with OVER clause, PARTITION BY, ORDER BY, frame specs\n- **MERGE Statements**: Full SQL:2003 MERGE support with WHEN MATCHED/NOT MATCHED clauses\n- **Grouping Operations**: GROUPING SETS, ROLLUP, CUBE (SQL-99 T431)\n- **PostgreSQL Extensions**: LATERAL JOIN, DISTINCT ON, FILTER clause, JSON/JSONB operators, aggregate ORDER BY, `::` type casting, UPSERT, dollar-quoted strings\n- **SQL Injection Detection**: Built-in security scanner (`pkg/sql/security`) with LIKE injection, blind injection, tautology detection\n- **Unicode Support**: Complete UTF-8 support for international SQL\n- **Zero-Copy**: Direct byte slice operations, \u003c1μs latency\n- **Intelligent Errors**: Structured error codes with typo detection, context highlighting, and helpful hints\n- **Python Bindings**: [PyGoSQLX](python/README.md) — use GoSQLX from Python via ctypes FFI, 100x+ faster than pure Python parsers\n- **MCP Server** (v1.10.0): `gosqlx-mcp` exposes all 7 SQL tools as [Model Context Protocol](https://modelcontextprotocol.io) tools over streamable HTTP — integrate GoSQLX into Claude, Cursor, and any MCP-compatible AI assistant\n- **Production Ready**: Battle-tested with 0 race conditions detected, ~85% SQL-99 compliance, Apache-2.0 licensed\n\n### Performance \u0026 Quality Highlights (v1.10.0)\n\n\u003cdiv align=\"center\"\u003e\n\n| **~50%** | **1.25M+** | **\u003c1μs** | **6** | **84%+** | **74** |\n|:---------:|:-------:|:----------:|:----------:|:-------:|:---------:|\n| Faster Parsing | Peak Ops/sec | Latency | SQL Dialects | Parser Coverage | New Commits |\n\n**v1.10.0 Released** • **MCP Server** • **7 AI-Ready SQL Tools** • **Streamable HTTP** • **Bearer Auth** • **Go 1.23+**\n\n\u003c/div\u003e\n\n### What's New in v1.10.0\n\n\u003cdiv align=\"center\"\u003e\n\n| Feature | Description |\n|---------|-------------|\n| **MCP Server** | All GoSQLX SQL capabilities as [Model Context Protocol](https://modelcontextprotocol.io) tools over streamable HTTP |\n| **7 MCP Tools** | `validate_sql`, `format_sql`, `parse_sql`, `extract_metadata`, `security_scan`, `lint_sql`, `analyze_sql` |\n| **Bearer Auth** | Optional authentication via `GOSQLX_MCP_AUTH_TOKEN` environment variable |\n| **Concurrent Analysis** | `analyze_sql` fans out all 6 tools concurrently via `sync.WaitGroup` |\n| **Multi-Dialect MCP** | Validate against postgresql, mysql, sqlite, sqlserver, oracle, snowflake, or generic |\n| **Go 1.23+** | Minimum Go version bumped to 1.23.0 (required by `mark3labs/mcp-go`) |\n\nSee [CHANGELOG.md](CHANGELOG.md) for the complete release details. See [MCP_GUIDE.md](docs/MCP_GUIDE.md) for setup instructions.\n\n\u003c/div\u003e\n\n### Project Stats\n\n\u003cdiv align=\"center\"\u003e\n\n[![Contributors](https://img.shields.io/github/contributors/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/graphs/contributors)\n[![Issues](https://img.shields.io/github/issues/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/issues)\n[![Pull Requests](https://img.shields.io/github/issues-pr/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/pulls)\n[![Downloads](https://img.shields.io/github/downloads/ajitpratap0/GoSQLX/total?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/releases)\n[![Last Commit](https://img.shields.io/github/last-commit/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/commits/main)\n[![Commit Activity](https://img.shields.io/github/commit-activity/m/ajitpratap0/GoSQLX?style=flat-square)](https://github.com/ajitpratap0/GoSQLX/graphs/commit-activity)\n\n\u003c/div\u003e\n\n## Installation\n\n### Library Installation\n```bash\ngo get github.com/ajitpratap0/GoSQLX\n```\n\n### VS Code Extension\n\nInstall the [GoSQLX extension](https://marketplace.visualstudio.com/items?itemName=ajitpratap0.gosqlx) for real-time SQL validation, formatting, linting, and analysis directly in your editor:\n\n```bash\ncode --install-extension ajitpratap0.gosqlx\n```\n\nOr search **\"GoSQLX\"** in the VS Code Extensions panel. The extension bundles the `gosqlx` binary — no separate installation needed.\n\n### CLI Installation\n```bash\n# Install the CLI tool\ngo install github.com/ajitpratap0/GoSQLX/cmd/gosqlx@latest\n\n# Or build from source\ngit clone https://github.com/ajitpratap0/GoSQLX.git\ncd GoSQLX\ngo build -o gosqlx ./cmd/gosqlx\n```\n\n### Python Bindings (PyGoSQLX)\n\nUse GoSQLX from Python with native performance via ctypes FFI:\n\n```bash\n# Build the shared library (requires Go 1.21+)\ncd pkg/cbinding \u0026\u0026 ./build.sh \u0026\u0026 cd ../..\n\n# Install the Python package\ncd python \u0026\u0026 pip install .\n```\n\n```python\nimport pygosqlx\n\nresult = pygosqlx.parse(\"SELECT * FROM users WHERE active = true\")\nprint(result.statement_types)  # ['SELECT']\n\ntables = pygosqlx.extract_tables(\"SELECT * FROM users u JOIN orders o ON u.id = o.user_id\")\nprint(tables)  # ['users', 'orders']\n```\n\nSee the full [PyGoSQLX documentation](python/README.md) for the complete API.\n\n### MCP Server\n\nUse GoSQLX SQL tools from any MCP-compatible AI assistant (Claude, Cursor, etc.):\n\n```bash\ngo install github.com/ajitpratap0/GoSQLX/cmd/gosqlx-mcp@latest\ngosqlx-mcp   # starts on 127.0.0.1:8080\n```\n\nSee the full [MCP Server Guide](docs/MCP_GUIDE.md) for configuration, authentication, and AI assistant integration.\n\n**Requirements:**\n- Go 1.23 or higher\n- Python 3.8+ (for Python bindings)\n- No external dependencies for the Go library\n\n## Quick Start\n\n### CLI Usage\n\n**Inline SQL:**\n```bash\n# Validate SQL syntax\ngosqlx validate \"SELECT * FROM users WHERE active = true\"\n\n# Analyze SQL structure and complexity\ngosqlx analyze \"SELECT COUNT(*) FROM orders GROUP BY status\"\n```\n\n**File Processing:**\n```bash\n# Format SQL files with intelligent indentation\ngosqlx format -i query.sql\n\n# Parse SQL to AST representation\ngosqlx parse -f json complex_query.sql\n```\n\n**Pipeline/Stdin:**\n```bash\ncat query.sql | gosqlx format                    # Format from stdin\necho \"SELECT * FROM users\" | gosqlx validate     # Validate from pipe\ngosqlx format query.sql | gosqlx validate        # Chain commands\ncat *.sql | gosqlx format | tee formatted.sql    # Pipeline composition\n```\n\n**Pipeline/Stdin Support** (v1.6.0+):\n```bash\n# Auto-detect piped input\necho \"SELECT * FROM users\" | gosqlx validate\ncat query.sql | gosqlx format\ncat complex.sql | gosqlx analyze --security\n\n# Explicit stdin marker\ngosqlx validate -\ngosqlx format - \u003c query.sql\n\n# Input redirection\ngosqlx validate \u003c query.sql\ngosqlx parse \u003c complex_query.sql\n\n# Full pipeline chains\ncat query.sql | gosqlx format | gosqlx validate\necho \"select * from users\" | gosqlx format \u003e formatted.sql\nfind . -name \"*.sql\" -exec cat {} \\; | gosqlx validate\n\n# Works on Windows PowerShell too!\nGet-Content query.sql | gosqlx format\n\"SELECT * FROM users\" | gosqlx validate\n```\n\n**Cross-Platform Pipeline Examples:**\n```bash\n# Unix/Linux/macOS\ncat query.sql | gosqlx format | tee formatted.sql | gosqlx validate\necho \"SELECT 1\" | gosqlx validate \u0026\u0026 echo \"Valid!\"\n\n# Windows PowerShell\nGet-Content query.sql | gosqlx format | Set-Content formatted.sql\n\"SELECT * FROM users\" | gosqlx validate\n\n# Git hooks (pre-commit)\ngit diff --cached --name-only --diff-filter=ACM \"*.sql\" | \\\n  xargs cat | gosqlx validate --quiet\n```\n\n**Language Server Protocol (LSP)** (v1.6.0+):\n```bash\n# Start LSP server for IDE integration\ngosqlx lsp\n\n# With debug logging\ngosqlx lsp --log /tmp/gosqlx-lsp.log\n```\n\nThe LSP server provides real-time SQL intelligence for IDEs:\n- **Diagnostics**: Real-time syntax error detection with position info\n- **Hover**: Documentation for 60+ SQL keywords\n- **Completion**: 100+ SQL keywords, functions, and 22 snippets\n- **Formatting**: SQL code formatting via `textDocument/formatting`\n- **Document Symbols**: SQL statement outline navigation\n- **Signature Help**: Function signatures for 20+ SQL functions\n- **Code Actions**: Quick fixes (add semicolon, uppercase keywords)\n\n**Linting** (v1.6.0+):\n```bash\n# Run built-in linter rules\ngosqlx lint query.sql\n\n# With auto-fix\ngosqlx lint --fix query.sql\n\n# Specific rules\ngosqlx lint --rules L001,L002,L003 query.sql\n```\n\nAvailable rules (L001-L010):\n- `L001`: Trailing Whitespace (auto-fix)\n- `L002`: Mixed Indentation (auto-fix)\n- `L003`: Consecutive Blank Lines (auto-fix)\n- `L004`: Indentation Depth\n- `L005`: Line Length\n- `L006`: Column Alignment\n- `L007`: Keyword Case (auto-fix)\n- `L008`: Comma Placement\n- `L009`: Aliasing Consistency\n- `L010`: Redundant Whitespace (auto-fix)\n\n**IDE Integration:**\n```jsonc\n// VSCode settings.json\n{\n  \"gosqlx.lsp.enable\": true,\n  \"gosqlx.lsp.path\": \"gosqlx\"\n}\n```\n\n```lua\n-- Neovim (nvim-lspconfig)\nrequire('lspconfig.configs').gosqlx = {\n  default_config = {\n    cmd = { 'gosqlx', 'lsp' },\n    filetypes = { 'sql' },\n    root_dir = function() return vim.fn.getcwd() end,\n  },\n}\nrequire('lspconfig').gosqlx.setup{}\n```\n\n### Library Usage - Simple API\n\nGoSQLX provides a simple, high-level API that handles all complexity for you:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/ajitpratap0/GoSQLX/pkg/gosqlx\"\n)\n\nfunc main() {\n    // Parse SQL in one line - that's it!\n    ast, err := gosqlx.Parse(\"SELECT * FROM users WHERE active = true\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    fmt.Printf(\"Successfully parsed %d statement(s)\\n\", len(ast.Statements))\n}\n```\n\n**That's it!** Just 3 lines of code. No pool management, no manual cleanup - everything is handled for you.\n\n### More Examples\n\n```go\n// Validate SQL without parsing\nif err := gosqlx.Validate(\"SELECT * FROM users\"); err != nil {\n    fmt.Println(\"Invalid SQL:\", err)\n}\n\n// Parse multiple queries efficiently\nqueries := []string{\n    \"SELECT * FROM users\",\n    \"SELECT * FROM orders\",\n}\nasts, err := gosqlx.ParseMultiple(queries)\n\n// Parse with timeout for long queries\nast, err := gosqlx.ParseWithTimeout(sql, 5*time.Second)\n\n// Parse from byte slice (zero-copy)\nast, err := gosqlx.ParseBytes([]byte(\"SELECT * FROM users\"))\n```\n\n### Advanced Usage - Low-Level API\n\nFor performance-critical code that needs fine-grained control, use the low-level API:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/ajitpratap0/GoSQLX/pkg/sql/tokenizer\"\n    \"github.com/ajitpratap0/GoSQLX/pkg/sql/parser\"\n)\n\nfunc main() {\n    // Get tokenizer from pool (always return it!)\n    tkz := tokenizer.GetTokenizer()\n    defer tokenizer.PutTokenizer(tkz)\n\n    // Tokenize SQL\n    sql := \"SELECT id, name FROM users WHERE age \u003e 18\"\n    tokens, err := tkz.Tokenize([]byte(sql))\n    if err != nil {\n        panic(err)\n    }\n\n    // Convert tokens\n    converter := parser.NewTokenConverter()\n    result, err := converter.Convert(tokens)\n    if err != nil {\n        panic(err)\n    }\n\n    // Parse to AST\n    p := parser.NewParser()\n    defer p.Release()\n\n    ast, err := p.Parse(result.Tokens)\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"Parsed %d statement(s)\\n\", len(ast.Statements))\n    fmt.Printf(\"Statement type: %T\\n\", ast.Statements[0])\n}\n```\n\n\u003e **Note:** The simple API has \u003c 1% performance overhead compared to low-level API. Use the simple API unless you need fine-grained control.\n\n## Documentation\n\n### Comprehensive Guides\n\n| Guide | Description |\n|-------|-------------|\n| [**Getting Started**](docs/GETTING_STARTED.md) | Get started in 5 minutes |\n| [**Comparison Guide**](docs/COMPARISON.md) | GoSQLX vs SQLFluff, JSQLParser, pg_query |\n| [**CLI Guide**](docs/CLI_GUIDE.md) | Complete CLI documentation and usage examples |\n| [**API Reference**](docs/API_REFERENCE.md) | Complete API documentation with examples |\n| [**Usage Guide**](docs/USAGE_GUIDE.md) | Detailed patterns and best practices |\n| [**Architecture**](docs/ARCHITECTURE.md) | System design and internal architecture |\n| [**Python Bindings**](python/README.md) | PyGoSQLX — Python API, installation, and examples |\n| [**MCP Server Guide**](docs/MCP_GUIDE.md) | `gosqlx-mcp` — 7 SQL tools for AI assistant integration |\n| [**Troubleshooting**](docs/TROUBLESHOOTING.md) | Common issues and solutions |\n\n### Getting Started\n\n| Document | Purpose |\n|----------|---------|\n| [**Production Guide**](docs/PRODUCTION_GUIDE.md) | Deployment and monitoring |\n| [**SQL Compatibility**](docs/SQL_COMPATIBILITY.md) | Dialect support matrix |\n| [**Migration Guide**](docs/MIGRATION.md) | v1.7.0 → v1.8.0 breaking changes |\n| [**Security Analysis**](docs/SECURITY.md) | Security assessment |\n| [**LSP Guide**](docs/LSP_GUIDE.md) | LSP server and IDE integration |\n| [**Linting Rules**](docs/LINTING_RULES.md) | All 10 linting rules reference |\n| [**Error Codes**](docs/ERROR_CODES.md) | Error code reference (E1001-E3004) |\n| [**Upgrade Guide**](docs/UPGRADE_GUIDE.md) | Version upgrade instructions |\n| [**Examples**](examples/) | Working code examples (including transform API) |\n\n### Quick Links\n\n- [Installation \u0026 Setup](docs/USAGE_GUIDE.md#getting-started)\n- [Basic Usage](docs/USAGE_GUIDE.md#basic-usage)\n- [Advanced Patterns](docs/USAGE_GUIDE.md#advanced-patterns)\n- [Performance Tuning](docs/PRODUCTION_GUIDE.md#performance-optimization)\n- [Error Handling](docs/TROUBLESHOOTING.md#error-messages)\n- [FAQ](docs/TROUBLESHOOTING.md#faq)\n\n### Advanced SQL Features\n\nGoSQLX supports Common Table Expressions (CTEs) and Set Operations alongside complete JOIN support:\n\n#### Common Table Expressions (CTEs)\n\n```go\n// Simple CTE\nsql := `\n    WITH sales_summary AS (\n        SELECT region, SUM(amount) as total \n        FROM sales \n        GROUP BY region\n    ) \n    SELECT region FROM sales_summary WHERE total \u003e 1000\n`\n\n// Recursive CTE for hierarchical data\nsql := `\n    WITH RECURSIVE employee_tree AS (\n        SELECT employee_id, manager_id, name \n        FROM employees \n        WHERE manager_id IS NULL\n        UNION ALL\n        SELECT e.employee_id, e.manager_id, e.name \n        FROM employees e \n        JOIN employee_tree et ON e.manager_id = et.employee_id\n    ) \n    SELECT * FROM employee_tree\n`\n\n// Multiple CTEs in single query\nsql := `\n    WITH regional AS (SELECT region, total FROM sales),\n         summary AS (SELECT region FROM regional WHERE total \u003e 1000)\n    SELECT * FROM summary\n`\n```\n\n#### Set Operations\n\n```go\n// UNION - combine results with deduplication\nsql := \"SELECT name FROM users UNION SELECT name FROM customers\"\n\n// UNION ALL - combine results preserving duplicates\nsql := \"SELECT id FROM orders UNION ALL SELECT id FROM invoices\"\n\n// EXCEPT - set difference\nsql := \"SELECT product FROM inventory EXCEPT SELECT product FROM discontinued\"\n\n// INTERSECT - set intersection\nsql := \"SELECT customer_id FROM orders INTERSECT SELECT customer_id FROM payments\"\n\n// Left-associative parsing for multiple operations\nsql := \"SELECT a FROM t1 UNION SELECT b FROM t2 INTERSECT SELECT c FROM t3\"\n// Parsed as: (SELECT a FROM t1 UNION SELECT b FROM t2) INTERSECT SELECT c FROM t3\n```\n\n#### Complete JOIN Support\n\nGoSQLX supports all JOIN types with proper left-associative tree logic:\n\n```go\n// Complex JOIN query with multiple table relationships\nsql := `\n    SELECT u.name, o.order_date, p.product_name, c.category_name\n    FROM users u\n    LEFT JOIN orders o ON u.id = o.user_id  \n    INNER JOIN products p ON o.product_id = p.id\n    RIGHT JOIN categories c ON p.category_id = c.id\n    WHERE u.active = true\n    ORDER BY o.order_date DESC\n`\n\n// Parse with the simple API (recommended)\ntree, err := gosqlx.Parse(sql)\nif err != nil {\n    panic(err)\n}\n\n// Access JOIN information\nif selectStmt, ok := tree.Statements[0].(*ast.SelectStatement); ok {\n    fmt.Printf(\"Found %d JOINs:\\n\", len(selectStmt.Joins))\n    for i, join := range selectStmt.Joins {\n        fmt.Printf(\"JOIN %d: %s (left: %s, right: %s)\\n\",\n            i+1, join.Type, join.Left.Name, join.Right.Name)\n    }\n}\n```\n\n**Supported JOIN Types:**\n\n- ✅ `INNER JOIN` - Standard inner joins\n- ✅ `LEFT JOIN` / `LEFT OUTER JOIN` - Left outer joins\n- ✅ `RIGHT JOIN` / `RIGHT OUTER JOIN` - Right outer joins\n- ✅ `FULL JOIN` / `FULL OUTER JOIN` - Full outer joins\n- ✅ `CROSS JOIN` - Cartesian product joins\n- ✅ `NATURAL JOIN` - Natural joins (implicit ON clause)\n- ✅ `USING (column)` - Single-column using clause\n\n### Advanced SQL Features (v1.4+)\n\n#### MERGE Statements (SQL:2003 F312)\n\n```go\nsql := `\n    MERGE INTO target_table t\n    USING source_table s ON t.id = s.id\n    WHEN MATCHED THEN\n        UPDATE SET t.name = s.name, t.value = s.value\n    WHEN NOT MATCHED THEN\n        INSERT (id, name, value) VALUES (s.id, s.name, s.value)\n`\nast, err := gosqlx.Parse(sql)\n```\n\n#### GROUPING SETS, ROLLUP, CUBE (SQL-99 T431)\n\n```go\n// GROUPING SETS - explicit grouping combinations\nsql := `SELECT region, product, SUM(sales)\n        FROM orders\n        GROUP BY GROUPING SETS ((region), (product), (region, product), ())`\n\n// ROLLUP - hierarchical subtotals\nsql := `SELECT year, quarter, month, SUM(revenue)\n        FROM sales\n        GROUP BY ROLLUP (year, quarter, month)`\n\n// CUBE - all possible combinations\nsql := `SELECT region, product, SUM(amount)\n        FROM sales\n        GROUP BY CUBE (region, product)`\n```\n\n#### Materialized Views\n\n```go\n// Create materialized view\nsql := `CREATE MATERIALIZED VIEW sales_summary AS\n        SELECT region, SUM(amount) as total\n        FROM sales GROUP BY region`\n\n// Refresh materialized view\nsql := `REFRESH MATERIALIZED VIEW CONCURRENTLY sales_summary`\n\n// Drop materialized view\nsql := `DROP MATERIALIZED VIEW IF EXISTS sales_summary`\n```\n\n#### SQL Injection Detection\n\n```go\nimport \"github.com/ajitpratap0/GoSQLX/pkg/sql/security\"\n\n// Create scanner\nscanner := security.NewScanner()\n\n// Scan for injection patterns\nresult := scanner.Scan(ast)\n\nif result.HasCritical() {\n    fmt.Printf(\"Found %d critical issues!\\n\", result.CriticalCount)\n    for _, finding := range result.Findings {\n        fmt.Printf(\"  [%s] %s: %s\\n\",\n            finding.Severity, finding.Pattern, finding.Description)\n    }\n}\n\n// Detected patterns include:\n// - Tautology (1=1, 'a'='a')\n// - UNION-based injection\n// - Time-based blind (SLEEP, WAITFOR DELAY)\n// - Comment bypass (--, /**/)\n// - Stacked queries\n// - Dangerous functions (xp_cmdshell, LOAD_FILE)\n```\n\n#### Expression Operators (BETWEEN, IN, LIKE, IS NULL)\n\n```go\n// BETWEEN with expressions\nsql := `SELECT * FROM orders WHERE amount BETWEEN 100 AND 500`\n\n// IN with subquery\nsql := `SELECT * FROM users WHERE id IN (SELECT user_id FROM admins)`\n\n// LIKE with pattern matching\nsql := `SELECT * FROM products WHERE name LIKE '%widget%'`\n\n// IS NULL / IS NOT NULL\nsql := `SELECT * FROM users WHERE deleted_at IS NULL`\n\n// NULLS FIRST/LAST ordering (SQL-99 F851)\nsql := `SELECT * FROM users ORDER BY last_login DESC NULLS LAST`\n```\n\n#### PostgreSQL-Specific Features (v1.6+)\n\n**LATERAL JOIN** - Correlated subqueries in FROM clause:\n\n```go\n// LATERAL allows referencing columns from preceding tables\nsql := `\n    SELECT u.name, recent_orders.order_date, recent_orders.total\n    FROM users u\n    LEFT JOIN LATERAL (\n        SELECT order_date, total\n        FROM orders\n        WHERE user_id = u.id\n        ORDER BY order_date DESC\n        LIMIT 1\n    ) AS recent_orders ON true\n`\nast, err := gosqlx.Parse(sql)\n```\n\n**ORDER BY inside Aggregates** - Ordered set functions:\n\n```go\n// STRING_AGG with ORDER BY\nsql := `SELECT STRING_AGG(name, ', ' ORDER BY name DESC NULLS LAST) FROM users`\n\n// ARRAY_AGG with ORDER BY\nsql := `SELECT ARRAY_AGG(value ORDER BY created_at, priority DESC) FROM items`\n\n// JSON_AGG with ORDER BY\nsql := `SELECT JSON_AGG(employee_data ORDER BY hire_date) FROM employees`\n\n// Multiple aggregates with different orderings\nsql := `\n    SELECT\n        department,\n        STRING_AGG(name, '; ' ORDER BY name ASC NULLS FIRST) AS employee_names,\n        ARRAY_AGG(salary ORDER BY salary DESC) AS salaries\n    FROM employees\n    GROUP BY department\n`\nast, err := gosqlx.Parse(sql)\n```\n\n**JSON/JSONB Operators** - PostgreSQL JSON support:\n\n```go\n// Arrow operators for field access\nsql := `SELECT data -\u003e 'user' -\u003e 'profile' -\u003e\u003e 'email' FROM users`\n\n// Path operators for nested access\nsql := `SELECT data #\u003e '{address,city}', data #\u003e\u003e '{address,zipcode}' FROM users`\n\n// Containment operators\nsql := `SELECT * FROM users WHERE data @\u003e '{\"active\": true}'`\nsql := `SELECT * FROM users WHERE '{\"admin\": true}' \u003c@ data`\n\n// Combined JSON operators in complex queries\nsql := `\n    SELECT\n        u.id,\n        u.data -\u003e\u003e 'name' AS user_name,\n        u.data -\u003e 'settings' -\u003e\u003e 'theme' AS theme\n    FROM users u\n    WHERE u.data @\u003e '{\"verified\": true}'\n    AND u.data -\u003e\u003e 'status' = 'active'\n`\nast, err := gosqlx.Parse(sql)\n```\n\n**DISTINCT ON** - PostgreSQL unique row selection:\n\n```go\n// Select first row per group based on ordering\nsql := `\n    SELECT DISTINCT ON (user_id) user_id, created_at, status\n    FROM orders\n    ORDER BY user_id, created_at DESC\n`\nast, err := gosqlx.Parse(sql)\n```\n\n**FILTER Clause** - Conditional aggregation:\n\n```go\n// COUNT with FILTER\nsql := `\n    SELECT\n        COUNT(*) AS total_orders,\n        COUNT(*) FILTER (WHERE status = 'completed') AS completed_orders,\n        SUM(amount) FILTER (WHERE region = 'US') AS us_revenue\n    FROM orders\n`\nast, err := gosqlx.Parse(sql)\n```\n\n## Examples\n\n### Multi-Dialect Support (v1.8.0)\n\n```go\nimport \"github.com/ajitpratap0/GoSQLX/pkg/sql/parser\"\n\n// Parse with explicit dialect\nast, err := parser.ParseWithDialect(\"SHOW TABLES\", \"mysql\")\n\n// MySQL-specific syntax\nast, err = parser.ParseWithDialect(`\n    INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')\n    ON DUPLICATE KEY UPDATE email = VALUES(email)\n`, \"mysql\")\n\n// PostgreSQL (default)\nast, err = parser.ParseWithDialect(`\n    SELECT * FROM users WHERE tags @\u003e ARRAY['admin']\n`, \"postgresql\")\n\n// CLI with dialect flag\n// gosqlx validate --dialect mysql \"SHOW TABLES\"\n```\n\n### Query Transform API (v1.8.0)\n\n```go\nimport \"github.com/ajitpratap0/GoSQLX/pkg/transform\"\n\n// Parse SQL, add multi-tenant WHERE filter\nstmt, _ := transform.ParseSQL(\"SELECT * FROM orders\")\ntransform.AddWhere(stmt, \"tenant_id = 42\")\nsql := transform.FormatSQL(stmt) // SELECT * FROM orders WHERE tenant_id = 42\n\n// Composable rules\ntransform.Apply(stmt,\n    transform.AddWhereRule(\"active = true\"),\n    transform.SetLimitRule(100),\n    transform.AddOrderByRule(\"created_at\", \"DESC\"),\n)\n```\n\n### Unicode and International SQL\n\n```go\n// Japanese\nsql := `SELECT \"名前\", \"年齢\" FROM \"ユーザー\"`\n\n// Russian\nsql := `SELECT \"имя\", \"возраст\" FROM \"пользователи\"`\n\n// Arabic\nsql := `SELECT \"الاسم\", \"العمر\" FROM \"المستخدمون\"`\n\n// Emoji support\nsql := `SELECT * FROM users WHERE status = '🚀'`\n```\n\n### Concurrent Processing\n\n```go\nfunc ProcessConcurrently(queries []string) {\n    var wg sync.WaitGroup\n    \n    for _, sql := range queries {\n        wg.Add(1)\n        go func(query string) {\n            defer wg.Done()\n            \n            // Each goroutine gets its own tokenizer\n            tkz := tokenizer.GetTokenizer()\n            defer tokenizer.PutTokenizer(tkz)\n            \n            tokens, _ := tkz.Tokenize([]byte(query))\n            // Process tokens...\n        }(sql)\n    }\n    \n    wg.Wait()\n}\n```\n\n## Performance\n\n### v1.0.0 Performance Improvements\n\n| Metric | Previous | **v1.0.0** | Improvement |\n|--------|----------|------------|-------------|\n| **Sustained Throughput** | 2.2M ops/s | **946K+ ops/s** | **Production Grade** ✅ |\n| **Peak Throughput** | 2.2M ops/s | **1.25M+ ops/s** | **Enhanced** ✅ |\n| **Token Processing** | 8M tokens/s | **8M+ tokens/s** | **Maintained** ✅ |\n| **Simple Query Latency** | 200ns | **\u003c280ns** | **Optimized** ✅ |\n| **Complex Query Latency** | N/A | **\u003c1μs (CTE/Set Ops)** | **New Capability** ✅ |\n| **Memory Usage** | Baseline | **60-80% reduction** | **-70%** ✅ |\n| **SQL-92 Compliance** | 40% | **~70%** | **+75%** ✅ |\n\n### Latest Benchmark Results\n\n```\nBenchmarkParserSustainedLoad-16           946,583      1,057 ns/op     1,847 B/op      23 allocs/op\nBenchmarkParserThroughput-16            1,252,833        798 ns/op     1,452 B/op      18 allocs/op\nBenchmarkParserSimpleSelect-16          3,571,428        279 ns/op       536 B/op       9 allocs/op\nBenchmarkParserComplexSelect-16           985,221      1,014 ns/op     2,184 B/op      31 allocs/op\n\nBenchmarkCTE/SimpleCTE-16                 524,933      1,891 ns/op     3,847 B/op      52 allocs/op\nBenchmarkCTE/RecursiveCTE-16              387,654      2,735 ns/op     5,293 B/op      71 allocs/op\nBenchmarkSetOperations/UNION-16           445,782      2,234 ns/op     4,156 B/op      58 allocs/op\n\nBenchmarkTokensPerSecond-16               815,439      1,378 ns/op   8,847,625 tokens/sec\n```\n\n### Performance Characteristics\n\n| Metric | Value | Details |\n|--------|-------|---------|\n| **Sustained Throughput** | **946K+ ops/sec** | 30s load testing |\n| **Peak Throughput** | **1.25M+ ops/sec** | Concurrent goroutines |\n| **Token Rate** | **8M+ tokens/sec** | Sustained processing |\n| **Simple Query Latency** | **\u003c280ns** | Basic SELECT (p50) |\n| **Complex Query Latency** | **\u003c1μs** | CTEs/Set Operations |\n| **Memory** | **1.8KB/query** | Complex SQL with pooling |\n| **Scaling** | **Linear to 128+** | Perfect concurrency |\n| **Pool Efficiency** | **95%+ hit rate** | Effective reuse |\n\nRun `go test -bench=. -benchmem ./pkg/...` for detailed performance analysis.\n\n## Testing\n\n```bash\n# Run all tests with race detection\ngo test -race ./...\n\n# Run benchmarks\ngo test -bench=. -benchmem ./...\n\n# Generate coverage report\ngo test -coverprofile=coverage.out ./...\ngo tool cover -html=coverage.out\n\n# Run specific test suites\ngo test -v ./pkg/sql/tokenizer/\ngo test -v ./pkg/sql/parser/\n```\n\n## Project Structure\n\n```\nGoSQLX/\n├── cmd/gosqlx/              # CLI tool (validate, format, parse, analyze, lint, lsp, optimize, action)\n│   ├── cmd/                 # Core CLI commands\n│   └── internal/            # Extracted sub-packages (lspcmd, actioncmd, optimizecmd, cmdutil)\n├── pkg/\n│   ├── models/              # Core data structures (tokens, spans, locations)\n│   ├── errors/              # Structured error handling with position tracking\n│   ├── config/              # Configuration management (YAML/JSON/env)\n│   ├── metrics/             # Performance monitoring and observability\n│   ├── gosqlx/              # High-level simple API (recommended entry point)\n│   ├── cbinding/            # C shared library bindings (for Python/FFI)\n│   ├── linter/              # SQL linting engine with 10 rules (L001-L010)\n│   ├── lsp/                 # Language Server Protocol server for IDEs\n│   ├── transform/           # Query rewriting/transform API (v1.8.0)\n│   ├── formatter/           # Public SQL formatter package (v1.8.0)\n│   ├── advisor/             # Query optimization advisor with 12 rules\n│   ├── schema/              # Schema-aware validation\n│   ├── compatibility/       # API stability testing\n│   └── sql/\n│       ├── tokenizer/       # Zero-copy lexical analysis with dialect support\n│       ├── parser/          # Recursive descent parser with dialect modes\n│       ├── ast/             # Abstract syntax tree with SQL() serialization\n│       ├── token/           # Token type definitions (int-based, v1.8.0)\n│       ├── keywords/        # Multi-dialect SQL keyword definitions\n│       ├── security/        # SQL injection detection with fuzz testing\n│       └── monitor/         # SQL monitoring utilities\n├── wasm/                    # WebAssembly build + browser playground (v1.8.0)\n├── python/                  # PyGoSQLX - Python bindings via ctypes FFI\n├── examples/                # Usage examples (including transform examples)\n├── docs/                    # Comprehensive documentation (20+ guides)\n└── vscode-extension/        # Official VSCode extension\n```\n\n## Development\n\n### Prerequisites\n\n- Go 1.21+\n- [Task](https://taskfile.dev) - task runner (install: `go install github.com/go-task/task/v3/cmd/task@latest`)\n- golangci-lint, staticcheck (for code quality, install: `task deps:tools`)\n\n### Task Runner\n\nThis project uses [Task](https://taskfile.dev) as the task runner. Install with:\n```bash\ngo install github.com/go-task/task/v3/cmd/task@latest\n# Or: brew install go-task (macOS)\n```\n\n### Building\n\n```bash\n# Show all available tasks\ntask\n\n# Build the project\ntask build\n\n# Build the CLI binary\ntask build:cli\n\n# Install CLI globally\ntask install\n\n# Run all quality checks\ntask quality\n\n# Run all tests\ntask test\n\n# Run tests with race detection (recommended)\ntask test:race\n\n# Clean build artifacts\ntask clean\n```\n\n### Code Quality\n\n```bash\n# Format code\ntask fmt\n\n# Run go vet\ntask vet\n\n# Run golangci-lint\ntask lint\n\n# Run all quality checks (fmt, vet, lint)\ntask quality\n\n# Full CI check (format, vet, lint, test:race)\ntask check\n```\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### How to Contribute\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Development Guidelines\n\n- Write tests for new features\n- Ensure all tests pass with race detection\n- Follow Go idioms and best practices\n- Update documentation for API changes\n- Add benchmarks for performance-critical code\n\n## Roadmap\n\n\u003cdiv align=\"center\"\u003e\n\n| Phase | Version | Status | Highlights |\n|-------|---------|--------|------------|\n| **Phase 1** | v1.1.0 | ✅ Complete | JOIN Support |\n| **Phase 2** | v1.2.0 | ✅ Complete | CTEs \u0026 Set Operations |\n| **Phase 2.5** | v1.3.0-v1.4.0 | ✅ Complete | Window Functions, MERGE, Grouping Sets |\n| **Phase 3** | v1.5.0-v1.6.0 | ✅ Complete | PostgreSQL Extensions, LSP, Linter |\n| **Phase 4** | v1.7.0 | ✅ Complete | Parser Enhancements, Schema-Qualified Names |\n| **Phase 5** | v1.8.0 | ✅ Complete | Dialect Engine, MySQL, Query Transforms, WASM, Token Overhaul |\n| **Phase 6** | v2.0.0 | 📋 Planned | Advanced Optimizations \u0026 Schema Intelligence |\n\n\u003c/div\u003e\n\n### Phase 5: Dialect Engine, Query Transforms \u0026 Tooling - v1.8.0 ✅\n- ✅ **Dialect Mode Engine** - `ParseWithDialect()`, `--dialect` CLI flag, 6 dialects\n- ✅ **MySQL Syntax** - SHOW, DESCRIBE, REPLACE INTO, ON DUPLICATE KEY UPDATE, GROUP_CONCAT, MATCH AGAINST, REGEXP\n- ✅ **Query Transform API** - `pkg/transform/` with WHERE, columns, JOINs, tables, LIMIT/OFFSET, ORDER BY manipulation\n- ✅ **WASM Playground** - Browser-based SQL parsing, formatting, linting via WebAssembly\n- ✅ **Comment Preservation** - SQL comments survive parse-format round-trips\n- ✅ **AST-to-SQL Serialization** - `SQL()` methods on all AST nodes with roundtrip support\n- ✅ **AST-based Formatter** - CompactStyle/ReadableStyle presets with keyword casing options\n- ✅ **DDL Formatters** - Format() for ALTER TABLE, CREATE INDEX/VIEW, DROP, TRUNCATE\n- ✅ **Error Recovery** - `ParseWithRecovery()` for multi-error IDE diagnostics\n- ✅ **Dollar-Quoted Strings** - PostgreSQL `$$body$$` tokenizer support\n- ✅ **Token Type Overhaul** - ~50% faster parsing via O(1) integer token comparison\n- ✅ **Query Advisor** - 12 optimization rules (OPT-001 through OPT-012)\n- ✅ **Schema Validation** - NOT NULL, type compatibility, foreign key validation\n- ✅ **Snowflake Dialect** - Keyword detection and support\n- ✅ **Apache-2.0 License** - Relicensed from AGPL\n\n### Phase 4: Parser Enhancements \u0026 PostgreSQL Extensions - v1.7.0 ✅\n- ✅ **Schema-Qualified Names** - `schema.table` and `db.schema.table` across all DML/DDL\n- ✅ **PostgreSQL Type Casting** - `::` operator for type casts\n- ✅ **UPSERT** - `INSERT ... ON CONFLICT DO UPDATE/NOTHING`\n- ✅ **ARRAY Constructors** - `ARRAY[1, 2, 3]` with subscript/slice operations\n- ✅ **Regex Operators** - `~`, `~*`, `!~`, `!~*` for pattern matching\n- ✅ **INTERVAL Expressions** - Temporal literals\n- ✅ **FOR UPDATE/SHARE** - Row-level locking clauses\n- ✅ **Positional Parameters** - `$1`, `$2` style placeholders\n- ✅ **Python Bindings** - [PyGoSQLX](python/README.md) with ctypes FFI, thread-safe, memory-safe\n\n### Phase 6: Advanced Optimizations \u0026 Schema Intelligence - v2.0.0 📋\n- 📋 **Advanced Query Cost Estimation** - Extended complexity analysis\n- 📋 **Schema Diff** - Compare and generate migration scripts\n- 📋 **Entity-Relationship Extraction** - Generate ER diagrams from DDL\n- 📋 **Stored Procedures** - CREATE PROCEDURE/FUNCTION parsing\n- 📋 **PL/pgSQL** - PostgreSQL procedural language\n- 📋 **T-SQL Extensions** - PIVOT/UNPIVOT, CROSS/OUTER APPLY parsing\n\nSee [ARCHITECTURE.md](docs/ARCHITECTURE.md) for detailed system design and [CHANGELOG.md](CHANGELOG.md) for version history\n\n## Community \u0026 Support\n\n\u003cdiv align=\"center\"\u003e\n\n### Community Health\n\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=flat-square)](CODE_OF_CONDUCT.md)\n[![Contributing Guide](https://img.shields.io/badge/Contributing-Guide-brightgreen?style=flat-square)](CONTRIBUTING.md)\n[![Governance](https://img.shields.io/badge/Governance-Model-blue?style=flat-square)](GOVERNANCE.md)\n[![Support](https://img.shields.io/badge/Support-Channels-orange?style=flat-square)](SUPPORT.md)\n[![Good First Issues](https://img.shields.io/github/issues/ajitpratap0/GoSQLX/good%20first%20issue?style=flat-square\u0026label=Good%20First%20Issues\u0026color=7057ff)](https://github.com/ajitpratap0/GoSQLX/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)\n\n### Join Our Community\n\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/discussions\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitHub-Discussions-181717?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"GitHub Discussions\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/issues\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitHub-Issues-181717?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"GitHub Issues\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/discussions/new?category=q-a\"\u003e\u003cimg src=\"https://img.shields.io/badge/Ask%20a-Question-purple?style=for-the-badge\u0026logo=github\" alt=\"Ask a Question\"\u003e\u003c/a\u003e\n\n### Get Help\n\n| Channel | Purpose | Response Time |\n|---------|---------|---------------|\n| [🐛 Bug Reports](https://github.com/ajitpratap0/GoSQLX/issues/new?template=bug_report.md) | Report issues | Community-driven |\n| [💡 Feature Requests](https://github.com/ajitpratap0/GoSQLX/issues/new?template=feature_request.md) | Suggest improvements | Community-driven |\n| [📖 Docs Issues](https://github.com/ajitpratap0/GoSQLX/issues/new?template=documentation.md) | Fix docs | Community-driven |\n| [💬 Q\u0026A](https://github.com/ajitpratap0/GoSQLX/discussions/new?category=q-a) | Questions \u0026 help | Community-driven |\n| [💡 Ideas](https://github.com/ajitpratap0/GoSQLX/discussions/new?category=ideas) | Propose features | Community-driven |\n| [🎤 Show \u0026 Tell](https://github.com/ajitpratap0/GoSQLX/discussions/new?category=show-and-tell) | Share your project | Community-driven |\n| [🔒 Security](https://github.com/ajitpratap0/GoSQLX/security/advisories/new) | Report vulnerabilities privately | Best effort |\n\n\u003c/div\u003e\n\n## Contributors\n\n\u003cdiv align=\"center\"\u003e\n\n### Core Team\n\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=ajitpratap0/GoSQLX\u0026max=100\u0026columns=10\" alt=\"Contributors\" /\u003e\n\u003c/a\u003e\n\n### How to Contribute\n\nWe love your input! We want to make contributing as easy and transparent as possible.\n\n\u003ca href=\"CONTRIBUTING.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/📝_Contributing_Guide-blue?style=for-the-badge\" alt=\"Contributing Guide\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/issues?q=is%3Aopen+label%3A%22good+first+issue%22\"\u003e\u003cimg src=\"https://img.shields.io/badge/🟣_Good_First_Issues-7057ff?style=for-the-badge\" alt=\"Good First Issues\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/issues?q=is%3Aopen+label%3A%22help+wanted%22\"\u003e\u003cimg src=\"https://img.shields.io/badge/🙏_Help_Wanted-008672?style=for-the-badge\" alt=\"Help Wanted\"\u003e\u003c/a\u003e\n\n#### Quick Contribution Guide\n\n1. 🍴 Fork the repo and create a feature branch\n2. 🔨 Make your changes following the [patterns in CLAUDE.md](CLAUDE.md)\n3. ✅ Ensure tests pass with race detection (`go test -race ./...`)\n4. 📝 Update CHANGELOG.md and relevant docs\n5. 🚀 Submit a PR — CI runs automatically\n\n\u003c/div\u003e\n\n## Use Cases\n\n\u003cdiv align=\"center\"\u003e\n\n| Industry | Use Case | Benefits |\n|----------|----------|----------|\n| **🏦 FinTech** | SQL validation \u0026 auditing | Fast validation, compliance tracking |\n| **📊 Analytics** | Query parsing \u0026 optimization | Real-time analysis, performance insights |\n| **🛡️ Security** | SQL injection detection | Pattern matching, threat prevention |\n| **🏗️ DevTools** | IDE integration \u0026 linting | Syntax highlighting, auto-completion |\n| **📚 Education** | SQL learning platforms | Interactive parsing, error explanation |\n| **🔄 Migration** | Cross-database migration | Dialect conversion, compatibility check |\n| **🐍 Python** | SQL parsing in Python apps | Native speed via FFI, 100x+ faster than pure Python |\n\n\u003c/div\u003e\n\n## Who's Using GoSQLX\n\n\u003cdiv align=\"center\"\u003e\n\n*Using GoSQLX in production? [Let us know!](https://github.com/ajitpratap0/GoSQLX/issues/new?title=Add%20our%20company%20to%20users)*\n\n\u003c/div\u003e\n\n\n## Project Metrics\n\n\u003cdiv align=\"center\"\u003e\n\n\n### Performance Benchmarks\n\n```mermaid\ngraph LR\n    A[SQL Input] --\u003e|946K+ ops/sec| B[Tokenizer]\n    B --\u003e|8M+ tokens/sec| C[Parser]\n    C --\u003e|Zero-copy| D[AST]\n    D --\u003e|60-80% less memory| E[Output]\n```\n\n\u003c/div\u003e\n\n## Support This Project\n\n\u003cdiv align=\"center\"\u003e\n\nIf GoSQLX helps your project, please consider:\n\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX\"\u003e\u003cimg src=\"https://img.shields.io/badge/⭐_Star_This_Repo-yellow?style=for-the-badge\" alt=\"Star This Repo\"\u003e\u003c/a\u003e\n\n### Other Ways to Support\n\n- ⭐ Star this repository\n- 🐦 Tweet about GoSQLX\n- 📝 Write a blog post\n- 🎥 Create a tutorial\n- 🐛 Report bugs\n- 💡 Suggest features\n- 🔧 Submit PRs\n\n\u003c/div\u003e\n\n## License\n\n\u003cdiv align=\"center\"\u003e\n\nThis project is licensed under the **Apache License 2.0** - see the [LICENSE](LICENSE) file for details.\n\n\u003c/div\u003e\n\n---\n\n\u003ch3\u003eBuilt with ❤️ by the GoSQLX Team\u003c/h3\u003e\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX\"\u003e\u003cimg src=\"https://img.shields.io/badge/⭐_Star_Us-yellow?style=for-the-badge\" alt=\"Star Us\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/fork\"\u003e\u003cimg src=\"https://img.shields.io/badge/🍴_Fork_Me-blue?style=for-the-badge\" alt=\"Fork Me\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ajitpratap0/GoSQLX/watchers\"\u003e\u003cimg src=\"https://img.shields.io/badge/👁️_Watch-green?style=for-the-badge\" alt=\"Watch\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003csub\u003eCopyright © 2024-2026 GoSQLX. All rights reserved.\u003c/sub\u003e\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajitpratap0%2Fgosqlx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajitpratap0%2Fgosqlx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajitpratap0%2Fgosqlx/lists"}