DROP TOPIC
(
state: &SharedState,
_identity: &AuthenticatedIdentity,
parts: &[&str],
)
| 42 | |
| 43 | /// DROP TOPIC <name> |
| 44 | pub 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 |
| 62 | pub fn show_topics(state: &SharedState) -> PgWireResult<Vec<Response>> { |
nothing calls this directly
no test coverage detected