surrealdb_core/sql/
operation.rs

1use crate::sql::idiom::Idiom;
2use crate::sql::value::Value;
3use revision::revisioned;
4use serde::{Deserialize, Serialize};
5
6#[revisioned(revision = 1)]
7#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
8#[serde(tag = "op")]
9#[serde(rename_all = "lowercase")]
10#[non_exhaustive]
11pub enum Operation {
12	Add {
13		path: Idiom,
14		value: Value,
15	},
16	Remove {
17		path: Idiom,
18	},
19	Replace {
20		path: Idiom,
21		value: Value,
22	},
23	Change {
24		path: Idiom,
25		value: Value,
26	},
27	Copy {
28		path: Idiom,
29		from: Idiom,
30	},
31	Move {
32		path: Idiom,
33		from: Idiom,
34	},
35	Test {
36		path: Idiom,
37		value: Value,
38	},
39}