use arrow_array::RecordBatch;
#[derive(Debug, Clone)]
pub struct VertexSet {
pub label: String,
pub id_column: String,
pub batch: RecordBatch,
}
#[derive(Debug, Clone)]
pub struct VertexDelete {
pub label: String,
pub id_column: String,
pub batch: RecordBatch,
}
#[derive(Debug, Clone)]
pub struct EdgeSet {
pub src_label: String,
pub edge_type: String,
pub dst_label: String,
pub src_id_column: String,
pub dst_id_column: String,
#[allow(clippy::doc_markdown)]
pub edge_key_props: Vec<String>,
pub replace_outgoing: bool,
pub batch: RecordBatch,
}
#[derive(Debug, Clone, Default)]
pub struct GraphMutation {
pub vertices: Vec<VertexSet>,
pub edges: Vec<EdgeSet>,
pub deletes: Vec<VertexDelete>,
pub edge_deletes: Vec<EdgeSet>,
}
impl GraphMutation {
pub fn is_empty(&self) -> bool {
self.vertices.is_empty() && self.edges.is_empty() && self.deletes.is_empty() && self.edge_deletes.is_empty()
}
pub fn merge(&mut self, other: GraphMutation) {
self.vertices.extend(other.vertices);
self.edges.extend(other.edges);
self.deletes.extend(other.deletes);
self.edge_deletes.extend(other.edge_deletes);
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct SinkReport {
pub vertices_written: usize,
pub edges_written: usize,
pub deleted: usize,
}