ASTTransformer

Trait ASTTransformer 

Source
pub trait ASTTransformer: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn transform(&mut self, stmt: SelectStatement) -> Result<SelectStatement>;

    // Provided methods
    fn description(&self) -> &str { ... }
    fn enabled(&self) -> bool { ... }
    fn begin(&mut self) -> Result<()> { ... }
    fn end(&mut self) -> Result<()> { ... }
}
Expand description

Trait for AST transformers that can be added to the preprocessing pipeline

Required Methods§

Source

fn name(&self) -> &str

Name of this transformer (for logging and debugging)

Source

fn transform(&mut self, stmt: SelectStatement) -> Result<SelectStatement>

Transform the AST, returning the modified statement

Transformers should be idempotent where possible and should not modify the semantic meaning of the query.

Provided Methods§

Source

fn description(&self) -> &str

Description of what this transformer does

Source

fn enabled(&self) -> bool

Whether this transformer is enabled

Source

fn begin(&mut self) -> Result<()>

Called before transformation starts (for initialization)

Source

fn end(&mut self) -> Result<()>

Called after transformation completes (for cleanup)

Implementors§