Skip to content

Commit be25753

Browse files
ajitpratap0Ajit Pratap Singhclaude
authored
chore(release): prepare v1.14.0 (#508)
Cut v1.14.0 release across all shipping surfaces: Library & CLI: - pkg/gosqlx: const Version = "1.14.0" - cmd/gosqlx: CLI version 1.14.0, updated feature list in help - pkg/mcp: MCP server handshake reports 1.14.0 - Full dialect list in CLI help (8 dialects) Companions: - vscode-extension: 1.14.0 (tracks library) - glama.json: 1.14.0 + MariaDB/ClickHouse in dialect list - python/pygosqlx: 0.2.0 (independent alpha track) - integrations/{opentelemetry,gorm}: bumped post-tag in Phase 6 - WASM: rebuilt for both wasm/playground and website/public/wasm Docs: - CHANGELOG: [1.14.0] - 2026-04-12 with full PR audit (30+ PRs) - MIGRATION.md: v1.13→v1.14 section with new APIs and behavioral notes - GETTING_STARTED.md: v1.14 feature highlights, 30-rule linter, 8 dialects - SQL_COMPATIBILITY.md: Snowflake 87/87 and ClickHouse 69/83 with gaps - examples/README.md: stale v1.6.0 -> v1.14.0 Benchmarks: - performance_baselines.json: refreshed to v1.14.0 (2026-04-12) - All 5 baselines improved 25-38% over v1.13.0 QA corpus tests committed (qa build tag, excluded from normal CI): - pkg/sql/parser/clickhouse_qa_test.go: 83 queries, 69 pass - pkg/sql/parser/snowflake_qa_test.go: 87 queries, 87 pass Verification: - task check green (fmt + vet + test:race) - All 37 library packages + CLI subcommands pass with -race - Performance regression test: 0 failures, 0 warnings - CLI, MCP (stdio), LSP smoke tests confirm 1.14.0 Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 96137ab commit be25753

File tree

20 files changed

+761
-84
lines changed

20 files changed

+761
-84
lines changed

CHANGELOG.md

Lines changed: 132 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,145 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.14.0] - 2026-04-12
11+
12+
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.
13+
1014
### Added
11-
- **SQL Transpilation** (`pkg/transpiler`): New `Transpile(sql, from, to)` function converts SQL between dialects with a composable rewrite-rule pipeline
15+
16+
#### Dialect-aware formatting (closes #479)
17+
- **`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
18+
- **`transform.ParseSQLWithDialect(sql, keywords.SQLDialect)`**: dialect-aware parsing convenience wrapper
19+
- `FormatOptions.Dialect` field threads dialect through the formatter pipeline
20+
- `normalizeSelectForDialect()` converts `Limit`/`Offset` into `TopClause` (SQL Server) or `FetchClause` (Oracle) on a shallow copy — original AST never mutated
21+
- Parsed `TopClause` now renders (previously silently dropped — a long-standing bug)
22+
- SQL Server pagination: `OFFSET m ROWS FETCH NEXT n ROWS ONLY` when both limit and offset are set
23+
- PR #507
24+
25+
#### Snowflake dialect (100% QA corpus — 87/87 queries, epic #483)
26+
- **`MATCH_RECOGNIZE`** clause (SQL:2016 R010): PARTITION BY, ORDER BY, MEASURES, ONE/ALL ROWS PER MATCH, AFTER MATCH SKIP, PATTERN, DEFINE (PR #506)
27+
- **`@stage` references** in FROM clause with optional path and file format (PR #505)
28+
- **`MINUS` as EXCEPT synonym** for Snowflake/Oracle (PR #494); fix for MINUS-as-alias edge case (PR #504)
29+
- **`SAMPLE` / `TABLESAMPLE`** clause with BERNOULLI/ROW/SYSTEM/BLOCK methods (PR #501)
30+
- **`QUALIFY`** clause for window-function filtering (Snowflake/BigQuery) (PR #490)
31+
- **VARIANT colon-path expressions** (`expr:field.sub[0]`) (PR #496)
32+
- **Time-travel** `AT`/`BEFORE`/`CHANGES` on table references (PR #495)
33+
- **`LATERAL FLATTEN`** table function + named arguments (`name => expr`) (PR #492)
34+
- **`TRY_CAST`** + `IGNORE NULLS` / `RESPECT NULLS` for window functions (PR #486)
35+
- **`LIKE ANY`/`LIKE ALL`** and `ILIKE ANY`/`ILIKE ALL` quantifiers (PR #500)
36+
- **`USE [WAREHOUSE|DATABASE|SCHEMA|ROLE]`** and `DESCRIBE` with object-kind prefixes (PR #491)
37+
- **`COPY INTO`**, `PUT`, `GET`, `LIST`, `REMOVE` parse-only stubs (PR #499)
38+
- **`CREATE STAGE`/`STREAM`/`TASK`/`PIPE`/`FILE FORMAT`/`WAREHOUSE`/`DATABASE`/`SCHEMA`/`ROLE`/`SEQUENCE`/`FUNCTION`/`PROCEDURE`** parse-only stubs (PR #498)
39+
- **`CLUSTER BY`**, `COPY GRANTS`, and CTAS (`CREATE TABLE ... AS SELECT`) for CREATE TABLE (PR #504)
40+
- **`ILIKE`** + PIVOT/UNPIVOT support for Snowflake dialect (PR #484)
41+
42+
#### ClickHouse dialect (69/83 QA corpus — 83%, up from 53% in v1.13.0, epic #482)
43+
- 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
44+
- **Reserved-word identifiers**: `table`, `partition`, `tables`, `databases` now valid as column/identifier names (closes #480, PR #481)
45+
- **Nested column types**: `Nullable(T)`, `Array(T)`, `Map(K,V)`, `LowCardinality(T)` in CREATE TABLE (PR #488)
46+
- **Engine clauses**: `MergeTree()`, `ORDER BY`, `PARTITION BY`, `PRIMARY KEY`, `SAMPLE BY`, `TTL`, `SETTINGS` (PR #488)
47+
- **Parametric aggregates**: `quantile(0.95)(duration)` double-paren syntax (PR #487)
48+
- **Bare-bracket array literals**: `[1, 2, 3]` without ARRAY keyword (PR #485)
49+
- **`ORDER BY ... WITH FILL`** with FROM/TO/STEP (PR #493)
50+
- **`CODEC(...)`** column compression option (PR #497)
51+
- **`WITH TOTALS`** in GROUP BY, **`LIMIT ... BY`** clause, **ANY/ALL JOIN** strictness prefix, `DEFAULT` as identifier (PR #503)
52+
- **`SETTINGS`** clause on SELECT and in CREATE TABLE, **`TTL`** column clause, **`INSERT ... FORMAT`** (JSONEachRow, CSV, Parquet, etc.) (PR #489)
53+
54+
#### MariaDB dialect
55+
- New `DialectMariaDB` extending MySQL (`mariadb`) (PR #431)
56+
- **SEQUENCE DDL**: `CREATE/DROP/ALTER SEQUENCE` with full option set (START WITH, INCREMENT BY, MINVALUE/MAXVALUE, CYCLE, CACHE, NOCACHE)
57+
- **Temporal tables**: `FOR SYSTEM_TIME`, `WITH SYSTEM VERSIONING`, `PERIOD FOR`
58+
- **Hierarchical queries**: `CONNECT BY` with `PRIOR`, `START WITH`, `NOCYCLE`
59+
- Added to playground and WASM dialect map (PR #432)
60+
61+
#### SQL Server enhancements
62+
- **PIVOT / UNPIVOT** clause parsing (T-SQL) (PR #477)
63+
64+
#### SQL Transpilation (`pkg/transpiler`)
65+
- **`Transpile(sql, from, to keywords.SQLDialect)`**: composable rewrite-rule pipeline for cross-dialect conversion (PR #449)
1266
- MySQL → PostgreSQL: `AUTO_INCREMENT``SERIAL`/`BIGSERIAL`, `TINYINT(1)``BOOLEAN`
1367
- PostgreSQL → MySQL: `SERIAL``INT AUTO_INCREMENT`, `ILIKE``LOWER() LIKE LOWER()`
1468
- PostgreSQL → SQLite: `SERIAL`/`BIGSERIAL``INTEGER`, array types → `TEXT`
15-
- `gosqlx.Transpile()` top-level convenience wrapper
16-
- `gosqlx transpile --from <dialect> --to <dialect>` CLI subcommand
17-
- **Live schema introspection** (`pkg/schema/db`): New `Loader` interface and `DatabaseSchema`/`Table`/`Column`/`Index`/`ForeignKey` types for querying live database metadata
18-
- **PostgreSQL schema loader** (`pkg/schema/postgres`): Introspects tables, columns (with primary/unique flags), indexes, and foreign keys via `information_schema` and `pg_catalog`
19-
- **MySQL schema loader** (`pkg/schema/mysql`): Introspects tables, columns, indexes, and foreign keys via `information_schema`
20-
- **SQLite schema loader** (`pkg/schema/sqlite`): Introspects tables, columns, indexes, and foreign keys via PRAGMA commands (pure Go, no cgo required)
21-
- **`gosqlx.LoadSchema()`** top-level convenience wrapper for dialect-agnostic schema loading
69+
- **`gosqlx.Transpile()`** top-level convenience wrapper
70+
- **`gosqlx transpile --from <dialect> --to <dialect>`** CLI subcommand
71+
72+
#### Live schema introspection (`pkg/schema/db`)
73+
- **`Loader` interface** with `DatabaseSchema`/`Table`/`Column`/`Index`/`ForeignKey` types (PR #448)
74+
- **PostgreSQL loader** (`pkg/schema/postgres`): introspects tables, columns (with primary/unique flags), indexes, and foreign keys via `information_schema` and `pg_catalog`
75+
- **MySQL loader** (`pkg/schema/mysql`): introspects tables, columns, indexes, and foreign keys via `information_schema`
76+
- **SQLite loader** (`pkg/schema/sqlite`): introspects via PRAGMA commands (pure Go, no cgo)
77+
- **`gosqlx.LoadSchema()`** top-level dialect-agnostic convenience wrapper
2278
- Integration tests using `testcontainers-go` v0.32.0 for PostgreSQL and MySQL loaders
23-
- **MariaDB dialect** (`--dialect mariadb`): New SQL dialect extending MySQL with support for SEQUENCE DDL (`CREATE/DROP/ALTER SEQUENCE` with full option set), temporal tables (`FOR SYSTEM_TIME`, `WITH SYSTEM VERSIONING`, `PERIOD FOR`), and `CONNECT BY` hierarchical queries with `PRIOR`, `START WITH`, and `NOCYCLE`
24-
- `integrations/opentelemetry/` sub-module: `InstrumentedParse()` wraps `gosqlx.Parse()` with OpenTelemetry spans including `db.system`, `db.statement.type`, `db.sql.tables`, `db.sql.columns` attributes
25-
- `integrations/gorm/` sub-module: 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
79+
80+
#### DML Transform API (`pkg/transform`)
81+
- `AddSetClause`, `SetClause`, `RemoveSetClause`, `ReplaceSetClause` for UPDATE statements (PR #446)
82+
- `AddReturning`, `RemoveReturning` for INSERT/UPDATE/DELETE (PR #446)
83+
84+
#### Linter — expanded from 10 to 30 rules (PR #445)
85+
- New rule categories: **safety**, **performance**, **naming** (alongside existing style and whitespace)
86+
- Rules cover SQL injection patterns, missing WHERE clauses on UPDATE/DELETE, implicit type conversions, inconsistent identifier casing, table aliasing conventions, and more
87+
- See `docs/LINTING_RULES.md` for full reference
88+
89+
#### Optimization Advisor (`pkg/advisor`)
90+
- 12 new optimization rules: **OPT-009 through OPT-020** (PR #464)
91+
- `gosqlx optimize` CLI subcommand runs the full advisor pipeline
92+
93+
#### Fingerprinting (`pkg/fingerprint`)
94+
- **`Normalize(sql)`** canonicalizes literals (`WHERE id = 123``WHERE id = ?`) (PR #463)
95+
- **`Fingerprint(sql)`** returns SHA-256 hash of normalized query for deduplication and query caches
96+
- Integration with advisor and linter for aggregated findings
97+
98+
#### Integrations (sub-modules)
99+
- **`integrations/opentelemetry/`**: `InstrumentedParse()` wraps `gosqlx.Parse()` with OpenTelemetry spans including `db.system`, `db.statement.type`, `db.sql.tables`, `db.sql.columns` attributes (PR #451)
100+
- **`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)
26101
- CI workflow for integration sub-modules (`.github/workflows/integrations.yml`)
27102

