Struct lumus_sql_builder::sqlite::Where
source · pub struct Where { /* private fields */ }
Expand description
Represents a WHERE clause builder for SQL queries.
Implementations§
source§impl Where
impl Where
sourcepub fn from(statement: &str) -> Self
pub fn from(statement: &str) -> Self
Creates a new Where
instance with a specified initial statement.
sourcepub fn equal_to(&mut self, field: &str, value: &str) -> &mut Self
pub fn equal_to(&mut self, field: &str, value: &str) -> &mut Self
Adds an equality condition (field = value
) to the WHERE clause.
sourcepub fn not_equal_to(&mut self, field: &str, value: &str) -> &mut Self
pub fn not_equal_to(&mut self, field: &str, value: &str) -> &mut Self
Adds a not equal condition (field != value
) to the WHERE clause.
sourcepub fn greater_than(&mut self, field: &str, value: &str) -> &mut Self
pub fn greater_than(&mut self, field: &str, value: &str) -> &mut Self
Adds a greater than condition (field > value
) to the WHERE clause.
sourcepub fn greater_than_equal(&mut self, field: &str, value: &str) -> &mut Self
pub fn greater_than_equal(&mut self, field: &str, value: &str) -> &mut Self
Adds a greater than or equal condition (field >= value
) to the WHERE clause.
sourcepub fn less_than(&mut self, field: &str, value: &str) -> &mut Self
pub fn less_than(&mut self, field: &str, value: &str) -> &mut Self
Adds a less than condition (field < value
) to the WHERE clause.
sourcepub fn less_than_equal(
&mut self,
field: &str,
value: &str,
) -> Result<&mut Self, SqlBuilderError>
pub fn less_than_equal( &mut self, field: &str, value: &str, ) -> Result<&mut Self, SqlBuilderError>
Adds a less than or equal condition (field <= value
) to the WHERE clause.
sourcepub fn is_null(&mut self, field: &str) -> &mut Self
pub fn is_null(&mut self, field: &str) -> &mut Self
Adds a IS NULL
condition (field IS NULL
) to the WHERE clause.
sourcepub fn is_not_null(&mut self, field: &str) -> &mut Self
pub fn is_not_null(&mut self, field: &str) -> &mut Self
Adds a IS NOT NULL
condition (field IS NOT NULL
) to the WHERE clause.
sourcepub fn inside(&mut self, field: &str, values: Vec<&str>) -> &mut Self
pub fn inside(&mut self, field: &str, values: Vec<&str>) -> &mut Self
Adds an IN
condition (field IN (values)
) to the WHERE clause.
sourcepub fn not_inside(&mut self, field: &str, values: Vec<&str>) -> &mut Self
pub fn not_inside(&mut self, field: &str, values: Vec<&str>) -> &mut Self
Adds a NOT IN
condition (field NOT IN (values)
) to the WHERE clause.
sourcepub fn like(&mut self, field: &str, value: &str) -> &mut Self
pub fn like(&mut self, field: &str, value: &str) -> &mut Self
Adds a LIKE
condition (field LIKE value
) to the WHERE clause.
sourcepub fn not_like(&mut self, field: &str, value: &str) -> &mut Self
pub fn not_like(&mut self, field: &str, value: &str) -> &mut Self
Adds a NOT LIKE
condition (field NOT LIKE value
) to the WHERE clause.
sourcepub fn nest(&mut self) -> &mut Self
pub fn nest(&mut self) -> &mut Self
Appends a left parenthesis (
to the current statement in the WHERE clause.