pub struct DatabaseConnection {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl DatabaseConnection
impl DatabaseConnection
pub async fn connect( host: &str, port: u16, database: &str, username: &str, password: &str, ) -> Result<DatabaseConnection>
pub async fn list_tables(&self) -> Result<Vec<String>>
pub async fn get_table_data( &self, table_name: &str, offset: i64, limit: i64, ) -> Result<(Vec<String>, Vec<Vec<String>>)>
pub async fn get_table_count(&self, table_name: &str) -> Result<i64>
pub async fn execute_custom_query( &self, query: &str, offset: i64, limit: i64, ) -> Result<(Vec<String>, Vec<Vec<String>>)>
pub async fn get_query_row_count(&self, query: &str) -> Result<i64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DatabaseConnection
impl !RefUnwindSafe for DatabaseConnection
impl Send for DatabaseConnection
impl Sync for DatabaseConnection
impl Unpin for DatabaseConnection
impl !UnwindSafe for DatabaseConnection
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> 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