Skip to main content

surql_parser/upstream/sql/
cond.rs

1use crate::upstream::fmt::CoverStmts;
2use crate::upstream::sql::Expr;
3use surrealdb_types::{SqlFormat, ToSql, write_sql};
4#[derive(Clone, Debug, PartialEq, Eq)]
5#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
6pub struct Cond(pub Expr);
7impl ToSql for Cond {
8	fn fmt_sql(&self, f: &mut String, fmt: SqlFormat) {
9		write_sql!(f, fmt, "WHERE {}", CoverStmts(&self.0))
10	}
11}