Skip to content

feat: add Phase 7 advanced SQL features#23

Merged
sivchari merged 5 commits intomainfrom
feature/phase7-advanced-sql
Feb 5, 2026
Merged

feat: add Phase 7 advanced SQL features#23
sivchari merged 5 commits intomainfrom
feature/phase7-advanced-sql

Conversation

@sivchari
Copy link
Copy Markdown
Owner

@sivchari sivchari commented Feb 5, 2026

Summary

Phase 7 の高度な SQL 機能を追加:

  • LATERAL FLATTEN 拡張: path, outer, recursive, mode オプション対応
  • PIVOT/UNPIVOT: 行列変換サポート
  • SAMPLE/TABLESAMPLE: ランダムサンプリング (ROW count / percentage)
  • MERGE INTO: Upsert 操作
  • Sequence: CREATE/DROP SEQUENCE, NEXTVAL, CURRVAL

Changes

  • Remove unused playground package
  • Add SQL rewriter for PIVOT, UNPIVOT, SAMPLE
  • Add executor support for MERGE INTO and Sequence
  • Add Go integration tests
  • Fix clippy warnings

Test plan

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test --workspace (195 tests)

Remove the legacy WASM playground that was incompatible with
the current engine architecture.
- Extend LATERAL FLATTEN with options (path, outer, recursive, mode)
- Add PIVOT transformation (row to columns via CASE WHEN)
- Add UNPIVOT transformation (columns to rows via UNION ALL)
- Add SAMPLE/TABLESAMPLE support (ROW count and percentage)
MERGE INTO:
- Parse MERGE INTO ... USING ... ON ... WHEN MATCHED/NOT MATCHED
- Handle UPDATE for matched rows and INSERT for non-matched rows
- Support table recreation pattern for atomic updates

Sequence:
- Add Sequence struct with AtomicI64 for thread-safe incrementing
- Implement CREATE/DROP SEQUENCE DDL
- Support NEXTVAL and CURRVAL operations
- Add SAMPLE ROW tests
- Add Sequence tests (CREATE, NEXTVAL, CURRVAL, DROP)
- Add Sequence with custom START/INCREMENT tests
- Inline format string arguments
- Add #[allow(dead_code)] for intentionally unused code
- Add #[allow(deprecated)] for chrono API migration
- Fix unused variable warnings with underscore prefix
- Remove unreachable pattern in match expression
@sivchari sivchari merged commit fdcd597 into main Feb 5, 2026
1 check passed
@sivchari sivchari deleted the feature/phase7-advanced-sql branch February 5, 2026 08:39
@github-actions github-actions bot mentioned this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant