Extract ASTNode::SQLSelect to a separate struct (1/5)

This will allow re-using it for SQLStatement in a later commit.

(Also split the new struct into a separate file, other query-related
types will be moved here in a follow-up commit.)
This commit is contained in:
Nickolay Ponomarev 2019-01-21 02:28:39 +03:00
parent 50b5724c39
commit d8173d4196
5 changed files with 97 additions and 96 deletions

View file

@ -11,7 +11,7 @@ fn parse_simple_select() {
let sql = String::from("SELECT id, fname, lname FROM customer WHERE id = 1");
let ast = parse_sql(&sql);
match ast {
ASTNode::SQLSelect { projection, .. } => {
ASTNode::SQLSelect(SQLSelect { projection, .. }) => {
assert_eq!(3, projection.len());
}
_ => assert!(false),