Skip to main content

SqliteOperation

Trait SqliteOperation 

Source
pub trait SqliteOperation<T>: Expressive<T>
where T: Into<AnySqliteType> + Send + Clone + 'static,
{
Show 15 methods // Provided methods fn or_(&self, other: impl Expressive<T>) -> ConditionGroup<T> where Self: Sized { ... } fn and_(&self, other: impl Expressive<T>) -> ConditionGroup<T> where Self: Sized { ... } fn eq(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn ne(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn gt(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn gte(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn lt(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn lte(&self, value: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn in_(&self, values: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition where Self: Sized, T: Clone { ... } fn not_in(&self, values: impl Expressive<T>) -> SqliteCondition where Self: Sized { ... } fn not_in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition where Self: Sized, T: Clone { ... } fn cast(&self, type_name: &str) -> SqliteCondition where Self: Sized { ... } fn is_null(&self) -> SqliteCondition where Self: Sized { ... } fn is_not_null(&self) -> SqliteCondition where Self: Sized { ... }
}
Expand description

Vendor-specific operations producing the backend’s condition type.

Blanket-implemented for all Expressive<T> where T: Into<AnyType>. The condition type itself implements Expressive<AnyType>, enabling cross-type chaining like price.gt(10).eq(false).

Provided Methods§

Source

fn or_(&self, other: impl Expressive<T>) -> ConditionGroup<T>
where Self: Sized,

(self OR other) — joins two conditions into a ConditionGroup.

Use this method to write alternatives. Do not write "a OR b" as text. The group writes its own brackets, and it keeps its meaning next to the other conditions. Text has no brackets, and AND binds more tightly than OR. Thus role = 'admin' AND a OR b means (role = 'admin' AND a) OR b.

A chain stays flat: a.or_(b).or_(c) gives (a OR b OR c).

Source

fn and_(&self, other: impl Expressive<T>) -> ConditionGroup<T>
where Self: Sized,

(self AND other) — joins two conditions into a ConditionGroup.

A table joins its conditions with AND already. Use this method when you must make a group inside an or_.

Source

fn eq(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field = value

Source

fn ne(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field != value

Source

fn gt(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field > value

Source

fn gte(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field >= value

Source

fn lt(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field < value

Source

fn lte(&self, value: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field <= value

Source

fn in_(&self, values: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field IN (values_expression)

Source

fn in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition
where Self: Sized, T: Clone,

field IN (a, b, c) from a slice of scalar values

Source

fn not_in(&self, values: impl Expressive<T>) -> SqliteCondition
where Self: Sized,

field NOT IN (values_expression)

Source

fn not_in_list<V: Into<T> + Clone>(&self, values: &[V]) -> SqliteCondition
where Self: Sized, T: Clone,

field NOT IN (a, b, c) from a slice of scalar values

Source

fn cast(&self, type_name: &str) -> SqliteCondition
where Self: Sized,

CAST(expr AS type_name)

Source

fn is_null(&self) -> SqliteCondition
where Self: Sized,

field IS NULL

Source

fn is_not_null(&self) -> SqliteCondition
where Self: Sized,

field IS NOT NULL

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, S> SqliteOperation<T> for S
where S: Expressive<T>, T: Into<AnySqliteType> + Send + Clone + 'static,

Blanket: any Expressive<T> where T: Into<AnyType> gets the operation trait for free.