Skip to content

Commit 375525b

Browse files
ajitpratap0Ajit Pratap Singhclaude
authored
docs: complete comprehensive API reference (Issue #57 DOC-001) (#123)
* docs: expand API_REFERENCE.md with comprehensive AST documentation (Issue #57) Significantly expanded the AST API section to cover all 50+ node types: AST Section Changes: - Expanded from ~150 lines to 1,200+ lines - Complete documentation for all DML statements (SELECT, INSERT, UPDATE, DELETE, MERGE) - Complete documentation for all DDL statements (CREATE TABLE/VIEW/MATERIALIZED VIEW/INDEX, ALTER, DROP) - CTE and Set Operations documentation (WITH, UNION, EXCEPT, INTERSECT) - All expression types documented (Binary, Unary, Case, Cast, In, Between, Exists, etc.) - Grouping set types (ROLLUP, CUBE, GROUPING SETS) - Window function types (WindowSpec, WindowFrame, WindowFrameBound) - Supporting types (TableReference, JoinClause, OnConflict, etc.) - Object pool functions and visitor pattern examples - Type assertion examples for common use cases Table of Contents: - Updated with hierarchical navigation structure - Added sub-sections for each major category Total documentation now ~4,000 lines (up from ~2,900 lines) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: consolidate documentation and add Security package API reference - Add comprehensive Security package documentation to API_REFERENCE.md - Scanner types, severity levels, pattern detection - Usage examples for SQL injection detection - Best practices and performance considerations - Remove duplicate documentation: - Removed docs/migrations/ (duplicate of docs/migration/) - Remove outdated internal docs: - RELEASE_v1.0.md (outdated, now at v1.4+) - FIXES_APPLIED.md (internal development artifact) - CODE_QUALITY_AUDIT.md (all issues resolved) - DOC-001-COMPLETION-SUMMARY.md (internal tracking) - Update package overview to include security package This consolidation reduces documentation clutter and ensures all packages are properly documented in the API reference. Addresses Issue #57 (DOC-001: Complete Comprehensive API Reference) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: comprehensive documentation update for v1.4+ features ## docs/README.md - Updated to v1.5.1+ with current date - Added new documentation sections (Getting Started, CLI Guide, Error Codes) - Added Testing & Quality section (Fuzz Testing, Performance Regression) - Added Migration Guides section - Updated documentation structure to 22 files - Added Recent Feature Additions section (v1.4+) - Updated all version references from v1.0.0 to v1.5.1 ## docs/SQL_COMPATIBILITY.md - Added MERGE statement support (SQL:2003 F312) - Added GROUPING SETS, ROLLUP, CUBE section (SQL-99 T431) - Added ORDER BY Extensions (NULLS FIRST/LAST - SQL-99 F851) - Added Expression Operators section (BETWEEN, IN, LIKE, IS NULL) - Added Materialized Views and Table Partitioning to DDL - Updated test suite to 600+ test cases, 95% coverage - Added SQL-99 compliance rating (~80-85%) ## docs/SECURITY.md - Added Security Package (pkg/sql/security) section - Added SQL injection detection overview with code example - Updated security score to 9.0/10 - Added PROACTIVE finding for built-in injection detection - Updated version to v1.5.1+ ## docs/ARCHITECTURE.md - Added modular parser architecture (11 parser modules) - Updated method hierarchy with all new parsing methods - Added new AST statement types (Merge, MaterializedView, etc.) - Added new expression types (Between, In, Like, IsNull) - Added Grouping Types section (GroupingSet, Rollup, Cube) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: update root-level documentation with v1.5.1+ features - CHANGELOG.md: Add Unreleased section with new features (GROUPING SETS, ROLLUP, CUBE, MERGE, Materialized Views, SQL Injection Detection, Expression Operators, Subqueries, NULLS FIRST/LAST), remove duplicate v1.2.0 sections and outdated planned features - CLAUDE.md: Add Security package to Core Components, add new SQL feature examples (GROUPING SETS, MERGE, Materialized Views, Expression Operators), update version reference to v1.5.1+ - README.md: Already contains v1.4+ features from previous session 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: comprehensive documentation refresh for v1.5.1+ features - USAGE_GUIDE.md: Add Simple API section, v1.5.1 features (GROUPING SETS, ROLLUP, CUBE, MERGE, Materialized Views, Expression Operators), SQL Injection Detection section with examples - CLEAN_ARCHITECTURE.md: Add security package, gosqlx high-level API, update AST types with new statement/expression types, version info - PRODUCTION_GUIDE.md: Add SQL Injection Detection section with code examples for production security scanning, version header - SECURITY.md (root): Add cross-reference note to docs/SECURITY.md - docs/SECURITY.md: Add cross-reference note to root SECURITY.md - Removed empty /docs/getting-started/ directory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini.local> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3dc45fa commit 375525b

19 files changed

Lines changed: 2240 additions & 4355 deletions

CHANGELOG.md

Lines changed: 10 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- **GROUPING SETS, ROLLUP, CUBE** (SQL-99 T431): Complete grouping operations support for advanced aggregations
12+
- **MERGE Statements** (SQL:2003 F312): Full MERGE support with WHEN MATCHED/NOT MATCHED clauses
13+
- **Materialized Views**: CREATE, DROP, REFRESH MATERIALIZED VIEW support
14+
- **Table Partitioning**: PARTITION BY RANGE, LIST, HASH support
15+
- **SQL Injection Detection**: Built-in security scanner (`pkg/sql/security`) for pattern detection
16+
- **Expression Operators**: BETWEEN, IN, LIKE, IS NULL with full expression support
17+
- **Subquery Support**: Scalar, table, correlated, EXISTS subqueries
18+
- **NULLS FIRST/LAST**: ORDER BY null ordering (SQL-99 F851)
19+
1020
## [1.5.1] - 2025-11-15 - Phases 2-3 Test Coverage Completion
1121

1222
### 🎯 Phase 3 Complete: Token and Tokenizer Coverage Enhancement
@@ -452,120 +462,6 @@ This substantial test coverage increase provides strong confidence in the AST pa
452462
- ✅ Comprehensive test coverage for all new features
453463
- ✅ Zero performance regression while adding major features
454464

455-
## [1.2.0] - 2025-09-04 - Phase 2: Advanced SQL Features
456-
457-
### ✅ Major Features Implemented
458-
- **Complete Common Table Expression (CTE) support**: Simple and recursive CTEs with full SQL-92 compliance
459-
- **Set operations**: UNION, UNION ALL, EXCEPT, INTERSECT with proper left-associative parsing
460-
- **Multiple CTE definitions**: Comma-separated CTEs in single query with column specifications
461-
- **CTE Integration**: Full compatibility with all statement types (SELECT, INSERT, UPDATE, DELETE)
462-
- **Enhanced parser architecture**: New parsing functions for WITH statements and set operations
463-
464-
### 🚀 Performance & Quality
465-
- **946K+ sustained operations/second** (30s load testing) - production grade performance
466-
- **1.25M+ operations/second** peak throughput with concurrent processing
467-
- **<1μs latency** for complex queries with CTEs and set operations
468-
- **Zero performance regression** from Phase 1 - all existing functionality maintained
469-
- **Race-free implementation** - comprehensive concurrent testing validates thread safety
470-
- **Memory efficient** - object pooling preserved with 60-80% memory reduction
471-
472-
### 🎯 SQL Standards Compliance
473-
- **~70% SQL-92 compliance** achieved (up from ~40% in Phase 1)
474-
- **Advanced SQL features**: WITH clause, RECURSIVE support, set operations
475-
- **Complex query compositions**: CTEs combined with set operations in single queries
476-
- **Proper operator precedence**: Left-associative parsing for chained set operations
477-
478-
### 🔧 Technical Implementation
479-
- **parseWithStatement()** - Complete WITH clause parsing with recursive support
480-
- **parseSelectWithSetOperations()** - Set operations parsing with proper precedence
481-
- **parseCommonTableExpr()** - Individual CTE parsing with column specifications
482-
- **parseMainStatementAfterWith()** - Post-CTE statement routing with full integration
483-
- **Enhanced AST structures** - Complete integration with existing AST framework
484-
485-
### 📊 Comprehensive Testing
486-
- **24+ test functions** total (9 new Phase 2 tests added)
487-
- **4 comprehensive CTE tests**: Simple CTE, Recursive CTE, Multiple CTEs, Column specs
488-
- **5 comprehensive set operation tests**: All operations, chaining, CTE combinations
489-
- **100% test pass rate** with race detection enabled
490-
- **Extensive error case coverage** with contextual error messages
491-
492-
### 📚 Documentation Updates
493-
- **Enhanced Go package documentation** with Phase 2 examples and API references
494-
- **Comprehensive README updates** with CTE and set operations examples
495-
- **Updated performance benchmarks** reflecting Phase 2 capabilities
496-
- **Complete API documentation** for all new parsing functions
497-
498-
### 🔄 Backward Compatibility
499-
- **100% backward compatible** - all existing functionality preserved
500-
- **API stability** - no breaking changes to public interfaces
501-
- **Legacy test compatibility** - all Phase 1 and prior tests continue passing
502-
- **Performance maintained** - no degradation in existing query parsing performance
503-
504-
### Goals Achieved
505-
-~70% SQL-92 compliance milestone reached
506-
- ✅ Production-grade CTE implementation with recursive support
507-
- ✅ Complete set operations support with proper precedence
508-
- ✅ Enhanced error handling with contextual messages
509-
- ✅ Comprehensive test coverage for all new features
510-
- ✅ Zero performance regression while adding major features
511-
512-
## [1.2.0] - 2025-09-04 - Phase 2: Advanced SQL Features
513-
514-
### ✅ Major Features Implemented
515-
- **Complete Common Table Expression (CTE) support**: Simple and recursive CTEs with full SQL-92 compliance
516-
- **Set operations**: UNION, UNION ALL, EXCEPT, INTERSECT with proper left-associative parsing
517-
- **Multiple CTE definitions**: Comma-separated CTEs in single query with column specifications
518-
- **CTE Integration**: Full compatibility with all statement types (SELECT, INSERT, UPDATE, DELETE)
519-
- **Enhanced parser architecture**: New parsing functions for WITH statements and set operations
520-
521-
### 🚀 Performance & Quality
522-
- **946K+ sustained operations/second** (30s load testing) - production grade performance
523-
- **1.25M+ operations/second** peak throughput with concurrent processing
524-
- **<1μs latency** for complex queries with CTEs and set operations
525-
- **Zero performance regression** from Phase 1 - all existing functionality maintained
526-
- **Race-free implementation** - comprehensive concurrent testing validates thread safety
527-
- **Memory efficient** - object pooling preserved with 60-80% memory reduction
528-
529-
### 🎯 SQL Standards Compliance
530-
- **~70% SQL-92 compliance** achieved (up from ~40% in Phase 1)
531-
- **Advanced SQL features**: WITH clause, RECURSIVE support, set operations
532-
- **Complex query compositions**: CTEs combined with set operations in single queries
533-
- **Proper operator precedence**: Left-associative parsing for chained set operations
534-
535-
### 🔧 Technical Implementation
536-
- **parseWithStatement()** - Complete WITH clause parsing with recursive support
537-
- **parseSelectWithSetOperations()** - Set operations parsing with proper precedence
538-
- **parseCommonTableExpr()** - Individual CTE parsing with column specifications
539-
- **parseMainStatementAfterWith()** - Post-CTE statement routing with full integration
540-
- **Enhanced AST structures** - Complete integration with existing AST framework
541-
542-
### 📊 Comprehensive Testing
543-
- **24+ test functions** total (9 new Phase 2 tests added)
544-
- **4 comprehensive CTE tests**: Simple CTE, Recursive CTE, Multiple CTEs, Column specs
545-
- **5 comprehensive set operation tests**: All operations, chaining, CTE combinations
546-
- **100% test pass rate** with race detection enabled
547-
- **Extensive error case coverage** with contextual error messages
548-
549-
### 📚 Documentation Updates
550-
- **Enhanced Go package documentation** with Phase 2 examples and API references
551-
- **Comprehensive README updates** with CTE and set operations examples
552-
- **Updated performance benchmarks** reflecting Phase 2 capabilities
553-
- **Complete API documentation** for all new parsing functions
554-
555-
### 🔄 Backward Compatibility
556-
- **100% backward compatible** - all existing functionality preserved
557-
- **API stability** - no breaking changes to public interfaces
558-
- **Legacy test compatibility** - all Phase 1 and prior tests continue passing
559-
- **Performance maintained** - no degradation in existing query parsing performance
560-
561-
### Goals Achieved
562-
-~70% SQL-92 compliance milestone reached
563-
- ✅ Production-grade CTE implementation with recursive support
564-
- ✅ Complete set operations support with proper precedence
565-
- ✅ Enhanced error handling with contextual messages
566-
- ✅ Comprehensive test coverage for all new features
567-
- ✅ Zero performance regression while adding major features
568-
569465
## [1.1.0] - 2025-01-03 - Phase 1: Core SQL Enhancements
570466

571467
### ✅ Implemented Features
@@ -586,36 +482,6 @@ This substantial test coverage increase provides strong confidence in the AST pa
586482
- Unified AST structure
587483
- Consistent error system with context and hints
588484

589-
## [1.2.0] - (Planned Q4 2024) - Phase 2: Advanced Features
590-
591-
### Planned Features
592-
- Window functions (OVER, PARTITION BY, RANK, LAG/LEAD)
593-
- Transaction control statements (BEGIN/COMMIT/ROLLBACK)
594-
- Views and materialized views support
595-
- Stored procedure parsing (basic)
596-
- Streaming parser API for large files
597-
- AST transformation framework
598-
599-
### Goals
600-
- Achieve 85% SQL-99 compliance
601-
- Streaming support for queries >10MB
602-
- Query transformation and optimization capabilities
603-
604-
## [2.0.0] - (Planned Q1 2025) - Phase 3: Dialect Specialization
605-
606-
### Planned Features
607-
- PostgreSQL-specific features (arrays, JSONB, custom types)
608-
- MySQL-specific syntax and functions
609-
- SQL Server T-SQL extensions
610-
- Oracle PL/SQL basics
611-
- SQLite pragmas and special syntax
612-
- Dialect auto-detection
613-
614-
### Goals
615-
- Multi-dialect parser with configuration
616-
- 95% dialect-specific compliance
617-
- Auto-detection with 99% accuracy
618-
619485
## [1.0.2] - 2025-08-23
620486

621487
### Added

CLAUDE.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SDK for Go that provides lexing, parsing, and AST generation with zero-copy optimizations. The library is designed for enterprise use with comprehensive object pooling for memory efficiency.
88

9-
### **Production Status**: ✅ **VALIDATED FOR PRODUCTION DEPLOYMENT** (v1.4.0)
9+
### **Production Status**: ✅ **VALIDATED FOR PRODUCTION DEPLOYMENT** (v1.5.1+)
1010
- **Thread Safety**: Confirmed race-free through comprehensive concurrent testing
1111
- **Performance**: 1.38M+ operations/second sustained, up to 1.5M peak with memory-efficient object pooling
1212
- **International**: Full Unicode support for global SQL processing
@@ -26,6 +26,7 @@ GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SD
2626
- **Models** (`pkg/models/`): Core data structures (tokens, spans, locations, errors) - 100% test coverage
2727
- **Errors** (`pkg/errors/`): Structured error handling system with error codes and position tracking
2828
- **Metrics** (`pkg/metrics/`): Production performance monitoring and observability
29+
- **Security** (`pkg/sql/security/`): SQL injection detection with pattern scanning and severity classification
2930
- **CLI** (`cmd/gosqlx/`): Production-ready command-line tool for SQL validation, formatting, and analysis
3031

3132
### Object Pooling Architecture
@@ -435,7 +436,63 @@ These mistakes have been made before - avoid them:
435436
- ✅ Allows for comprehensive testing and validation before tagging
436437
- ✅ Enables rollback if critical issues are found before release
437438

438-
## Current SQL Feature Support (v1.4.0)
439+
## Current SQL Feature Support (v1.5.1+)
440+
441+
### GROUPING SETS, ROLLUP, CUBE (SQL-99 T431) - Complete ✅
442+
```sql
443+
-- GROUPING SETS - explicit grouping combinations
444+
SELECT region, product, SUM(sales)
445+
FROM orders
446+
GROUP BY GROUPING SETS ((region), (product), (region, product), ());
447+
448+
-- ROLLUP - hierarchical subtotals
449+
SELECT year, quarter, month, SUM(revenue)
450+
FROM sales
451+
GROUP BY ROLLUP (year, quarter, month);
452+
453+
-- CUBE - all possible combinations
454+
SELECT region, product, SUM(amount)
455+
FROM sales
456+
GROUP BY CUBE (region, product);
457+
```
458+
459+
### MERGE Statements (SQL:2003 F312) - Complete ✅
460+
```sql
461+
MERGE INTO target_table t
462+
USING source_table s ON t.id = s.id
463+
WHEN MATCHED THEN
464+
UPDATE SET t.name = s.name, t.value = s.value
465+
WHEN NOT MATCHED THEN
466+
INSERT (id, name, value) VALUES (s.id, s.name, s.value);
467+
```
468+
469+
### Materialized Views - Complete ✅
470+
```sql
471+
CREATE MATERIALIZED VIEW sales_summary AS
472+
SELECT region, SUM(amount) as total FROM sales GROUP BY region;
473+
474+
REFRESH MATERIALIZED VIEW CONCURRENTLY sales_summary;
475+
476+
DROP MATERIALIZED VIEW IF EXISTS sales_summary;
477+
```
478+
479+
### Expression Operators (BETWEEN, IN, LIKE, IS NULL) - Complete ✅
480+
```sql
481+
-- BETWEEN with expressions
482+
SELECT * FROM orders WHERE amount BETWEEN 100 AND 500;
483+
484+
-- IN with subquery
485+
SELECT * FROM users WHERE id IN (SELECT user_id FROM admins);
486+
487+
-- LIKE with pattern matching
488+
SELECT * FROM products WHERE name LIKE '%widget%';
489+
490+
-- IS NULL / IS NOT NULL
491+
SELECT * FROM users WHERE deleted_at IS NULL;
492+
493+
-- NULLS FIRST/LAST ordering (SQL-99 F851)
494+
SELECT * FROM users ORDER BY last_login DESC NULLS LAST;
495+
```
439496

440497
### Window Functions (Phase 2.5) - Complete ✅
441498
```sql

README.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ GoSQLX is a high-performance SQL parsing library designed for production use. It
4949
- **🔗 Complete JOIN Support**: All JOIN types (INNER/LEFT/RIGHT/FULL OUTER/CROSS/NATURAL) with proper tree logic
5050
- **🔄 Advanced SQL Features**: CTEs with RECURSIVE support, Set Operations (UNION/EXCEPT/INTERSECT)
5151
- **🪟 Window Functions**: Complete SQL-99 window function support with OVER clause, PARTITION BY, ORDER BY, frame specifications
52+
- **🔄 MERGE Statements**: Full SQL:2003 MERGE support with WHEN MATCHED/NOT MATCHED clauses
53+
- **📊 Grouping Operations**: GROUPING SETS, ROLLUP, CUBE (SQL-99 T431)
54+
- **🗃️ Materialized Views**: CREATE, DROP, REFRESH MATERIALIZED VIEW support
55+
- **📋 Table Partitioning**: PARTITION BY RANGE, LIST, HASH support
56+
- **🔐 SQL Injection Detection**: Built-in security scanner (`pkg/sql/security`) for injection pattern detection
5257
- **🌍 Unicode Support**: Complete UTF-8 support for international SQL
5358
- **🔧 Multi-Dialect**: PostgreSQL, MySQL, SQL Server, Oracle, SQLite
5459
- **📊 Zero-Copy**: Direct byte slice operations, **<1μs latency**
@@ -391,14 +396,112 @@ if selectStmt, ok := ast.Statements[0].(*ast.SelectStatement); ok {
391396
```
392397

393398
**Supported JOIN Types:**
399+
394400
-`INNER JOIN` - Standard inner joins
395-
-`LEFT JOIN` / `LEFT OUTER JOIN` - Left outer joins
401+
-`LEFT JOIN` / `LEFT OUTER JOIN` - Left outer joins
396402
-`RIGHT JOIN` / `RIGHT OUTER JOIN` - Right outer joins
397403
-`FULL JOIN` / `FULL OUTER JOIN` - Full outer joins
398404
-`CROSS JOIN` - Cartesian product joins
399405
-`NATURAL JOIN` - Natural joins (implicit ON clause)
400406
-`USING (column)` - Single-column using clause
401407

408+
### 🆕 Advanced SQL Features (v1.4+)
409+
410+
#### MERGE Statements (SQL:2003 F312)
411+
412+
```go
413+
sql := `
414+
MERGE INTO target_table t
415+
USING source_table s ON t.id = s.id
416+
WHEN MATCHED THEN
417+
UPDATE SET t.name = s.name, t.value = s.value
418+
WHEN NOT MATCHED THEN
419+
INSERT (id, name, value) VALUES (s.id, s.name, s.value)
420+
`
421+
ast, err := gosqlx.Parse(sql)
422+
```
423+
424+
#### GROUPING SETS, ROLLUP, CUBE (SQL-99 T431)
425+
426+
```go
427+
// GROUPING SETS - explicit grouping combinations
428+
sql := `SELECT region, product, SUM(sales)
429+
FROM orders
430+
GROUP BY GROUPING SETS ((region), (product), (region, product), ())`
431+
432+
// ROLLUP - hierarchical subtotals
433+
sql := `SELECT year, quarter, month, SUM(revenue)
434+
FROM sales
435+
GROUP BY ROLLUP (year, quarter, month)`
436+
437+
// CUBE - all possible combinations
438+
sql := `SELECT region, product, SUM(amount)
439+
FROM sales
440+
GROUP BY CUBE (region, product)`
441+
```
442+
443+
#### Materialized Views
444+
445+
```go
446+
// Create materialized view
447+
sql := `CREATE MATERIALIZED VIEW sales_summary AS
448+
SELECT region, SUM(amount) as total
449+
FROM sales GROUP BY region`
450+
451+
// Refresh materialized view
452+
sql := `REFRESH MATERIALIZED VIEW CONCURRENTLY sales_summary`
453+
454+
// Drop materialized view
455+
sql := `DROP MATERIALIZED VIEW IF EXISTS sales_summary`
456+
```
457+
458+
#### SQL Injection Detection
459+
460+
```go
461+
import "github.com/ajitpratap0/GoSQLX/pkg/sql/security"
462+
463+
// Create scanner
464+
scanner := security.NewScanner()
465+
466+
// Scan for injection patterns
467+
result := scanner.Scan(ast)
468+
469+
if result.HasCritical() {
470+
fmt.Printf("Found %d critical issues!\n", result.CriticalCount)
471+
for _, finding := range result.Findings {
472+
fmt.Printf(" [%s] %s: %s\n",
473+
finding.Severity, finding.Pattern, finding.Description)
474+
}
475+
}
476+
477+
// Detected patterns include:
478+
// - Tautology (1=1, 'a'='a')
479+
// - UNION-based injection
480+
// - Time-based blind (SLEEP, WAITFOR DELAY)
481+
// - Comment bypass (--, /**/)
482+
// - Stacked queries
483+
// - Dangerous functions (xp_cmdshell, LOAD_FILE)
484+
```
485+
486+
#### Expression Operators (BETWEEN, IN, LIKE, IS NULL)
487+
488+
```go
489+
// BETWEEN with expressions
490+
sql := `SELECT * FROM orders WHERE amount BETWEEN 100 AND 500`
491+
492+
// IN with subquery
493+
sql := `SELECT * FROM users WHERE id IN (SELECT user_id FROM admins)`
494+
495+
// LIKE with pattern matching
496+
sql := `SELECT * FROM products WHERE name LIKE '%widget%'`
497+
498+
// IS NULL / IS NOT NULL
499+
sql := `SELECT * FROM users WHERE deleted_at IS NULL`
500+
501+
// NULLS FIRST/LAST ordering (SQL-99 F851)
502+
sql := `SELECT * FROM users ORDER BY last_login DESC NULLS LAST`
503+
```
504+
402505
## 💻 Examples
403506

404507
### Multi-Dialect Support

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Security Policy
22

3+
> **Note**: This file covers security policies and vulnerability reporting. For comprehensive security analysis, threat modeling, and the SQL injection detection API, see [docs/SECURITY.md](docs/SECURITY.md).
4+
35
## Supported Versions
46

57
We release patches for security vulnerabilities. Currently supported versions:

0 commit comments

Comments
 (0)