Skip to content

Improve CLI argument validation and error handling #1

Description

@castengine

Goal

Strengthen validation of CLI arguments and improve error reporting across the insert-tools CLI (mainly clickhouse_insert.cli and runner).

Tasks

  • Validate required arguments in one place (e.g., host, target_table, select_sql)
  • Add checks for missing or conflicting arguments
  • Handle errors such as:
    • Missing select_sql value
    • Non-existent file if reading SQL from file
    • Invalid types (e.g., port is not an integer)
  • Improve error messages to be more user-friendly
  • Add validate() method inside InsertConfig to encapsulate checks

Why it matters

Current CLI behavior lacks robust validation and gives unclear errors when arguments are missing or misused. Improving this will make the tool easier to use and reduce confusion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions