feat(v34): introduce DataProvider trait for data abstraction#4
Merged
TimelordUK merged 1 commit intomainfrom Aug 12, 2025
Merged
feat(v34): introduce DataProvider trait for data abstraction#4TimelordUK merged 1 commit intomainfrom
TimelordUK merged 1 commit intomainfrom
Conversation
- Create minimal DataProvider trait with core data access methods - Add DataViewProvider trait for filtering/sorting operations - Include default implementations for common methods - Add comprehensive tests for the new traits This is the first step in migrating to a DataTable/DataView architecture. The traits define the contract that the TUI will use to access data, allowing us to gradually replace the underlying implementation.
TimelordUK
added a commit
that referenced
this pull request
Oct 26, 2025
Extends the AST preprocessing pipeline to work with script execution (-f flag), enabling all Quick Win features (WHERE/GROUP BY/HAVING alias expansion) in SQL scripts with GO separators. ## Problem Scripts executed with -f flag were bypassing the preprocessing pipeline, so Quick Win features (alias expansion) only worked in query mode (-q) and interactive mode. This made scripts inconsistent with other execution modes. ## Solution Added preprocessing pipeline to script execution in execute_script(): - Parse each statement in the script - Apply full preprocessing pipeline if statement has FROM clause - Fall back to original query if preprocessing fails - Preserve special row-iteration semantics for queries without FROM ## Implementation Modified src/non_interactive.rs execute_script(): - Check if statement has FROM clause - If yes: apply preprocessing pipeline, then format AST back to SQL - If no: preserve original behavior (special semantics) - Handle INTO clause removal after preprocessing Pipeline runs transformers in order: 1. ExpressionLifter 2. WhereAliasExpander 3. GroupByAliasExpander 4. HavingAliasTransformer 5. CTEHoister 6. InOperatorLifter ## New Reference File Added examples/expansion_transformers.sql: - Comprehensive reference showing all supported alias expansion features - Documents Quick Wins #1, #2, #3 - Shows working examples for each transformer - Documents future enhancements (CASE, BETWEEN, IN with aliases) - Includes implementation notes and testing commands - Can be run directly: sql-cli examples/expansion_transformers.sql ## Tests All tests passing: - 487 Rust unit tests - 397 integration tests - 511 Python tests - expansion_transformers.sql runs successfully with all features working ## Benefits - Scripts now have feature parity with query and interactive modes - Users can write cleaner SQL scripts with alias expansion - Example files demonstrate best practices - Consistent behavior across all execution modes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first step in migrating to a DataTable/DataView architecture. The traits define the contract that the TUI will use to access data, allowing us to gradually replace the underlying implementation.