Skip to main content

SelectQuery

Struct SelectQuery 

Source
pub struct SelectQuery<'a, B>
where B: StorageBackend,
{ /* private fields */ }

Implementations§

Source§

impl<'a, B> SelectQuery<'a, B>
where B: StorageBackend,

Source

pub fn filter(self, expr: Expr) -> SelectQuery<'a, B>

Source

pub fn where_eq( self, column: &str, value: impl Into<PropValue>, ) -> SelectQuery<'a, B>

Source

pub fn where_prefix(self, column: &str, prefix: &str) -> SelectQuery<'a, B>

Prefix predicate on a string column — uses the column’s secondary index if it has one, otherwise filters during a table scan.

Source

pub fn where_range( self, column: &str, start: Bound<PropValue>, end: Bound<PropValue>, ) -> SelectQuery<'a, B>

Range predicate — uses the pk or a secondary index when possible, otherwise filters during a table scan.

Source

pub fn order_by(self, column: &str, order: Order) -> SelectQuery<'a, B>

Source

pub fn limit(self, n: usize) -> SelectQuery<'a, B>

Source

pub fn order_by_asc(self, column: &str) -> SelectQuery<'a, B>

Source

pub fn order_by_desc(self, column: &str) -> SelectQuery<'a, B>

Source

pub fn offset(self, n: usize) -> SelectQuery<'a, B>

Source

pub fn columns<S>( self, columns: impl IntoIterator<Item = S>, ) -> SelectQuery<'a, B>
where S: Into<String>,

Source

pub fn query(&self) -> &Query

Source

pub fn run(self) -> Result<Vec<Row>, BknError>

Source

pub fn count(self) -> Result<usize, BknError>

Source

pub fn aggregate(self, aggs: &[Agg]) -> Result<Vec<PropValue>, BknError>

Ungrouped aggregates: one value per aggs entry.

Source

pub fn aggregate_by( self, group_by: &[&str], aggs: &[Agg], ) -> Result<Vec<AggregateRow>, BknError>

GROUP BY group_by aggregates.

Auto Trait Implementations§

§

impl<'a, B> Freeze for SelectQuery<'a, B>
where RelTable<'a, B>: Freeze,

§

impl<'a, B> RefUnwindSafe for SelectQuery<'a, B>
where RelTable<'a, B>: RefUnwindSafe,

§

impl<'a, B> Send for SelectQuery<'a, B>
where RelTable<'a, B>: Send,

§

impl<'a, B> Sync for SelectQuery<'a, B>
where RelTable<'a, B>: Sync,

§

impl<'a, B> Unpin for SelectQuery<'a, B>
where RelTable<'a, B>: Unpin,

§

impl<'a, B> UnsafeUnpin for SelectQuery<'a, B>
where RelTable<'a, B>: UnsafeUnpin,

§

impl<'a, B> UnwindSafe for SelectQuery<'a, B>
where RelTable<'a, B>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.