Skip to main content

surrealdb_expr/expr/convert/
output.rs

1//! `sql` -> `expr` conversions for [`crate::sql::output`].
2//!
3//! Lives in core rather than beside the AST: `surrealdb-sql` sits below
4//! core, so it cannot name `expr` types.
5
6use crate::sql::output::*;
7
8impl From<Output> for crate::expr::Output {
9	fn from(v: Output) -> Self {
10		match v {
11			Output::None => Self::None,
12			Output::Null => Self::Null,
13			Output::Diff => Self::Diff,
14			Output::After => Self::After,
15			Output::Before => Self::Before,
16			Output::Fields(v) => Self::Fields(v.into()),
17		}
18	}
19}
20
21impl From<crate::expr::Output> for Output {
22	fn from(v: crate::expr::Output) -> Self {
23		match v {
24			crate::expr::Output::None => Self::None,
25			crate::expr::Output::Null => Self::Null,
26			crate::expr::Output::Diff => Self::Diff,
27			crate::expr::Output::After => Self::After,
28			crate::expr::Output::Before => Self::Before,
29			crate::expr::Output::Fields(v) => Self::Fields(v.into()),
30		}
31	}
32}