Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(cargo test:*)"
],
"deny": [],
"ask": []
}
}
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ insta = { features = ["yaml"], version = "1.40.0" }
predicates = "3.1.2"
reqwest = { features = ["json"], version = "0.12.23" }
serde_json = "1.0.140"
socket2 = "0.5"
tempfile = "3.2.0"
url = "2.5.2"

Expand Down
14 changes: 13 additions & 1 deletion crates/datafusion-app/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,26 @@ pub struct WasmUdfConfig {
}

#[cfg(feature = "flightsql")]
#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug)]
pub struct FlightSQLConfig {
pub connection_url: String,
pub benchmark_iterations: usize,
pub auth: AuthConfig,
pub headers: HashMap<String, String>,
}

#[cfg(feature = "flightsql")]
impl Default for FlightSQLConfig {
fn default() -> Self {
Self {
connection_url: "http://localhost:50051".to_string(),
benchmark_iterations: 10,
auth: AuthConfig::default(),
headers: HashMap::new(),
}
}
}

#[cfg(feature = "flightsql")]
impl FlightSQLConfig {
pub fn new(
Expand Down
18 changes: 17 additions & 1 deletion src/tui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,23 @@ pub async fn try_run(cli: DftArgs, config: AppConfig) -> Result<()> {
crate::APP_NAME,
env!("CARGO_PKG_VERSION"),
)?;
let app_execution = AppExecution::new(execution_ctx);
#[allow(unused_mut)]
let mut app_execution = AppExecution::new(execution_ctx);

#[cfg(feature = "flightsql")]
{
use datafusion_app::config::FlightSQLConfig;
use datafusion_app::flightsql::FlightSQLContext;

let flightsql_config = FlightSQLConfig::new(
config.flightsql_client.connection_url.clone(),
config.flightsql_client.benchmark_iterations,
config.flightsql_client.auth.clone(),
config.flightsql_client.headers.clone(),
);
app_execution.with_flightsql_ctx(FlightSQLContext::new(flightsql_config));
}

register_db(app_execution.session_ctx(), &config.db).await?;
let app = App::new(state, cli, app_execution);
app.run_app().await?;
Expand Down