pub enum Filter {
Show 14 variants
Eq(String, Value),
Ne(String, Value),
Gt(String, Value),
Lt(String, Value),
Ge(String, Value),
In(String, Vec<Value>),
Json(String, JsonFilter),
Le(String, Value),
Like(String, String),
NotNull(String),
IsNull(String),
And(Box<Filter>, Box<Filter>),
Or(Box<Filter>, Box<Filter>),
Not(Box<Filter>),
}Expand description
super::Query filters.
The first value refers to the column name, and the second to the value to compare against.
Variants§
Eq(String, Value)
Ne(String, Value)
Gt(String, Value)
Lt(String, Value)
Ge(String, Value)
In(String, Vec<Value>)
Json(String, JsonFilter)
JSON filter applied to a column.
Le(String, Value)
Like(String, String)
NotNull(String)
IsNull(String)
And(Box<Filter>, Box<Filter>)
Or(Box<Filter>, Box<Filter>)
Not(Box<Filter>)
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn json(field: &str, json_filter: JsonFilter) -> Self
pub fn json(field: &str, json_filter: JsonFilter) -> Self
Creates a JSON filter.
Sourcepub fn matches_joined_row(
&self,
table_groups: &[(&str, Vec<(ColumnDef, Value)>)],
) -> QueryResult<bool>
pub fn matches_joined_row( &self, table_groups: &[(&str, Vec<(ColumnDef, Value)>)], ) -> QueryResult<bool>
Checks if the given joined row values match the filter.
Each element in table_groups is a (table_name, columns) pair.
Column references can be qualified (“table.column”) or unqualified (“column”).
Unqualified names that exist in multiple tables produce an error.
Sourcepub fn matches_joined_row_ref(
&self,
table_groups: &[(&str, &[(ColumnDef, Value)])],
) -> QueryResult<bool>
pub fn matches_joined_row_ref( &self, table_groups: &[(&str, &[(ColumnDef, Value)])], ) -> QueryResult<bool>
Borrowing variant of Self::matches_joined_row.
Takes the columns of every table as slices, so a caller that keeps its
rows elsewhere can evaluate the filter without cloning them. Semantics
are identical to Self::matches_joined_row.
Sourcepub fn validate_joined(
&self,
table_groups: &[(&str, &[ColumnDef])],
) -> QueryResult<()>
pub fn validate_joined( &self, table_groups: &[(&str, &[ColumnDef])], ) -> QueryResult<()>
Validates joined-row column references and typed filter operands against table schemas.
This validation is independent of row data, so invalid filters are rejected even when a join produces no rows. Missing column names retain the normal non-matching semantics.