Module repl

Module repl 

Source
Expand description

Interactive REPL (Read-Eval-Print Loop) for cqlsh-rs.

Integrates rustyline for line editing, history, and prompt management. Mirrors the Python cqlsh interactive behavior including multi-line input, prompt formatting, and Ctrl-C/Ctrl-D handling.

StructsΒ§

ShellState πŸ”’
Mutable shell state for commands like EXPAND, PAGING, and CAPTURE.

ConstantsΒ§

CONTINUATION_PROMPT πŸ”’
Continuation prompt for multi-line input (matches Python cqlsh).
DEFAULT_HISTORY_DIR πŸ”’
Default history file path: ~/.cassandra/cql_history
DEFAULT_HISTORY_FILE πŸ”’
DEFAULT_HISTORY_SIZE πŸ”’
Maximum history entries (matches Python cqlsh default).

FunctionsΒ§

build_prompt
Build the primary prompt string matching Python cqlsh format.
dispatch_input πŸ”’
Dispatch a complete input line/statement to the session.
execute_source πŸ”’
Execute a SOURCE file: read CQL statements and execute them sequentially.
expand_tilde πŸ”’
Expand ~ at the start of a path to the user’s home directory.
print_help
Print a basic help message matching Python cqlsh style.
print_help_topic
Print help for a specific topic.
process_line πŸ”’
Process a single line of input through the REPL pipeline.
resolve_history_path πŸ”’
Resolve the history file path.
run
Run the interactive REPL loop.
strip_quotes πŸ”’
Strip surrounding single or double quotes from a string.