Skip to main content

SelectQuery

Struct SelectQuery 

Source
pub struct SelectQuery {
Show 18 fields pub entity: String, pub projection: Vec<String>, pub expr_projection: Vec<NamedExpr>, pub filter: Option<Expr>, pub having: Option<Expr>, pub order_by: Vec<OrderBy>, pub slice: Option<Slice>, pub aggregates: Vec<Aggregate>, pub group_by: Vec<String>, pub relations: Vec<RelationLoad>, pub aggregation_cache: Option<AggregationCacheOptions>, pub comment: Option<String>, pub raw_sql: Option<String>, pub raw_sql_search_criteria: Vec<String>, pub dynamic_properties: Vec<RawSqlProjection>, pub raw_projections: Vec<RawSqlProjection>, pub object_group_bys: Vec<ObjectGroupBy>, pub child_enhancements: Vec<SelectQuery>,
}

Fields§

§entity: String§projection: Vec<String>§expr_projection: Vec<NamedExpr>§filter: Option<Expr>§having: Option<Expr>§order_by: Vec<OrderBy>§slice: Option<Slice>§aggregates: Vec<Aggregate>§group_by: Vec<String>§relations: Vec<RelationLoad>§aggregation_cache: Option<AggregationCacheOptions>§comment: Option<String>§raw_sql: Option<String>§raw_sql_search_criteria: Vec<String>§dynamic_properties: Vec<RawSqlProjection>§raw_projections: Vec<RawSqlProjection>§object_group_bys: Vec<ObjectGroupBy>§child_enhancements: Vec<SelectQuery>

Implementations§

Source§

impl SelectQuery

Source

pub fn new(entity: impl Into<String>) -> Self

Source

pub fn project(self, field: impl Into<String>) -> Self

Source

pub fn projects( self, fields: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Source

pub fn project_expr(self, alias: impl Into<String>, expr: Expr) -> Self

Source

pub fn project_raw( self, alias: impl Into<String>, raw_sql_segment: impl Into<String>, ) -> Self

Source

pub fn dynamic_property_raw( self, alias: impl Into<String>, raw_sql_segment: impl Into<String>, ) -> Self

Source

pub fn filter(self, filter: Expr) -> Self

Source

pub fn and_filter(self, filter: Expr) -> Self

Source

pub fn or_filter(self, filter: Expr) -> Self

Source

pub fn having(self, having: Expr) -> Self

Source

pub fn and_having(self, having: Expr) -> Self

Source

pub fn or_having(self, having: Expr) -> Self

Source

pub fn order_by(self, order: OrderBy) -> Self

Source

pub fn order_asc(self, field: impl Into<String>) -> Self

Source

pub fn order_desc(self, field: impl Into<String>) -> Self

Source

pub fn order_expr_asc(self, expr: Expr) -> Self

Source

pub fn order_expr_desc(self, expr: Expr) -> Self

Source

pub fn order_gbk_asc(self, field: impl Into<String>) -> Self

Source

pub fn order_gbk_desc(self, field: impl Into<String>) -> Self

Source

pub fn group_by(self, field: impl Into<String>) -> Self

Source

pub fn aggregate(self, aggregate: Aggregate) -> Self

Source

pub fn count(self, alias: impl Into<String>) -> Self

Source

pub fn count_field( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self

Source

pub fn sum(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn avg(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn min(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn max(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn stddev(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn stddev_pop( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self

Source

pub fn var_samp( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self

Source

pub fn var_pop(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn bit_and(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn bit_or(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn bit_xor(self, field: impl Into<String>, alias: impl Into<String>) -> Self

Source

pub fn enable_aggregation_cache(self) -> Self

Source

pub fn enable_aggregation_cache_for(self, cache_expired_millis: u64) -> Self

Source

pub fn propagate_aggregation_cache(self, cache_expired_millis: u64) -> Self

Source

pub fn comment(self, comment: impl Into<String>) -> Self

Source

pub fn raw_sql(self, raw_sql: impl Into<String>) -> Self

Source

pub fn raw_sql_search_criteria(self, raw_sql: impl Into<String>) -> Self

Source

pub fn object_group_by( self, property_name: impl Into<String>, storage_field: impl Into<String>, query: SelectQuery, ) -> Self

Source

pub fn child_enhancement(self, query: SelectQuery) -> Self

Source

pub fn relation(self, name: impl Into<String>) -> Self

Source

pub fn relation_query(self, name: impl Into<String>, query: SelectQuery) -> Self

Source

pub fn limit(self, limit: u64) -> Self

Source

pub fn offset(self, offset: u64) -> Self

Source

pub fn page(self, offset: u64, limit: u64) -> Self

Trait Implementations§

Source§

impl Clone for SelectQuery

Source§

fn clone(&self) -> SelectQuery

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SelectQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SelectQuery

Source§

fn eq(&self, other: &SelectQuery) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SelectQuery

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.