diff --git a/CHANGELOG.md b/CHANGELOG.md index 16495c77..5810b785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -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 diff --git a/CLAUDE.md b/CLAUDE.md index 14c2090f..5be7be8f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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.) @@ -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 @@ -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 diff --git a/cmd/gosqlx/cmd/root.go b/cmd/gosqlx/cmd/root.go index 26c178fb..33d317db 100644 --- a/cmd/gosqlx/cmd/root.go +++ b/cmd/gosqlx/cmd/root.go @@ -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 diff --git a/cmd/gosqlx/doc.go b/cmd/gosqlx/doc.go index 1a297272..4da72367 100644 --- a/cmd/gosqlx/doc.go +++ b/cmd/gosqlx/doc.go @@ -24,7 +24,7 @@ // // # Version // -// Current version: 1.13.0 +// Current version: 1.14.0 // // # Architecture // diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index 65e5f6bd..2594232c 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -1,4 +1,4 @@ -# GoSQLX API Reference (v1.12.0) +# GoSQLX API Reference (v1.14.0) ## Table of Contents diff --git a/docs/CLI_GUIDE.md b/docs/CLI_GUIDE.md index a3077e58..d1bee241 100644 --- a/docs/CLI_GUIDE.md +++ b/docs/CLI_GUIDE.md @@ -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. diff --git a/docs/LINTING_RULES.md b/docs/LINTING_RULES.md index be2e452c..dace68eb 100644 --- a/docs/LINTING_RULES.md +++ b/docs/LINTING_RULES.md @@ -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). diff --git a/docs/LSP_GUIDE.md b/docs/LSP_GUIDE.md index e54937ed..95a79c70 100644 --- a/docs/LSP_GUIDE.md +++ b/docs/LSP_GUIDE.md @@ -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 @@ -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 diff --git a/docs/PRODUCTION_GUIDE.md b/docs/PRODUCTION_GUIDE.md index 0d66c79f..2ac0be18 100644 --- a/docs/PRODUCTION_GUIDE.md +++ b/docs/PRODUCTION_GUIDE.md @@ -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. diff --git a/docs/README.md b/docs/README.md index 915400e1..f48dd227 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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: diff --git a/docs/SECURITY.md b/docs/SECURITY.md index af5dc288..fe92bfae 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -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 ⭐⭐⭐⭐⭐ --- diff --git a/glama.json b/glama.json index 4af40340..8c020b43 100644 --- a/glama.json +++ b/glama.json @@ -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", @@ -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+", diff --git a/llms.txt b/llms.txt index ac33d704..aac8895e 100644 --- a/llms.txt +++ b/llms.txt @@ -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/ diff --git a/pkg/linter/README.md b/pkg/linter/README.md index 6da7331e..82716c7b 100644 --- a/pkg/linter/README.md +++ b/pkg/linter/README.md @@ -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 @@ -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 diff --git a/vscode-extension/CHANGELOG.md b/vscode-extension/CHANGELOG.md index d036bc9a..3e347f97 100644 --- a/vscode-extension/CHANGELOG.md +++ b/vscode-extension/CHANGELOG.md @@ -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 diff --git a/website/scripts/split-changelog.js b/website/scripts/split-changelog.js index cbfc0924..e57a8f92 100644 --- a/website/scripts/split-changelog.js +++ b/website/scripts/split-changelog.js @@ -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'); diff --git a/website/src/app/blog/BlogList.tsx b/website/src/app/blog/BlogList.tsx index 68e7238a..181f1099 100644 --- a/website/src/app/blog/BlogList.tsx +++ b/website/src/app/blog/BlogList.tsx @@ -37,6 +37,11 @@ export function BlogList({ posts }: { posts: BlogPost[] }) {

{post.title}

