pub struct MultiExpressionEval { /* private fields */ }Expand description
Evaluates multiple expressions efficiently (for SELECT projections).
Pre-compiles all expressions once, then evaluates them together for each row.
Implementations§
Source§impl MultiExpressionEval
impl MultiExpressionEval
Sourcepub fn compile(exprs: &[Expression], columns: &[String]) -> Result<Self>
pub fn compile(exprs: &[Expression], columns: &[String]) -> Result<Self>
Compile multiple expressions.
Sourcepub fn compile_with_aliases(
exprs: &[Expression],
columns: &[String],
aliases: &[(String, usize)],
) -> Result<Self>
pub fn compile_with_aliases( exprs: &[Expression], columns: &[String], aliases: &[(String, usize)], ) -> Result<Self>
Compile multiple expressions with expression aliases.
Expression aliases map expression strings (like “SUM(amount)”) to column indices in the result row. This is used for window function ORDER BY clauses where aggregate expressions need to reference pre-computed results.
§Arguments
exprs- The expressions to compilecolumns- Column names for the result rowaliases- Slice of (expression_name, column_index) pairs
Sourcepub fn with_params(self, params: ParamVec) -> Self
pub fn with_params(self, params: ParamVec) -> Self
Set query parameters.
Sourcepub fn with_context(self, ctx: &ExecutionContext) -> Self
pub fn with_context(self, ctx: &ExecutionContext) -> Self
Set from execution context.
PERF: Both params and named_params share the Arc - zero cloning.
Sourcepub fn eval_all(&mut self, row: &Row) -> Result<Vec<Value>>
pub fn eval_all(&mut self, row: &Row) -> Result<Vec<Value>>
Evaluate all expressions for a row, returning values in order.
Auto Trait Implementations§
impl !RefUnwindSafe for MultiExpressionEval
impl !UnwindSafe for MultiExpressionEval
impl Freeze for MultiExpressionEval
impl Send for MultiExpressionEval
impl Sync for MultiExpressionEval
impl Unpin for MultiExpressionEval
impl UnsafeUnpin for MultiExpressionEval
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