pub struct SelectQuery {Show 25 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>,
pub continuous_page_fetch: Option<ContinuousPageFetchOptions>,
pub id_set_pagination: Option<IdSetPaginationOptions>,
}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>§continuous_page_fetch: Option<ContinuousPageFetchOptions>Explicit, process-local hint for transparent seek pagination of outer list queries.
id_set_pagination: Option<IdSetPaginationOptions>Explicit hint to retain the complete ordered ID sequence for pagination.
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
pub fn optimize_for_continuous_page_fetch(self) -> Self
pub fn optimize_for_continuous_page_fetch_with( self, namespace: impl Into<String>, ttl_seconds: u64, ) -> Self
pub fn optimize_pagination_with_id_set(self) -> Self
pub fn optimize_pagination_with_id_set_config( self, namespace: impl Into<String>, ttl_seconds: u64, max_ids: 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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more