iffyio commented on code in PR #1616:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1616#discussion_r1898902087
##########
src/ast/mod.rs:
##########
@@ -3401,6 +3401,13 @@ pub enum Statement {
partitioned: Option<Vec<Expr>>,
table_format: Option<HiveLoadDataFormat>,
},
+ /// ```sql
+ /// Rename TABLE tbl_name TO new_tbl_name[, tbl_name2 TO new_tbl_name2] ...
+ /// ```
+ /// Renames one or more tables
+ ///
+ /// See Mysql <https://dev.mysql.com/doc/refman/9.1/en/rename-table.html>
+ RenameTable(Vec<RenameObjectDef>),
Review Comment:
```suggestion
RenameTable(Vec<RenameTable>),
```
Could we call `RenameTable`? that would match the variant name, and the
object def terminology I think would become too specific or no longer
descriptive if other fields are added to the struct
##########
src/dialect/mod.rs:
##########
@@ -715,6 +715,11 @@ pub trait Dialect: Debug + Any {
true
}
+ // Returns true if the dialect supports the `RENAME TABLE` statement
+ fn supports_rename_table(&self) -> bool {
+ false
+ }
Review Comment:
Ah so its not only a matter of whether the dialect supports the syntax in
this case, I also meant that in order to avoid introducing the
`supports_rename_table` flag, we can allow the parser always accept the `RENAME
TABLE` syntax. Yes it will indeed mean that all dialects accept the syntax but
that is fine given that it does not conflict with any other syntax the dialect
supports
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]