use crate::{expr::private::Expression, Expr, SimpleExpr};
use super::SqliteBinOper;
pub trait SqliteExpr: Expression {
fn glob<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.bin_op(SqliteBinOper::Glob, right)
}
fn matches<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.bin_op(SqliteBinOper::Match, right)
}
fn get_json_field<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.bin_op(SqliteBinOper::GetJsonField, right)
}
fn cast_json_field<T>(self, right: T) -> SimpleExpr
where
T: Into<SimpleExpr>,
{
self.bin_op(SqliteBinOper::CastJsonField, right)
}
}
impl SqliteExpr for Expr {}
impl SqliteExpr for SimpleExpr {}