pub struct SelectBuilder { /* private fields */ }unparser only.Implementations§
Source§impl SelectBuilder
impl SelectBuilder
pub fn distinct(&mut self, value: Option<Distinct>) -> &mut Self
pub fn top(&mut self, value: Option<Top>) -> &mut Self
pub fn projection(&mut self, value: Vec<SelectItem>) -> &mut Self
pub fn pop_projections(&mut self) -> Vec<SelectItem>
Sourcepub fn already_projected(&self) -> bool
pub fn already_projected(&self) -> bool
Returns true if a projection has been explicitly set via projection().
This method is used to determine whether the SELECT clause has already been
defined, which helps avoid creating duplicate projection nodes during query
unparsing. It returns true for both empty and non-empty projections.
§Returns
trueifprojection()has been called (regardless of whether it was empty or not)falseif no projection has been set yet
§Example
let mut builder = SelectBuilder::default();
assert!(!builder.already_projected());
builder.projection(vec![]);
assert!(builder.already_projected()); // true even for empty projection
builder.projection(vec![SelectItem::Wildcard(...)]);
assert!(builder.already_projected()); // true for non-empty projectionpub fn into(&mut self, value: Option<SelectInto>) -> &mut Self
pub fn from(&mut self, value: Vec<TableWithJoinsBuilder>) -> &mut Self
pub fn push_from(&mut self, value: TableWithJoinsBuilder) -> &mut Self
pub fn pop_from(&mut self) -> Option<TableWithJoinsBuilder>
pub fn lateral_views(&mut self, value: Vec<LateralView>) -> &mut Self
Sourcepub fn replace_mark(&mut self, existing_expr: &Expr, value: &Expr) -> &mut Self
pub fn replace_mark(&mut self, existing_expr: &Expr, value: &Expr) -> &mut Self
Replaces the selection with a new value.
This function is used to replace a specific expression within the selection.
Unlike the selection method which combines existing and new selections with AND,
this method searches for and replaces occurrences of a specific expression.
This method is primarily used to modify LEFT MARK JOIN expressions. When processing a LEFT MARK JOIN, we need to replace the placeholder expression with the actual join condition in the selection clause.
§Arguments
existing_expr- The expression to replacevalue- The new expression to set as the selection
pub fn selection(&mut self, value: Option<Expr>) -> &mut Self
pub fn group_by(&mut self, value: GroupByExpr) -> &mut Self
pub fn cluster_by(&mut self, value: Vec<Expr>) -> &mut Self
pub fn distribute_by(&mut self, value: Vec<Expr>) -> &mut Self
pub fn sort_by(&mut self, value: Vec<OrderByExpr>) -> &mut Self
pub fn having(&mut self, value: Option<Expr>) -> &mut Self
pub fn named_window(&mut self, value: Vec<NamedWindowDefinition>) -> &mut Self
pub fn qualify(&mut self, value: Option<Expr>) -> &mut Self
pub fn value_table_mode(&mut self, value: Option<ValueTableMode>) -> &mut Self
pub fn build(&self) -> Result<Select, BuilderError>
Trait Implementations§
Source§impl Clone for SelectBuilder
impl Clone for SelectBuilder
Source§fn clone(&self) -> SelectBuilder
fn clone(&self) -> SelectBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SelectBuilder
impl RefUnwindSafe for SelectBuilder
impl Send for SelectBuilder
impl Sync for SelectBuilder
impl Unpin for SelectBuilder
impl UnwindSafe for SelectBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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