Struct polars_sql::SQLContext

source ·
pub struct SQLContext {
    pub table_map: PlHashMap<String, LazyFrame>,
}

Fields§

§table_map: PlHashMap<String, LazyFrame>

Implementations§

Examples found in repository?
src/context.rs (line 233)
223
224
225
226
227
228
229
230
231
232
233
234
    pub fn execute(&self, query: &str) -> PolarsResult<LazyFrame> {
        let ast = Parser::parse_sql(&GenericDialect::default(), query)
            .map_err(|e| PolarsError::ComputeError(format!("{:?}", e).into()))?;
        if ast.len() != 1 {
            return Err(PolarsError::ComputeError(
                "One and only one statement at a time please".into(),
            ));
        }

        let ast = ast.get(0).unwrap();
        return self.execute_statement(ast);
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.