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

Function drop_topic

nodedb/src/control/server/pgwire/ddl/pubsub.rs:44–59  ·  view source on GitHub ↗

DROP TOPIC

(
    state: &SharedState,
    _identity: &AuthenticatedIdentity,
    parts: &[&str],
)

Source from the content-addressed store, hash-verified

42
43/// DROP TOPIC <name>
44pub fn drop_topic(
45 state: &SharedState,
46 _identity: &AuthenticatedIdentity,
47 parts: &[&str],
48) -> PgWireResult<Vec<Response>> {
49 let name = parts
50 .get(2)
51 .filter(|s| !s.is_empty())
52 .ok_or_else(|| sqlstate_error("42601", "DROP TOPIC requires a name"))?
53 .to_lowercase();
54 state
55 .topic_registry
56 .drop_topic(&name)
57 .map_err(|e| sqlstate_error("42P01", &e.to_string()))?;
58 Ok(vec![Response::Execution(Tag::new("DROP TOPIC"))])
59}
60
61/// SHOW TOPICS
62pub fn show_topics(state: &SharedState) -> PgWireResult<Vec<Response>> {

Callers

nothing calls this directly

Calls 5

drop_topicMethod · 0.80
to_stringMethod · 0.80
sqlstate_errorFunction · 0.70
getMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected