SelectProps

Struct SelectProps 

Source
pub struct SelectProps {
    pub connect: SQLImplementation,
    pub columns: Vec<Column>,
    pub table: String,
    pub joins: Vec<Joins>,
    pub clause: Option<String>,
    pub order_by: (Option<String>, OrderBy),
    pub group_by: Option<Vec<String>>,
    pub limit: Limit,
    pub return_header: bool,
}

Fields§

§connect: SQLImplementation§columns: Vec<Column>§table: String§joins: Vec<Joins>§clause: Option<String>§order_by: (Option<String>, OrderBy)§group_by: Option<Vec<String>>§limit: Limit§return_header: bool

Trait Implementations§

Source§

impl Debug for SelectProps

Source§

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

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

impl QueryConjunctions for SelectProps

Source§

fn where_in(self, column: &ColumnProps, values: WhereArg) -> Self

Adds a WHERE clause to your query. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like and, or, and_not, and or_not. Read more
Source§

fn where_not(self, column: &ColumnProps, values: WhereArg) -> Self

Adds a WHERE NOT clause to your query. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like and, or, and_not, and or_not. Read more
Source§

fn and(self, column: &ColumnProps, values: WhereArg) -> Self

Adds an AND conjunction to a WHERE clause. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like or, and_not, and or_not. Read more
Source§

fn or(self, column: &ColumnProps, values: WhereArg) -> Self

Adds an OR conjunction to a WHERE clause. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like and, and_not, and or_not. Read more
Source§

fn and_not(self, column: &ColumnProps, values: WhereArg) -> Self

Adds an AND NOT conjunction to a WHERE clause. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like and, or, and or_not. Read more
Source§

fn or_not(self, column: &ColumnProps, values: WhereArg) -> Self

Adds an OR NOT conjunction to a WHERE clause. The first argument is the column you want to filter on, and the second argument is the values you want to filter by. This can be chained with other conjunctions like and, and_not, and or. Read more
Source§

impl SelectBuilder for SelectProps

Source§

fn inner_join( self, foreign_table: &str, primary_column: &str, foreign_column: &str, ) -> Self

Inner joins another table to your query. Read more
Source§

fn outer_join( self, foreign_table: &str, primary_column: &str, foreign_column: &str, ) -> Self

Outer joins another table to your query. Read more
Source§

fn right_join( self, foreign_table: &str, primary_column: &str, foreign_column: &str, ) -> Self

Right joins another table to your query. Read more
Source§

fn left_join( self, foreign_table: &str, primary_column: &str, foreign_column: &str, ) -> Self

Left joins another table to your query. Read more
Source§

fn order_asc(self, column: &str) -> Ordered

Order By a column ascending
Source§

fn order_desc(self, column: &str) -> Ordered

Order By a column descending
Source§

fn group_by(self, columns: Vec<&str>) -> Grouped

Group By column(s)
Source§

fn build(self) -> Result<Vec<Vec<Box<SQLDataTypes>>>, Error>

Builds the query. This is multi-threaded by default, dividing the number of rows by the number of CPU cores. If you’re using a single core machine, it’s recommended to use build_single_thread. SQLite runs better using build_single_thread (will either fix or remove it as an option in a future update).
Source§

fn build_single_thread(self) -> Result<Vec<Vec<Box<SQLDataTypes>>>, Error>

Builds the query only using one thread.
Source§

fn limit(self, limit: usize, offset: Option<usize>) -> Self

Sets limit and offset of query
Source§

fn return_header(self) -> Self

Returns column names

Auto Trait Implementations§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.