1use serde::{Deserialize, Serialize};
7use std::sync::Arc;
8
9use crate::types::{LabelId, SpaceInfo, VertexId};
10use crate::Value;
11
12#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct InsertVertexRedo {
18 pub label: LabelId,
19 pub vid: VertexId,
20 pub properties: Vec<(Arc<str>, Value)>,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct InsertEdgeRedo {
25 pub src_label: LabelId,
26 pub src_vid: VertexId,
27 pub dst_label: LabelId,
28 pub dst_vid: VertexId,
29 pub edge_label: LabelId,
30 pub rank: i64,
31 pub properties: Vec<(Arc<str>, Value)>,
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct UpdateVertexPropRedo {
36 pub label: LabelId,
37 pub vid: VertexId,
38 pub prop_name: std::sync::Arc<str>,
39 pub value: Value,
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
43pub struct UpdateEdgePropRedo {
44 pub src_label: LabelId,
45 pub src_vid: VertexId,
46 pub dst_label: LabelId,
47 pub dst_vid: VertexId,
48 pub edge_label: LabelId,
49 pub rank: i64,
50 pub prop_name: std::sync::Arc<str>,
51 pub value: Value,
52}
53
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct DeleteVertexRedo {
56 pub label: LabelId,
57 pub vid: VertexId,
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
61pub struct DeleteEdgeRedo {
62 pub src_label: LabelId,
63 pub src_vid: VertexId,
64 pub dst_label: LabelId,
65 pub dst_vid: VertexId,
66 pub edge_label: LabelId,
67 pub rank: i64,
68}
69
70#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct CreateSpaceRedo {
76 pub space: SpaceInfo,
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize)]
80pub struct DropSpaceRedo {
81 pub space_name: String,
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize)]
85pub struct ClearSpaceRedo {
86 pub space_name: String,
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
90pub struct CreateVertexTypeRedo {
91 pub space_name: String,
92 pub label_id: Option<LabelId>,
93 pub label_name: String,
94 pub schema: Vec<(String, String, bool)>,
96}
97
98#[derive(Debug, Clone, Serialize, Deserialize)]
99pub struct CreateEdgeTypeRedo {
100 pub space_name: String,
101 pub label_id: Option<LabelId>,
102 pub src_label: String,
103 pub dst_label: String,
104 pub edge_label: String,
105 pub schema: Vec<(String, String, bool)>,
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
110pub struct DeleteVertexTypeRedo {
111 pub space_name: Option<String>,
112 pub label_name: String,
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
116pub struct DeleteEdgeTypeRedo {
117 pub space_name: Option<String>,
118 pub src_label: String,
119 pub dst_label: String,
120 pub edge_label: String,
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
124pub struct AddVertexPropRedo {
125 pub label: LabelId,
126 pub properties: Vec<(String, String, bool)>,
128 #[serde(default)]
129 pub new_comment: Option<String>,
130}
131
132#[derive(Debug, Clone, Serialize, Deserialize)]
133pub struct AddEdgePropRedo {
134 pub src_label: LabelId,
135 pub dst_label: LabelId,
136 pub edge_label: LabelId,
137 pub properties: Vec<(String, String, bool)>,
139 #[serde(default)]
140 pub new_comment: Option<String>,
141}
142
143#[derive(Debug, Clone, Serialize, Deserialize)]
144pub struct DeleteVertexPropRedo {
145 pub label: LabelId,
146 pub prop_names: Vec<std::sync::Arc<str>>,
147}
148
149#[derive(Debug, Clone, Serialize, Deserialize)]
150pub struct DeleteEdgePropRedo {
151 pub src_label: LabelId,
152 pub dst_label: LabelId,
153 pub edge_label: LabelId,
154 pub prop_names: Vec<std::sync::Arc<str>>,
155}
156
157#[derive(Debug, Clone, Serialize, Deserialize)]
158pub struct DeleteVertexPropsRedo {
159 pub label: LabelId,
160 pub vid: VertexId,
161 pub prop_names: Vec<std::sync::Arc<str>>,
162}
163
164#[derive(Debug, Clone, Serialize, Deserialize)]
165pub struct RenameVertexPropRedo {
166 pub label: LabelId,
167 pub old_name: String,
168 pub new_name: String,
169}
170
171#[derive(Debug, Clone, Serialize, Deserialize)]
172pub struct RenameEdgePropRedo {
173 pub src_label: LabelId,
174 pub dst_label: LabelId,
175 pub edge_label: LabelId,
176 pub old_name: String,
177 pub new_name: String,
178}
179
180#[derive(Debug, Clone, Serialize, Deserialize)]
181pub struct RenameTagRedo {
182 pub space_id: u64,
183 pub old_name: String,
184 pub new_name: String,
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
188pub struct RenameEdgeTypeRedo {
189 pub space_id: u64,
190 pub old_name: String,
191 pub new_name: String,
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
195pub struct CreateTagIndexRedo {
196 pub space_id: u64,
197 pub index_name: String,
198 pub fields: Vec<(String, String)>,
199 pub properties: Vec<String>,
200 pub is_unique: bool,
201}
202
203#[derive(Debug, Clone, Serialize, Deserialize)]
204pub struct DropTagIndexRedo {
205 pub space_id: u64,
206 pub index_name: String,
207}
208
209#[derive(Debug, Clone, Serialize, Deserialize)]
210pub struct CreateEdgeIndexRedo {
211 pub space_id: u64,
212 pub index_name: String,
213 pub fields: Vec<(String, String)>,
214 pub properties: Vec<String>,
215 pub is_unique: bool,
216}
217
218#[derive(Debug, Clone, Serialize, Deserialize)]
219pub struct DropEdgeIndexRedo {
220 pub space_id: u64,
221 pub index_name: String,
222}
223
224#[derive(Debug, Clone, Serialize, Deserialize)]
227pub struct CompactRedo;
228
229#[derive(Debug, Clone, Serialize, Deserialize)]
239pub struct UpdateSequenceRedo {
240 pub space_id: u64,
241 pub table_name: String,
242 pub next_value: u64,
243}
244
245#[derive(Debug, Clone, Serialize, Deserialize)]
254pub struct CreateMacroRedo {
255 pub space_name: String,
256 pub name: String,
257 pub params: Vec<crate::metadata::MacroParamDef>,
258 pub body: crate::types::expr::Expression,
259}
260
261#[derive(Debug, Clone, Serialize, Deserialize)]
265pub struct DropMacroRedo {
266 pub space_name: String,
267 pub name: String,
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
274pub struct CreateTypeAliasRedo {
275 pub space_name: String,
276 pub name: String,
277 pub underlying: String,
278}
279
280#[derive(Debug, Clone, Serialize, Deserialize)]
284pub struct DropTypeAliasRedo {
285 pub space_name: String,
286 pub name: String,
287}