mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-10 14:02:14 +00:00
Add suppport for Show Objects statement for the Snowflake parser (#1702)
Co-authored-by: Denys Tsomenko <denys.tsomenko@caspiandb.com> Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
parent
443f492b4b
commit
0b8ba91156
6 changed files with 97 additions and 2 deletions
|
@ -3010,6 +3010,12 @@ pub enum Statement {
|
|||
show_options: ShowStatementOptions,
|
||||
},
|
||||
/// ```sql
|
||||
/// SHOW OBJECTS LIKE 'line%' IN mydb.public
|
||||
/// ```
|
||||
/// Snowflake-specific statement
|
||||
/// <https://docs.snowflake.com/en/sql-reference/sql/show-objects>
|
||||
ShowObjects(ShowObjects),
|
||||
/// ```sql
|
||||
/// SHOW TABLES
|
||||
/// ```
|
||||
ShowTables {
|
||||
|
@ -4703,6 +4709,17 @@ impl fmt::Display for Statement {
|
|||
)?;
|
||||
Ok(())
|
||||
}
|
||||
Statement::ShowObjects(ShowObjects {
|
||||
terse,
|
||||
show_options,
|
||||
}) => {
|
||||
write!(
|
||||
f,
|
||||
"SHOW {terse}OBJECTS{show_options}",
|
||||
terse = if *terse { "TERSE " } else { "" },
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
Statement::ShowTables {
|
||||
terse,
|
||||
history,
|
||||
|
@ -8343,6 +8360,14 @@ impl fmt::Display for ShowStatementIn {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
|
||||
pub struct ShowObjects {
|
||||
pub terse: bool,
|
||||
pub show_options: ShowStatementOptions,
|
||||
}
|
||||
|
||||
/// MSSQL's json null clause
|
||||
///
|
||||
/// ```plaintext
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue