refactor(cli): remove obsolete workflow commands
This commit is contained in:
@@ -148,32 +148,6 @@ def validate_cmd(
|
||||
typer.secho("OK: SQL valido (statico).", fg=typer.colors.GREEN)
|
||||
|
||||
|
||||
@sql_app.command("explain")
|
||||
def explain_cmd(
|
||||
file: Path = typer.Argument(...),
|
||||
session: str = typer.Option(None, "--session"),
|
||||
config: Path = CONFIG_OPT,
|
||||
) -> None:
|
||||
"""EXPLAIN (FORMAT JSON) con sintesi e warning dal piano. Mai ANALYZE."""
|
||||
from tht.execute import ExecutionError
|
||||
from tht.execute.warnings import plan_warnings
|
||||
|
||||
cfg = _load_config_or_exit(config)
|
||||
require_action(cfg, "explain")
|
||||
sql = _read_sql(file)
|
||||
validate_or_exit(cfg, sql, session)
|
||||
try:
|
||||
plan = do_explain(cfg, sql)
|
||||
except ExecutionError as e:
|
||||
typer.secho(f"ERRORE: {e}", fg=typer.colors.RED, err=True)
|
||||
raise typer.Exit(code=1)
|
||||
typer.echo(f"costo totale stimato: {plan.total_cost}")
|
||||
typer.echo(f"righe stimate: {plan.plan_rows}")
|
||||
typer.echo(f"nodi del piano: {', '.join(plan.node_types)}")
|
||||
for w in plan_warnings(plan, cfg.execution):
|
||||
typer.secho(f" warning: {w}", fg=typer.colors.YELLOW)
|
||||
|
||||
|
||||
@sql_app.command("preview")
|
||||
def preview_cmd(
|
||||
file: Path = typer.Argument(None, help="File SQL da eseguire. Opzionale se --session è dato."),
|
||||
@@ -278,19 +252,6 @@ def set_final_cmd(
|
||||
typer.secho("OK: SQL finale salvato.", fg=typer.colors.GREEN)
|
||||
|
||||
|
||||
@sql_app.command("save")
|
||||
def save_cmd(
|
||||
dest: Path = typer.Argument(..., help="Percorso di destinazione del file SQL."),
|
||||
session: str = typer.Option(..., "--session"),
|
||||
config: Path = CONFIG_OPT,
|
||||
) -> None:
|
||||
"""Salva una copia di sql_final.sql nel percorso indicato (su richiesta esplicita)."""
|
||||
cfg = _load_config_or_exit(config)
|
||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||
dest.write_text(_session_sql(cfg, session))
|
||||
typer.secho(f"OK: SQL salvato in {dest}", fg=typer.colors.GREEN)
|
||||
|
||||
|
||||
@sql_app.command("export")
|
||||
def export_cmd(
|
||||
dest: Path = typer.Argument(..., help="Percorso del CSV di destinazione."),
|
||||
|
||||
Reference in New Issue
Block a user