Skip to content

Default local teardown to the default instance - #355

Open
sdairs wants to merge 2 commits into
codex/issue-328-install-output-polishfrom
codex/issue-326-default-local-instance
Open

Default local teardown to the default instance#355
sdairs wants to merge 2 commits into
codex/issue-328-install-output-polishfrom
codex/issue-326-default-local-instance

Conversation

@sdairs

@sdairs sdairs commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • default omitted names to default for ClickHouse server stop and server remove
  • apply the same default to Postgres postgres stop and postgres remove
  • add Clap parse coverage for omitted and explicit names
  • document the bare default-instance lifecycle commands

Why

start creates or resumes the default instance when no name is supplied, but the matching teardown commands required a positional name. This made the natural default-instance lifecycle fail at argument parsing before the command could run.

Impact

Users can now start, stop, and remove the default ClickHouse or Postgres instance without typing its name. Explicit names and existing disambiguation flags continue to work unchanged.

Stack

This PR is stacked on #354 and should be reviewed as the delta from codex/issue-328-install-output-polish.

Closes #326.

Validation

  • cargo fmt --all --check
  • cargo build -p clickhousectl
  • cargo test -p clickhousectl
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Makes local teardown commands symmetric with start by defaulting the omitted instance name to "default" for both ClickHouse and Postgres, improving the default-instance lifecycle and reducing clap parse failures.

Changes:

  • Default positional <NAME> to "default" for local server stop/remove and local postgres stop/remove.
  • Add clap parse tests covering omitted-name defaults and explicit-name preservation.
  • Update README examples and wording to document the default-instance teardown flow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
README.md Documents stop/remove without a name as operating on "default" for ClickHouse and Postgres.
crates/clickhousectl/src/local/cli.rs Implements clap defaults for teardown commands and adds parse-coverage unit tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/clickhousectl/src/local/cli.rs
@sdairs
sdairs force-pushed the codex/issue-326-default-local-instance branch from e38743c to 918bcd5 Compare August 3, 2026 18:42
@sdairs
sdairs force-pushed the codex/issue-326-default-local-instance branch from 918bcd5 to 424fc86 Compare August 3, 2026 19:34
@sdairs
sdairs force-pushed the codex/issue-326-default-local-instance branch from 424fc86 to 09d0c47 Compare August 3, 2026 20:04
@sdairs
sdairs marked this pull request as ready for review August 3, 2026 20:12
@sdairs
sdairs requested review from iskakaushik and rndD as code owners August 3, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

postgres stop/postgres remove require <NAME> while postgres start defaults to "default"

2 participants