pub struct CollectionQuery<'a, C> {
pub ids: IdFilter<CollectionId>,
pub name: TextFilter,
pub source: TextFilter,
/* private fields */
}Available on crate feature
utils only.Expand description
Fluent query builder for collections. Obtained via PostArchiverManager::collections().
§Available filter fields
ids: filter by a set ofCollectionIdvalues.name:LIKEfuzzy match on the collection name.source:LIKEfuzzy match on the source field.
Fields§
§ids: IdFilter<CollectionId>§name: TextFilter§source: TextFilterImplementations§
Source§impl<'a, C: PostArchiverConnection> CollectionQuery<'a, C>
impl<'a, C: PostArchiverConnection> CollectionQuery<'a, C>
pub fn new(manager: &'a PostArchiverManager<C>) -> Self
Trait Implementations§
Source§impl<C: PostArchiverConnection> BaseFilter for CollectionQuery<'_, C>
impl<C: PostArchiverConnection> BaseFilter for CollectionQuery<'_, C>
type Based = Collection
Source§fn update_sql<T: FromQuery<Based = Self::Based>>(
&self,
sql: RawSql<T>,
) -> RawSql<T>
fn update_sql<T: FromQuery<Based = Self::Based>>( &self, sql: RawSql<T>, ) -> RawSql<T>
Append all filter conditions held by this builder into
sql and return the updated RawSql.Source§fn queryer(&self) -> &Queryer<'_, impl PostArchiverConnection>
fn queryer(&self) -> &Queryer<'_, impl PostArchiverConnection>
Return a reference to the
Queryer owned by this builder, used by the default count() impl.fn count(&self) -> Result<u64>
Source§impl<'a, C: Debug> Debug for CollectionQuery<'a, C>
impl<'a, C: Debug> Debug for CollectionQuery<'a, C>
Source§impl<C: PostArchiverConnection> Query for CollectionQuery<'_, C>
impl<C: PostArchiverConnection> Query for CollectionQuery<'_, C>
Source§type Wrapper<T> = Vec<T>
type Wrapper<T> = Vec<T>
The wrapper type for query results. For most builders this is
Vec<T>;
when wrapped by WithTotal it becomes Totalled<Vec<T>>.Source§type Based = Collection
type Based = Collection
The database table type this query targets.
Source§impl<C> Sortable for CollectionQuery<'_, C>
impl<C> Sortable for CollectionQuery<'_, C>
Source§type SortField = CollectionSort
type SortField = CollectionSort
The sortable field enum type, defined in each sub-module by
impl_sortable!.Source§fn sort(
self,
field: Self::SortField,
dir: SortDir,
) -> Sorted<Self, Self::SortField>
fn sort( self, field: Self::SortField, dir: SortDir, ) -> Sorted<Self, Self::SortField>
Sort by the given field and direction, returning
Sorted<Self, SortField>.Source§fn sort_random(self) -> Sorted<Self, Random>
fn sort_random(self) -> Sorted<Self, Random>
Sort results randomly using
ORDER BY RANDOM().Auto Trait Implementations§
impl<'a, C> Freeze for CollectionQuery<'a, C>
impl<'a, C> RefUnwindSafe for CollectionQuery<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for CollectionQuery<'a, C>where
C: Sync,
impl<'a, C> Sync for CollectionQuery<'a, C>where
C: Sync,
impl<'a, C> Unpin for CollectionQuery<'a, C>
impl<'a, C> UnsafeUnpin for CollectionQuery<'a, C>
impl<'a, C> UnwindSafe for CollectionQuery<'a, C>where
C: RefUnwindSafe,
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> Countable for Twhere
T: Query,
impl<T> Countable for Twhere
T: Query,
Source§fn with_total(self) -> WithTotal<Self>
fn with_total(self) -> WithTotal<Self>
Available on crate feature
utils only.Wrap this builder in
WithTotal<Self>. When Query::query() is called,
an additional COUNT(*) query is executed and the result is placed in
the total field of the returned Totalled.Source§impl<T> Paginate for Twhere
T: Query,
impl<T> Paginate for Twhere
T: Query,
Source§fn pagination(self, limit: u64, page: u64) -> Paginated<T>
fn pagination(self, limit: u64, page: u64) -> Paginated<T>
Available on crate feature
utils only.Wrap this builder with
limit (items per page) and page (0-based page index),
returning Paginated<Self> which appends LIMIT limit OFFSET limit*page on execution.