Skip to main content

surrealdb_expr/expr/convert/statements/
relate.rs

1//! `sql` -> `expr` conversions for [`crate::sql::statements::relate`].
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::statements::relate::*;
7
8impl From<RelateStatement> for crate::expr::statements::RelateStatement {
9	fn from(v: RelateStatement) -> Self {
10		crate::expr::statements::RelateStatement {
11			only: v.only,
12			or_update: v.or_update,
13			through: v.through.into(),
14			from: v.from.into(),
15			to: v.to.into(),
16			data: v.data.map(Into::into),
17			output: v.output.map(Into::into),
18			timeout: v.timeout.into(),
19		}
20	}
21}
22
23impl From<crate::expr::statements::RelateStatement> for RelateStatement {
24	fn from(v: crate::expr::statements::RelateStatement) -> Self {
25		RelateStatement {
26			only: v.only,
27			or_update: v.or_update,
28			through: v.through.into(),
29			from: v.from.into(),
30			to: v.to.into(),
31			data: v.data.map(Into::into),
32			output: v.output.map(Into::into),
33			timeout: v.timeout.into(),
34		}
35	}
36}