Skip to main content

SqlResolver

Trait SqlResolver 

pub trait SqlResolver: Send + Sync {
    // Required method
    fn resolve(
        &self,
        query: &str,
        relations: Vec<(PlSmallStr, DslPlan)>,
        cached: Option<&(dyn Any + Send + Sync + 'static)>,
        lp_arena: &mut Arena<IR>,
        expr_arena: &mut Arena<AExpr>,
    ) -> Result<DslPlan, PolarsError>;
}
Available on crate feature lazy only.
Expand description

Resolves a SQL query into a DslPlan.

Implemented by polars-sql and registered through set_sql_resolver, as polars-plan cannot depend on polars-sql.

Required Methods§

fn resolve( &self, query: &str, relations: Vec<(PlSmallStr, DslPlan)>, cached: Option<&(dyn Any + Send + Sync + 'static)>, lp_arena: &mut Arena<IR>, expr_arena: &mut Arena<AExpr>, ) -> Result<DslPlan, PolarsError>

relations are the named relations the query may reference. The arenas are those of the ongoing DSL -> IR conversion.

cached holds the already-parsed query when the node has not been deserialized.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§