Skip to content

Commit 131a176

Browse files
committed
feat: add MERGE statement, advanced cursor operations, and PostgreSQL dollar-quoting
1 parent ae3f669 commit 131a176

File tree

12 files changed

+2263
-4
lines changed

12 files changed

+2263
-4
lines changed

claude.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ Since we now have advanced features support, here's the pattern:
207207
- ✅ CTEs (WITH clause) - see [cte_examples.sql](examples/queries/cte_examples.sql)
208208
- ✅ Window Functions - see [window_function_examples.sql](examples/queries/window_function_examples.sql)
209209
- ✅ Set Operations - see [set_operations_examples.sql](examples/queries/set_operations_examples.sql)
210-
- ⚠️ CASE expressions - AST nodes exist, parsing needs expression parser refactoring
210+
- ✅ CASE expressions - see [case_expression_examples.sql](examples/queries/case_expression_examples.sql)
211+
-**MERGE Statement** - see [merge_examples.sql](examples/queries/merge_examples.sql) 🆕
212+
-**Advanced Cursor Operations** - FETCH NEXT/PRIOR/FIRST/LAST/ABSOLUTE/RELATIVE, DEALLOCATE 🆕
213+
-**PostgreSQL Dollar-Quoted Strings** - $$...$$, $tag$...$tag$ for function bodies 🆕
211214

212215
### Task 6: Improve Performance
213216
**Target**: Lexer, Parser, or Analyzer
@@ -530,6 +533,31 @@ go tool pprof cpu.prof
530533
- **Multi-dialect support** - SQL Server, PostgreSQL, MySQL, Oracle syntax
531534
- **23+ comprehensive tests** - All passing across all exception types
532535
- **400+ lines of examples** - Real-world error handling scenarios in exception_handling_examples.sql
536+
- **MERGE Statement Support** ✅ 🆕
537+
- **MERGE INTO...USING...ON** - Full MERGE statement syntax
538+
- **WHEN MATCHED / NOT MATCHED** - All conditional clauses
539+
- **WHEN NOT MATCHED BY SOURCE** - SQL Server specific clause
540+
- **Multiple WHEN clauses** - Multiple conditions per statement
541+
- **UPDATE / INSERT / DELETE actions** - All DML actions in MERGE
542+
- **Subquery sources** - Support for subqueries as data sources
543+
- **Qualified column names** - table.column syntax in SET clauses
544+
- **18+ comprehensive tests** - All passing across SQL Server, PostgreSQL, Oracle
545+
- **350+ lines of examples** - Real-world ETL and synchronization scenarios in merge_examples.sql
546+
- **Advanced Cursor Operations** ✅ 🆕
547+
- **FETCH directions** - NEXT, PRIOR, FIRST, LAST, ABSOLUTE n, RELATIVE n
548+
- **FETCH...INTO** - Fetch cursor values into variables
549+
- **DEALLOCATE** - Deallocate cursor or prepared statement
550+
- **FROM/IN keywords** - PostgreSQL-style FETCH FROM cursor
551+
- **12+ comprehensive tests** - All passing for MySQL, PostgreSQL, SQL Server
552+
- **Full cursor lifecycle** - DECLARE, OPEN, FETCH, CLOSE, DEALLOCATE
553+
- **PostgreSQL Dollar-Quoted Strings** ✅ 🆕
554+
- **$$...$$ syntax** - Simple dollar quoting for strings
555+
- **$tag$...$tag$ syntax** - Tagged dollar quoting with custom delimiters
556+
- **Nested content** - Supports $$ inside tagged strings
557+
- **Function bodies** - Perfect for PostgreSQL function/procedure bodies
558+
- **Multi-line support** - Preserves newlines and formatting
559+
- **Dialect-specific** - Only enabled for PostgreSQL dialect
560+
- **13+ comprehensive tests** - All passing including nested and edge cases
533561

534562
### 🚧 In Progress / Planned
535563
- [ ] Real-time log monitoring

0 commit comments

Comments
 (0)