From edce560f207dc9260d315c21fa512d377a76049e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Feb 2026 21:18:40 +0000 Subject: [PATCH] Auto-start stackql server in build, teardown, and test commands Added check_and_start_server() before creating the client connection in build, teardown, and test commands, matching the existing behavior in the shell command. The server is automatically started if not already running on the configured port. https://claude.ai/code/session_01ShAyjRLWBYC3tPsusCxggv --- src/commands/build.rs | 2 ++ src/commands/teardown.rs | 2 ++ src/commands/test.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/commands/build.rs b/src/commands/build.rs index 8e905d7..00030d9 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -21,6 +21,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Defines the `build` command for the CLI application. pub fn command() -> Command { @@ -56,6 +57,7 @@ pub fn execute(matches: &ArgMatches) { let on_failure_val = matches.get_one::("on-failure").unwrap(); let output_file = matches.get_one::("output-file"); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client, diff --git a/src/commands/teardown.rs b/src/commands/teardown.rs index b8c5b74..75f28b8 100644 --- a/src/commands/teardown.rs +++ b/src/commands/teardown.rs @@ -19,6 +19,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Configures the `teardown` command for the CLI application. pub fn command() -> Command { @@ -47,6 +48,7 @@ pub fn execute(matches: &ArgMatches) { let is_show_queries = matches.get_flag("show-queries"); let on_failure_val = matches.get_one::("on-failure").unwrap(); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client, diff --git a/src/commands/test.rs b/src/commands/test.rs index af742b3..535e5f3 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -21,6 +21,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Configures the `test` command for the CLI application. pub fn command() -> Command { @@ -56,6 +57,7 @@ pub fn execute(matches: &ArgMatches) { let on_failure_val = matches.get_one::("on-failure").unwrap(); let output_file = matches.get_one::("output-file"); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client,