|
1 | 1 | --- |
2 | | -title: "v1.13.0" |
| 2 | +title: "v1.13.0 — ClickHouse Dialect & LSP Semantic Tokens" |
3 | 3 | date: "2026-03-20" |
4 | 4 | version: "1.13.0" |
| 5 | +description: "GoSQLX v1.13.0 adds ClickHouse SQL dialect support, LSP semantic tokens, and comprehensive website improvements." |
5 | 6 | --- |
6 | 7 |
|
| 8 | +GoSQLX v1.13.0 ships ClickHouse dialect support, LSP semantic tokens, parser API consolidation, and a comprehensive website security and accessibility pass. |
| 9 | + |
7 | 10 | ### Added |
8 | | -- ClickHouse SQL dialect support (`DialectClickHouse = "clickhouse"`) with 30+ keywords |
9 | | -- `PrewhereClause` field on `SelectStatement` AST for ClickHouse PREWHERE optimization |
10 | | -- `Final` field on `TableReference` for ClickHouse MergeTree FINAL modifier |
11 | | -- PREWHERE clause parsing in ClickHouse dialect mode |
12 | | -- FINAL modifier parsing in ClickHouse dialect mode |
13 | | -- GLOBAL IN / GLOBAL NOT IN expression parsing (ClickHouse) |
14 | | -- ClickHouse data types: FixedString, LowCardinality, Nullable, DateTime64, IPv4, IPv6 |
15 | | -- MergeTree engine family keywords (MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, etc.) |
16 | | -- LSP semantic token provider (`textDocument/semanticTokens/full`) with 6-type legend: keyword, identifier, number, string, operator, comment |
17 | | -- LSP diagnostic debouncing (300ms) — prevents excessive re-parsing on rapid typing |
18 | | -- LSP document cleanup on `textDocument/didClose` |
19 | | -- Glama MCP registry integration with stdio transport support |
20 | | -- Auto-trigger Glama build on GitHub release via CI (`glama-sync.yml`) |
21 | | -- Sentry error monitoring, tracing, and session replay on website |
| 11 | + |
| 12 | +**ClickHouse SQL Dialect** |
| 13 | + |
| 14 | +The new `DialectClickHouse` dialect parses ClickHouse-specific SQL that is not valid in standard SQL or other dialects: |
| 15 | + |
| 16 | +```go |
| 17 | +ast, err := gosqlx.ParseWithDialect( |
| 18 | + `SELECT DISTINCT ON (user_id) * FROM events FINAL |
| 19 | + PREWHERE event_type = 'purchase' |
| 20 | + WHERE ts > now() - INTERVAL 7 DAY`, |
| 21 | + gosqlx.DialectClickHouse, |
| 22 | +) |
| 23 | +``` |
| 24 | + |
| 25 | +Supported ClickHouse features: |
| 26 | +- **PREWHERE** clause — pre-filter applied before reading primary key data, stored as `SelectStatement.PrewhereClause` |
| 27 | +- **FINAL** modifier on table references — forces MergeTree to merge all parts before reading, stored as `TableReference.Final` |
| 28 | +- **GLOBAL IN / GLOBAL NOT IN** — distributed query execution across shards |
| 29 | +- **ClickHouse data types**: `FixedString(N)`, `LowCardinality(T)`, `Nullable(T)`, `DateTime64`, `IPv4`, `IPv6` |
| 30 | +- **MergeTree engine keywords**: MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, SUMMINGMERGETREE, COLLAPSINGMERGETREE, VERSIONEDCOLLAPSINGMERGETREE |
| 31 | +- **30+ additional keywords**: TTL, CODEC, FORMAT, SETTINGS, DISTRIBUTED, ASOF, SAMPLE, and more |
| 32 | + |
| 33 | +**LSP Semantic Token Provider** |
| 34 | + |
| 35 | +`textDocument/semanticTokens/full` is now supported with a 6-type legend: |
| 36 | + |
| 37 | +| Type | Covers | |
| 38 | +|------|--------| |
| 39 | +| `keyword` | SELECT, FROM, WHERE, JOIN, etc. | |
| 40 | +| `identifier` | Table names, column names, aliases | |
| 41 | +| `number` | Integer and float literals | |
| 42 | +| `string` | String literals and quoted identifiers | |
| 43 | +| `operator` | =, >, <, AND, OR, NOT, etc. | |
| 44 | +| `comment` | Line and block comments | |
| 45 | + |
| 46 | +VS Code and Neovim users will see richer syntax highlighting without any configuration changes. |
| 47 | + |
| 48 | +**LSP Diagnostic Debouncing** |
| 49 | + |
| 50 | +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. |
22 | 51 |
|
23 | 52 | ### Changed |
24 | | -- `ParseFromModelTokens` is now the canonical parse entry point (positions always populated) |
25 | | -- Docker base image Go 1.25 → 1.26 to match go.mod requirement |
26 | | -- Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057) |
27 | | -- Website rebuilt on Next.js 16 App Router with comprehensive a11y, SEO, and performance audit |
28 | | -- Lighthouse Desktop: 100 Performance / 100 Accessibility / 100 SEO (maintained) |
29 | | -- CI: Vercel deployment working-directory bug fixed (doubled path `website/website/`) |
| 53 | + |
| 54 | +- `ParseFromModelTokens` is now the canonical parse entry point. It has always populated position information — the previous `ParseFromModelTokensWithPositions` variant is now an alias. |
| 55 | +- Docker base image bumped Go 1.25 → 1.26 to match go.mod. |
| 56 | +- Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057). |
| 57 | +- Glama MCP registry now auto-syncs on every GitHub release. |
30 | 58 |
|
31 | 59 | ### Deprecated |
32 | | -- `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead |
33 | | -- `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens` |
34 | | -- `ConversionResult.PositionMapping` — always nil, will be removed in v2 |
| 60 | + |
| 61 | +These functions still work but will be removed in v2: |
| 62 | + |
| 63 | +| Deprecated | Use Instead | |
| 64 | +|-----------|-------------| |
| 65 | +| `parser.Parse([]token.Token)` | `parser.ParseFromModelTokens(tokens)` | |
| 66 | +| `parser.ParseFromModelTokensWithPositions(tokens)` | `parser.ParseFromModelTokens(tokens)` | |
| 67 | +| `ConversionResult.PositionMapping` | Always nil — remove any references | |
| 68 | + |
| 69 | +**Migration example:** |
| 70 | + |
| 71 | +```go |
| 72 | +// Before (deprecated) |
| 73 | +tokens := tokenizer.Tokenize(sql) |
| 74 | +ast, err := parser.Parse(tokens) |
| 75 | + |
| 76 | +// After (canonical — positions always populated) |
| 77 | +tokens := tokenizer.Tokenize(sql) |
| 78 | +ast, err := parser.ParseFromModelTokens(tokens) |
| 79 | +``` |
35 | 80 |
|
36 | 81 | ### Fixed |
37 | | -- Production playground WASM 404 (CI working-directory path doubling) |
| 82 | + |
| 83 | +- Production playground WASM 404 — CI `working-directory: website` was doubling the path against Vercel's `rootDirectory=website` setting |
38 | 84 | - WASM service worker cache versioning |
39 | | -- Broken `.md` relative links in docs → `/docs/` URL paths |
40 | | -- JSON-LD BreadcrumbList and Article markup on docs pages |
41 | | -- Horizontal overflow at 320–390px viewport |
42 | | -- Keyboard accessibility (tabIndex) on scrollable code blocks |
| 85 | +- Broken `.md` relative links in docs pointing to local files instead of `/docs/` URL paths |
| 86 | +- JSON-LD BreadcrumbList and Article markup on docs and blog pages |
| 87 | +- Horizontal overflow at 320-390px viewport widths |
| 88 | +- Keyboard accessibility (`tabIndex={0}`) on scrollable code blocks (WCAG 2.1.1) |
| 89 | +- `rel=preload` for `gosqlx.wasm` on /playground |
| 90 | + |
| 91 | +### Performance |
| 92 | + |
| 93 | +Benchmark results from 2026-03-20 on Apple Silicon (Go 1.26.1): |
| 94 | + |
| 95 | +| Query Type | ops/sec | |
| 96 | +|------------|---------| |
| 97 | +| Simple SELECT | **1.40M** | |
| 98 | +| Complex SELECT | **376K** | |
| 99 | +| Window Function | **848K** | |
| 100 | +| CTE | **833K** | |
| 101 | +| INSERT | **992K** | |
| 102 | +| Simple SELECT (parallel) | **3.16M** | |
| 103 | +| Sustained 30s load | **513K** | |
| 104 | + |
| 105 | +The ClickHouse dialect additions have no measurable impact on non-ClickHouse parse paths. |
| 106 | + |
| 107 | +### Full Changelog |
| 108 | + |
| 109 | +- **Added**: ClickHouse SQL dialect support (`DialectClickHouse`) with 30+ keywords |
| 110 | +- **Added**: `PrewhereClause` field on `SelectStatement` AST for ClickHouse PREWHERE optimization |
| 111 | +- **Added**: `Final` field on `TableReference` for ClickHouse MergeTree FINAL modifier |
| 112 | +- **Added**: GLOBAL IN / GLOBAL NOT IN expression parsing (ClickHouse) |
| 113 | +- **Added**: ClickHouse data types: FixedString, LowCardinality, Nullable, DateTime64, IPv4, IPv6 |
| 114 | +- **Added**: MergeTree engine family keywords (MERGETREE, REPLACINGMERGETREE, AGGREGATINGMERGETREE, etc.) |
| 115 | +- **Added**: LSP semantic token provider (`textDocument/semanticTokens/full`) with 6-type legend |
| 116 | +- **Added**: LSP diagnostic debouncing (300ms) — prevents excessive re-parsing on rapid typing |
| 117 | +- **Added**: LSP document cleanup on `textDocument/didClose` |
| 118 | +- **Added**: Glama MCP registry integration with stdio transport support |
| 119 | +- **Added**: Auto-trigger Glama build on GitHub release via CI (`glama-sync.yml`) |
| 120 | +- **Added**: Sentry error monitoring, tracing, and session replay on website |
| 121 | +- **Changed**: `ParseFromModelTokens` is now the canonical parse entry point (positions always populated) |
| 122 | +- **Changed**: Docker base image Go 1.25 → 1.26 to match go.mod requirement |
| 123 | +- **Changed**: Next.js 16.1.6 → 16.1.7 (CVE-2026-27979, CVE-2026-27980, CVE-2026-29057) |
| 124 | +- **Changed**: Website rebuilt on Next.js 16 App Router with comprehensive a11y, SEO, and performance audit |
| 125 | +- **Changed**: Lighthouse Desktop: 100 Performance / 100 Accessibility / 100 SEO |
| 126 | +- **Deprecated**: `parser.Parse([]token.Token)` — use `ParseFromModelTokens` instead |
| 127 | +- **Deprecated**: `ParseFromModelTokensWithPositions` — consolidated into `ParseFromModelTokens` |
| 128 | +- **Deprecated**: `ConversionResult.PositionMapping` — always nil, will be removed in v2 |
| 129 | +- **Fixed**: Production playground WASM 404 (CI working-directory path doubling) |
| 130 | +- **Fixed**: WASM service worker cache versioning |
| 131 | +- **Fixed**: Broken `.md` relative links in docs → `/docs/` URL paths |
| 132 | +- **Fixed**: JSON-LD BreadcrumbList and Article markup on docs pages |
| 133 | +- **Fixed**: Horizontal overflow at 320–390px viewport |
| 134 | +- **Fixed**: Keyboard accessibility (tabIndex) on scrollable code blocks |
0 commit comments