mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-11-25 08:21:19 +00:00
Support basic CREATE VIEW
This commit is contained in:
parent
346d1ff2e4
commit
0c0cbcaff4
4 changed files with 100 additions and 59 deletions
|
|
@ -700,6 +700,18 @@ fn parse_scalar_subqueries() {
|
|||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_view() {
|
||||
let sql = "CREATE VIEW myschema.myview AS SELECT foo FROM bar";
|
||||
match verified_stmt(sql) {
|
||||
SQLStatement::SQLCreateView { name, query } => {
|
||||
assert_eq!("myschema.myview", name.to_string());
|
||||
assert_eq!("SELECT foo FROM bar", query.to_string());
|
||||
}
|
||||
_ => assert!(false),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_invalid_subquery_without_parens() {
|
||||
let res = parse_sql_statements("SELECT SELECT 1 FROM bar WHERE 1=1 FROM baz");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue