[][src]Struct elephantry::Pool

pub struct Pool { /* fields omitted */ }

Implementations

impl Pool[src]

pub fn new(url: &str) -> Result<Self>[src]

pub fn from_config(config: &Config) -> Result<Self>[src]

pub fn add_default(self, name: &str, url: &str) -> Result<Self>[src]

pub fn add_connection(self, name: &str, url: &str) -> Result<Self>[src]

pub fn get_default(&self) -> Option<&Connection>[src]

pub fn set_default(&mut self, name: &str)[src]

pub fn get(&self, name: &str) -> Option<&Connection>[src]

Methods from Deref<Target = Connection>

pub fn model<'a, M>(&'a self) -> M where
    M: Model<'a>, 
[src]

pub fn execute(&self, query: &str) -> Result<Result>[src]

pub fn query<E: Entity>(
    &self,
    query: &str,
    params: &[&dyn ToSql]
) -> Result<Rows<E>>
[src]

pub fn query_one<E: Entity>(
    &self,
    query: &str,
    params: &[&dyn ToSql]
) -> Result<E>
[src]

pub fn find_by_pk<'a, M>(
    &self,
    pk: &HashMap<&str, &dyn ToSql>
) -> Result<Option<M::Entity>> where
    M: Model<'a>, 
[src]

pub fn find_all<'a, M>(&self, suffix: Option<&str>) -> Result<Rows<M::Entity>> where
    M: Model<'a>, 
[src]

pub fn find_where<'a, M>(
    &self,
    clause: &str,
    params: &[&dyn ToSql],
    suffix: Option<&str>
) -> Result<Rows<M::Entity>> where
    M: Model<'a>, 
[src]

pub fn paginate_find_where<'a, M>(
    &self,
    clause: &str,
    params: &[&dyn ToSql],
    max_per_page: usize,
    page: usize,
    suffix: Option<&str>
) -> Result<Pager<M::Entity>> where
    M: Model<'a>, 
[src]

pub fn count_where<'a, M>(
    &self,
    clause: &str,
    params: &[&dyn ToSql]
) -> Result<usize> where
    M: Model<'a>, 
[src]

pub fn exist_where<'a, M>(
    &self,
    clause: &str,
    params: &[&dyn ToSql]
) -> Result<bool> where
    M: Model<'a>, 
[src]

pub fn insert_one<'a, M>(&self, entity: &M::Entity) -> Result<M::Entity> where
    M: Model<'a>, 
[src]

pub fn update_one<'a, M>(
    &self,
    pk: &HashMap<&str, &dyn ToSql>,
    entity: &M::Entity
) -> Result<M::Entity> where
    M: Model<'a>, 
[src]

pub fn update_by_pk<'a, M>(
    &self,
    pk: &HashMap<&str, &dyn ToSql>,
    data: &HashMap<String, &dyn ToSql>
) -> Result<M::Entity> where
    M: Model<'a>, 
[src]

pub fn delete_one<'a, M>(&self, entity: &M::Entity) -> Result<M::Entity> where
    M: Model<'a>, 
[src]

pub fn delete_by_pk<'a, M>(
    &self,
    pk: &HashMap<&str, &dyn ToSql>
) -> Result<M::Entity> where
    M: Model<'a>, 
[src]

pub fn delete_where<'a, M>(
    &self,
    clause: &str,
    params: &[&dyn ToSql]
) -> Result<Rows<M::Entity>> where
    M: Model<'a>, 
[src]

Trait Implementations

impl Debug for Pool[src]

impl Default for Pool[src]

impl Deref for Pool[src]

type Target = Connection

The resulting type after dereferencing.

impl<'_> Index<&'_ str> for Pool[src]

type Output = Connection

The returned type after indexing.

Auto Trait Implementations

impl RefUnwindSafe for Pool

impl !Send for Pool

impl !Sync for Pool

impl Unpin for Pool

impl UnwindSafe for Pool

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, 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.