103+
#### Parser / AST additions
104+
- **DDL formatter**, **`CONNECT BY`** hierarchical queries, **`SAMPLE`** clause (PR #472)
105+
- **JSON function parsing** improvements (PR #460)
106+
- **`gosqlx stats`** CLI subcommand exposes object pool utilization (PR #459)
107+
- **`gosqlx watch`** CLI subcommand for continuous validation (PR #458)
108+
- **`gosqlx action`** GitHub Actions integration with inline annotations (PR #443)
109+
110+
#### C binding
111+
- Coverage hardened from **18% to 93%** via comprehensive test suite (PR #447)
112+
113+
#### Docs, website, and CI
114+
- "Who's Using GoSQLX" section in README (PR #475)
115+
- OpenSSF Scorecard security analysis workflow (PR #443)
116+
- Sentry → GitHub Issues automation (PR #438)
117+
- Website: mobile responsiveness improvements (PR #441), comprehensive a11y/UX audit (PR #440)
118+
- MariaDB + Snowflake added to playground dialect dropdown (PR #432)
119+
120+
### Changed
121+
- **OpenTelemetry SDK** bumped from v1.42.0 to v1.43.0 to address **CVE-2026-39883** (PR #502)
122+
- Linter rule count exposed in glama.json, docs, and CLI help (10 → 30)
123+
- Docs: SQL compatibility matrix updated to reflect Snowflake and ClickHouse 100% pass rate
124+
125+
### Fixed
126+
- **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.
127+
- **Snowflake ILIKE + PIVOT/UNPIVOT** parse-time fix (PR #484)
128+
- **MINUS consumed as select-list alias**: `SELECT 1 MINUS SELECT 2` now correctly treats MINUS as a set operator (PR #494)
129+
- **ClickHouse production playground WASM 404**: committed `gosqlx.wasm` to git, removed auto-commit step blocked by branch protection (PRs #423, #424)
130+
- **Playground React error #310**: `useState`/`useCallback` now above early returns (PR #429)
131+
- Website: Vercel Analytics, Speed Insights, and CSP fixes (PR #433); Sentry hydration mismatch (PRs #434, #437, #439)
132+
- CI: `testcontainers` skip on Windows; `.trivyignore` entries for unfixable transitive CVEs; graceful handling of `glama-sync` on non-GA runners
133+
134+
### Deprecated
135+
Carried over from v1.13.0 (no new deprecations in v1.14.0):
136+
- `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead
137+
- `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens`
138+
- `ConversionResult.PositionMapping` — always nil, will be removed in v2
139+
140+
### Security
141+
- **CVE-2026-39883** (HIGH, `go.opentelemetry.io/otel/sdk`): resolved by upgrading to v1.43.0 (PR #502)
142+
- **`.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)
143+
144+
### Companion releases
145+
- **VS Code extension**: bumped to **1.14.0** — tracks library version, no behavioral changes
146+
- **MCP server**: bumped to **1.14.0** — glama.json updated with MariaDB and ClickHouse in dialect list
147+
- **`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
148+
28149
## [1.13.0] - 2026-03-20
29150

30151
### Added

cmd/gosqlx/cmd/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
//
342342
// Version information:
343343
//
344-
// Version = "1.13.0" - Current CLI version
344+
// Version = "1.14.0" - Current CLI version
345345
//
346346
// # Dependencies
347347
//

cmd/gosqlx/cmd/root.go

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@ import (
2828
// This version tracks feature releases and compatibility.
2929
// Format: MAJOR.MINOR.PATCH (Semantic Versioning 2.0.0)
3030
//
31+
// Version 1.14.0 includes:
32+
// - Dialect-aware SQL formatting (TOP/FETCH FIRST/LIMIT per dialect)
33+
// - Snowflake dialect: 87/87 QA pass (MATCH_RECOGNIZE, @stage, SAMPLE, QUALIFY, VARIANT, time-travel, MINUS, LATERAL FLATTEN, TRY_CAST)
34+
// - ClickHouse dialect: 69/83 QA pass, up from 53% (nested types, parametric aggregates, WITH FILL, CODEC, SETTINGS/TTL, INSERT FORMAT)
35+
// - MariaDB dialect (SEQUENCE DDL, temporal tables, CONNECT BY)
36+
// - SQL transpilation (MySQL↔PostgreSQL, PostgreSQL→SQLite) + CLI subcommand
37+
// - Live schema introspection (Postgres/MySQL/SQLite loaders)
38+
// - DML transform API (SET clause, RETURNING clause)
39+
// - Linter expanded from 10 to 30 rules
40+
// - Integrations: OpenTelemetry + GORM sub-modules
41+
//
3142
// Version 1.13.0 includes:
32-
// - ClickHouse SQL dialect support (PREWHERE, FINAL, GLOBAL IN)
33-
// - LSP semantic tokens + diagnostic debouncing
34-
// - Parser API consolidation (ParseFromModelTokens canonical)
35-
// Version 1.12.1 includes:
36-
// - MCP Server: All GoSQLX SQL capabilities as Model Context Protocol tools over streamable HTTP
37-
// - 7 MCP tools: validate_sql, format_sql, parse_sql, extract_metadata, security_scan, lint_sql, analyze_sql
38-
// - Optional bearer token auth via GOSQLX_MCP_AUTH_TOKEN
39-
// - Go minimum bumped to 1.23.0 (required by mark3labs/mcp-go)
40-
var Version = "1.13.0"
43+
// - ClickHouse SQL dialect support (PREWHERE, FINAL, GLOBAL IN)
44+
// - LSP semantic tokens + diagnostic debouncing
45+
// - Parser API consolidation (ParseFromModelTokens canonical)
46+
var Version = "1.14.0"
4147

4248
var (
4349
// verbose enables detailed output for debugging and troubleshooting.
@@ -120,12 +126,12 @@ Key features:
120126
• High-performance formatting with intelligent indentation
121127
• AST structure inspection and analysis
122128
• Security vulnerability detection
123-
• Multi-dialect SQL support (PostgreSQL, MySQL, SQL Server, Oracle, SQLite)
129+
• Multi-dialect SQL support (PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse)
124130
• Batch processing with directory/glob patterns
125131
• CI/CD integration with proper exit codes
126132
127133
Performance: 1.5M+ operations/second sustained, 1.97M peak. 100-1000x faster than competitors.`,
128-
Version: "1.13.0",
134+
Version: "1.14.0",
129135
}
130136

131137
// Execute adds all child commands to the root command and sets flags appropriately.

0 commit comments

Comments
 (0)