Trait WhereClauses

Source
pub trait WhereClauses {
Show 22 methods // Required methods fn where_eq(&mut self, column: &str, value: Value); fn where_ne(&mut self, column: &str, value: Value); fn where_in(&mut self, column: &str, values: Vec<Value>); fn where_not_in(&mut self, column: &str, values: Vec<Value>); fn where_null(&mut self, column: &str); fn where_not_null(&mut self, column: &str); fn where_between(&mut self, column: &str, values: [Value; 2]); fn where_not_between(&mut self, column: &str, values: [Value; 2]); fn where_like(&mut self, column: &str, value: Value); fn where_not_like(&mut self, column: &str, value: Value); fn where_ilike(&mut self, column: &str, value: Value); fn where_gt(&mut self, column: &str, value: Value); fn where_gte(&mut self, column: &str, value: Value); fn where_lt(&mut self, column: &str, value: Value); fn where_lte(&mut self, column: &str, value: Value); fn where_column(&mut self, lhs: &str, operator: &str, rhs: &str); fn where_exists(&mut self, query: impl FnOnce(&mut ChainBuilder)); fn where_not_exists(&mut self, query: impl FnOnce(&mut ChainBuilder)); fn where_json_contains(&mut self, column: &str, value: Value); fn where_subquery(&mut self, query: impl FnOnce(&mut QueryBuilder)); fn or(&mut self) -> &mut QueryBuilder; fn where_raw(&mut self, sql: &str, binds: Option<Vec<Value>>);
}
Expand description

Trait for WHERE clause operations

Required Methods§

Source

fn where_eq(&mut self, column: &str, value: Value)

Add an equality condition

Source

fn where_ne(&mut self, column: &str, value: Value)

Add a not equality condition

Source

fn where_in(&mut self, column: &str, values: Vec<Value>)

Add an IN condition

Source

fn where_not_in(&mut self, column: &str, values: Vec<Value>)

Add a NOT IN condition

Source

fn where_null(&mut self, column: &str)

Add an IS NULL condition

Source

fn where_not_null(&mut self, column: &str)

Add an IS NOT NULL condition

Source

fn where_between(&mut self, column: &str, values: [Value; 2])

Add a BETWEEN condition

Source

fn where_not_between(&mut self, column: &str, values: [Value; 2])

Add a NOT BETWEEN condition

Source

fn where_like(&mut self, column: &str, value: Value)

Add a LIKE condition

Source

fn where_not_like(&mut self, column: &str, value: Value)

Add a NOT LIKE condition

Source

fn where_ilike(&mut self, column: &str, value: Value)

Add a case-insensitive LIKE condition (ILIKE for Postgres, LOWER() for MySQL)

Source

fn where_gt(&mut self, column: &str, value: Value)

Add a greater than condition

Source

fn where_gte(&mut self, column: &str, value: Value)

Add a greater than or equal condition

Source

fn where_lt(&mut self, column: &str, value: Value)

Add a less than condition

Source

fn where_lte(&mut self, column: &str, value: Value)

Add a less than or equal condition

Source

fn where_column(&mut self, lhs: &str, operator: &str, rhs: &str)

Add a column-to-column comparison

Source

fn where_exists(&mut self, query: impl FnOnce(&mut ChainBuilder))

Add an EXISTS condition

Source

fn where_not_exists(&mut self, query: impl FnOnce(&mut ChainBuilder))

Add a NOT EXISTS condition

Source

fn where_json_contains(&mut self, column: &str, value: Value)

Add a JSON contains condition (MySQL JSON_CONTAINS)

Source

fn where_subquery(&mut self, query: impl FnOnce(&mut QueryBuilder))

Add a subquery condition

Source

fn or(&mut self) -> &mut QueryBuilder

Add an OR condition

Source

fn where_raw(&mut self, sql: &str, binds: Option<Vec<Value>>)

Add a raw WHERE condition

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§