pub struct ReadCommitted;Expand description
Isolation::ReadCommitted as a type, for the bound
Opens sets.
§Examples
use ruststream_sqlx_dialect::{
Dialect, Isolation, Opening, Opens, Statement, StatementError, TableSpec, level,
};
/// SQL Server, a database without a built-in dialect.
#[derive(Debug)]
pub struct Mssql;
impl Dialect for Mssql {
fn name(&self) -> &'static str {
"mssql"
}
fn begin(&self, opening: Opening) -> Result<Option<&'static str>, StatementError> {
match opening {
Opening::Default | Opening::Isolation(Isolation::ReadCommitted) => Ok(Some(
"SET TRANSACTION ISOLATION LEVEL READ COMMITTED; BEGIN TRANSACTION",
)),
other => Err(StatementError::UnsupportedOpening {
dialect: self.name(),
opening: other.name(),
}),
}
}
}
// A table with `isolation = read_committed` mounts on `Mssql`.
impl Opens<level::ReadCommitted> for Mssql {}Trait Implementations§
Source§impl Clone for ReadCommitted
impl Clone for ReadCommitted
impl Copy for ReadCommitted
Source§impl Debug for ReadCommitted
impl Debug for ReadCommitted
Source§impl Default for ReadCommitted
impl Default for ReadCommitted
impl Eq for ReadCommitted
Source§impl Hash for ReadCommitted
impl Hash for ReadCommitted
impl Opens<ReadCommitted> for MySql
impl Opens<ReadCommitted> for Postgres
Source§impl PartialEq for ReadCommitted
impl PartialEq for ReadCommitted
impl StructuralPartialEq for ReadCommitted
Auto Trait Implementations§
impl Freeze for ReadCommitted
impl RefUnwindSafe for ReadCommitted
impl Send for ReadCommitted
impl Sync for ReadCommitted
impl Unpin for ReadCommitted
impl UnsafeUnpin for ReadCommitted
impl UnwindSafe for ReadCommitted
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