intelli_shell/process/query.rs
1use color_eyre::eyre::Result;
2
3use super::{Process, ProcessOutput};
4use crate::{cli::QueryProcess, config::Config, service::IntelliShellService};
5
6impl Process for QueryProcess {
7 async fn execute(self, _config: Config, service: IntelliShellService) -> Result<ProcessOutput> {
8 let sql = self.sql.contents()?;
9 let output = service.query(sql).await?;
10 Ok(ProcessOutput::success().stdout(output))
11 }
12}