Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.14.0] - 2026-04-12
## [1.14.0] - 2026-04-12 — Dialect-Aware Transforms, Snowflake 100%, Schema Introspection

Headline themes: dialect-aware transforms, Snowflake at 100% of the QA corpus, ClickHouse significantly expanded (83% of the QA corpus, up from 53%), live schema introspection, SQL transpilation, and first-class integration sub-modules (OpenTelemetry and GORM). Drop-in upgrade from v1.13.0 — no breaking changes.

Expand Down Expand Up @@ -146,7 +146,7 @@ Carried over from v1.13.0 (no new deprecations in v1.14.0):
- **MCP server**: bumped to **1.14.0** — glama.json updated with MariaDB and ClickHouse in dialect list
- **`pygosqlx` Python bindings**: bumped to **0.2.0** — Python bindings follow an independent semver track (alpha) since they have not yet received the same QA sweep as the core library

## [1.13.0] - 2026-03-20
## [1.13.0] - 2026-03-20 — ClickHouse Dialect & LSP Semantic Tokens

### Added
- ClickHouse SQL dialect support (`DialectClickHouse = "clickhouse"`) with 30+ keywords
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SD

**Requirements**: Go 1.26+ (upgraded from 1.23 to fix stdlib vulnerabilities; `mark3labs/mcp-go` requires 1.23)

**Production Status**: ✅ Validated for production deployment (v1.6.0+, current: v1.13.0)
**Production Status**: ✅ Validated for production deployment (v1.6.0+, current: v1.14.0)
- Thread-safe with zero race conditions (20,000+ concurrent operations tested)
- 1.38M+ ops/sec sustained, 1.5M peak with memory-efficient object pooling
- ~80-85% SQL-99 compliance (window functions, CTEs, set operations, MERGE, etc.)
Expand All @@ -26,7 +26,7 @@ GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SD
- **Errors** (`pkg/errors/`): Structured error handling with position tracking
- **Metrics** (`pkg/metrics/`): Production performance monitoring
- **Security** (`pkg/sql/security/`): SQL injection detection with severity classification
- **Linter** (`pkg/linter/`): SQL linting engine with 10 built-in rules (L001-L010)
- **Linter** (`pkg/linter/`): SQL linting engine with 30 built-in rules (L001-L030)
- **LSP** (`pkg/lsp/`): Language Server Protocol for IDE integration
- **GoSQLX** (`pkg/gosqlx/`): High-level simple API (recommended for most users)
- **Compatibility** (`pkg/compatibility/`): API stability testing
Expand Down Expand Up @@ -229,7 +229,7 @@ Install with: `task hooks:install`
- `docs/GETTING_STARTED.md` - Quick start guide
- `docs/USAGE_GUIDE.md` - Comprehensive usage patterns
- `docs/LSP_GUIDE.md` - LSP server and IDE integration
- `docs/LINTING_RULES.md` - All 10 linting rules reference
- `docs/LINTING_RULES.md` - All 30 linting rules reference
- `docs/SQL_COMPATIBILITY.md` - SQL dialect compatibility matrix
- `docs/ARCHITECTURE.md` - Detailed system design
- `https://gosqlx.dev` - Official website with interactive playground
Expand Down
2 changes: 1 addition & 1 deletion cmd/gosqlx/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var (
// - format: Intelligent SQL formatting with AST-based transformations
// - parse: AST structure inspection with multiple output formats
// - analyze: Security and complexity analysis with grading
// - lint: Style and quality checking with L001-L010 rules
// - lint: Style and quality checking with L001-L030 rules
// - lsp: Language Server Protocol server for IDE integration
// - config: Configuration file management
// - completion: Shell autocompletion setup
Expand Down
2 changes: 1 addition & 1 deletion cmd/gosqlx/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//
// # Version
//
// Current version: 1.13.0
// Current version: 1.14.0
//
// # Architecture
//
Expand Down
2 changes: 1 addition & 1 deletion docs/API_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GoSQLX API Reference (v1.12.0)
# GoSQLX API Reference (v1.14.0)

## Table of Contents

Expand Down
4 changes: 2 additions & 2 deletions docs/CLI_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GoSQLX CLI Guide

**Version**: v1.12.0
**Last Updated**: 2026-03-13
**Version**: v1.14.0
**Last Updated**: 2026-04-12

The GoSQLX Command Line Interface (CLI) provides high-performance SQL parsing, validation, formatting, and analysis capabilities directly from your terminal.

Expand Down
2 changes: 1 addition & 1 deletion docs/LINTING_RULES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SQL Linting Rules Reference

**Version**: v1.13.0
**Version**: v1.14.0
**Last Updated**: 2026-03-20

This document provides a complete reference for all GoSQLX SQL linting rules (L001-L010).
Expand Down
4 changes: 2 additions & 2 deletions docs/LSP_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GoSQLX Language Server Protocol (LSP) Guide

**Version**: v1.13.0
**Version**: v1.14.0
**Last Updated**: 2026-03-20

## Table of Contents
Expand Down Expand Up @@ -446,4 +446,4 @@ tail -f /tmp/gosqlx-lsp.log | grep -E "Initialize|Document|Diagnostic"
---

**Last Updated**: 2026-03-20
**Version**: v1.13.0
**Version**: v1.14.0
2 changes: 1 addition & 1 deletion docs/PRODUCTION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GoSQLX Production Deployment Guide

**Version**: v1.12.0 | **Last Updated**: 2026-03-15
**Version**: v1.14.0 | **Last Updated**: 2026-04-12

Comprehensive guide for deploying GoSQLX in production environments.

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Comprehensive documentation for the GoSQLX SQL parsing SDK.

**Current Version**: v1.12.0 | **Last Updated**: 2026-03-15
**Current Version**: v1.14.0 | **Last Updated**: 2026-04-12

## Feature Overview (v1.12.0)
## Feature Overview (v1.14.0)

GoSQLX is a production-ready, high-performance SQL parsing SDK for Go with comprehensive feature support:

Expand Down
2 changes: 1 addition & 1 deletion docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This document provides comprehensive security analysis, operational security set
## 🛡️ Comprehensive Security Assessment

**Analysis Date**: 2026-02-28
**Version**: v1.12.0
**Version**: v1.14.0
**Security Score**: 9.0/10 ⭐⭐⭐⭐⭐

---
Expand Down
6 changes: 3 additions & 3 deletions glama.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
{
"name": "lint_sql",
"description": "Lint SQL against all 10 GoSQLX style rules (L001–L010): trailing whitespace, mixed indentation, consecutive blank lines, indentation depth, line length, column alignment, keyword case, comma placement, aliasing consistency, redundant whitespace. Returns violations with line/column positions and fix suggestions."
"description": "Lint SQL against all 30 GoSQLX style rules (L001–L030): whitespace, keywords, safety, performance, and naming. Returns violations with line/column positions and fix suggestions."
},
{
"name": "analyze_sql",
Expand Down Expand Up @@ -95,8 +95,8 @@
"patterns": ["tautology", "union-attack", "stacked-queries", "comment-bypass", "blind-injection"]
},
"linting": {
"rules": 10,
"rule_ids": ["L001", "L002", "L003", "L004", "L005", "L006", "L007", "L008", "L009", "L010"]
"rules": 30,
"rule_ids": ["L001", "L002", "L003", "L004", "L005", "L006", "L007", "L008", "L009", "L010", "L011", "L012", "L013", "L014", "L015", "L016", "L017", "L018", "L019", "L020", "L021", "L022", "L023", "L024", "L025", "L026", "L027", "L028", "L029", "L030"]
},
"performance": {
"ops_per_sec": "1380000+",
Expand Down
6 changes: 3 additions & 3 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

GoSQLX is a production-ready SQL parsing library for Go that provides zero-copy tokenization,
recursive-descent parsing, and AST generation with comprehensive object pooling. It supports
PostgreSQL, MySQL, SQL Server, Oracle, SQLite, and Snowflake dialects, and ships a full-featured
CLI tool (`gosqlx`) for validation, formatting, linting, and security analysis. Apache-2.0 licensed.
PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, and ClickHouse dialects (8 total), and ships a full-featured
CLI tool (`gosqlx`) for validation, formatting, linting, transpilation, and security analysis. Apache-2.0 licensed.

Current stable version: v1.12.1 (2026-03-13)
Current stable version: v1.14.0 (2026-04-12)
Website: https://gosqlx.dev
Interactive Playground: https://gosqlx.dev/playground/

Expand Down
4 changes: 2 additions & 2 deletions pkg/linter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The `linter` package provides a comprehensive SQL linting rules engine similar to SQLFluff. It offers code style checking, auto-fix capabilities, and extensible rule system for SQL quality enforcement.

**Status**: Phase 1a Complete (3/10 rules implemented)
**Status**: 30 rules implemented (L001-L030)
**Test Coverage**: 98.1% (exceeded 70% target by +28%)

## Key Features
Expand Down Expand Up @@ -411,7 +411,7 @@ FROM users;

## Roadmap

### Phase 1 (10 basic rules)
### Phase 1 (30 rules — complete)
- [x] L001: Trailing Whitespace
- [x] L002: Mixed Indentation
- [x] L005: Long Lines
Expand Down
46 changes: 46 additions & 0 deletions vscode-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@

All notable changes to the "GoSQLX" extension will be documented in this file.

## [1.14.0] - 2026-04-12

### Added
- **Dialect-aware SQL formatting**: `transform.FormatSQLWithDialect()` renders TOP (SQL Server), FETCH FIRST (Oracle), or LIMIT per dialect
- **Snowflake dialect at 100%** of QA corpus (87/87): MATCH_RECOGNIZE, @stage, SAMPLE, QUALIFY, VARIANT colon-paths, time-travel, LATERAL FLATTEN, TRY_CAST, LIKE ANY/ALL
- **ClickHouse dialect at 83%** of QA corpus (69/83, up from 53%): nested column types, parametric aggregates, bare-bracket arrays, ORDER BY WITH FILL, CODEC, WITH TOTALS, LIMIT BY, SETTINGS/TTL
- **MariaDB dialect**: SEQUENCE DDL, temporal tables, CONNECT BY hierarchical queries
- **SQL transpilation**: MySQL to PostgreSQL, PostgreSQL to MySQL, PostgreSQL to SQLite via `gosqlx transpile` CLI
- **Live schema introspection**: PostgreSQL, MySQL, and SQLite loaders via `gosqlx.LoadSchema()`
- **DML Transform API**: SET clause and RETURNING clause transforms
- **30 linter rules** (expanded from 10): safety (L011-L015), performance (L016-L023), naming (L024-L030)
- **Optimization advisor**: OPT-009 through OPT-020 rules via `gosqlx optimize`
- **Query fingerprinting**: Normalize and SHA-256 hash SQL for deduplication
- **OpenTelemetry integration** sub-module with span instrumentation
- **GORM integration** sub-module with query metadata plugin
- New CLI subcommands: `transpile`, `optimize`, `stats`, `watch`, `action`
- SQL Server PIVOT/UNPIVOT parsing
- C binding coverage hardened from 18% to 93%

### Fixed
- Parsed SQL Server `TOP` clauses now render correctly in formatted output (previously silently dropped)
- MINUS consumed as alias fixed for Snowflake/Oracle set operations

### Security
- OpenTelemetry SDK upgraded to v1.43.0 (CVE-2026-39883)

## [1.13.0] - 2026-03-20

### Added
- **ClickHouse SQL dialect support** with 30+ keywords: PREWHERE, FINAL, GLOBAL IN/NOT IN
- **LSP semantic token provider** (`textDocument/semanticTokens/full`) with 6-type legend: keyword, identifier, number, string, operator, comment
- **LSP diagnostic debouncing** (300ms) prevents excessive re-parsing on rapid typing
- LSP document cleanup on `textDocument/didClose`
- Glama MCP registry integration with stdio transport support
- Sentry error monitoring on the website

### Changed
- `ParseFromModelTokens` is now the canonical parse entry point (positions always populated)
- Docker base image Go 1.25 to 1.26
- Next.js 16.1.6 to 16.1.7 (3 CVE fixes)
- Lighthouse Desktop: 100 Performance / 100 Accessibility / 100 SEO

### Deprecated
- `parser.Parse([]token.Token)` -- use `ParseFromModelTokens` instead
- `ParseFromModelTokensWithPositions` -- consolidated into `ParseFromModelTokens`

## [1.12.1] - 2026-03-15

### Changed
Expand Down
7 changes: 7 additions & 0 deletions website/scripts/split-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ for (const release of releases) {
if (subtitle) titleParts.push(`\u2014 ${subtitle}`);
const title = titleParts.join(' ');

// Extract first non-empty, non-heading, non-list line as description
const descLine = release.body.find(l => l.trim() && !l.startsWith('#') && !l.startsWith('---') && !l.startsWith('- '));
const rawDesc = (descLine || subtitle || `GoSQLX v${version} release`).replace(/\*\*/g, '').replace(/`/g, '').trim();
// YAML-safe: escape quotes, strip trailing truncated quotes, limit length
const description = rawDesc.slice(0, 160).replace(/"/g, "'").replace(/'$/, '');

const frontmatter = [
'---',
`title: "${title}"`,
`date: "${date}"`,
`version: "${version}"`,
`description: "${description}"`,
'---',
].join('\n');

Expand Down
5 changes: 5 additions & 0 deletions website/src/app/blog/BlogList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export function BlogList({ posts }: { posts: BlogPost[] }) {
<h2 className="text-lg font-semibold text-zinc-100 group-hover:text-white transition-colors truncate">
{post.title}
</h2>
{post.description && (
<p className="mt-1 text-sm text-zinc-400 line-clamp-2">
{post.description}
</p>
)}
</div>

{/* Arrow */}
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v0-9-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v0.9.0"
date: "2024-01-15"
version: "0.9.0"
description: "| Version | Release Date | Status | Key Features |"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-0-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.0.0"
date: "2024-12-01"
version: "1.0.0"
description: "GoSQLX v1.0.0 release"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-0-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.0.1"
date: "2025-08-23"
version: "1.0.1"
description: "GoSQLX v1.0.1 release"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-0-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.0.2"
date: "2025-08-23"
version: "1.0.2"
description: "GoSQLX v1.0.2 release"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-10-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.10.0 — MCP Server"
date: "2026-03-13"
version: "1.10.0"
description: "- 7 tools: validate_sql, format_sql, parse_sql, extract_metadata, security_scan, lint_sql, analyze_sql"
---

### ✨ New Features
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-10-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.10.1 — VS Code Marketplace Publishing"
date: "2026-03-13"
version: "1.10.1"
description: "- 5 platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64"
---

### ✨ New Features
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-10-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.10.2 — VS Code Extension Fix"
date: "2026-03-14"
version: "1.10.2"
description: "VS Code Extension Fix"
---

### Fixed
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-10-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.10.3 — LSP --stdio compatibility"
date: "2026-03-14"
version: "1.10.3"
description: "LSP --stdio compatibility"
---

### Fixed
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-10-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.10.4 — AST-based LSP Formatting"
date: "2026-03-14"
version: "1.10.4"
description: "AST-based LSP Formatting"
---

### Fixed
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-11-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.11.0 — Product Website with WASM Playground"
date: "2026-03-14"
version: "1.11.0"
description: "Product Website with WASM Playground"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-11-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.11.1 — Website Polish & SEO"
date: "2026-03-15"
version: "1.11.1"
description: "Website Polish & SEO"
---

### Fixed
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-12-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.12.0 — Custom Domain & Remote MCP Server"
date: "2026-03-15"
version: "1.12.0"
description: "Custom Domain & Remote MCP Server"
---

### Added
Expand Down
1 change: 1 addition & 0 deletions website/src/content/blog/v1-12-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: "v1.12.1 — Website Performance & Mobile Optimization"
date: "2026-03-15"
version: "1.12.1"
description: "Website Performance & Mobile Optimization"
---

### Improved
Expand Down
Loading
Loading