pub struct SelectBuilder { /* private fields */ }Expand description
Builder for SELECT statements.
Implementations§
Source§impl SelectBuilder
impl SelectBuilder
Sourcepub fn with_cte(self, name: &str, query: SqlFragment) -> Self
pub fn with_cte(self, name: &str, query: SqlFragment) -> Self
Add a CTE (WITH clause).
Sourcepub fn qualified_column(self, table: &str, column: &str) -> Self
pub fn qualified_column(self, table: &str, column: &str) -> Self
Add a qualified column (table.column).
Sourcepub fn column_raw(self, sql: SqlFragment) -> Self
pub fn column_raw(self, sql: SqlFragment) -> Self
Add a raw SQL column expression.
Sourcepub fn all_columns(self) -> Self
pub fn all_columns(self) -> Self
Add all columns (*).
Sourcepub fn all_columns_from(self, table: &str) -> Self
pub fn all_columns_from(self, table: &str) -> Self
Add all columns from a table (table.*).
Sourcepub fn from_table(self, qi: &QualifiedIdentifier) -> Self
pub fn from_table(self, qi: &QualifiedIdentifier) -> Self
Set the FROM table.
Sourcepub fn from_table_as(self, qi: &QualifiedIdentifier, alias: &str) -> Self
pub fn from_table_as(self, qi: &QualifiedIdentifier, alias: &str) -> Self
Set FROM with alias.
Sourcepub fn from_raw(self, sql: SqlFragment) -> Self
pub fn from_raw(self, sql: SqlFragment) -> Self
Set FROM from raw SQL.
Sourcepub fn inner_join(self, table: &str, condition: &str) -> Self
pub fn inner_join(self, table: &str, condition: &str) -> Self
Add an INNER JOIN.
Sourcepub fn left_join_lateral(
self,
subquery: SqlFragment,
alias: &str,
on: &str,
) -> Self
pub fn left_join_lateral( self, subquery: SqlFragment, alias: &str, on: &str, ) -> Self
Add a LEFT JOIN LATERAL with subquery.
Sourcepub fn where_expr(self, expr: Expr) -> Self
pub fn where_expr(self, expr: Expr) -> Self
Add a WHERE clause.
Sourcepub fn where_raw(self, sql: SqlFragment) -> Self
pub fn where_raw(self, sql: SqlFragment) -> Self
Add a raw WHERE clause.
Sourcepub fn order_by_raw(self, sql: SqlFragment) -> Self
pub fn order_by_raw(self, sql: SqlFragment) -> Self
Add ORDER BY from raw SQL.
Sourcepub fn build(self) -> SqlFragment
pub fn build(self) -> SqlFragment
Build the SELECT statement.
Trait Implementations§
Source§impl Clone for SelectBuilder
impl Clone for SelectBuilder
Source§fn clone(&self) -> SelectBuilder
fn clone(&self) -> SelectBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectBuilder
impl Debug for SelectBuilder
Source§impl Default for SelectBuilder
impl Default for SelectBuilder
Source§fn default() -> SelectBuilder
fn default() -> SelectBuilder
Returns the “default value” for a type. Read more
Auto 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
Mutably borrows from an owned value. Read more