pub struct SelectQuery {Show 23 fields
pub hard_limit: u64,
pub entity: String,
pub projection: Vec<String>,
pub expr_projection: Vec<NamedExpr>,
pub search_with_text: Option<String>,
pub filter: Option<Expr>,
pub having: Option<Expr>,
pub order_by: Vec<OrderBy>,
pub slice: Option<Slice>,
pub partition_by: Option<String>,
pub aggregates: Vec<Aggregate>,
pub group_by: Vec<String>,
pub relations: Vec<RelationLoad>,
pub aggregation_cache: Option<AggregationCacheOptions>,
pub comment: Option<String>,
pub trace_chain: Vec<TraceNode>,
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>,
pub stream_config: Option<StreamConfig>,
}Fields§
§hard_limit: u64Safety ceiling for a fully materialized outer query.
entity: String§projection: Vec<String>§expr_projection: Vec<NamedExpr>§search_with_text: Option<String>§filter: Option<Expr>§having: Option<Expr>§order_by: Vec<OrderBy>§slice: Option<Slice>§partition_by: Option<String>Apply slice independently inside each value of this property.
aggregates: Vec<Aggregate>§group_by: Vec<String>§relations: Vec<RelationLoad>§aggregation_cache: Option<AggregationCacheOptions>§comment: Option<String>§trace_chain: Vec<TraceNode>§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>§stream_config: Option<StreamConfig>Implementations§
Source§impl SelectQuery
impl SelectQuery
pub fn new(entity: impl Into<String>) -> Self
pub fn project(self, field: impl Into<String>) -> Self
pub fn projects( self, fields: impl IntoIterator<Item = impl Into<String>>, ) -> Self
pub fn project_expr(self, alias: impl Into<String>, expr: Expr) -> Self
pub fn project_raw( self, alias: impl Into<String>, raw_sql_segment: impl Into<String>, ) -> Self
pub fn dynamic_property_raw( self, alias: impl Into<String>, raw_sql_segment: impl Into<String>, ) -> Self
pub fn search_with_text(self, text: impl Into<String>) -> Self
pub fn filter(self, filter: Expr) -> Self
pub fn and_filter(self, filter: Expr) -> Self
pub fn or_filter(self, filter: Expr) -> Self
pub fn having(self, having: Expr) -> Self
pub fn and_having(self, having: Expr) -> Self
pub fn or_having(self, having: Expr) -> Self
pub fn order_by(self, order: OrderBy) -> Self
pub fn order_asc(self, field: impl Into<String>) -> Self
pub fn order_desc(self, field: impl Into<String>) -> Self
pub fn order_expr_asc(self, expr: Expr) -> Self
pub fn order_expr_desc(self, expr: Expr) -> Self
pub fn order_gbk_asc(self, field: impl Into<String>) -> Self
pub fn order_gbk_desc(self, field: impl Into<String>) -> Self
pub fn group_by(self, field: impl Into<String>) -> Self
pub fn aggregate(self, aggregate: Aggregate) -> Self
pub fn count(self, alias: impl Into<String>) -> Self
pub fn count_field( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self
pub fn sum(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn avg(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn min(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn max(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn stddev(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn stddev_pop( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self
pub fn var_samp( self, field: impl Into<String>, alias: impl Into<String>, ) -> Self
pub fn var_pop(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn bit_and(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn bit_or(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn bit_xor(self, field: impl Into<String>, alias: impl Into<String>) -> Self
pub fn enable_aggregation_cache(self) -> Self
pub fn enable_aggregation_cache_for(self, cache_expired_millis: u64) -> Self
pub fn propagate_aggregation_cache(self, cache_expired_millis: u64) -> Self
pub fn comment(self, comment: impl Into<String>) -> Self
pub fn raw_sql(self, raw_sql: impl Into<String>) -> Self
pub fn raw_sql_search_criteria(self, raw_sql: impl Into<String>) -> Self
pub fn object_group_by( self, property_name: impl Into<String>, storage_field: impl Into<String>, query: SelectQuery, ) -> Self
pub fn child_enhancement(self, query: SelectQuery) -> Self
pub fn relation(self, name: impl Into<String>) -> Self
pub fn relation_query(self, name: impl Into<String>, query: SelectQuery) -> Self
pub fn limit(self, limit: u64) -> Self
Sourcepub fn hard_limit(self, hard_limit: u64) -> Self
pub fn hard_limit(self, hard_limit: u64) -> Self
Override the outer materialized-list ceiling. Most callers should keep 10,000.
Sourcepub fn prepare_for_list(self) -> Result<Self, String>
pub fn prepare_for_list(self) -> Result<Self, String>
Apply and validate list-materialization limits. This is intentionally not used by streaming execution.
pub fn offset(self, offset: u64) -> Self
pub fn page(self, offset: u64, limit: u64) -> Self
Sourcepub fn partition_by(self, field: impl Into<String>) -> Self
pub fn partition_by(self, field: impl Into<String>) -> Self
Scope pagination to each distinct value of field.
Relation loading sets this automatically. Most application queries should use a generated relation selector instead of calling this method directly.
Sourcepub fn stream(self, chunk_size: usize) -> Self
pub fn stream(self, chunk_size: usize) -> Self
Enable streaming mode with the given chunk size. When streaming, rows are fetched and enhanced in batches rather than all at once.
Sourcepub fn stream_default(self) -> Self
pub fn stream_default(self) -> Self
Enable streaming mode with default chunk size (1000).
Trait Implementations§
Source§impl Clone for SelectQuery
impl Clone for SelectQuery
Source§fn clone(&self) -> SelectQuery
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectQuery
impl Debug for SelectQuery
Source§impl From<SelectQuery> for QuerySelection
impl From<SelectQuery> for QuerySelection
Source§fn from(query: SelectQuery) -> Self
fn from(query: SelectQuery) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SelectQuery
impl PartialEq for SelectQuery
impl StructuralPartialEq for SelectQuery
Auto Trait Implementations§
impl Freeze for SelectQuery
impl RefUnwindSafe for SelectQuery
impl Send for SelectQuery
impl Sync for SelectQuery
impl Unpin for SelectQuery
impl UnsafeUnpin for SelectQuery
impl UnwindSafe for SelectQuery
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