pub struct RepeatableRead;Expand description
Isolation::RepeatableRead 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 => Ok(Some(
"SET TRANSACTION ISOLATION LEVEL READ COMMITTED; BEGIN TRANSACTION",
)),
Opening::Isolation(Isolation::RepeatableRead) => Ok(Some(
"SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; BEGIN TRANSACTION",
)),
other => Err(StatementError::UnsupportedOpening {
dialect: self.name(),
opening: other.name(),
}),
}
}
}
// A table with `isolation = repeatable_read` mounts on `Mssql`.
impl Opens<level::RepeatableRead> for Mssql {}Trait Implementations§
Source§impl Clone for RepeatableRead
impl Clone for RepeatableRead
impl Copy for RepeatableRead
Source§impl Debug for RepeatableRead
impl Debug for RepeatableRead
Source§impl Default for RepeatableRead
impl Default for RepeatableRead
impl Eq for RepeatableRead
Source§impl Hash for RepeatableRead
impl Hash for RepeatableRead
impl Opens<RepeatableRead> for MySql
impl Opens<RepeatableRead> for Postgres
Source§impl PartialEq for RepeatableRead
impl PartialEq for RepeatableRead
impl StructuralPartialEq for RepeatableRead
Auto Trait Implementations§
impl Freeze for RepeatableRead
impl RefUnwindSafe for RepeatableRead
impl Send for RepeatableRead
impl Sync for RepeatableRead
impl Unpin for RepeatableRead
impl UnsafeUnpin for RepeatableRead
impl UnwindSafe for RepeatableRead
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