pub struct Selector<S>where
S: SelectorTrait,{ /* private fields */ }
Expand description
Defines a type to do SELECT
operations through a SelectStatement on a Model
Implementations§
source§impl<S> Selector<S>where
S: SelectorTrait,
impl<S> Selector<S>where
S: SelectorTrait,
sourcepub fn with_columns<T, C>(
query: SelectStatement
) -> Selector<SelectGetableValue<T, C>>where
T: TryGetableMany,
C: IntoEnumIterator + Iden,
pub fn with_columns<T, C>(
query: SelectStatement
) -> Selector<SelectGetableValue<T, C>>where
T: TryGetableMany,
C: IntoEnumIterator + Iden,
Create Selector
from Statement and columns. Executing this Selector
will return a type T
which implement TryGetableMany
.
sourcepub fn into_tuple<T>(query: SelectStatement) -> Selector<SelectGetableTuple<T>>where
T: TryGetableMany,
pub fn into_tuple<T>(query: SelectStatement) -> Selector<SelectGetableTuple<T>>where
T: TryGetableMany,
Get tuple from query result based on column index
sourcepub async fn one<'a, C>(self, db: &C) -> Result<Option<S::Item>, DbErr>where
C: ConnectionTrait,
pub async fn one<'a, C>(self, db: &C) -> Result<Option<S::Item>, DbErr>where
C: ConnectionTrait,
Get an item from the Select query