pub struct CqlCompleter {
cache: Arc<RwLock<SchemaCache>>,
current_keyspace: Arc<RwLock<Option<String>>>,
rt_handle: Handle,
colorizer: CqlColorizer,
}Expand description
Tab completer for the CQL shell REPL.
Fields§
§cache: Arc<RwLock<SchemaCache>>Shared schema cache for keyspace/table/column lookups.
current_keyspace: Arc<RwLock<Option<String>>>Current keyspace (shared with session via USE command).
rt_handle: HandleTokio runtime handle for blocking cache reads inside sync complete().
colorizer: CqlColorizerSyntax colorizer for highlighting.
Implementations§
Source§impl CqlCompleter
impl CqlCompleter
Sourcepub fn new(
cache: Arc<RwLock<SchemaCache>>,
current_keyspace: Arc<RwLock<Option<String>>>,
rt_handle: Handle,
color_enabled: bool,
) -> Self
pub fn new( cache: Arc<RwLock<SchemaCache>>, current_keyspace: Arc<RwLock<Option<String>>>, rt_handle: Handle, color_enabled: bool, ) -> Self
Create a new completer with shared cache and keyspace state.
Sourcefn detect_context(&self, line: &str, pos: usize) -> CompletionContext
fn detect_context(&self, line: &str, pos: usize) -> CompletionContext
Detect completion context from the input line up to the cursor position.
Uses the unified CQL lexer for grammar-aware context detection.
Sourcefn extract_qualifying_keyspace(&self, sig: &[&Token]) -> Option<String>
fn extract_qualifying_keyspace(&self, sig: &[&Token]) -> Option<String>
Extract the keyspace qualifier from a dot-qualified name in the token stream.
Sourcefn extract_table_from_tokens(
&self,
sig: &[&Token],
) -> (Option<String>, Option<String>)
fn extract_table_from_tokens( &self, sig: &[&Token], ) -> (Option<String>, Option<String>)
Extract table name from the token stream by finding FROM/INTO/UPDATE