From ed01b8af041f852c2b525b65169188c6df925eb9 Mon Sep 17 00:00:00 2001 From: Matthew Turner Date: Tue, 4 Nov 2025 14:36:37 -0500 Subject: [PATCH 1/3] Default fsql config for tui --- crates/datafusion-app/src/config.rs | 14 +++++++++++++- src/tui/mod.rs | 18 +++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crates/datafusion-app/src/config.rs b/crates/datafusion-app/src/config.rs index 848ef634..41ec29ed 100644 --- a/crates/datafusion-app/src/config.rs +++ b/crates/datafusion-app/src/config.rs @@ -247,7 +247,7 @@ pub struct WasmUdfConfig { } #[cfg(feature = "flightsql")] -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug)] pub struct FlightSQLConfig { pub connection_url: String, pub benchmark_iterations: usize, @@ -255,6 +255,18 @@ pub struct FlightSQLConfig { pub headers: HashMap, } +#[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( diff --git a/src/tui/mod.rs b/src/tui/mod.rs index 39a587df..b06e65bc 100644 --- a/src/tui/mod.rs +++ b/src/tui/mod.rs @@ -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?; From 96164882c757acd2775e9abafefb1e50d16600d5 Mon Sep 17 00:00:00 2001 From: Matthew Turner Date: Tue, 4 Nov 2025 17:05:14 -0500 Subject: [PATCH 2/3] Fix --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f2480dee..8116b86e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1774,6 +1774,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "socket2 0.5.8", "strum 0.26.3", "tempfile", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 3c18c9d1..87c90b04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ pin-project-lite = { version = "0.2.14" } prost = "0.13.1" ratatui = "0.28.0" serde = { features = ["derive"], version = "1.0.197" } +socket2 = "0.5" strum = "0.26.2" tokio = { features = [ "macros", From 317f88ce7bd36820c3c2e670858559fdc5d97c69 Mon Sep 17 00:00:00 2001 From: Matthew Turner Date: Tue, 4 Nov 2025 17:59:16 -0500 Subject: [PATCH 3/3] Working i guess? --- .claude/settings.local.json | 9 +++++++++ Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..68811fed --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(cargo test:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/Cargo.toml b/Cargo.toml index 87c90b04..c894df56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ pin-project-lite = { version = "0.2.14" } prost = "0.13.1" ratatui = "0.28.0" serde = { features = ["derive"], version = "1.0.197" } -socket2 = "0.5" strum = "0.26.2" tokio = { features = [ "macros", @@ -77,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"