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: boolTrait Implementations§
Source§impl Debug for SelectProps
impl Debug for SelectProps
Source§impl QueryConjunctions for SelectProps
impl QueryConjunctions for SelectProps
Source§fn where_in(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§fn where_not(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§fn and(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§fn or(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§fn and_not(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§fn or_not(self, column: &ColumnProps, values: WhereArg) -> Self
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 moreSource§impl SelectBuilder for SelectProps
impl SelectBuilder for SelectProps
Source§fn inner_join(
self,
foreign_table: &str,
primary_column: &str,
foreign_column: &str,
) -> Self
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
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
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
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_desc(self, column: &str) -> Ordered
fn order_desc(self, column: &str) -> Ordered
Order By a column descending
Source§fn build(self) -> Result<Vec<Vec<Box<SQLDataTypes>>>, Error>
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>
fn build_single_thread(self) -> Result<Vec<Vec<Box<SQLDataTypes>>>, Error>
Builds the query only using one thread.
Source§fn return_header(self) -> Self
fn return_header(self) -> Self
Returns column names
Auto Trait Implementations§
impl Freeze for SelectProps
impl RefUnwindSafe for SelectProps
impl Send for SelectProps
impl Sync for SelectProps
impl Unpin for SelectProps
impl UnwindSafe for SelectProps
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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