pub struct StatementExecutor { /* private fields */ }Expand description
Core statement executor
This is the unified execution engine used by both script mode and single query mode. It ensures consistent behavior by:
- Parsing SQL exactly once
- Applying preprocessing pipeline exactly once (if needed)
- Executing the AST directly (no re-parsing)
- Managing temp tables and context properly
Implementations§
Source§impl StatementExecutor
impl StatementExecutor
Sourcepub fn with_config(config: ExecutionConfig) -> Self
pub fn with_config(config: ExecutionConfig) -> Self
Create executor with custom configuration
Sourcepub fn execute(
&self,
stmt: SelectStatement,
context: &mut ExecutionContext,
) -> Result<ExecutionResult>
pub fn execute( &self, stmt: SelectStatement, context: &mut ExecutionContext, ) -> Result<ExecutionResult>
Execute a single SQL statement that has already been parsed
§Arguments
stmt- The parsed SQL statement (AST)context- Execution context (temp tables, variables, etc.)
§Returns
ExecutionResult containing the DataView and statistics
§Example
ⓘ
let executor = StatementExecutor::new();
let mut context = ExecutionContext::new(source_table);
let stmt = Parser::new("SELECT * FROM test").parse()?;
let result = executor.execute(&stmt, &mut context)?;Sourcepub fn config(&self) -> &ExecutionConfig
pub fn config(&self) -> &ExecutionConfig
Get the current configuration
Sourcepub fn set_config(&mut self, config: ExecutionConfig)
pub fn set_config(&mut self, config: ExecutionConfig)
Update configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatementExecutor
impl RefUnwindSafe for StatementExecutor
impl Send for StatementExecutor
impl Sync for StatementExecutor
impl Unpin for StatementExecutor
impl UnwindSafe for StatementExecutor
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> 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