Skip to content

Commit

Permalink
chadmin: "table attach" command (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Burmak committed May 14, 2024
1 parent 7d247db commit 77f870b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ch_tools/chadmin/cli/table_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,32 @@ def reattach_command(
)


@table_group.command("attach")
@argument("database_name", metavar="DATABASE")
@argument("table_name", metavar="TABLE")
@option(
"--cluster",
"--on-cluster",
"on_cluster",
is_flag=True,
help="Reattach tables on all hosts of the cluster.",
)
@option(
"-n",
"--dry-run",
is_flag=True,
default=False,
help="Enable dry run mode and do not perform any modifying actions.",
)
@pass_context
def attach_command(ctx, database_name, table_name, on_cluster, dry_run):
"""
Attach table.
"""
cluster = get_cluster_name(ctx) if on_cluster else None
attach_table(ctx, database_name, table_name, cluster=cluster, dry_run=dry_run)


@table_group.command("materialize-ttl")
@option_group(
"Table selection options",
Expand Down

0 comments on commit 77f870b

Please sign in to comment.