use serde::{Deserialize, Serialize};
use std::sync::Arc;
use crate::types::{LabelId, SpaceInfo, VertexId};
use crate::Value;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InsertVertexRedo {
pub label: LabelId,
pub vid: VertexId,
pub properties: Vec<(Arc<str>, Value)>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InsertEdgeRedo {
pub src_label: LabelId,
pub src_vid: VertexId,
pub dst_label: LabelId,
pub dst_vid: VertexId,
pub edge_label: LabelId,
pub rank: i64,
pub properties: Vec<(Arc<str>, Value)>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateVertexPropRedo {
pub label: LabelId,
pub vid: VertexId,
pub prop_name: std::sync::Arc<str>,
pub value: Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateEdgePropRedo {
pub src_label: LabelId,
pub src_vid: VertexId,
pub dst_label: LabelId,
pub dst_vid: VertexId,
pub edge_label: LabelId,
pub rank: i64,
pub prop_name: std::sync::Arc<str>,
pub value: Value,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteVertexRedo {
pub label: LabelId,
pub vid: VertexId,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteEdgeRedo {
pub src_label: LabelId,
pub src_vid: VertexId,
pub dst_label: LabelId,
pub dst_vid: VertexId,
pub edge_label: LabelId,
pub rank: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateSpaceRedo {
pub space: SpaceInfo,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DropSpaceRedo {
pub space_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClearSpaceRedo {
pub space_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateVertexTypeRedo {
pub space_name: String,
pub label_id: Option<LabelId>,
pub label_name: String,
pub schema: Vec<(String, String, bool)>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateEdgeTypeRedo {
pub space_name: String,
pub label_id: Option<LabelId>,
pub src_label: String,
pub dst_label: String,
pub edge_label: String,
pub schema: Vec<(String, String, bool)>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteVertexTypeRedo {
pub space_name: Option<String>,
pub label_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteEdgeTypeRedo {
pub space_name: Option<String>,
pub src_label: String,
pub dst_label: String,
pub edge_label: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AddVertexPropRedo {
pub label: LabelId,
pub properties: Vec<(String, String, bool)>,
#[serde(default)]
pub new_comment: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AddEdgePropRedo {
pub src_label: LabelId,
pub dst_label: LabelId,
pub edge_label: LabelId,
pub properties: Vec<(String, String, bool)>,
#[serde(default)]
pub new_comment: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteVertexPropRedo {
pub label: LabelId,
pub prop_names: Vec<std::sync::Arc<str>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteEdgePropRedo {
pub src_label: LabelId,
pub dst_label: LabelId,
pub edge_label: LabelId,
pub prop_names: Vec<std::sync::Arc<str>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DeleteVertexPropsRedo {
pub label: LabelId,
pub vid: VertexId,
pub prop_names: Vec<std::sync::Arc<str>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenameVertexPropRedo {
pub label: LabelId,
pub old_name: String,
pub new_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenameEdgePropRedo {
pub src_label: LabelId,
pub dst_label: LabelId,
pub edge_label: LabelId,
pub old_name: String,
pub new_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenameTagRedo {
pub space_id: u64,
pub old_name: String,
pub new_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenameEdgeTypeRedo {
pub space_id: u64,
pub old_name: String,
pub new_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateTagIndexRedo {
pub space_id: u64,
pub index_name: String,
pub fields: Vec<(String, String)>,
pub properties: Vec<String>,
pub is_unique: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DropTagIndexRedo {
pub space_id: u64,
pub index_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateEdgeIndexRedo {
pub space_id: u64,
pub index_name: String,
pub fields: Vec<(String, String)>,
pub properties: Vec<String>,
pub is_unique: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DropEdgeIndexRedo {
pub space_id: u64,
pub index_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CompactRedo;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UpdateSequenceRedo {
pub space_id: u64,
pub table_name: String,
pub next_value: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateMacroRedo {
pub space_name: String,
pub name: String,
pub params: Vec<crate::metadata::MacroParamDef>,
pub body: crate::types::expr::Expression,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DropMacroRedo {
pub space_name: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateTypeAliasRedo {
pub space_name: String,
pub name: String,
pub underlying: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DropTypeAliasRedo {
pub space_name: String,
pub name: String,
}