pub struct TableCatalog { /* private fields */ }Expand description
Table catalog that holds all loaded table definitions
Implementations§
Source§impl TableCatalog
impl TableCatalog
pub fn new() -> Self
Sourcepub fn load_from_config(config: &Config) -> Result<Self>
pub fn load_from_config(config: &Config) -> Result<Self>
Load tables from a configuration
Sourcepub fn get_table(&self, name: &str) -> Option<&Table>
pub fn get_table(&self, name: &str) -> Option<&Table>
Get a table by name from the current database
Sourcepub fn get_table_from_db(&self, database: &str, table: &str) -> Option<&Table>
pub fn get_table_from_db(&self, database: &str, table: &str) -> Option<&Table>
Get a table from a specific database
Sourcepub fn use_database(&mut self, name: &str) -> Result<()>
pub fn use_database(&mut self, name: &str) -> Result<()>
Set the current database
Sourcepub fn current_database(&self) -> &str
pub fn current_database(&self) -> &str
Get the current database name
Sourcepub fn list_databases(&self) -> Vec<String>
pub fn list_databases(&self) -> Vec<String>
List all databases
Sourcepub fn list_tables(&self) -> Vec<String>
pub fn list_tables(&self) -> Vec<String>
List all tables in the current database
Trait Implementations§
Source§impl Clone for TableCatalog
impl Clone for TableCatalog
Source§impl Debug for TableCatalog
impl Debug for TableCatalog
Auto Trait Implementations§
impl Freeze for TableCatalog
impl RefUnwindSafe for TableCatalog
impl Send for TableCatalog
impl Sync for TableCatalog
impl Unpin for TableCatalog
impl UnsafeUnpin for TableCatalog
impl UnwindSafe for TableCatalog
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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