Module config

Module config 

Source
Expand description

Configuration file parsing and merged configuration for cqlsh-rs.

Handles ~/.cassandra/cqlshrc (INI format) parsing, environment variable loading, and merging with CLI arguments following the precedence rule: CLI > environment variables > cqlshrc > defaults.

Many fields are defined ahead of their use in later development phases.

StructsΒ§

AuthenticationSection
ConnectionSection
CopyFromSection
CopySection
CopyToSection
CqlSection
CqlshrcConfig
Represents the parsed contents of a cqlshrc INI file.
CsvSection
EnvConfig
Load environment variables relevant to cqlsh.
MergedConfig
The fully resolved configuration after merging CLI args, environment variables, cqlshrc file, and defaults. Follows precedence: CLI > env > cqlshrc > defaults.
SslSection
TracingSection
UiSection

EnumsΒ§

ColorMode
ConfigError
Errors specific to configuration loading.

ConstantsΒ§

DEFAULT_CONNECT_TIMEOUT πŸ”’
Default connect timeout in seconds (matches Python cqlsh).
DEFAULT_HOST πŸ”’
Default host.
DEFAULT_PORT πŸ”’
Default port.
DEFAULT_REQUEST_TIMEOUT πŸ”’
Default request timeout in seconds (matches Python cqlsh).

FunctionsΒ§

default_cqlshrc_path
Return the default cqlshrc path: ~/.cassandra/cqlshrc
load_config
Load the full configuration pipeline: resolve path β†’ load cqlshrc β†’ read env β†’ merge.
parse_bool πŸ”’
Parse boolean values in the same way Python cqlsh does: β€œtrue”, β€œyes”, β€œon”, β€œ1” β†’ true, everything else β†’ false.
resolve_cqlshrc_path
Resolve the cqlshrc file path based on CLI flag or default location.