+ {post.description && ( +

+ {post.description} +

+ )} {/* Arrow */} diff --git a/website/src/content/blog/v0-9-0.md b/website/src/content/blog/v0-9-0.md index be7ebff8..ab863900 100644 --- a/website/src/content/blog/v0-9-0.md +++ b/website/src/content/blog/v0-9-0.md @@ -2,6 +2,7 @@ title: "v0.9.0" date: "2024-01-15" version: "0.9.0" +description: "| Version | Release Date | Status | Key Features |" --- ### Added diff --git a/website/src/content/blog/v1-0-0.md b/website/src/content/blog/v1-0-0.md index 499431af..ff4840cf 100644 --- a/website/src/content/blog/v1-0-0.md +++ b/website/src/content/blog/v1-0-0.md @@ -2,6 +2,7 @@ title: "v1.0.0" date: "2024-12-01" version: "1.0.0" +description: "GoSQLX v1.0.0 release" --- ### Added diff --git a/website/src/content/blog/v1-0-1.md b/website/src/content/blog/v1-0-1.md index a4ddff79..1b63ee6f 100644 --- a/website/src/content/blog/v1-0-1.md +++ b/website/src/content/blog/v1-0-1.md @@ -2,6 +2,7 @@ title: "v1.0.1" date: "2025-08-23" version: "1.0.1" +description: "GoSQLX v1.0.1 release" --- ### Added diff --git a/website/src/content/blog/v1-0-2.md b/website/src/content/blog/v1-0-2.md index 6a50df8a..c4030f20 100644 --- a/website/src/content/blog/v1-0-2.md +++ b/website/src/content/blog/v1-0-2.md @@ -2,6 +2,7 @@ title: "v1.0.2" date: "2025-08-23" version: "1.0.2" +description: "GoSQLX v1.0.2 release" --- ### Added diff --git a/website/src/content/blog/v1-10-0.md b/website/src/content/blog/v1-10-0.md index ede07b89..b7c15c87 100644 --- a/website/src/content/blog/v1-10-0.md +++ b/website/src/content/blog/v1-10-0.md @@ -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 diff --git a/website/src/content/blog/v1-10-1.md b/website/src/content/blog/v1-10-1.md index 01751c7b..8d1c04e1 100644 --- a/website/src/content/blog/v1-10-1.md +++ b/website/src/content/blog/v1-10-1.md @@ -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 diff --git a/website/src/content/blog/v1-10-2.md b/website/src/content/blog/v1-10-2.md index babebf24..5eff4d62 100644 --- a/website/src/content/blog/v1-10-2.md +++ b/website/src/content/blog/v1-10-2.md @@ -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 diff --git a/website/src/content/blog/v1-10-3.md b/website/src/content/blog/v1-10-3.md index 88e77fe4..34ac31db 100644 --- a/website/src/content/blog/v1-10-3.md +++ b/website/src/content/blog/v1-10-3.md @@ -2,6 +2,7 @@ title: "v1.10.3 — LSP --stdio compatibility" date: "2026-03-14" version: "1.10.3" +description: "LSP --stdio compatibility" --- ### Fixed diff --git a/website/src/content/blog/v1-10-4.md b/website/src/content/blog/v1-10-4.md index 2ca1ddc4..6b5364eb 100644 --- a/website/src/content/blog/v1-10-4.md +++ b/website/src/content/blog/v1-10-4.md @@ -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 diff --git a/website/src/content/blog/v1-11-0.md b/website/src/content/blog/v1-11-0.md index 79eb8282..560e1fcb 100644 --- a/website/src/content/blog/v1-11-0.md +++ b/website/src/content/blog/v1-11-0.md @@ -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 diff --git a/website/src/content/blog/v1-11-1.md b/website/src/content/blog/v1-11-1.md index 6cf024f2..a6bf8500 100644 --- a/website/src/content/blog/v1-11-1.md +++ b/website/src/content/blog/v1-11-1.md @@ -2,6 +2,7 @@ title: "v1.11.1 — Website Polish & SEO" date: "2026-03-15" version: "1.11.1" +description: "Website Polish & SEO" --- ### Fixed diff --git a/website/src/content/blog/v1-12-0.md b/website/src/content/blog/v1-12-0.md index 0232d0f4..d0780416 100644 --- a/website/src/content/blog/v1-12-0.md +++ b/website/src/content/blog/v1-12-0.md @@ -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 diff --git a/website/src/content/blog/v1-12-1.md b/website/src/content/blog/v1-12-1.md index 55539209..42c77d27 100644 --- a/website/src/content/blog/v1-12-1.md +++ b/website/src/content/blog/v1-12-1.md @@ -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 diff --git a/website/src/content/blog/v1-13-0.md b/website/src/content/blog/v1-13-0.md index 27cc3cde..4c9af48c 100644 --- a/website/src/content/blog/v1-13-0.md +++ b/website/src/content/blog/v1-13-0.md @@ -2,133 +2,42 @@ title: "v1.13.0 — ClickHouse Dialect & LSP Semantic Tokens" date: "2026-03-20" version: "1.13.0" -description: "GoSQLX v1.13.0 adds ClickHouse SQL dialect support, LSP semantic tokens, and comprehensive website improvements." +description: "ClickHouse Dialect & LSP Semantic Tokens" --- -GoSQLX v1.13.0 ships ClickHouse dialect support, LSP semantic tokens, parser API consolidation, and a comprehensive website security and accessibility pass. - ### Added - -**ClickHouse SQL Dialect** - -The new `DialectClickHouse` dialect parses ClickHouse-specific SQL that is not valid in standard SQL or other dialects: - -```go -ast, err := gosqlx.ParseWithDialect( - `SELECT DISTINCT ON (user_id) * FROM events FINAL - PREWHERE event_type = 'purchase' - WHERE ts > now() - INTERVAL 7 DAY`, - gosqlx.DialectClickHouse, -) -``` - -Supported ClickHouse features: -- **PREWHERE** clause — pre-filter applied before reading primary key data, stored as `SelectStatement.PrewhereClause` -- **FINAL** modifier on table references — forces MergeTree to merge all parts before reading, stored as `TableReference.Final` -- **GLOBAL IN / GLOBAL NOT IN** — distributed query execution across shards -- **ClickHouse data types**: `FixedString(N)`, `LowCardinality(T)`, `Nullable(T)`, `DateTime64`, `IPv4`, `IPv6` -- **MergeTree engine keywords**: MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, SUMMINGMERGETREE, COLLAPSINGMERGETREE, VERSIONEDCOLLAPSINGMERGETREE -- **30+ additional keywords**: TTL, CODEC, FORMAT, SETTINGS, DISTRIBUTED, ASOF, SAMPLE, and more - -**LSP Semantic Token Provider** - -`textDocument/semanticTokens/full` is now supported with a 6-type legend: - -| Type | Covers | -|------|--------| -| `keyword` | SELECT, FROM, WHERE, JOIN, etc. | -| `identifier` | Table names, column names, aliases | -| `number` | Integer and float literals | -| `string` | String literals and quoted identifiers | -| `operator` | =, >, <, AND, OR, NOT, etc. | -| `comment` | Line and block comments | - -VS Code and Neovim users will see richer syntax highlighting without any configuration changes. - -**LSP Diagnostic Debouncing** - -Diagnostics are now debounced 300ms per document URI. Rapid typing no longer triggers a full SQL parse on every keystroke, improving responsiveness in large SQL files. +- ClickHouse SQL dialect support (`DialectClickHouse = "clickhouse"`) with 30+ keywords +- `PrewhereClause` field on `SelectStatement` AST for ClickHouse PREWHERE optimization +- `Final` field on `TableReference` for ClickHouse MergeTree FINAL modifier +- PREWHERE clause parsing in ClickHouse dialect mode +- FINAL modifier parsing in ClickHouse dialect mode +- GLOBAL IN / GLOBAL NOT IN expression parsing (ClickHouse) +- ClickHouse data types: FixedString, LowCardinality, Nullable, DateTime64, IPv4, IPv6 +- MergeTree engine family keywords (MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, etc.) +- 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 +- Auto-trigger Glama build on GitHub release via CI (`glama-sync.yml`) +- Sentry error monitoring, tracing, and session replay on website ### Changed - -- `ParseFromModelTokens` is now the canonical parse entry point. It has always populated position information — the previous `ParseFromModelTokensWithPositions` variant is now an alias. -- Docker base image bumped Go 1.25 → 1.26 to match go.mod. -- Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057). -- Glama MCP registry now auto-syncs on every GitHub release. +- `ParseFromModelTokens` is now the canonical parse entry point (positions always populated) +- Docker base image Go 1.25 → 1.26 to match go.mod requirement +- Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057) +- Website rebuilt on Next.js 16 App Router with comprehensive a11y, SEO, and performance audit +- Lighthouse Desktop: 100 Performance / 100 Accessibility / 100 SEO (maintained) +- CI: Vercel deployment working-directory bug fixed (doubled path `website/website/`) ### Deprecated - -These functions still work but will be removed in v2: - -| Deprecated | Use Instead | -|-----------|-------------| -| `parser.Parse([]token.Token)` | `parser.ParseFromModelTokens(tokens)` | -| `parser.ParseFromModelTokensWithPositions(tokens)` | `parser.ParseFromModelTokens(tokens)` | -| `ConversionResult.PositionMapping` | Always nil — remove any references | - -**Migration example:** - -```go -// Before (deprecated) -tokens := tokenizer.Tokenize(sql) -ast, err := parser.Parse(tokens) - -// After (canonical — positions always populated) -tokens := tokenizer.Tokenize(sql) -ast, err := parser.ParseFromModelTokens(tokens) -``` +- `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead +- `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens` +- `ConversionResult.PositionMapping` — always nil, will be removed in v2 ### Fixed - -- Production playground WASM 404 — CI `working-directory: website` was doubling the path against Vercel's `rootDirectory=website` setting +- Production playground WASM 404 (CI working-directory path doubling) - WASM service worker cache versioning -- Broken `.md` relative links in docs pointing to local files instead of `/docs/` URL paths -- JSON-LD BreadcrumbList and Article markup on docs and blog pages -- Horizontal overflow at 320-390px viewport widths -- Keyboard accessibility (`tabIndex={0}`) on scrollable code blocks (WCAG 2.1.1) -- `rel=preload` for `gosqlx.wasm` on /playground - -### Performance - -Benchmark results from 2026-03-20 on Apple Silicon (Go 1.26.1): - -| Query Type | ops/sec | -|------------|---------| -| Simple SELECT | **1.40M** | -| Complex SELECT | **376K** | -| Window Function | **848K** | -| CTE | **833K** | -| INSERT | **992K** | -| Simple SELECT (parallel) | **3.16M** | -| Sustained 30s load | **513K** | - -The ClickHouse dialect additions have no measurable impact on non-ClickHouse parse paths. - -### Full Changelog - -- **Added**: ClickHouse SQL dialect support (`DialectClickHouse`) with 30+ keywords -- **Added**: `PrewhereClause` field on `SelectStatement` AST for ClickHouse PREWHERE optimization -- **Added**: `Final` field on `TableReference` for ClickHouse MergeTree FINAL modifier -- **Added**: GLOBAL IN / GLOBAL NOT IN expression parsing (ClickHouse) -- **Added**: ClickHouse data types: FixedString, LowCardinality, Nullable, DateTime64, IPv4, IPv6 -- **Added**: MergeTree engine family keywords (MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, etc.) -- **Added**: LSP semantic token provider (`textDocument/semanticTokens/full`) with 6-type legend -- **Added**: LSP diagnostic debouncing (300ms) — prevents excessive re-parsing on rapid typing -- **Added**: LSP document cleanup on `textDocument/didClose` -- **Added**: Glama MCP registry integration with stdio transport support -- **Added**: Auto-trigger Glama build on GitHub release via CI (`glama-sync.yml`) -- **Added**: Sentry error monitoring, tracing, and session replay on website -- **Changed**: `ParseFromModelTokens` is now the canonical parse entry point (positions always populated) -- **Changed**: Docker base image Go 1.25 → 1.26 to match go.mod requirement -- **Changed**: Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057) -- **Changed**: Website rebuilt on Next.js 16 App Router with comprehensive a11y, SEO, and performance audit -- **Changed**: Lighthouse Desktop: 100 Performance / 100 Accessibility / 100 SEO -- **Deprecated**: `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead -- **Deprecated**: `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens` -- **Deprecated**: `ConversionResult.PositionMapping` — always nil, will be removed in v2 -- **Fixed**: Production playground WASM 404 (CI working-directory path doubling) -- **Fixed**: WASM service worker cache versioning -- **Fixed**: Broken `.md` relative links in docs → `/docs/` URL paths -- **Fixed**: JSON-LD BreadcrumbList and Article markup on docs pages -- **Fixed**: Horizontal overflow at 320–390px viewport -- **Fixed**: Keyboard accessibility (tabIndex) on scrollable code blocks +- Broken `.md` relative links in docs → `/docs/` URL paths +- JSON-LD BreadcrumbList and Article markup on docs pages +- Horizontal overflow at 320–390px viewport +- Keyboard accessibility (tabIndex) on scrollable code blocks diff --git a/website/src/content/blog/v1-14-0.md b/website/src/content/blog/v1-14-0.md new file mode 100644 index 00000000..3af4f47c --- /dev/null +++ b/website/src/content/blog/v1-14-0.md @@ -0,0 +1,143 @@ +--- +title: "v1.14.0 — Dialect-Aware Transforms, Snowflake 100%, Schema Introspection" +date: "2026-04-12" +version: "1.14.0" +description: "Headline themes: dialect-aware transforms, Snowflake at 100% of the QA corpus, ClickHouse significantly expanded (83% of the QA corpus, up from 53%), live schem" +--- + +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. + +### Added + +#### Dialect-aware formatting (closes #479) +- **`transform.FormatSQLWithDialect(stmt, keywords.SQLDialect)`**: renders an AST using dialect-specific row-limiting syntax — `SELECT TOP n` for SQL Server, `FETCH FIRST n ROWS ONLY` for Oracle, `LIMIT n` for PostgreSQL/MySQL/SQLite/Snowflake/ClickHouse/MariaDB +- **`transform.ParseSQLWithDialect(sql, keywords.SQLDialect)`**: dialect-aware parsing convenience wrapper +- `FormatOptions.Dialect` field threads dialect through the formatter pipeline +- `normalizeSelectForDialect()` converts `Limit`/`Offset` into `TopClause` (SQL Server) or `FetchClause` (Oracle) on a shallow copy — original AST never mutated +- Parsed `TopClause` now renders (previously silently dropped — a long-standing bug) +- SQL Server pagination: `OFFSET m ROWS FETCH NEXT n ROWS ONLY` when both limit and offset are set +- PR #507 + +#### Snowflake dialect (100% QA corpus — 87/87 queries, epic #483) +- **`MATCH_RECOGNIZE`** clause (SQL:2016 R010): PARTITION BY, ORDER BY, MEASURES, ONE/ALL ROWS PER MATCH, AFTER MATCH SKIP, PATTERN, DEFINE (PR #506) +- **`@stage` references** in FROM clause with optional path and file format (PR #505) +- **`MINUS` as EXCEPT synonym** for Snowflake/Oracle (PR #494); fix for MINUS-as-alias edge case (PR #504) +- **`SAMPLE` / `TABLESAMPLE`** clause with BERNOULLI/ROW/SYSTEM/BLOCK methods (PR #501) +- **`QUALIFY`** clause for window-function filtering (Snowflake/BigQuery) (PR #490) +- **VARIANT colon-path expressions** (`expr:field.sub[0]`) (PR #496) +- **Time-travel** `AT`/`BEFORE`/`CHANGES` on table references (PR #495) +- **`LATERAL FLATTEN`** table function + named arguments (`name => expr`) (PR #492) +- **`TRY_CAST`** + `IGNORE NULLS` / `RESPECT NULLS` for window functions (PR #486) +- **`LIKE ANY`/`LIKE ALL`** and `ILIKE ANY`/`ILIKE ALL` quantifiers (PR #500) +- **`USE [WAREHOUSE|DATABASE|SCHEMA|ROLE]`** and `DESCRIBE` with object-kind prefixes (PR #491) +- **`COPY INTO`**, `PUT`, `GET`, `LIST`, `REMOVE` parse-only stubs (PR #499) +- **`CREATE STAGE`/`STREAM`/`TASK`/`PIPE`/`FILE FORMAT`/`WAREHOUSE`/`DATABASE`/`SCHEMA`/`ROLE`/`SEQUENCE`/`FUNCTION`/`PROCEDURE`** parse-only stubs (PR #498) +- **`CLUSTER BY`**, `COPY GRANTS`, and CTAS (`CREATE TABLE ... AS SELECT`) for CREATE TABLE (PR #504) +- **`ILIKE`** + PIVOT/UNPIVOT support for Snowflake dialect (PR #484) + +#### ClickHouse dialect (69/83 QA corpus — 83%, up from 53% in v1.13.0, epic #482) +- Remaining ClickHouse QA gaps (tracked for v1.15): ARRAY JOIN / LEFT ARRAY JOIN, LIMIT n,m BY, named window definitions, scalar CTE subqueries, CREATE MATERIALIZED VIEW / DISTRIBUTED TABLE, SAMPLE with decimal and OFFSET, standalone SELECT ... SETTINGS without preceding FROM/WHERE +- **Reserved-word identifiers**: `table`, `partition`, `tables`, `databases` now valid as column/identifier names (closes #480, PR #481) +- **Nested column types**: `Nullable(T)`, `Array(T)`, `Map(K,V)`, `LowCardinality(T)` in CREATE TABLE (PR #488) +- **Engine clauses**: `MergeTree()`, `ORDER BY`, `PARTITION BY`, `PRIMARY KEY`, `SAMPLE BY`, `TTL`, `SETTINGS` (PR #488) +- **Parametric aggregates**: `quantile(0.95)(duration)` double-paren syntax (PR #487) +- **Bare-bracket array literals**: `[1, 2, 3]` without ARRAY keyword (PR #485) +- **`ORDER BY ... WITH FILL`** with FROM/TO/STEP (PR #493) +- **`CODEC(...)`** column compression option (PR #497) +- **`WITH TOTALS`** in GROUP BY, **`LIMIT ... BY`** clause, **ANY/ALL JOIN** strictness prefix, `DEFAULT` as identifier (PR #503) +- **`SETTINGS`** clause on SELECT and in CREATE TABLE, **`TTL`** column clause, **`INSERT ... FORMAT`** (JSONEachRow, CSV, Parquet, etc.) (PR #489) + +#### MariaDB dialect +- New `DialectMariaDB` extending MySQL (`mariadb`) (PR #431) +- **SEQUENCE DDL**: `CREATE/DROP/ALTER SEQUENCE` with full option set (START WITH, INCREMENT BY, MINVALUE/MAXVALUE, CYCLE, CACHE, NOCACHE) +- **Temporal tables**: `FOR SYSTEM_TIME`, `WITH SYSTEM VERSIONING`, `PERIOD FOR` +- **Hierarchical queries**: `CONNECT BY` with `PRIOR`, `START WITH`, `NOCYCLE` +- Added to playground and WASM dialect map (PR #432) + +#### SQL Server enhancements +- **PIVOT / UNPIVOT** clause parsing (T-SQL) (PR #477) + +#### SQL Transpilation (`pkg/transpiler`) +- **`Transpile(sql, from, to keywords.SQLDialect)`**: composable rewrite-rule pipeline for cross-dialect conversion (PR #449) + - MySQL → PostgreSQL: `AUTO_INCREMENT` → `SERIAL`/`BIGSERIAL`, `TINYINT(1)` → `BOOLEAN` + - PostgreSQL → MySQL: `SERIAL` → `INT AUTO_INCREMENT`, `ILIKE` → `LOWER() LIKE LOWER()` + - PostgreSQL → SQLite: `SERIAL`/`BIGSERIAL` → `INTEGER`, array types → `TEXT` +- **`gosqlx.Transpile()`** top-level convenience wrapper +- **`gosqlx transpile --from --to `** CLI subcommand + +#### Live schema introspection (`pkg/schema/db`) +- **`Loader` interface** with `DatabaseSchema`/`Table`/`Column`/`Index`/`ForeignKey` types (PR #448) +- **PostgreSQL loader** (`pkg/schema/postgres`): introspects tables, columns (with primary/unique flags), indexes, and foreign keys via `information_schema` and `pg_catalog` +- **MySQL loader** (`pkg/schema/mysql`): introspects tables, columns, indexes, and foreign keys via `information_schema` +- **SQLite loader** (`pkg/schema/sqlite`): introspects via PRAGMA commands (pure Go, no cgo) +- **`gosqlx.LoadSchema()`** top-level dialect-agnostic convenience wrapper +- Integration tests using `testcontainers-go` v0.32.0 for PostgreSQL and MySQL loaders + +#### DML Transform API (`pkg/transform`) +- `AddSetClause`, `SetClause`, `RemoveSetClause`, `ReplaceSetClause` for UPDATE statements (PR #446) +- `AddReturning`, `RemoveReturning` for INSERT/UPDATE/DELETE (PR #446) + +#### Linter — expanded from 10 to 30 rules (PR #445) +- New rule categories: **safety**, **performance**, **naming** (alongside existing style and whitespace) +- Rules cover SQL injection patterns, missing WHERE clauses on UPDATE/DELETE, implicit type conversions, inconsistent identifier casing, table aliasing conventions, and more +- See `docs/LINTING_RULES.md` for full reference + +#### Optimization Advisor (`pkg/advisor`) +- 12 new optimization rules: **OPT-009 through OPT-020** (PR #464) +- `gosqlx optimize` CLI subcommand runs the full advisor pipeline + +#### Fingerprinting (`pkg/fingerprint`) +- **`Normalize(sql)`** canonicalizes literals (`WHERE id = 123` → `WHERE id = ?`) (PR #463) +- **`Fingerprint(sql)`** returns SHA-256 hash of normalized query for deduplication and query caches +- Integration with advisor and linter for aggregated findings + +#### Integrations (sub-modules) +- **`integrations/opentelemetry/`**: `InstrumentedParse()` wraps `gosqlx.Parse()` with OpenTelemetry spans including `db.system`, `db.statement.type`, `db.sql.tables`, `db.sql.columns` attributes (PR #451) +- **`integrations/gorm/`**: GORM plugin that records executed query metadata (tables, columns, statement type) via GoSQLX parsing with GORM SQL normalization (backtick identifiers, `?` placeholders); exposes `Stats()` and `Reset()` APIs (PR #452) +- CI workflow for integration sub-modules (`.github/workflows/integrations.yml`) + +#### Parser / AST additions +- **DDL formatter**, **`CONNECT BY`** hierarchical queries, **`SAMPLE`** clause (PR #472) +- **JSON function parsing** improvements (PR #460) +- **`gosqlx stats`** CLI subcommand exposes object pool utilization (PR #459) +- **`gosqlx watch`** CLI subcommand for continuous validation (PR #458) +- **`gosqlx action`** GitHub Actions integration with inline annotations (PR #443) + +#### C binding +- Coverage hardened from **18% to 93%** via comprehensive test suite (PR #447) + +#### Docs, website, and CI +- "Who's Using GoSQLX" section in README (PR #475) +- OpenSSF Scorecard security analysis workflow (PR #443) +- Sentry → GitHub Issues automation (PR #438) +- Website: mobile responsiveness improvements (PR #441), comprehensive a11y/UX audit (PR #440) +- MariaDB + Snowflake added to playground dialect dropdown (PR #432) + +### Changed +- **OpenTelemetry SDK** bumped from v1.42.0 to v1.43.0 to address **CVE-2026-39883** (PR #502) +- Linter rule count exposed in glama.json, docs, and CLI help (10 → 30) +- Docs: SQL compatibility matrix updated to reflect Snowflake and ClickHouse 100% pass rate + +### Fixed +- **SQL Server TOP rendering**: parsed `TopClause` values now correctly render in formatted output (PR #507). Round-trippers that parse `SELECT TOP 10 * FROM users` and format again will see `TOP 10` preserved — previously it was silently dropped. +- **Snowflake ILIKE + PIVOT/UNPIVOT** parse-time fix (PR #484) +- **MINUS consumed as select-list alias**: `SELECT 1 MINUS SELECT 2` now correctly treats MINUS as a set operator (PR #494) +- **ClickHouse production playground WASM 404**: committed `gosqlx.wasm` to git, removed auto-commit step blocked by branch protection (PRs #423, #424) +- **Playground React error #310**: `useState`/`useCallback` now above early returns (PR #429) +- Website: Vercel Analytics, Speed Insights, and CSP fixes (PR #433); Sentry hydration mismatch (PRs #434, #437, #439) +- CI: `testcontainers` skip on Windows; `.trivyignore` entries for unfixable transitive CVEs; graceful handling of `glama-sync` on non-GA runners + +### Deprecated +Carried over from v1.13.0 (no new deprecations in v1.14.0): +- `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead +- `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens` +- `ConversionResult.PositionMapping` — always nil, will be removed in v2 + +### Security +- **CVE-2026-39883** (HIGH, `go.opentelemetry.io/otel/sdk`): resolved by upgrading to v1.43.0 (PR #502) +- **`.trivyignore`** entries audited and documented — all remaining ignores are transitive test-only (Docker via testcontainers) or npm-only (website build-time dependencies, not shipped in Go binaries) + +### Companion releases +- **VS Code extension**: bumped to **1.14.0** — tracks library version, no behavioral changes +- **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 diff --git a/website/src/content/blog/v1-9-2.md b/website/src/content/blog/v1-9-2.md index b3f9aea3..4a49e9f9 100644 --- a/website/src/content/blog/v1-9-2.md +++ b/website/src/content/blog/v1-9-2.md @@ -2,6 +2,7 @@ title: "v1.9.2 — Documentation, Community Health & License Fixes" date: "2026-03-08" version: "1.9.2" +description: "19 actionable bugs fixed (PR #348) — 3 new capabilities, 8 parser fixes," --- ### 📚 Documentation (PR #351) diff --git a/website/src/content/blog/v1-9-3.md b/website/src/content/blog/v1-9-3.md index 96da564a..34188104 100644 --- a/website/src/content/blog/v1-9-3.md +++ b/website/src/content/blog/v1-9-3.md @@ -2,6 +2,7 @@ title: "v1.9.3 — License Detection Fix" date: "2026-03-08" version: "1.9.3" +description: "v1.9.2 was cached by the Go module proxy before the LICENSE fix landed," --- ### 🐛 Bug Fixes diff --git a/website/src/lib/blog.ts b/website/src/lib/blog.ts index d3b1c9d4..12829949 100644 --- a/website/src/lib/blog.ts +++ b/website/src/lib/blog.ts @@ -7,6 +7,7 @@ export interface BlogPost { title: string; date: string; version: string; + description: string; content: string; } @@ -32,6 +33,7 @@ export function getPostBySlug(slug: string): BlogPost | null { title: data.title ?? '', date: data.date ?? '', version: data.version ?? '', + description: data.description ?? '', content, }; }