SqlPattern

Trait SqlPattern 

Source
pub trait SqlPattern: Send + Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn matches(&self, stmt: &Statement, ctx: &MatchContext) -> bool;
    fn extract(
        &self,
        stmt: &Statement,
        ctx: &MatchContext,
    ) -> Result<PatternData, ExtractError>;
    fn transform(
        &self,
        data: &PatternData,
        ctx: &TransformContext,
    ) -> Result<String, TransformError>;

    // Provided method
    fn priority(&self) -> u32 { ... }
}
Expand description

Trait for SQL pattern matching and transformation

Required Methods§

Source

fn id(&self) -> &'static str

Source

fn matches(&self, stmt: &Statement, ctx: &MatchContext) -> bool

Check if this pattern matches the SQL statement

Source

fn extract( &self, stmt: &Statement, ctx: &MatchContext, ) -> Result<PatternData, ExtractError>

Source

fn transform( &self, data: &PatternData, ctx: &TransformContext, ) -> Result<String, TransformError>

Generate QAIL code from extracted data

Provided Methods§

Source

fn priority(&self) -> u32

Implementors§