MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / parse_show_query

Function parse_show_query

crates/gitql-parser/src/parser.rs:223–238  ·  view source on GitHub ↗
(tokens: &[Token], position: &mut usize)

Source from the content-addressed store, hash-verified

221}
222
223fn parse_show_query(tokens: &[Token], position: &mut usize) -> Result<Query, Box<Diagnostic>> {
224 // Consume SHOW keyword
225 *position += 1;
226
227 if *position >= tokens.len() || tokens[*position].to_string() != "tables" {
228 return Err(
229 Diagnostic::error("Show can not be followed by names other than tables")
230 .add_help("A correct statement will be `SHOW TABLES`")
231 .with_location(calculate_safe_location(tokens, *position - 1))
232 .as_boxed(),
233 );
234 }
235
236 *position += 1;
237 Ok(Query::ShowTables)
238}
239
240fn parse_select_query(
241 env: &mut Environment,

Callers 1

parse_gqlFunction · 0.85

Calls 5

calculate_safe_locationFunction · 0.85
as_boxedMethod · 0.80
with_locationMethod · 0.80
add_helpMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…