Skip to main content

surrealdb_expr/expr/
start.rs

1use surrealdb_types::{SqlFormat, ToSql};
2
3use crate::expr::Expr;
4
5#[derive(Clone, Debug, Eq, PartialEq, Hash)]
6pub struct Start(pub Expr);
7
8impl Start {
9	/// Whether evaluating the start expression can be done on a read-only
10	/// transaction.
11	pub fn read_only(&self) -> bool {
12		self.0.read_only()
13	}
14}
15
16impl ToSql for Start {
17	fn fmt_sql(&self, f: &mut String, fmt: SqlFormat) {
18		let sql_start: crate::sql::Start = self.clone().into();
19		sql_start.fmt_sql(f, fmt);
20	}
21}