Skip to main content

uqa_engine/capabilities/
graph_lifecycle.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Bind graph command execution to live catalogs and public graph transaction entry points.
8
9use crate::Engine;
10use uqa_execution::query::graph_lifecycle::GraphLifecycle;
11use uqa_graph::{GraphLabelInfo, LabelKind};
12use uqa_storage::StorageBackendResult;
13
14impl GraphLifecycle for Engine {
15    fn has_graph(&self, name: &str) -> StorageBackendResult<bool> {
16        self.has_graph_in_execution(name)
17    }
18    fn has_namespace(&self, name: &str) -> StorageBackendResult<bool> {
19        self.has_namespace_in_execution(name)
20    }
21    fn create_graph(&self, name: String) -> StorageBackendResult<bool> {
22        self.create_graph(name)
23    }
24    fn drop_graph(&self, name: &str) -> StorageBackendResult<bool> {
25        self.drop_graph(name)
26    }
27    fn list_graph_labels(&self, graph: &str) -> StorageBackendResult<Option<Vec<GraphLabelInfo>>> {
28        self.graph_labels_in_execution(graph)
29    }
30    fn create_graph_label(
31        &self,
32        graph: &str,
33        label: &str,
34        kind: LabelKind,
35    ) -> StorageBackendResult<bool> {
36        self.create_graph_label(graph, label, kind)
37    }
38    fn drop_graph_label(&self, graph: &str, label: &str) -> StorageBackendResult<bool> {
39        self.drop_graph_label(graph, label)
40    }
41    fn graph_label_relation_dependents(
42        &self,
43        graph: &str,
44        label: &str,
45    ) -> StorageBackendResult<Vec<String>> {
46        self.graph_label_relation_dependents(graph, label)
47    }
48    fn rename_graph(&self, from: &str, to: &str) -> StorageBackendResult<bool> {
49        self.rename_graph(from, to)
50    }
51}