pub struct ExpressionEvaluator<'a> { /* private fields */ }Expand description
Evaluates expressions in the context of a row
Implementations§
Source§impl ExpressionEvaluator<'_>
impl ExpressionEvaluator<'_>
Sourcepub fn eval(
&self,
expr: &Expression,
row: &Row,
) -> Result<SqlValue, ExecutorError>
pub fn eval( &self, expr: &Expression, row: &Row, ) -> Result<SqlValue, ExecutorError>
Evaluate an expression in the context of a row
Source§impl<'a> ExpressionEvaluator<'a>
impl<'a> ExpressionEvaluator<'a>
Sourcepub fn new(schema: &'a TableSchema) -> Self
pub fn new(schema: &'a TableSchema) -> Self
Create a new expression evaluator for a given schema
Sourcepub fn with_outer_context(
schema: &'a TableSchema,
outer_row: &'a Row,
outer_schema: &'a TableSchema,
) -> Self
pub fn with_outer_context( schema: &'a TableSchema, outer_row: &'a Row, outer_schema: &'a TableSchema, ) -> Self
Create a new expression evaluator with outer query context for correlated subqueries
Sourcepub fn with_database(schema: &'a TableSchema, database: &'a Database) -> Self
pub fn with_database(schema: &'a TableSchema, database: &'a Database) -> Self
Create a new expression evaluator with database reference for subqueries
Sourcepub fn with_trigger_context(
schema: &'a TableSchema,
database: &'a Database,
trigger_context: &'a TriggerContext<'a>,
) -> Self
pub fn with_trigger_context( schema: &'a TableSchema, database: &'a Database, trigger_context: &'a TriggerContext<'a>, ) -> Self
Create a new expression evaluator with trigger context for OLD/NEW pseudo-variables
Sourcepub fn with_database_and_outer_context(
schema: &'a TableSchema,
database: &'a Database,
outer_row: &'a Row,
outer_schema: &'a TableSchema,
) -> Self
pub fn with_database_and_outer_context( schema: &'a TableSchema, database: &'a Database, outer_row: &'a Row, outer_schema: &'a TableSchema, ) -> Self
Create a new expression evaluator with database and outer context (for correlated subqueries)
Sourcepub fn with_procedural_context(
schema: &'a TableSchema,
database: &'a Database,
procedural_context: &'a ExecutionContext,
) -> Self
pub fn with_procedural_context( schema: &'a TableSchema, database: &'a Database, procedural_context: &'a ExecutionContext, ) -> Self
Create a new expression evaluator with procedural context for stored procedure/function execution
Sourcepub fn with_database_and_cte(
schema: &'a TableSchema,
database: &'a Database,
cte_context: &'a HashMap<String, CteResult>,
) -> Self
pub fn with_database_and_cte( schema: &'a TableSchema, database: &'a Database, cte_context: &'a HashMap<String, CteResult>, ) -> Self
Create a new expression evaluator with database and CTE context Used for UPDATE/DELETE statements with WITH clauses
Sourcepub fn set_row_index(&mut self, index: u64)
pub fn set_row_index(&mut self, index: u64)
Set the row index for ROWID pseudo-column support
When set, references to ROWID, rowid, or oid columns will return this value as a Bigint. This provides SQLite compatibility.
Sourcepub fn clear_row_index(&mut self)
pub fn clear_row_index(&mut self)
Clear the row index (typically between row evaluations)
Sourcepub fn set_table_alias(&mut self, alias: String)
pub fn set_table_alias(&mut self, alias: String)
Set the table alias for UPDATE/DELETE statements
When set, column references qualified with this alias will resolve to the schema. SQLite extension: UPDATE t1 AS xyz SET … WHERE xyz.column = …
Sourcepub fn clear_cse_cache(&self)
pub fn clear_cse_cache(&self)
Clear the CSE cache Should be called before evaluating expressions for a new row in multi-row contexts
Auto Trait Implementations§
impl<'a> Freeze for ExpressionEvaluator<'a>
impl<'a> !RefUnwindSafe for ExpressionEvaluator<'a>
impl<'a> !Send for ExpressionEvaluator<'a>
impl<'a> !Sync for ExpressionEvaluator<'a>
impl<'a> Unpin for ExpressionEvaluator<'a>
impl<'a> !UnwindSafe for ExpressionEvaluator<'a>
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
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>
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>
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