pub struct Select { /* private fields */ }Expand description
A SELECT statement.
Implementations§
Source§impl Select
impl Select
Sourcepub fn columns<C: Into<ColumnRef>>(
self,
columns: impl IntoIterator<Item = C>,
) -> Self
pub fn columns<C: Into<ColumnRef>>( self, columns: impl IntoIterator<Item = C>, ) -> Self
Selects several columns.
Sourcepub fn has_items(&self) -> bool
pub fn has_items(&self) -> bool
Whether any item has been selected; without one the statement renders
SELECT *.
Sourcepub fn clear_items(self) -> Self
pub fn clear_items(self) -> Self
Removes all selected items.
Sourcepub fn from_subquery(self, subquery: Select, alias: impl IntoIden) -> Self
pub fn from_subquery(self, subquery: Select, alias: impl IntoIden) -> Self
Sets FROM (subquery) AS alias.
Sourcepub fn join(
self,
kind: JoinType,
table: impl Into<TableRef>,
on: impl IntoCondition,
) -> Self
pub fn join( self, kind: JoinType, table: impl Into<TableRef>, on: impl IntoCondition, ) -> Self
Adds a JOIN table ON cond of the given kind.
Sourcepub fn inner_join(
self,
table: impl Into<TableRef>,
on: impl IntoCondition,
) -> Self
pub fn inner_join( self, table: impl Into<TableRef>, on: impl IntoCondition, ) -> Self
Adds an INNER JOIN.
Sourcepub fn left_join(
self,
table: impl Into<TableRef>,
on: impl IntoCondition,
) -> Self
pub fn left_join( self, table: impl Into<TableRef>, on: impl IntoCondition, ) -> Self
Adds a LEFT JOIN.
Sourcepub fn and_where(self, cond: impl IntoCondition) -> Self
pub fn and_where(self, cond: impl IntoCondition) -> Self
Adds a condition to WHERE with AND.
Sourcepub fn cond_where(self, cond: impl IntoCondition) -> Self
pub fn cond_where(self, cond: impl IntoCondition) -> Self
Replaces the whole WHERE condition.
Sourcepub fn and_having(self, cond: impl IntoCondition) -> Self
pub fn and_having(self, cond: impl IntoCondition) -> Self
Adds a condition to HAVING with AND.
Sourcepub fn order_by(self, column: impl Into<ColumnRef>, order: Order) -> Self
pub fn order_by(self, column: impl Into<ColumnRef>, order: Order) -> Self
Adds an ORDER BY column.
Sourcepub fn order_by_expr(self, expr: Expr, order: Order) -> Self
pub fn order_by_expr(self, expr: Expr, order: Order) -> Self
Adds an ORDER BY expr.
Sourcepub fn clear_order_by(self) -> Self
pub fn clear_order_by(self) -> Self
Removes the ordering.
Sourcepub fn reset_limit(self) -> Self
pub fn reset_limit(self) -> Self
Removes LIMIT.
Sourcepub fn reset_offset(self) -> Self
pub fn reset_offset(self) -> Self
Removes OFFSET.
Sourcepub fn from_tables(&self) -> &[TableRef]
pub fn from_tables(&self) -> &[TableRef]
The FROM tables.
Trait Implementations§
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnsafeUnpin for Select
impl UnwindSafe for Select
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