-
Notifications
You must be signed in to change notification settings - Fork 13
Separate display logic from execution logic in ExecutionContext #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate display logic from execution logic in ExecutionContext #134
Conversation
bc49ebb
to
094f809
Compare
094f809
to
44857d1
Compare
/// | ||
/// Error handling: If an error occurs while executing a query, the error is | ||
/// logged and execution continues | ||
pub async fn run_sqls(&self, sqls: Vec<&str>, sender: UnboundedSender<AppEvent>) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the code that executes queries and sends them as AppEvents into its own struct
} | ||
|
||
/// Prints the stream to stdout | ||
async fn print_stream(&self, mut stream: SendableRecordBatchStream) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the actual calls to println
into the cli code
@@ -145,123 +140,44 @@ impl ExecutionContext { | |||
&self.flightsql_client | |||
} | |||
|
|||
pub async fn run_sqls(&self, sqls: Vec<&str>, sender: UnboundedSender<AppEvent>) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to AppExecution
@@ -42,8 +39,6 @@ use { | |||
}; | |||
|
|||
use crate::app::config::ExecutionConfig; | |||
use crate::app::state::tabs::sql::Query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main goal of the PR is to remove these lines from this module
I test locally with both the local context and flightsql client and app still works as expected so good to go |
Thanks @matthewmturner |
Second part of #132
Follow on to #131
The rationale here is to split out the logic that handles display (e.g.
println!
andQuery
from the actual execution, again so that we can update / test the underyingExecutionContext
without having the UI affectedThis PR moves the "display" releated logic out of the ExecutionContext and into the app / CLI modules respectively.