(tokens: &[Token], position: &mut usize)
| 221 | } |
| 222 | |
| 223 | fn 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 | |
| 240 | fn parse_select_query( |
| 241 | env: &mut Environment, |
no test coverage detected
searching dependent graphs…