[][src]Struct orma::JoinBuilder

pub struct JoinBuilder<'a, A> where
    A: DbData
{ /* fields omitted */ }

Implementations

impl<'a, A> JoinBuilder<'a, A> where
    A: DbData
[src]

pub fn new(source: &'a A) -> Self[src]

Defines the source DbEntity of the DbJoin

pub fn with_target(self, target_table: &'a str) -> Self[src]

Provides the name of the table where DbJoin items are mapped to

pub fn with_source_fk(self, source_fk: &'a str) -> Self[src]

The name of the source foreign key in the items table when you want to represents a simple join ( 1 to n )

pub fn with_join_table(
    self,
    join_table: &'a str,
    source_fk: &'a str,
    items_fk: &'a str
) -> Self
[src]

If you want to map a m2n join, you provide the name of the db table with name of the source foreign key and the foreign key of the items table

pub fn with_sorting(self, sorting: &'a [&'a str]) -> Self[src]

DbJoin sorting attribute used to provide a sorting method on data fetching.

vec!["data->>'first_name'", "data->>'last_name' DESC"];

pub fn build(&self) -> Result<DbJoin, DbError>[src]

Creates the DbJoin object and fetches the data

Auto Trait Implementations

impl<'a, A> RefUnwindSafe for JoinBuilder<'a, A> where
    A: RefUnwindSafe

impl<'a, A> Send for JoinBuilder<'a, A> where
    A: Sync

impl<'a, A> Sync for JoinBuilder<'a, A> where
    A: Sync

impl<'a, A> Unpin for JoinBuilder<'a, A>

impl<'a, A> UnwindSafe for JoinBuilder<'a, A> where
    A: RefUnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,