diff --git a/docs/API_REFERENCE.md b/docs/API_REFERENCE.md index 3dc1d731..65e5f6bd 100644 --- a/docs/API_REFERENCE.md +++ b/docs/API_REFERENCE.md @@ -1891,7 +1891,7 @@ Returns `next` unchanged when `cfg.AuthEnabled()` is false. When enabled, enforc | `lint_sql` | Style rule enforcement (L001–L010) | | `analyze_sql` | Concurrent composite of all 6 above | -See [MCP Server Guide](MCP_GUIDE.md) for complete tool schemas and JSON response formats. +See [MCP Server Guide](/docs/mcp-guide) for complete tool schemas and JSON response formats. --- @@ -2317,14 +2317,14 @@ GoSQLX achieves **~80-85% SQL-99 compliance** with comprehensive support for: - **GitHub Repository**: https://github.com/ajitpratap0/GoSQLX - **Documentation**: See `/docs` directory - - `GETTING_STARTED.md` - Quick start guide - - `MCP_GUIDE.md` - MCP server and AI assistant integration - - `USAGE_GUIDE.md` - Comprehensive usage guide - - `LSP_GUIDE.md` - LSP server and IDE integration - - `LINTING_RULES.md` - All 10 linting rules reference - - `CONFIGURATION.md` - Configuration file guide - - `SQL_COMPATIBILITY.md` - SQL dialect compatibility matrix - - `ERROR_CODES.md` - Complete error code reference + - [Getting Started](/docs/getting-started) - Quick start guide + - [MCP Server Guide](/docs/mcp-guide) - MCP server and AI assistant integration + - [Usage Guide](/docs/usage-guide) - Comprehensive usage guide + - [LSP Guide](/docs/lsp-guide) - LSP server and IDE integration + - [Linting Rules](/docs/linting-rules) - All 10 linting rules reference + - [Configuration](/docs/configuration) - Configuration file guide + - [SQL Compatibility](/docs/sql-compatibility) - SQL dialect compatibility matrix + - [Error Codes](/docs/error-codes) - Complete error code reference - **Examples**: See `/examples` directory - **Issue Tracker**: GitHub Issues - **License**: Apache-2.0 diff --git a/docs/CLI_GUIDE.md b/docs/CLI_GUIDE.md index 17d58a1c..a3077e58 100644 --- a/docs/CLI_GUIDE.md +++ b/docs/CLI_GUIDE.md @@ -480,7 +480,7 @@ gosqlx lint [file...] [flags] | L009 | Aliasing Consistency | No | Detects mixed table aliasing | | L010 | Redundant Whitespace | Yes | Finds multiple consecutive spaces | -See [LINTING_RULES.md](LINTING_RULES.md) for complete rule documentation. +See [Linting Rules](/docs/linting-rules) for complete rule documentation. #### Examples @@ -617,7 +617,7 @@ require('lspconfig').gosqlx.setup{} :server-id 'gosqlx)) ``` -See [LSP_GUIDE.md](LSP_GUIDE.md) for complete LSP documentation. +See [LSP Guide](/docs/lsp-guide) for complete LSP documentation. --- @@ -715,7 +715,7 @@ linter: L010: enabled # Redundant whitespace ``` -See [CONFIGURATION.md](CONFIGURATION.md) for complete configuration guide. +See [Configuration](/docs/configuration) for complete configuration guide. --- @@ -1005,7 +1005,7 @@ $ gosqlx validate /dev/null Error: not a regular file: /dev/null ``` -For more details, see the [Security Validation Package](../cmd/gosqlx/internal/validate/README.md). +For more details, see the [Security Validation Package](https://github.com/ajitpratap0/GoSQLX/tree/main/cmd/gosqlx/internal/validate). --- @@ -1388,18 +1388,18 @@ To contribute to the GoSQLX CLI: 3. Add tests for new CLI features 4. Submit a pull request -See [CONTRIBUTING.md](../CONTRIBUTING.md) for detailed guidelines. +See [CONTRIBUTING.md](https://github.com/ajitpratap0/GoSQLX/blob/main/CONTRIBUTING.md) for detailed guidelines. --- ## Related Documentation -- [LSP Guide](LSP_GUIDE.md) - Complete LSP server documentation and IDE integration -- [Linting Rules](LINTING_RULES.md) - All 10 linting rules (L001-L010) reference -- [Configuration Guide](CONFIGURATION.md) - Configuration file (.gosqlx.yml) guide -- [Getting Started](GETTING_STARTED.md) - Quick start guide for new users -- [Usage Guide](USAGE_GUIDE.md) - Comprehensive usage guide -- [SQL Compatibility](SQL_COMPATIBILITY.md) - SQL dialect compatibility matrix +- [LSP Guide](/docs/lsp-guide) - Complete LSP server documentation and IDE integration +- [Linting Rules](/docs/linting-rules) - All 10 linting rules (L001-L010) reference +- [Configuration Guide](/docs/configuration) - Configuration file (.gosqlx.yml) guide +- [Getting Started](/docs/getting-started) - Quick start guide for new users +- [Usage Guide](/docs/usage-guide) - Comprehensive usage guide +- [SQL Compatibility](/docs/sql-compatibility) - SQL dialect compatibility matrix --- diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index f4319273..cd8b031a 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -489,9 +489,9 @@ git commit -m "config: update GoSQLX settings" ## Related Documentation -- [CLI Guide](CLI_GUIDE.md) - Complete CLI reference -- [Linting Rules](LINTING_RULES.md) - Linting rules reference -- [API Reference](API_REFERENCE.md) - Full API documentation +- [CLI Guide](/docs/cli-guide) - Complete CLI reference +- [Linting Rules](/docs/linting-rules) - Linting rules reference +- [API Reference](/docs/api-reference) - Full API documentation --- @@ -524,7 +524,7 @@ GOSQLX_MCP_HOST=0.0.0.0 GOSQLX_MCP_PORT=8080 GOSQLX_MCP_AUTH_TOKEN=my-secret gos - `GOSQLX_MCP_PORT` rejects out-of-range or non-integer values at startup with a descriptive error. - MCP server configuration is independent of `.gosqlx.yml` - the YAML config file is not read by `gosqlx-mcp`. -See [MCP Server Guide](MCP_GUIDE.md) for the full startup and auth reference. +See [MCP Server Guide](/docs/mcp-guide) for the full startup and auth reference. --- diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index bdc219c1..ddcf67ef 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -421,7 +421,7 @@ gosqlx lsp --log /tmp/lsp.log - **[Linting Rules](/docs/linting-rules)** - All 10 linting rules (L001-L010) reference - **[Configuration](/docs/configuration)** - Configuration file (.gosqlx.yml) guide - **[API Reference](/docs/api-reference)** - Complete API documentation -- **[Examples](../examples/)** - Real-world code examples +- **[Examples](https://github.com/ajitpratap0/GoSQLX/tree/main/examples)** - Real-world code examples ### v1.12.0 Feature Guides: - **PostgreSQL Extensions:** diff --git a/docs/LINTING_RULES.md b/docs/LINTING_RULES.md index 445e1f35..50ff8965 100644 --- a/docs/LINTING_RULES.md +++ b/docs/LINTING_RULES.md @@ -458,9 +458,9 @@ jobs: ## Related Documentation -- [CLI Guide](CLI_GUIDE.md) - Complete CLI reference -- [Configuration Guide](CONFIGURATION.md) - Configuration options -- [API Reference](API_REFERENCE.md) - Full API documentation +- [CLI Guide](/docs/cli-guide) - Complete CLI reference +- [Configuration Guide](/docs/configuration) - Configuration options +- [API Reference](/docs/api-reference) - Full API documentation --- diff --git a/docs/SQL_COMPATIBILITY.md b/docs/SQL_COMPATIBILITY.md index 4b34fc31..28343817 100644 --- a/docs/SQL_COMPATIBILITY.md +++ b/docs/SQL_COMPATIBILITY.md @@ -852,6 +852,6 @@ gosqlx format --dialect mysql query.sql ### Migration Notes - **From v1.7.0**: High-level API (`gosqlx.Parse()`, `gosqlx.Validate()`) is fully backward compatible -- **Breaking**: `token.Token.ModelType` renamed to `Type`; string-based `token.Type` removed. See [MIGRATION.md](MIGRATION.md) +- **Breaking**: `token.Token.ModelType` renamed to `Type`; string-based `token.Type` removed. See [MIGRATION.md](https://github.com/ajitpratap0/GoSQLX/blob/main/docs/MIGRATION.md) - **MySQL Users**: Use `parser.ParseWithDialect(sql, "mysql")` for MySQL-specific syntax - **Performance**: ~50% faster parsing from token type overhaul \ No newline at end of file diff --git a/docs/USAGE_GUIDE.md b/docs/USAGE_GUIDE.md index 1bfe9a7a..4a9645d7 100644 --- a/docs/USAGE_GUIDE.md +++ b/docs/USAGE_GUIDE.md @@ -1325,7 +1325,7 @@ The LSP server provides: - Helpful error messages - Suggested fixes -For complete LSP documentation, see [LSP_GUIDE.md](./LSP_GUIDE.md). +For complete LSP documentation, see [LSP Guide](/docs/lsp-guide). ## CLI Tool Usage (v1.6.0) @@ -1519,7 +1519,7 @@ lsp: hover_enabled: true ``` -For complete configuration documentation, see [CONFIGURATION.md](./CONFIGURATION.md). +For complete configuration documentation, see [Configuration](/docs/configuration). ### CLI Examples diff --git a/website/public/wasm-sw.js b/website/public/wasm-sw.js index e2413241..8b4093ee 100644 --- a/website/public/wasm-sw.js +++ b/website/public/wasm-sw.js @@ -1,32 +1,38 @@ -const WASM_CACHE = 'gosqlx-wasm-7fe84bbe'; +const CACHE_VERSION = 'v2'; // Bump this when deploying new WASM binary +const CACHE_NAME = `gosqlx-wasm-${CACHE_VERSION}`; const WASM_URL = '/wasm/gosqlx.wasm'; self.addEventListener('install', (event) => { event.waitUntil( - caches.open(WASM_CACHE).then((cache) => cache.add(WASM_URL)) + caches.open(CACHE_NAME).then((cache) => cache.add(WASM_URL)) ); self.skipWaiting(); }); self.addEventListener('activate', (event) => { event.waitUntil( - caches.keys().then((keys) => - Promise.all(keys.filter((k) => k !== WASM_CACHE).map((k) => caches.delete(k))) + caches.keys().then((cacheNames) => + Promise.all( + cacheNames + .filter((name) => name.startsWith('gosqlx-wasm-') && name !== CACHE_NAME) + .map((name) => caches.delete(name)) + ) ) ); + self.clients.claim(); }); self.addEventListener('fetch', (event) => { - if (event.request.url.endsWith('gosqlx.wasm')) { + if (event.request.url.includes('/wasm/gosqlx.wasm')) { event.respondWith( - caches.match(event.request).then((cached) => { - if (cached) return cached; - return fetch(event.request).then((response) => { - const clone = response.clone(); - caches.open(WASM_CACHE).then((cache) => cache.put(event.request, clone)); - return response; - }); - }) + caches.open(CACHE_NAME).then((cache) => + cache.match(event.request).then( + (cached) => cached || fetch(event.request).then((response) => { + if (response.ok) cache.put(event.request, response.clone()); + return response; + }) + ) + ) ); } });