pub struct DoTransactionManager;Expand description
Refuses begin().
sql.exec rejects BEGIN and SAVEPOINT outright: the only transactions
Durable Object storage offers wrap a callback, and sqlx’s begin and
commit are two separate calls with the caller’s code in between.
Buffering writes until commit would look like a transaction and not be
one – reads inside it would see the database as it was before – which is
worse than an error. So conn.begin() compiles and fails at runtime, and
transactions go through DoConnection::transaction.
Trait Implementations§
Source§impl Debug for DoTransactionManager
impl Debug for DoTransactionManager
Source§impl TransactionManager for DoTransactionManager
impl TransactionManager for DoTransactionManager
type Database = Do
Source§fn begin(
_conn: &mut DoConnection,
_statement: Option<SqlStr>,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn begin( _conn: &mut DoConnection, _statement: Option<SqlStr>, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Begin a new transaction or establish a savepoint within the active transaction. Read more
Source§fn commit(
_conn: &mut DoConnection,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn commit( _conn: &mut DoConnection, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Commit the active transaction or release the most recent savepoint.
Source§fn rollback(
_conn: &mut DoConnection,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn rollback( _conn: &mut DoConnection, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Abort the active transaction or restore from the most recent savepoint.
Source§fn start_rollback(_conn: &mut DoConnection)
fn start_rollback(_conn: &mut DoConnection)
Starts to abort the active transaction or restore from the most recent snapshot.
Source§fn get_transaction_depth(_conn: &DoConnection) -> usize
fn get_transaction_depth(_conn: &DoConnection) -> usize
Returns the current transaction depth. Read more
Auto Trait Implementations§
impl Freeze for DoTransactionManager
impl RefUnwindSafe for DoTransactionManager
impl Send for DoTransactionManager
impl Sync for DoTransactionManager
impl Unpin for DoTransactionManager
impl UnsafeUnpin for DoTransactionManager
impl UnwindSafe for DoTransactionManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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