Skip to main content

GraphStoreMut

Trait GraphStoreMut 

Source
pub trait GraphStoreMut: GraphStore {
Show 24 methods // Required methods fn create_node(&self, labels: &[&str]) -> NodeId; fn create_node_versioned( &self, labels: &[&str], epoch: EpochId, transaction_id: TransactionId, ) -> NodeId; fn create_edge(&self, src: NodeId, dst: NodeId, edge_type: &str) -> EdgeId; fn create_edge_versioned( &self, src: NodeId, dst: NodeId, edge_type: &str, epoch: EpochId, transaction_id: TransactionId, ) -> EdgeId; fn batch_create_edges( &self, edges: &[(NodeId, NodeId, &str)], ) -> Vec<EdgeId>; fn delete_node(&self, id: NodeId) -> bool; fn delete_node_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool; fn delete_node_edges(&self, node_id: NodeId); fn delete_edge(&self, id: EdgeId) -> bool; fn delete_edge_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool; fn set_node_property(&self, id: NodeId, key: &str, value: Value); fn set_edge_property(&self, id: EdgeId, key: &str, value: Value); fn remove_node_property(&self, id: NodeId, key: &str) -> Option<Value>; fn remove_edge_property(&self, id: EdgeId, key: &str) -> Option<Value>; fn add_label(&self, node_id: NodeId, label: &str) -> bool; fn remove_label(&self, node_id: NodeId, label: &str) -> bool; // Provided methods fn set_node_property_versioned( &self, id: NodeId, key: &str, value: Value, _transaction_id: TransactionId, ) { ... } fn set_edge_property_versioned( &self, id: EdgeId, key: &str, value: Value, _transaction_id: TransactionId, ) { ... } fn remove_node_property_versioned( &self, id: NodeId, key: &str, _transaction_id: TransactionId, ) -> Option<Value> { ... } fn remove_edge_property_versioned( &self, id: EdgeId, key: &str, _transaction_id: TransactionId, ) -> Option<Value> { ... } fn add_label_versioned( &self, node_id: NodeId, label: &str, _transaction_id: TransactionId, ) -> bool { ... } fn remove_label_versioned( &self, node_id: NodeId, label: &str, _transaction_id: TransactionId, ) -> bool { ... } fn create_node_with_props( &self, labels: &[&str], properties: &[(PropertyKey, Value)], ) -> NodeId { ... } fn create_edge_with_props( &self, src: NodeId, dst: NodeId, edge_type: &str, properties: &[(PropertyKey, Value)], ) -> EdgeId { ... }
}
Expand description

Write operations for graph mutation.

Separated from GraphStore so read-only wrappers (snapshots, read replicas) can implement only GraphStore. Any mutable store is also readable via the supertrait bound.

Required Methods§

Source

fn create_node(&self, labels: &[&str]) -> NodeId

Creates a new node with the given labels.

Source

fn create_node_versioned( &self, labels: &[&str], epoch: EpochId, transaction_id: TransactionId, ) -> NodeId

Creates a new node within a transaction context.

Source

fn create_edge(&self, src: NodeId, dst: NodeId, edge_type: &str) -> EdgeId

Creates a new edge between two nodes.

Source

fn create_edge_versioned( &self, src: NodeId, dst: NodeId, edge_type: &str, epoch: EpochId, transaction_id: TransactionId, ) -> EdgeId

Creates a new edge within a transaction context.

Source

fn batch_create_edges(&self, edges: &[(NodeId, NodeId, &str)]) -> Vec<EdgeId>

Creates multiple edges in batch (single lock acquisition).

Source

fn delete_node(&self, id: NodeId) -> bool

Deletes a node. Returns true if the node existed.

Source

fn delete_node_versioned( &self, id: NodeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool

Deletes a node within a transaction context. Returns true if the node existed.

Source

fn delete_node_edges(&self, node_id: NodeId)

Deletes all edges connected to a node (DETACH DELETE).

Source

fn delete_edge(&self, id: EdgeId) -> bool

Deletes an edge. Returns true if the edge existed.

Source

fn delete_edge_versioned( &self, id: EdgeId, epoch: EpochId, transaction_id: TransactionId, ) -> bool

Deletes an edge within a transaction context. Returns true if the edge existed.

Source

fn set_node_property(&self, id: NodeId, key: &str, value: Value)

Sets a property on a node.

Source

fn set_edge_property(&self, id: EdgeId, key: &str, value: Value)

Sets a property on an edge.

Source

fn remove_node_property(&self, id: NodeId, key: &str) -> Option<Value>

Removes a property from a node. Returns the previous value if it existed.

Source

fn remove_edge_property(&self, id: EdgeId, key: &str) -> Option<Value>

Removes a property from an edge. Returns the previous value if it existed.

Source

fn add_label(&self, node_id: NodeId, label: &str) -> bool

Adds a label to a node. Returns true if the label was new.

Source

fn remove_label(&self, node_id: NodeId, label: &str) -> bool

Removes a label from a node. Returns true if the label existed.

Provided Methods§

Source

fn set_node_property_versioned( &self, id: NodeId, key: &str, value: Value, _transaction_id: TransactionId, )

Sets a node property within a transaction, recording the previous value so it can be restored on rollback.

Default delegates to set_node_property.

Source

fn set_edge_property_versioned( &self, id: EdgeId, key: &str, value: Value, _transaction_id: TransactionId, )

Sets an edge property within a transaction, recording the previous value so it can be restored on rollback.

Default delegates to set_edge_property.

Source

fn remove_node_property_versioned( &self, id: NodeId, key: &str, _transaction_id: TransactionId, ) -> Option<Value>

Removes a node property within a transaction, recording the previous value so it can be restored on rollback.

Default delegates to remove_node_property.

Source

fn remove_edge_property_versioned( &self, id: EdgeId, key: &str, _transaction_id: TransactionId, ) -> Option<Value>

Removes an edge property within a transaction, recording the previous value so it can be restored on rollback.

Default delegates to remove_edge_property.

Source

fn add_label_versioned( &self, node_id: NodeId, label: &str, _transaction_id: TransactionId, ) -> bool

Adds a label within a transaction, recording the change for rollback.

Default delegates to add_label.

Source

fn remove_label_versioned( &self, node_id: NodeId, label: &str, _transaction_id: TransactionId, ) -> bool

Removes a label within a transaction, recording the change for rollback.

Default delegates to remove_label.

Source

fn create_node_with_props( &self, labels: &[&str], properties: &[(PropertyKey, Value)], ) -> NodeId

Creates a new node with labels and properties in one call.

The default implementation calls create_node followed by set_node_property for each property. Implementations may override for atomicity or performance.

Source

fn create_edge_with_props( &self, src: NodeId, dst: NodeId, edge_type: &str, properties: &[(PropertyKey, Value)], ) -> EdgeId

Creates a new edge with properties in one call.

The default implementation calls create_edge followed by set_edge_property for each property. Implementations may override for atomicity or performance.

Implementors§