pub struct MariaDB { /* private fields */ }Expand description
A MariaDB 11.8+ [Driver] that connects through SQLx.
Uses MariaDB’s native UUID type and INSERT ... RETURNING.
§Examples
use toasty_driver_mysql::MariaDB;
let driver = MariaDB::new("mariadb://localhost/mydb").unwrap();Implementations§
Source§impl MariaDB
impl MariaDB
Sourcepub fn new(url: impl Into<String>) -> Result<Self>
pub fn new(url: impl Into<String>) -> Result<Self>
Creates a MariaDB driver without connecting to the server.
The URL must use the mariadb scheme and include a database path,
such as mariadb://user:pass@host:3306/dbname. The server must run
MariaDB 11.8 or later.
§Errors
Returns an error if the URL is malformed or uses another scheme.
Trait Implementations§
Source§impl Driver for MariaDB
impl Driver for MariaDB
Source§fn capability(&self) -> &'static Capability
fn capability(&self) -> &'static Capability
Describes the driver’s capability, which informs the query planner.
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 ConnectContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
cx: &'life1 ConnectContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new connection to the database. Read more
Source§fn generate_migration(&self, schema_diff: &Schema<'_>) -> Migration
fn generate_migration(&self, schema_diff: &Schema<'_>) -> Migration
Generates a migration from a [
diff::Schema].Source§fn reset_db<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_db<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drops the entire database and recreates an empty one without applying migrations. Read more
§fn max_connections(&self) -> Option<usize>
fn max_connections(&self) -> Option<usize>
Returns the maximum number of simultaneous database connections supported. For example,
this is
Some(1) for the in-memory SQLite driver which cannot be pooled.Auto Trait Implementations§
impl Freeze for MariaDB
impl RefUnwindSafe for MariaDB
impl Send for MariaDB
impl Sync for MariaDB
impl Unpin for MariaDB
impl UnsafeUnpin for MariaDB
impl UnwindSafe for MariaDB
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<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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