chain-builder 1.0.1

A query builder for MySQL for Rust is designed to be flexible and easy to use.
Documentation
use crate::query::Operator;

// operator and is_bind
pub fn operator_to_sql(operator: &Operator) -> (&str, bool) {
    match operator {
        Operator::Equal => ("=", true),
        Operator::NotEqual => ("!=", true),
        Operator::In => ("IN", true),
        Operator::NotIn => ("NOT IN", true),
        Operator::IsNull => ("IS NULL", false),
        Operator::IsNotNull => ("IS NOT NULL", false),
        Operator::Exists => ("EXISTS", false),
        Operator::NotExists => ("NOT EXISTS", false),
        Operator::Between => ("BETWEEN", true),
        Operator::NotBetween => ("NOT BETWEEN", true),
        Operator::Like => ("LIKE", true),
        Operator::NotLike => ("NOT LIKE", true),
        Operator::GreaterThan => (">", true),
        Operator::GreaterThanOrEqual => (">=", true),
        Operator::LessThan => ("<", true),
        Operator::LessThanOrEqual => ("<=", true),
        Operator::GreaterORLessThan => ("<>", true),
    }
}