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

Function parse_show_command

nodedb/src/control/server/pgwire/session/params.rs:201–215  ·  view source on GitHub ↗

Parse a SHOW command: `SHOW ` or `SHOW ALL`. Returns the parameter name, or "all" for SHOW ALL.

(sql: &str)

Source from the content-addressed store, hash-verified

199///
200/// Returns the parameter name, or "all" for SHOW ALL.
201pub fn parse_show_command(sql: &str) -> Option<String> {
202 let trimmed = sql.trim();
203 let upper = trimmed.to_uppercase();
204
205 if !upper.starts_with("SHOW ") {
206 return None;
207 }
208
209 let param = trimmed[5..].trim().to_lowercase();
210 if param.is_empty() {
211 return None;
212 }
213
214 Some(param)
215}
216
217#[cfg(test)]
218mod tests {

Callers 1

handle_showMethod · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected