[−][src]Struct diesel_transaction_handles::TransactionalConnection
Methods
impl<C: Connection> TransactionalConnection<C>
[src]
pub fn new(conn: C) -> Result<TransactionalConnection<C>, Error>
[src]
pub fn rollback(self) -> Result<(), ErrorVec>
[src]
pub fn commit(self) -> Result<(), Error>
[src]
pub fn handle_result<T, E>(self, res: Result<T, E>) -> Result<T, Error> where
Error: From<E>,
[src]
Error: From<E>,
pub fn add_rollback_hook(&self, hook: fn() -> Result<(), Error>)
[src]
Trait Implementations
impl<C: Connection> Drop for TransactionalConnection<C>
[src]
impl<C: Connection> Connection for TransactionalConnection<C>
[src]
type Backend = C::Backend
The backend this type connects to
type TransactionManager = Self
fn establish(_: &str) -> ConnectionResult<Self>
[src]
fn execute(&self, query: &str) -> QueryResult<usize>
[src]
fn query_by_index<T, U>(&self, source: T) -> QueryResult<Vec<U>> where
T: AsQuery,
T::Query: QueryFragment<Self::Backend> + QueryId,
Self::Backend: HasSqlType<T::SqlType>,
U: Queryable<T::SqlType, Self::Backend>,
[src]
T: AsQuery,
T::Query: QueryFragment<Self::Backend> + QueryId,
Self::Backend: HasSqlType<T::SqlType>,
U: Queryable<T::SqlType, Self::Backend>,
fn query_by_name<T, U>(&self, source: &T) -> QueryResult<Vec<U>> where
T: QueryFragment<Self::Backend> + QueryId,
U: QueryableByName<Self::Backend>,
[src]
T: QueryFragment<Self::Backend> + QueryId,
U: QueryableByName<Self::Backend>,
fn execute_returning_count<T>(&self, source: &T) -> QueryResult<usize> where
T: QueryFragment<Self::Backend> + QueryId,
[src]
T: QueryFragment<Self::Backend> + QueryId,
fn transaction_manager(&self) -> &Self::TransactionManager
[src]
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
E: From<Error>,
F: FnOnce() -> Result<T, E>,
[src]
E: From<Error>,
F: FnOnce() -> Result<T, E>,
Executes the given function inside of a database transaction Read more
fn begin_test_transaction(&self) -> Result<(), Error>
[src]
Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction. Read more
fn test_transaction<T, E, F>(&self, f: F) -> T where
E: Debug,
F: FnOnce() -> Result<T, E>,
[src]
E: Debug,
F: FnOnce() -> Result<T, E>,
Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. Read more
impl<C: Connection> TransactionManager<TransactionalConnection<C>> for TransactionalConnection<C>
[src]
fn begin_transaction(
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
[src]
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
fn rollback_transaction(
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
[src]
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
fn commit_transaction(
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
[src]
&self,
conn: &TransactionalConnection<C>
) -> QueryResult<()>
fn get_transaction_depth(&self) -> u32
[src]
impl<C: Connection> SimpleConnection for TransactionalConnection<C>
[src]
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
Auto Trait Implementations
impl<T> Send for TransactionalConnection<T>
impl<T> Sync for TransactionalConnection<T>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
Convert self
to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel's query builder. Read more