Skip to main content

ExpressionEvaluator

Struct ExpressionEvaluator 

Source
pub struct ExpressionEvaluator<'a> { /* private fields */ }
Expand description

Evaluates expressions in the context of a row

Implementations§

Source§

impl ExpressionEvaluator<'_>

Source

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>

Source

pub fn new(schema: &'a TableSchema) -> Self

Create a new expression evaluator for a given schema

Source

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

Source

pub fn with_database(schema: &'a TableSchema, database: &'a Database) -> Self

Create a new expression evaluator with database reference for subqueries

Source

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

Source

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)

Source

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

Source

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

Source

pub fn with_cte_context( self, cte_context: &'a HashMap<String, CteResult>, ) -> Self

Attach an outer CTE context to this evaluator (builder style).

Ensures subqueries evaluated in expression position resolve names bound by an enclosing WITH clause before falling back to catalog tables/views (issue #5350).

Source

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.

Source

pub fn clear_row_index(&mut self)

Clear the row index (typically between row evaluations)

Source

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 = …

Source

pub fn with_schema_context(self, schema_context: SchemaExprContext) -> Self

Mark this evaluator as evaluating a schema-attached expression (CHECK constraint, generated column, or index expression).

In these contexts SQLite rejects non-deterministic uses of the date/time functions (‘now’ / zero-argument defaults / ‘localtime’ / ‘utc’) at evaluation time with non-deterministic use of <fn>() in <context>.

Source

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§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool