Skip to main content

Filterable

Trait Filterable 

Source
pub trait Filterable: Sized {
Show 25 methods // Required methods fn filters_mut(&mut self) -> &mut Vec<FilterCondition>; fn params_mut(&mut self) -> &mut ParamStore; // Provided methods fn eq(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn neq(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn gt(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn gte(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn lt(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn lte(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self { ... } fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self { ... } fn is(self, column: &str, value: IsValue) -> Self { ... } fn in_<V>(self, column: &str, values: Vec<V>) -> Self where V: IntoSqlParam { ... } fn contains(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self { ... } fn text_search( self, column: &str, query: impl IntoSqlParam, search_type: TextSearchType, config: Option<&str>, ) -> Self { ... } fn not( self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>, ) -> Self { ... } fn or_filter( self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>, ) -> Self { ... } fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self { ... } fn filter(self, raw_sql: &str) -> Self { ... }
}
Expand description

Trait providing all filter methods for query builders.

Implementors must provide access to the internal filter list and param store.

Required Methods§

Source

fn filters_mut(&mut self) -> &mut Vec<FilterCondition>

Get a mutable reference to the filter list.

Source

fn params_mut(&mut self) -> &mut ParamStore

Get a mutable reference to the parameter store.

Provided Methods§

Source

fn eq(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column = value

Source

fn neq(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column != value

Source

fn gt(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column > value

Source

fn gte(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column >= value

Source

fn lt(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column < value

Source

fn lte(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column <= value

Source

fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self

Filter: column LIKE pattern

Source

fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self

Filter: column ILIKE pattern (case-insensitive)

Source

fn is(self, column: &str, value: IsValue) -> Self

Filter: column IS NULL / IS NOT NULL / IS TRUE / IS FALSE

Source

fn in_<V>(self, column: &str, values: Vec<V>) -> Self
where V: IntoSqlParam,

Filter: column IN (val1, val2, …)

Source

fn contains(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column @> value (contains)

Source

fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column <@ value (contained by)

Source

fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column && value (overlaps)

Source

fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column >> value (range strictly greater than)

Source

fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column &> value (range greater than or equal)

Source

fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column << value (range strictly less than)

Source

fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column &< value (range less than or equal)

Source

fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self

Filter: column -|- value (range adjacent)

Full-text search filter.

Source

fn not(self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>) -> Self

Negate a filter condition using a closure.

Source

fn or_filter( self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>, ) -> Self

OR filter: combine multiple conditions with OR.

Source

fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self

Match multiple column=value pairs (all must match).

Source

fn filter(self, raw_sql: &str) -> Self

Raw filter escape hatch. The string should be a valid SQL boolean expression.

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§