pub struct QueryBuilder { /* private fields */ }Expand description
Query builder for ElastiCube queries
Provides a fluent API for building and executing queries against a cube. Supports both SQL queries and a DataFrame-style fluent API.
§Examples
ⓘ
// SQL query
let results = cube.query()
.sql("SELECT region, SUM(sales) FROM cube GROUP BY region")
.execute()
.await?;
// Fluent API query
let results = cube.query()
.select(&["region", "SUM(sales) as total_sales"])
.filter("sales > 1000")
.group_by(&["region"])
.order_by(&["total_sales DESC"])
.limit(10)
.execute()
.await?;Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn where_clause(self, condition: impl Into<String>) -> Self
pub fn where_clause(self, condition: impl Into<String>) -> Self
Add WHERE filter (alias for filter)
Sourcepub fn drill_down(
self,
_parent_level: impl AsRef<str>,
child_levels: &[impl AsRef<str>],
) -> Self
pub fn drill_down( self, _parent_level: impl AsRef<str>, child_levels: &[impl AsRef<str>], ) -> Self
Sourcepub async fn execute(self) -> Result<QueryResult>
pub async fn execute(self) -> Result<QueryResult>
Auto Trait Implementations§
impl Freeze for QueryBuilder
impl !RefUnwindSafe for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin for QueryBuilder
impl !UnwindSafe for QueryBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more