pub struct QueryEngine { /* private fields */ }
Expand description
Query engine that executes SQL directly on DataTable
Implementations§
Source§impl QueryEngine
impl QueryEngine
pub fn new() -> Self
pub fn with_behavior_config(config: BehaviorConfig) -> Self
pub fn with_date_notation(_date_notation: String) -> Self
pub fn with_case_insensitive(case_insensitive: bool) -> Self
pub fn with_case_insensitive_and_date_notation( case_insensitive: bool, _date_notation: String, ) -> Self
Sourcepub fn execute(&self, table: Arc<DataTable>, sql: &str) -> Result<DataView>
pub fn execute(&self, table: Arc<DataTable>, sql: &str) -> Result<DataView>
Execute a SQL query on a DataTable
and return a DataView
(for backward compatibility)
Sourcepub fn execute_statement(
&self,
table: Arc<DataTable>,
statement: SelectStatement,
) -> Result<DataView>
pub fn execute_statement( &self, table: Arc<DataTable>, statement: SelectStatement, ) -> Result<DataView>
Execute a parsed SelectStatement on a DataTable
and return a DataView
Sourcepub fn execute_statement_with_cte_context(
&self,
table: Arc<DataTable>,
statement: SelectStatement,
cte_context: &HashMap<String, Arc<DataView>>,
) -> Result<DataView>
pub fn execute_statement_with_cte_context( &self, table: Arc<DataTable>, statement: SelectStatement, cte_context: &HashMap<String, Arc<DataView>>, ) -> Result<DataView>
Execute a statement with provided CTE context (for subqueries)
Sourcepub fn execute_with_plan(
&self,
table: Arc<DataTable>,
sql: &str,
) -> Result<(DataView, ExecutionPlan)>
pub fn execute_with_plan( &self, table: Arc<DataTable>, sql: &str, ) -> Result<(DataView, ExecutionPlan)>
Execute a query and return both the result and the execution plan
Trait Implementations§
Source§impl Clone for QueryEngine
impl Clone for QueryEngine
Source§fn clone(&self) -> QueryEngine
fn clone(&self) -> QueryEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for QueryEngine
impl Default for QueryEngine
Source§impl GroupByExpressions for QueryEngine
impl GroupByExpressions for QueryEngine
Source§fn group_by_expressions(
&self,
view: DataView,
group_by_exprs: &[SqlExpression],
) -> Result<HashMap<GroupKey, DataView>>
fn group_by_expressions( &self, view: DataView, group_by_exprs: &[SqlExpression], ) -> Result<HashMap<GroupKey, DataView>>
Group rows by evaluating expressions for each row
Source§fn apply_group_by_expressions(
&self,
view: DataView,
group_by_exprs: &[SqlExpression],
select_items: &[SelectItem],
having: Option<&SqlExpression>,
_case_insensitive: bool,
date_notation: String,
) -> Result<DataView>
fn apply_group_by_expressions( &self, view: DataView, group_by_exprs: &[SqlExpression], select_items: &[SelectItem], having: Option<&SqlExpression>, _case_insensitive: bool, date_notation: String, ) -> Result<DataView>
Apply GROUP BY with expressions to the view
Auto Trait Implementations§
impl Freeze for QueryEngine
impl RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnwindSafe for QueryEngine
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more