dr/src/sql.rs
Guillem Borrell 2b18f7b5e3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
Multiple improvements
2022-12-25 23:07:50 +00:00

11 lines
336 B
Rust

use polars_sql::SQLContext;
use polars_lazy::prelude::LazyFrame;
pub fn execute(ldf: LazyFrame, statement: &String) -> LazyFrame {
let mut context = SQLContext::try_new().expect("Could not create context");
context.register("this", ldf);
context
.execute(statement)
.expect("Could not execute statement")
}