Rename SQLStatement::SQLSelect to SQLQuery

The name was confusing:
SQLStatement::SQLSelect(
  SQLQuery {
    body: SQLSetExpr::Select(SQLSelect)
  }
)

Fix the `large_enum_variant` clippy lint for `SQLStatement::SQLQuery`
`SQLStatement::SQLCreateView`, and `SQLSetExpr::Select`, while we're
changing the AST anyway
https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
This commit is contained in:
Nickolay Ponomarev 2019-04-21 02:40:02 +03:00
parent 08bbce8992
commit 50a2310173
5 changed files with 21 additions and 18 deletions

View file

@ -1003,8 +1003,8 @@ fn only<T>(v: &[T]) -> &T {
fn verified_query(query: &str) -> SQLQuery {
match verified_stmt(query) {
SQLStatement::SQLSelect(select) => select,
_ => panic!("Expected SELECT"),
SQLStatement::SQLQuery(query) => *query,
_ => panic!("Expected SQLQuery"),
}
}
@ -1017,7 +1017,7 @@ fn expr_from_projection(item: &SQLSelectItem) -> &ASTNode {
fn verified_only_select(query: &str) -> SQLSelect {
match verified_query(query).body {
SQLSetExpr::Select(s) => s,
SQLSetExpr::Select(s) => *s,
_ => panic!("Expected SQLSetExpr::Select"),
}
}