use crate::{ColumnRef, Expr, ExprTrait, FunctionCall, Keyword, LikeExpr, SimpleExpr, Value};
use super::SqliteBinOper;
pub trait SqliteExpr: ExprTrait {
fn glob<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.binary(SqliteBinOper::Glob, right)
}
fn matches<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.binary(SqliteBinOper::Match, right)
}
fn get_json_field<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.binary(SqliteBinOper::GetJsonField, right)
}
fn cast_json_field<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.binary(SqliteBinOper::CastJsonField, right)
}
}
impl SqliteExpr for Expr {}
impl SqliteExpr for SimpleExpr {}
impl SqliteExpr for FunctionCall {}
impl SqliteExpr for ColumnRef {}
impl SqliteExpr for Keyword {}
impl SqliteExpr for LikeExpr {}
impl SqliteExpr for Value {}