pub struct Select {
pub ctes: Vec<Cte>,
pub distinct: bool,
pub columns: Vec<SelectColumn>,
pub from: Option<From>,
pub join: Vec<Join>,
pub where_: Where,
pub group: Vec<GroupBy>,
pub having: Where,
pub order: Vec<OrderBy>,
pub limit: Option<usize>,
pub offset: Option<usize>,
}
Expand description
A SELECT query.
Fields§
§ctes: Vec<Cte>
§distinct: bool
§columns: Vec<SelectColumn>
§from: Option<From>
§join: Vec<Join>
§where_: Where
§group: Vec<GroupBy>
§having: Where
§order: Vec<OrderBy>
§limit: Option<usize>
§offset: Option<usize>
Implementations§
Source§impl Select
impl Select
pub fn with_raw(self, name: &str, query: &str) -> Self
pub fn with(self, name: &str, query: Select) -> Self
pub fn distinct(self) -> Self
pub fn table_column(self, table: &str, column: &str) -> Self
pub fn select_raw(self, expression: impl Into<String>) -> Self
pub fn from(self, table: &str) -> Self
pub fn join(self, join: Join) -> Self
Sourcepub fn where_(self, where_: Where) -> Self
pub fn where_(self, where_: Where) -> Self
Assumes AND
. Access the .where_
field directly for more advanced operations.
pub fn where_raw(self, where_: impl Into<String>) -> Self
pub fn group_by(self, group: &str) -> Self
pub fn having(self, having: Where) -> Self
pub fn order_by(self, order: &str, direction: Direction) -> Self
pub fn order_asc(self, order: &str) -> Self
pub fn order_desc(self, order: &str) -> Self
pub fn limit(self, limit: usize) -> Self
pub fn offset(self, offset: usize) -> Self
Trait Implementations§
impl Eq for Select
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 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