mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-05 06:48:03 +00:00
merge CreateExternalTable & CreateTable.
This commit is contained in:
parent
35556593f5
commit
d8f824c400
4 changed files with 63 additions and 82 deletions
|
@ -163,7 +163,13 @@ fn parse_create_table_with_defaults() {
|
|||
active integer NOT NULL)",
|
||||
);
|
||||
match one_statement_parses_to(&sql, "") {
|
||||
SQLStatement::SQLCreateTable { name, columns } => {
|
||||
SQLStatement::SQLCreateTable {
|
||||
name,
|
||||
columns,
|
||||
external: _,
|
||||
file_format: _,
|
||||
location: _,
|
||||
} => {
|
||||
assert_eq!("public.customer", name.to_string());
|
||||
assert_eq!(10, columns.len());
|
||||
|
||||
|
@ -204,7 +210,13 @@ fn parse_create_table_from_pg_dump() {
|
|||
active integer
|
||||
)");
|
||||
match one_statement_parses_to(&sql, "") {
|
||||
SQLStatement::SQLCreateTable { name, columns } => {
|
||||
SQLStatement::SQLCreateTable {
|
||||
name,
|
||||
columns,
|
||||
external: _,
|
||||
file_format: _,
|
||||
location: _,
|
||||
} => {
|
||||
assert_eq!("public.customer", name.to_string());
|
||||
|
||||
let c_customer_id = &columns[0];
|
||||
|
@ -261,7 +273,13 @@ fn parse_create_table_with_inherit() {
|
|||
)",
|
||||
);
|
||||
match verified_stmt(&sql) {
|
||||
SQLStatement::SQLCreateTable { name, columns } => {
|
||||
SQLStatement::SQLCreateTable {
|
||||
name,
|
||||
columns,
|
||||
external: _,
|
||||
file_format: _,
|
||||
location: _,
|
||||
} => {
|
||||
assert_eq!("bazaar.settings", name.to_string());
|
||||
|
||||
let c_name = &columns[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue