[][src]Struct diesel_crud::Db

pub struct Db<BaseConnection: Connection + 'static> { /* fields omitted */ }

Methods

impl<BaseConnection> Db<BaseConnection> where
    BaseConnection: Connection + 'static, 
[src]

pub fn new() -> Result<Self, Error>[src]

Creates a database connection pool.

pub fn conn(
    &self
) -> Result<PooledConnection<ConnectionManager<BaseConnection>>, Error>
[src]

impl<BaseConnection> Db<BaseConnection> where
    BaseConnection: Connection<TransactionManager = AnsiTransactionManager>,
    BaseConnection::Backend: UsesAnsiSavepointSyntax
[src]

pub fn cud<C>(&self, cud: C) -> Result<(), Error> where
    C: Cud<BaseConnection>,
    C::Query: QueryFragment<BaseConnection::Backend> + QueryId
[src]

pub fn cud_query(
    &self,
    query: impl CudQuery<BaseConnection>
) -> Result<(), Error>
[src]

impl<BaseConnection> Db<BaseConnection> where
    BaseConnection: Connection
[src]

pub fn load<L>(&self, load: L) -> Result<Vec<L::Item>, Error> where
    L: Load<BaseConnection>, 
[src]

pub fn load_query<T>(
    &self,
    query: impl LoadQuery<T, BaseConnection>
) -> Result<Vec<T>, Error>
[src]

Auto Trait Implementations

impl<BaseConnection> !RefUnwindSafe for Db<BaseConnection>

impl<BaseConnection> Send for Db<BaseConnection>

impl<BaseConnection> Sync for Db<BaseConnection>

impl<BaseConnection> Unpin for Db<BaseConnection>

impl<BaseConnection> !UnwindSafe for Db<BaseConnection>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.