2022-01-22 21:16:13 +00:00
|
|
|
use crate::sql::idiom::Idiom;
|
2022-01-13 17:36:41 +00:00
|
|
|
use crate::sql::value::Value;
|
2023-08-17 18:03:46 +00:00
|
|
|
use revision::revisioned;
|
2022-01-13 17:36:41 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
2023-08-10 06:38:46 +00:00
|
|
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
|
|
|
|
#[serde(tag = "op")]
|
|
|
|
#[serde(rename_all = "lowercase")]
|
2023-08-17 18:03:46 +00:00
|
|
|
#[revisioned(revision = 1)]
|
2023-08-10 06:38:46 +00:00
|
|
|
pub enum Operation {
|
|
|
|
Add {
|
|
|
|
path: Idiom,
|
|
|
|
value: Value,
|
|
|
|
},
|
|
|
|
Remove {
|
|
|
|
path: Idiom,
|
|
|
|
},
|
|
|
|
Replace {
|
|
|
|
path: Idiom,
|
|
|
|
value: Value,
|
|
|
|
},
|
|
|
|
Change {
|
|
|
|
path: Idiom,
|
|
|
|
value: Value,
|
|
|
|
},
|
|
|
|
Copy {
|
|
|
|
path: Idiom,
|
|
|
|
from: Idiom,
|
|
|
|
},
|
|
|
|
Move {
|
|
|
|
path: Idiom,
|
|
|
|
from: Idiom,
|
|
|
|
},
|
|
|
|
Test {
|
|
|
|
path: Idiom,
|
|
|
|
value: Value,
|
|
|
|
},
|
2022-01-22 21:16:13 +00:00
|
|
|
}
|