Skip to content

v1.6.0

Latest

Choose a tag to compare

@ajitpratap0 ajitpratap0 released this 11 Dec 12:39
· 6 commits to main since this release
563ea8b

πŸš€ 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 true

JSON/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