pub struct SampleSelect<'conn> { /* private fields */ }Implementations§
Source§impl<'conn> SampleSelect<'conn>
impl<'conn> SampleSelect<'conn>
pub const Name: SelectField<Sample, String, String>
pub const IsReference: SelectField<Sample, bool, bool>
pub fn new(conn: &'conn Connection) -> Self
pub fn with_ref<R, K>(self, history_ref: R) -> Selfwhere
R: IntoHistoryRef<K>,
pub fn name(self, value: impl Into<String>) -> Self
pub fn name_in<I, V>(self, values: I) -> Self
pub fn name_contains(self, value: impl Into<String>) -> Self
Sourcepub fn name_like(self, pattern: impl Into<String>) -> Self
pub fn name_like(self, pattern: impl Into<String>) -> Self
Matches a bound SQL LIKE pattern, preserving % and _ wildcards.
Case sensitivity follows the database connection’s LIKE settings.
pub fn name_case_insensitive(self, value: impl Into<String>) -> Self
pub fn is_reference(self, value: bool) -> Self
pub fn is_reference_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = bool>,
pub fn order_by<T, JoinType>( self, field: SelectField<Sample, T, JoinType>, direction: Direction, ) -> Self
Sourcepub fn order_by_relevance<T>(
self,
field: SelectField<Sample, T, String>,
search: impl Into<String>,
) -> Self
pub fn order_by_relevance<T>( self, field: SelectField<Sample, T, String>, search: impl Into<String>, ) -> Self
Orders by exact match, case-insensitive exact match, LIKE prefix, then LIKE contains.
Search values are bound parameters; % and _ retain LIKE wildcard semantics.
Case-insensitive equality uses SQL lower (ASCII by default); LIKE follows the
connection’s settings. Case-sensitive equality has the highest priority.
Unmatched rows, including NULL, rank last. Add a _like filter to exclude them,
and chain order_by for deterministic ties. Ordering runs before pagination.
pub fn join_on<SourceType, JoinedModel, JoinedType, JoinType>(
self,
source_field: SelectField<Sample, SourceType, JoinType>,
joined_field: SelectField<JoinedModel, JoinedType, JoinType>,
) -> Selfwhere
JoinedModel: ModelSelectSource,
pub fn join_filtered_on<SourceType, JoinedModel, JoinedType, JoinType>(
self,
source_field: SelectField<Sample, SourceType, JoinType>,
joined_field: SelectField<JoinedModel, JoinedType, JoinType>,
joined: <JoinedModel as ModelSelectSource>::Selector<'conn>,
) -> Selfwhere
JoinedModel: ModelSelectSource,
pub fn only<P>(self, projection: P) -> SelectedFields<Self, P>where
P: SelectProjection,
pub fn models<P>(self) -> SelectedModels<Self, P>where
P: ModelProjection,
pub fn limit(self, limit: u32) -> Self
pub fn offset(self, offset: u32) -> Self
pub fn load(self) -> Result<Vec<Sample>, ModelSelectError>
pub fn get(self) -> Result<Option<Sample>, ModelSelectError>
pub fn get_by_id( self, id: impl Into<String>, ) -> Result<Option<Sample>, ModelSelectError>
pub fn query_by_ids<I, V>(self, ids: I) -> Result<Vec<Sample>, ModelSelectError>
pub fn delete_by_ids<I, V>(self, ids: I) -> Result<usize, ModelSelectError>
Trait Implementations§
Source§impl<'conn> Clone for SampleSelect<'conn>
impl<'conn> Clone for SampleSelect<'conn>
Source§fn clone(&self) -> SampleSelect<'conn>
fn clone(&self) -> SampleSelect<'conn>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'conn> !RefUnwindSafe for SampleSelect<'conn>
impl<'conn> !Send for SampleSelect<'conn>
impl<'conn> !Sync for SampleSelect<'conn>
impl<'conn> !UnwindSafe for SampleSelect<'conn>
impl<'conn> Freeze for SampleSelect<'conn>
impl<'conn> Unpin for SampleSelect<'conn>
impl<'conn> UnsafeUnpin for SampleSelect<'conn>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more