[−][src]Struct bb8_diesel::DieselConnection
An async-safe analogue of any connection that implements
diesel::Connection
.
All blocking methods within this type delegate to block_in_place
. The
number of threads is not unbounded, however, as they are controlled by the
truly asynchronous bb8::Pool
owner. This type makes it easy to use diesel
without fear of blocking the runtime and without fear of spawning too many
child threads.
Note that trying to construct this type via Connection::establish
will
panic. The only correct way to construct this type is by using a bb8 pool.
Trait Implementations
impl<C> Connection for DieselConnection<C> where
C: Connection<TransactionManager = AnsiTransactionManager>,
C::Backend: UsesAnsiSavepointSyntax,
[src]
C: Connection<TransactionManager = AnsiTransactionManager>,
C::Backend: UsesAnsiSavepointSyntax,
type Backend = C::Backend
The backend this type connects to
type TransactionManager = AnsiTransactionManager
fn establish(_database_url: &str) -> ConnectionResult<Self>
[src]
fn transaction<T, E, F>(&self, f: F) -> Result<T, E> where
F: FnOnce() -> Result<T, E>,
E: From<Error>,
[src]
F: FnOnce() -> Result<T, E>,
E: From<Error>,
fn begin_test_transaction(&self) -> QueryResult<()>
[src]
fn test_transaction<T, E, F>(&self, f: F) -> T where
F: FnOnce() -> Result<T, E>,
E: Debug,
[src]
F: FnOnce() -> Result<T, E>,
E: Debug,
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]
impl<C> Deref for DieselConnection<C>
[src]
impl<C> DerefMut for DieselConnection<C>
[src]
impl<C> SimpleConnection for DieselConnection<C> where
C: SimpleConnection,
[src]
C: SimpleConnection,
fn batch_execute(&self, query: &str) -> QueryResult<()>
[src]
Auto Trait Implementations
impl<C> RefUnwindSafe for DieselConnection<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for DieselConnection<C> where
C: Send,
C: Send,
impl<C> Sync for DieselConnection<C> where
C: Sync,
C: Sync,
impl<C> Unpin for DieselConnection<C> where
C: Unpin,
C: Unpin,
impl<C> UnwindSafe for DieselConnection<C> where
C: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,