Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/MARKETPLACE_PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Add relevant badges to increase trust:
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-GoSQLX-blue.svg)](...)
[![GitHub Release](https://img.shields.io/github/release/ajitpratap0/GoSQLX.svg)](...)
[![GitHub Stars](https://img.shields.io/github/stars/ajitpratap0/GoSQLX.svg)](...)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Go Report Card](https://goreportcard.com/badge/github.com/ajitpratap0/GoSQLX)](...)
```

Expand Down
4 changes: 2 additions & 2 deletions ACTION_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-GoSQLX%20Validator-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=github)](https://github.com/marketplace/actions/gosqlx-sql-validator)
[![GitHub Release](https://img.shields.io/github/release/ajitpratap0/GoSQLX.svg?style=flat)](https://github.com/ajitpratap0/GoSQLX/releases)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Ultra-fast SQL validation, linting, and formatting for your CI/CD pipelines. **100-1000x faster** than traditional SQL linters like SQLFluff.

Expand Down Expand Up @@ -435,7 +435,7 @@ We welcome contributions! Please see:

## License

MIT License - see [LICENSE](LICENSE) file for details.
GNU Affero General Public License v3.0 (AGPL-3.0) - see [LICENSE](LICENSE) file for details.

## Support

Expand Down
682 changes: 661 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[![Go Version](https://img.shields.io/badge/Go-1.19+-00ADD8?style=for-the-badge&logo=go)](https://go.dev)
[![Release](https://img.shields.io/github/v/release/ajitpratap0/GoSQLX?style=for-the-badge&color=orange)](https://github.com/ajitpratap0/GoSQLX/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge)](http://makeapullrequest.com)

[![Tests](https://img.shields.io/github/actions/workflow/status/ajitpratap0/GoSQLX/test.yml?branch=main&label=Tests&style=flat-square)](https://github.com/ajitpratap0/GoSQLX/actions)
Expand Down Expand Up @@ -771,7 +771,7 @@ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guid

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the [LICENSE](LICENSE) file for details.

## 🚀 Roadmap

Expand Down Expand Up @@ -940,7 +940,7 @@ If GoSQLX helps your project, please consider:

<div align="center">

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
This project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** - see the [LICENSE](LICENSE) file for details.

</div>

Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES_v1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Special thanks to all contributors who made this release possible!

## 📄 License

MIT License - see [LICENSE](LICENSE) file for details
GNU Affero General Public License v3.0 (AGPL-3.0) - see [LICENSE](LICENSE) file for details

---

Expand Down
2 changes: 1 addition & 1 deletion cmd/gosqlx/internal/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ When adding new configuration options:

## License

This package is part of GoSQLX and is licensed under the MIT License.
This package is part of GoSQLX and is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
2 changes: 1 addition & 1 deletion docs/CLI_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,4 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed guidelines.

## License

GoSQLX CLI is licensed under the MIT License. See [LICENSE](../LICENSE) for details.
GoSQLX CLI is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](../LICENSE) for details.
2 changes: 1 addition & 1 deletion docs/COMPARISON.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This guide helps you choose the right SQL parsing tool for your needs. We provid
| **IDE Integration** | ⚠️ Planned | ✅ VSCode | ❌ No | ⚠️ Limited | ❌ No |
| **Config Files** | ⚠️ Planned | ✅ .sqlfluff | ⚠️ Limited | ⚠️ Limited | ❌ No |
| **Active Development** | ✅ Yes | ✅ Yes | ⚠️ Slow | ✅ Yes | ✅ Yes |
| **License** | MIT | MIT | MIT | Apache 2.0 | BSD |
| **License** | AGPL-3.0 | MIT | MIT | Apache 2.0 | BSD |

*pg_query uses PostgreSQL's official parser, so PostgreSQL compliance is 100%

Expand Down
24 changes: 24 additions & 0 deletions pkg/sql/parser/sustained_load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func TestSustainedLoad_Tokenization10Seconds(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

const (
duration = 10 * time.Second
Expand Down Expand Up @@ -93,6 +97,10 @@ func TestSustainedLoad_Parsing10Seconds(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

const duration = 10 * time.Second
// Scale workers to available CPUs to avoid contention on smaller CI runners
Expand Down Expand Up @@ -207,6 +215,10 @@ func TestSustainedLoad_EndToEnd10Seconds(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

const duration = 10 * time.Second
// Scale workers to available CPUs to avoid contention on smaller CI runners
Expand Down Expand Up @@ -342,6 +354,10 @@ func TestSustainedLoad_MemoryStability(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

const duration = 10 * time.Second
// Scale workers to available CPUs to avoid contention on smaller CI runners
Expand Down Expand Up @@ -460,6 +476,10 @@ func TestSustainedLoad_VaryingWorkers(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

// Reduce duration and worker counts when race detection is enabled
// to prevent test timeouts (race detection adds significant overhead)
Expand Down Expand Up @@ -523,6 +543,10 @@ func TestSustainedLoad_ComplexQueries(t *testing.T) {
if testing.Short() {
t.Skip("Skipping sustained load test in short mode")
}
// Skip when race detector is enabled - adds 3-5x overhead making performance measurements unreliable
if raceEnabled {
t.Skip("Skipping sustained load test with race detector (adds 3-5x overhead)")
}

const duration = 10 * time.Second
// Scale workers to available CPUs to avoid contention on smaller CI runners
Expand Down
5 changes: 5 additions & 0 deletions pkg/sql/tokenizer/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ func TestTokenizeContext_ErrorHandling(t *testing.T) {

// TestTokenizeContext_CancellationResponseTime verifies fast cancellation (< 100ms requirement)
func TestTokenizeContext_CancellationResponseTime(t *testing.T) {
// Skip when race detector is enabled - adds 3-5x overhead making timing measurements unreliable
if raceEnabled {
t.Skip("Skipping timing-sensitive test with race detector (adds 3-5x overhead)")
}

ctx, cancel := context.WithCancel(context.Background())
tkz := GetTokenizer()
defer PutTokenizer(tkz)
Expand Down
9 changes: 9 additions & 0 deletions pkg/sql/tokenizer/norace.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build !race
// +build !race

package tokenizer

// raceEnabled is set to false when the race detector is not enabled
//
//nolint:unused // Used conditionally based on build tags
const raceEnabled = false
9 changes: 9 additions & 0 deletions pkg/sql/tokenizer/race.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build race
// +build race

package tokenizer

// raceEnabled is set to true when the race detector is enabled
//
//nolint:unused // Used conditionally based on build tags
const raceEnabled = true
28 changes: 28 additions & 0 deletions vscode-extension/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": ["camelCase", "PascalCase"]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
}
6 changes: 6 additions & 0 deletions vscode-extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
out/
dist/
node_modules/
.vscode-test/
*.vsix
.DS_Store
12 changes: 12 additions & 0 deletions vscode-extension/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
node_modules/**
.github/**
34 changes: 34 additions & 0 deletions vscode-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Change Log

All notable changes to the "GoSQLX" extension will be documented in this file.

## [0.1.0] - 2025-11-27

### Added
- Initial release of GoSQLX VS Code extension
- Real-time SQL validation via GoSQLX Language Server
- SQL syntax highlighting with comprehensive TextMate grammar
- SQL formatting with customizable options
- Configurable indent size
- Uppercase/lowercase keywords option
- Intelligent autocomplete for SQL keywords and functions
- Hover documentation for SQL keywords
- SQL analysis command for query complexity analysis
- Multi-dialect support (PostgreSQL, MySQL, SQL Server, Oracle, SQLite)
- Extension settings panel
- Command palette integration
- Context menu integration
- Status bar indicator
- Output channel for debugging

### Technical
- Language Server Protocol (LSP) client implementation
- TextMate grammar with patterns for:
- Comments (line and block)
- Strings (single, double, dollar-quoted, backtick)
- Numbers (integer, float, hex)
- Operators (comparison, arithmetic, JSON)
- Keywords (DML, DDL, joins, window functions, CTEs)
- Functions (aggregate, window, string, datetime, math, JSON, array)
- Data types (PostgreSQL comprehensive list)
- Parameters (positional and named)
Loading
Loading