Struct sequelite::model::query::ColumnQueryFilterUnary
source · pub struct ColumnQueryFilterUnary { /* private fields */ }Trait Implementations§
source§impl<T: ModelQueryFilter> BitAnd<T> for ColumnQueryFilterUnary
impl<T: ModelQueryFilter> BitAnd<T> for ColumnQueryFilterUnary
source§fn bitand(self, rhs: T) -> Self::Output
fn bitand(self, rhs: T) -> Self::Output
Alternative to ModelQueryFilterExt::and
§type Output = ModelQueryFilterAnd<ColumnQueryFilterUnary, T>
type Output = ModelQueryFilterAnd<ColumnQueryFilterUnary, T>
The resulting type after applying the
& operator.source§impl<T: ModelQueryFilter> BitOr<T> for ColumnQueryFilterUnary
impl<T: ModelQueryFilter> BitOr<T> for ColumnQueryFilterUnary
source§fn bitor(self, rhs: T) -> Self::Output
fn bitor(self, rhs: T) -> Self::Output
Alternative to ModelQueryFilterExt::or
§type Output = ModelQueryFilterOr<ColumnQueryFilterUnary, T>
type Output = ModelQueryFilterOr<ColumnQueryFilterUnary, T>
The resulting type after applying the
| operator.Auto Trait Implementations§
impl RefUnwindSafe for ColumnQueryFilterUnary
impl Send for ColumnQueryFilterUnary
impl Sync for ColumnQueryFilterUnary
impl Unpin for ColumnQueryFilterUnary
impl UnwindSafe for ColumnQueryFilterUnary
Blanket Implementations§
source§impl<F> ModelQueryFilterExt for Fwhere
F: ModelQueryFilter,
impl<F> ModelQueryFilterExt for Fwhere F: ModelQueryFilter,
source§fn and<F1>(self, filter: F1) -> ModelQueryFilterAnd<F, F1>where
F1: ModelQueryFilter,
fn and<F1>(self, filter: F1) -> ModelQueryFilterAnd<F, F1>where F1: ModelQueryFilter,
Combine two filters with an AND operator
Example
User::select().filter(User::name.eq("John").and(User::age.gt(18))).exec(conn);This will generate the following SQL query:
SELECT * FROM users WHERE users.name = ? AND users.age > ?;
Note
This is not a beautiful way to write this query, so you should use ‘&’ instead:
User::select().filter(User::name.eq("John") & User::age.gt(18)).exec(conn);source§fn or<F1>(self, filter: F1) -> ModelQueryFilterOr<F, F1>where
F1: ModelQueryFilter,
fn or<F1>(self, filter: F1) -> ModelQueryFilterOr<F, F1>where F1: ModelQueryFilter,
Combine two filters with an OR operator
Example
User::select().filter(User::name.eq("John").or(User::age.gt(18))).exec(conn);This will generate the following SQL query:
SELECT * FROM users WHERE users.name = ? OR users.age > ?;
Note
This is not a beautiful way to write this query, so you should use ‘|’ instead:
User::select().filter(User::name.eq("John") | User::age.gt(18)).exec(conn);