SQLComparable

Trait SQLComparable 

Source
pub trait SQLComparable<'a, V: SQLParam, Rhs> { }
Expand description

Marker trait for types that can be compared in SQL expressions.

Implementors§

Source§

impl<'a, V, L, R> SQLComparable<'a, V, R> for L
where V: SQLParam + 'a, L: ToSQL<'a, V>, R: ToSQL<'a, V> + Into<V>,

Column-to-Column comparison (most specific, type-safe) Only allows comparisons between columns with the same underlying type Column-to-Value comparison (type-safe) Only allows comparisons between a column and a value of the same type Value-to-Value comparison (most general, permissive) Allows any two values that can convert to SQL parameters Blanket implementation for all compatible types This covers all three cases:

  1. Column-to-Column (when both L and R are SQLColumn with same Type)
  2. Column-to-Value (when L is SQLColumn and R converts to same type)
  3. Value-to-Value (when both convert to SQL values)