pub struct MySqlBackend { /* private fields */ }
Expand description
A MySQL backend using mysql-async
Implementations§
Source§impl MySqlBackend
impl MySqlBackend
Sourcepub async fn clean_database(
&self,
name: &DatabaseName,
) -> Result<(), MySqlError>
pub async fn clean_database( &self, name: &DatabaseName, ) -> Result<(), MySqlError>
Clean the database explicitly - this is a blocking call This should be called at the end of tests to ensure databases are cleaned up
Trait Implementations§
Source§impl Clone for MySqlBackend
impl Clone for MySqlBackend
Source§fn clone(&self) -> MySqlBackend
fn clone(&self) -> MySqlBackend
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DatabaseBackend for MySqlBackend
impl DatabaseBackend for MySqlBackend
Source§fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_pool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
_config: &'life2 DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new connection pool for the given database
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection to the given database
Source§fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect_with_string<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_string: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single connection using a connection string directly
Source§fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
fn drop_database(&self, name: &DatabaseName) -> Result<(), Self::Error>
Drop a database with the given name
type Connection = MySqlConnection
type Pool = MySqlPool
type Error = MySqlError
fn new<'async_trait>(
config: DatabaseConfig,
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pool: &'life1 Self::Pool,
name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pool: &'life1 Self::Pool,
name: &'life2 DatabaseName,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new database with the given name
Source§fn connection_string(&self, name: &DatabaseName) -> String
fn connection_string(&self, name: &DatabaseName) -> String
Get the connection string for the given database
Auto Trait Implementations§
impl Freeze for MySqlBackend
impl RefUnwindSafe for MySqlBackend
impl Send for MySqlBackend
impl Sync for MySqlBackend
impl Unpin for MySqlBackend
impl UnwindSafe for MySqlBackend
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