MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / graph_delete_edge_impl

Method graph_delete_edge_impl

nodedb-client/src/remote/client/graph.rs:130–147  ·  view source on GitHub ↗
(
        &self,
        collection: &str,
        edge_id: &EdgeId,
    )

Source from the content-addressed store, hash-verified

128 }
129
130 pub(super) async fn graph_delete_edge_impl(
131 &self,
132 collection: &str,
133 edge_id: &EdgeId,
134 ) -> NodeDbResult<()> {
135 // `GRAPH DELETE EDGE IN '<collection>' FROM '<src>' TO '<dst>'
136 // TYPE '<label>'`. The (src, dst, label) tuple identifies a
137 // unique edge in the overlay — `seq` is part of `EdgeId` for
138 // multi-edge disambiguation, but the server DSL keys on the
139 // tuple alone today, so we drop seq here.
140 let coll = quote_string_literal(collection);
141 let src = quote_string_literal(edge_id.src.as_str());
142 let dst = quote_string_literal(edge_id.dst.as_str());
143 let label = quote_string_literal(&edge_id.label);
144 let sql = format!("GRAPH DELETE EDGE IN {coll} FROM {src} TO {dst} TYPE {label}");
145 self.simple_query_raw(&sql).await?;
146 Ok(())
147 }
148
149 pub(super) async fn graph_stats_impl(
150 &self,

Callers 1

graph_delete_edgeMethod · 0.45

Calls 3

quote_string_literalFunction · 0.85
simple_query_rawMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected