pub struct ReplSession { /* private fields */ }Expand description
REPL session context and state
Implementations§
Source§impl ReplSession
impl ReplSession
Sourcepub fn new(
db_path: &Path,
config: Config,
database: Database,
) -> ReplResult<Self>
pub fn new( db_path: &Path, config: Config, database: Database, ) -> ReplResult<Self>
Create a new REPL session
Sourcepub async fn initialize(&mut self) -> ReplResult<()>
pub async fn initialize(&mut self) -> ReplResult<()>
Initialize the session
Sourcepub fn state(&self) -> &SessionState
pub fn state(&self) -> &SessionState
Get current session state
Sourcepub fn current_keyspace(&self) -> Option<&String>
pub fn current_keyspace(&self) -> Option<&String>
Get current keyspace
Sourcepub fn database(&self) -> Option<&Database>
pub fn database(&self) -> Option<&Database>
Get reference to the database (for status metrics collection)
Sourcepub fn set_data_dir(&mut self, path: Option<PathBuf>)
pub fn set_data_dir(&mut self, path: Option<PathBuf>)
Set data directory
Sourcepub async fn use_keyspace(&mut self, keyspace: &str) -> ReplResult<()>
pub async fn use_keyspace(&mut self, keyspace: &str) -> ReplResult<()>
Switch to a keyspace
Sourcepub async fn execute_query(&mut self, query: &str) -> ReplResult<QueryResult>
pub async fn execute_query(&mut self, query: &str) -> ReplResult<QueryResult>
Execute a query
Sourcepub async fn list_tables(&mut self) -> ReplResult<Vec<String>>
pub async fn list_tables(&mut self) -> ReplResult<Vec<String>>
List available tables
Sourcepub async fn list_keyspaces(&mut self) -> ReplResult<Vec<String>>
pub async fn list_keyspaces(&mut self) -> ReplResult<Vec<String>>
List available keyspaces
Sourcepub async fn describe_object(&mut self, object_name: &str) -> ReplResult<String>
pub async fn describe_object(&mut self, object_name: &str) -> ReplResult<String>
Describe an object (table, keyspace, etc.)
Sourcepub fn get_variable(&self, name: &str) -> Option<&String>
pub fn get_variable(&self, name: &str) -> Option<&String>
Get session variable
Sourcepub fn set_variable(&mut self, name: String, value: String)
pub fn set_variable(&mut self, name: String, value: String)
Set session variable
Sourcepub fn connection_info(&self) -> &ConnectionInfo
pub fn connection_info(&self) -> &ConnectionInfo
Get connection information
Sourcepub fn metrics(&self) -> &SessionMetrics
pub fn metrics(&self) -> &SessionMetrics
Get session metrics
Sourcepub async fn shutdown(&mut self) -> ReplResult<()>
pub async fn shutdown(&mut self) -> ReplResult<()>
Shutdown the session
Sourcepub fn export_metrics(&self) -> String
pub fn export_metrics(&self) -> String
Export session metrics as a report
Sourcepub fn replace_database(&mut self, new_database: Database) -> ReplResult<()>
pub fn replace_database(&mut self, new_database: Database) -> ReplResult<()>
Replace the Database instance with a new one
Used when rebuilding the database after ingestion changes. The old Database will be dropped when the Arc refcount reaches zero.
Sourcepub fn schema_registry(&self) -> Option<Arc<RwLock<SchemaRegistry>>>
pub fn schema_registry(&self) -> Option<Arc<RwLock<SchemaRegistry>>>
Get reference to SchemaRegistry for coverage reporting
Sourcepub fn set_schema_registry(
&mut self,
registry: Option<Arc<RwLock<SchemaRegistry>>>,
)
pub fn set_schema_registry( &mut self, registry: Option<Arc<RwLock<SchemaRegistry>>>, )
Set the schema registry
Auto Trait Implementations§
impl !RefUnwindSafe for ReplSession
impl !UnwindSafe for ReplSession
impl Freeze for ReplSession
impl Send for ReplSession
impl Sync for ReplSession
impl Unpin for ReplSession
impl UnsafeUnpin for ReplSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more