pub struct GraphDB { /* private fields */ }
Expand description
Main GraphDB instance
Implementations§
Source§impl GraphDB
impl GraphDB
Sourcepub async fn new(path: &str) -> Result<Self, GraphError>
pub async fn new(path: &str) -> Result<Self, GraphError>
Create a new GraphDB instance
Sourcepub async fn create_node(
&self,
id: Option<String>,
labels: Vec<String>,
properties: BTreeMap<String, PropertyValue>,
) -> Result<String, GraphError>
pub async fn create_node( &self, id: Option<String>, labels: Vec<String>, properties: BTreeMap<String, PropertyValue>, ) -> Result<String, GraphError>
Create a new node
Sourcepub async fn get_node(&self, node_id: &str) -> Result<Option<Node>, GraphError>
pub async fn get_node(&self, node_id: &str) -> Result<Option<Node>, GraphError>
Get a node by ID
Sourcepub async fn update_node(
&self,
node_id: &str,
properties: BTreeMap<String, PropertyValue>,
) -> Result<(), GraphError>
pub async fn update_node( &self, node_id: &str, properties: BTreeMap<String, PropertyValue>, ) -> Result<(), GraphError>
Update a node
Sourcepub async fn delete_node(&self, node_id: &str) -> Result<(), GraphError>
pub async fn delete_node(&self, node_id: &str) -> Result<(), GraphError>
Delete a node
Sourcepub async fn create_edge(
&self,
id: Option<String>,
from_node: &str,
to_node: &str,
label: String,
properties: BTreeMap<String, PropertyValue>,
) -> Result<String, GraphError>
pub async fn create_edge( &self, id: Option<String>, from_node: &str, to_node: &str, label: String, properties: BTreeMap<String, PropertyValue>, ) -> Result<String, GraphError>
Create an edge
Sourcepub async fn get_edge(&self, edge_id: &str) -> Result<Option<Edge>, GraphError>
pub async fn get_edge(&self, edge_id: &str) -> Result<Option<Edge>, GraphError>
Get an edge by ID
Sourcepub async fn get_edges_from_node(
&self,
node_id: &str,
label: Option<&str>,
) -> Result<Vec<Edge>, GraphError>
pub async fn get_edges_from_node( &self, node_id: &str, label: Option<&str>, ) -> Result<Vec<Edge>, GraphError>
Get edges from a node
Sourcepub async fn get_edges_to_node(
&self,
node_id: &str,
label: Option<&str>,
) -> Result<Vec<Edge>, GraphError>
pub async fn get_edges_to_node( &self, node_id: &str, label: Option<&str>, ) -> Result<Vec<Edge>, GraphError>
Get edges to a node
Sourcepub async fn execute_query(
&self,
query: GraphQuery,
) -> Result<QueryResult, GraphError>
pub async fn execute_query( &self, query: GraphQuery, ) -> Result<QueryResult, GraphError>
Execute a graph query
Sourcepub async fn begin_transaction(&self) -> GraphTransaction<'_>
pub async fn begin_transaction(&self) -> GraphTransaction<'_>
Start a transaction
Sourcepub async fn scan_nodes(&self) -> Result<Vec<Node>, GraphError>
pub async fn scan_nodes(&self) -> Result<Vec<Node>, GraphError>
Scan all nodes
Sourcepub async fn scan_edges(&self) -> Result<Vec<Edge>, GraphError>
pub async fn scan_edges(&self) -> Result<Vec<Edge>, GraphError>
Scan all edges
Sourcepub async fn get_statistics(&self) -> Result<GraphStatistics, GraphError>
pub async fn get_statistics(&self) -> Result<GraphStatistics, GraphError>
Get database statistics
Auto Trait Implementations§
impl Freeze for GraphDB
impl !RefUnwindSafe for GraphDB
impl Send for GraphDB
impl Sync for GraphDB
impl Unpin for GraphDB
impl !UnwindSafe for GraphDB
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more