pub struct WithClause {
pub ctes: Vec<Cte>,
pub recursive: bool,
pub main_query: Option<String>,
}Expand description
A WITH clause containing one or more CTEs.
Fields§
§ctes: Vec<Cte>The CTEs in this WITH clause.
recursive: boolWhether any CTE is recursive.
main_query: Option<String>The main query that uses the CTEs.
Implementations§
Source§impl WithClause
impl WithClause
Sourcepub fn ctes<I>(self, ctes: I) -> Selfwhere
I: IntoIterator<Item = Cte>,
pub fn ctes<I>(self, ctes: I) -> Selfwhere
I: IntoIterator<Item = Cte>,
Add multiple CTEs.
Sourcepub fn main_query(self, query: impl Into<String>) -> Self
pub fn main_query(self, query: impl Into<String>) -> Self
Set the main query.
Sourcepub fn select(self, columns: impl Into<String>) -> WithQueryBuilder
pub fn select(self, columns: impl Into<String>) -> WithQueryBuilder
Convenience: SELECT from a CTE.
Sourcepub fn to_sql(&self, db_type: DatabaseType) -> QueryResult<String>
pub fn to_sql(&self, db_type: DatabaseType) -> QueryResult<String>
Generate the full SQL.
Trait Implementations§
Source§impl Clone for WithClause
impl Clone for WithClause
Source§fn clone(&self) -> WithClause
fn clone(&self) -> WithClause
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 WithClause
impl Debug for WithClause
Source§impl Default for WithClause
impl Default for WithClause
Source§fn default() -> WithClause
fn default() -> WithClause
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WithClause
impl<'de> Deserialize<'de> for WithClause
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WithClause
impl RefUnwindSafe for WithClause
impl Send for WithClause
impl Sync for WithClause
impl Unpin for WithClause
impl UnwindSafe for WithClause
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