π GoSQLX v1.6.0 - Major Feature Release
This release represents a major milestone with 20+ PRs merged, adding comprehensive PostgreSQL support, a full Language Server Protocol implementation, VSCode extension, and significant performance optimizations.
β¨ Highlights
| Feature | Description |
|---|---|
| π PostgreSQL Extensions | LATERAL JOIN, JSON/JSONB operators, DISTINCT ON, FILTER clause |
| π LSP Server | Full Language Server Protocol for IDE integration |
| π VSCode Extension | Official extension with syntax highlighting & autocomplete |
| β‘ Performance | 14x faster tokens, 575x faster keyword suggestions |
| π Linter Rules | 10 built-in rules (L001-L010) with auto-fix |
π PostgreSQL Features (PRs #173-#177)
LATERAL JOIN Support
SELECT u.name, recent_orders.total
FROM users u
LEFT JOIN LATERAL (
SELECT SUM(amount) as total FROM orders WHERE user_id = u.id
) AS recent_orders ON trueJSON/JSONB Operators
- Arrow operators:
->,->> - Path operators:
#>,#>> - Containment:
@>,<@ - Existence:
?,?|,?& - Delete:
#-
SELECT data -> 'user' ->> 'email',
data #> '{address,city}'
FROM users
WHERE data @> '{"active": true}'DISTINCT ON & FILTER Clause
SELECT DISTINCT ON (user_id) user_id, created_at, status
FROM orders ORDER BY user_id, created_at DESC;
SELECT COUNT(*) FILTER (WHERE status = 'completed') FROM orders;π Language Server Protocol (PRs #128-#129)
Full LSP implementation for IDE integration:
- Diagnostics: Real-time syntax error detection
- Hover: Documentation for 60+ SQL keywords
- Completion: 100+ keywords, functions, and 22 snippets
- Formatting: SQL code formatting
- Document Symbols: Statement outline navigation
- Signature Help: Function signatures for 20+ SQL functions
- Code Actions: Quick fixes (add semicolon, uppercase keywords)
gosqlx lsp # Start LSP server
gosqlx lsp --log /tmp/lsp.log # With debug loggingπ VSCode Extension (PRs #132, #135)
Official GoSQLX extension for Visual Studio Code:
- Real-time SQL validation via LSP
- SQL syntax highlighting with TextMate grammar
- SQL formatting with customizable options
- Intelligent autocomplete
- Multi-dialect support
π Linter Rules (PRs #164, #176)
10 built-in rules with auto-fix:
| Rule | Description |
|---|---|
| L001 | Avoid SELECT * |
| L002 | Missing table aliases in JOIN |
| L003 | Implicit column aliases |
| L004 | Missing WHERE in UPDATE/DELETE |
| L005 | Inefficient LIKE patterns |
| L006 | Use explicit JOIN syntax |
| L007 | ORDER BY ordinal numbers |
| L008 | Inconsistent keyword casing |
| L009 | Missing column list in INSERT |
| L010 | DISTINCT without ORDER BY |
gosqlx lint query.sql
gosqlx lint --fix query.sqlβ‘ Performance Improvements
- 14x faster token type comparison with O(1) int-based lookups
- 575x faster keyword suggestions with caching
- 22.5x faster config file loading
- 1.38M+ ops/sec sustained throughput maintained
π οΈ Developer Tools
- go-task: Modern Taskfile.yml replacing Makefile
- Structured Errors: Error codes E1001-E3004
- Security Scanner: Enhanced SQL injection detection
- Test Coverage: AST 80%+, Models 100%
π¦ Installation
# Library
go get github.com/ajitpratap0/[email protected]
# CLI
go install github.com/ajitpratap0/GoSQLX/cmd/[email protected]π Full Changelog
See CHANGELOG.md for the complete list of changes.
Full Changelog: v1.5.1...v1.6.0