Skip to main content

Select

Struct Select 

Source
pub struct Select<'a> {
    pub distinct: Option<()>,
    pub cols: Vec<&'a str>,
    pub joins: Vec<JoinInfo<'a>>,
    pub whereas: Vec<WhereInfo<'a>>,
    pub groups: Vec<&'a str>,
    pub havings: Vec<HavingInfo<'a>>,
    pub orders: Vec<Order<'a>>,
    pub limit: Option<u32>,
    pub offset: Option<u32>,
    /* private fields */
}

Fields§

§distinct: Option<()>§cols: Vec<&'a str>§joins: Vec<JoinInfo<'a>>§whereas: Vec<WhereInfo<'a>>§groups: Vec<&'a str>§havings: Vec<HavingInfo<'a>>§orders: Vec<Order<'a>>§limit: Option<u32>§offset: Option<u32>

Implementations§

Source§

impl<'a> Select<'a>

Source

pub fn any() -> Self

Source

pub fn cols(cols: Vec<&'a str>) -> Self

Source

pub fn col(self, col: &'a str) -> Self

Source

pub fn distinct(self) -> Self

Source

pub fn from(self, table: &'a str) -> Self

Source

pub fn from_subquery(self, table: impl Into<Select<'a>>) -> Self

Source

pub fn inner_join(self, table: &'a str) -> Join<'a>

Source

pub fn left_join(self, table: &'a str) -> Join<'a>

Source

pub fn right_join(self, table: &'a str) -> Join<'a>

Source

pub fn outer_join(self, table: &'a str) -> Join<'a>

Source

pub fn where_by(self, left: &'a str, op: Op<'a>) -> Where<'a>

Source

pub fn group_by(self, cols: Vec<&'a str>) -> Self

Source

pub fn order_by(self, col: &'a str) -> Self

Source

pub fn order_by_desc(self, col: &'a str) -> Self

Source

pub fn having(self, left: &'a str, op: Op<'a>) -> Having<'a>

Source

pub fn limit(self, num: u32) -> Self

Source

pub fn offset(self, num: u32) -> Self

Source

pub fn build(&self) -> String

Trait Implementations§

Source§

impl<'a> Display for Select<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Into<Select<'a>> for Where<'a>

Source§

fn into(self) -> Select<'a>

Converts this type into the (usually inferred) input type.
Source§

impl<'a> Into<Value<'a>> for Select<'a>

Source§

fn into(self) -> Value<'a>

Converts this type into the (usually inferred) input type.
Source§

impl<'a> WhereOwner<'a> for Select<'a>

Source§

fn set_seperator(&mut self, index: usize, sep: CondSep)

Source§

fn push(&mut self, where_info: WhereInfo<'a>)

Source§

fn len(&self) -> usize

Auto Trait Implementations§

§

impl<'a> Freeze for Select<'a>

§

impl<'a> RefUnwindSafe for Select<'a>

§

impl<'a> Send for Select<'a>

§

impl<'a> Sync for Select<'a>

§

impl<'a> Unpin for Select<'a>

§

impl<'a> UnsafeUnpin for Select<'a>

§

impl<'a> UnwindSafe for Select<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.