use crate::prelude::*;
use crate::sub_parts::search_condition::SearchCondition;
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Debug)]
pub struct Where {
search_condition: SearchCondition,
}
impl Where {
pub fn new(search_condition: SearchCondition) -> Self {
Self { search_condition }
}
}
impl Sql for Where {
fn sql(&self, mut s: String, ctx: &Context) -> Result<String> {
s.push_str(" WHERE ");
let s = self.search_condition.sql(s, ctx);
s
}
}