pub struct DoTransaction { /* private fields */ }Expand description
An open transaction: the executor DoConnection::transaction hands its
callback.
&DoTransaction and &mut DoTransaction are sqlx executors, like a
connection’s references, and every query run through one is part of the
transaction.
Trait Implementations§
Source§impl Debug for DoTransaction
impl Debug for DoTransaction
Source§impl<'c> Executor<'c> for &'c DoTransaction
impl<'c> Executor<'c> for &'c DoTransaction
Source§fn execute<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<DoQueryResult, Error>>
fn execute<'e, 'q: 'e, E>( self, query: E, ) -> BoxFuture<'e, Result<DoQueryResult, Error>>
Reports rows_affected and last_insert_rowid but no rows.
Source§fn fetch_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<Either<DoQueryResult, DoRow>, Error>>
fn fetch_many<'e, 'q: 'e, E>( self, query: E, ) -> BoxStream<'e, Result<Either<DoQueryResult, DoRow>, Error>>
Yields the rows only, never a DoQueryResult. Use
execute for what a statement changed.
type Database = Do
Source§fn execute_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<DoQueryResult, Error>>
fn execute_many<'e, 'q: 'e, E>( self, query: E, ) -> BoxStream<'e, Result<DoQueryResult, Error>>
Execute multiple queries and return the rows affected from each query, in a stream.
Source§fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<Option<DoRow>, Error>>
fn fetch_optional<'e, 'q: 'e, E>( self, query: E, ) -> BoxFuture<'e, Result<Option<DoRow>, Error>>
Execute the query and returns at most one row.
Source§fn prepare_with<'e>(
self,
sql: SqlStr,
_parameters: &'e [DoTypeInfo],
) -> BoxFuture<'e, Result<DoStatement, Error>>where
'c: 'e,
fn prepare_with<'e>(
self,
sql: SqlStr,
_parameters: &'e [DoTypeInfo],
) -> BoxFuture<'e, Result<DoStatement, Error>>where
'c: 'e,
Prepare the SQL query, with parameter type information, to inspect the
type information about its parameters and results. Read more
Source§fn fetch<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>
fn fetch<'e, 'q, E>( self, query: E, ) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>
Execute the query and return the generated results as a stream.
Source§fn fetch_all<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>
fn fetch_all<'e, 'q, E>( self, query: E, ) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>
Execute the query and return all the generated results, collected into a
Vec.Source§impl<'c> Executor<'c> for &'c mut DoTransaction
impl<'c> Executor<'c> for &'c mut DoTransaction
type Database = Do
Source§fn execute<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<DoQueryResult, Error>>
fn execute<'e, 'q: 'e, E>( self, query: E, ) -> BoxFuture<'e, Result<DoQueryResult, Error>>
Execute the query and return the total number of rows affected.
Source§fn execute_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<DoQueryResult, Error>>
fn execute_many<'e, 'q: 'e, E>( self, query: E, ) -> BoxStream<'e, Result<DoQueryResult, Error>>
Execute multiple queries and return the rows affected from each query, in a stream.
Source§fn fetch_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<Either<DoQueryResult, DoRow>, Error>>
fn fetch_many<'e, 'q: 'e, E>( self, query: E, ) -> BoxStream<'e, Result<Either<DoQueryResult, DoRow>, Error>>
Execute multiple queries and return the generated results as a stream
from each query, in a stream.
Source§fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<Option<DoRow>, Error>>
fn fetch_optional<'e, 'q: 'e, E>( self, query: E, ) -> BoxFuture<'e, Result<Option<DoRow>, Error>>
Execute the query and returns at most one row.
Source§fn prepare_with<'e>(
self,
sql: SqlStr,
parameters: &'e [DoTypeInfo],
) -> BoxFuture<'e, Result<DoStatement, Error>>where
'c: 'e,
fn prepare_with<'e>(
self,
sql: SqlStr,
parameters: &'e [DoTypeInfo],
) -> BoxFuture<'e, Result<DoStatement, Error>>where
'c: 'e,
Prepare the SQL query, with parameter type information, to inspect the
type information about its parameters and results. Read more
Source§fn fetch<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>
fn fetch<'e, 'q, E>( self, query: E, ) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>
Execute the query and return the generated results as a stream.
Source§fn fetch_all<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>
fn fetch_all<'e, 'q, E>( self, query: E, ) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>
Execute the query and return all the generated results, collected into a
Vec.Auto Trait Implementations§
impl Freeze for DoTransaction
impl RefUnwindSafe for DoTransaction
impl Send for DoTransaction
impl Sync for DoTransaction
impl Unpin for DoTransaction
impl UnsafeUnpin for DoTransaction
impl UnwindSafe for DoTransaction
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