Skip to content

Commit 198ca40

Browse files
committed
Code review comments
1 parent 2b043c9 commit 198ca40

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/ast/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7358,6 +7358,8 @@ impl Display for UtilityOption {
73587358
/// statement to filter the results. Example from Snowflake:
73597359
/// https://docs.snowflake.com/en/sql-reference/sql/show-tables
73607360
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
7361+
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7362+
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
73617363
pub struct ShowStatementOptions {
73627364
pub show_in: Option<ShowStatementIn>,
73637365
pub starts_with: Option<Value>,

src/dialect/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ pub trait Dialect: Debug + Any {
607607
false
608608
}
609609

610-
/// Returns true if this dialect support the `LIKE 'pattern'` option in
610+
/// Returns true if this dialect supports the `LIKE 'pattern'` option in
611611
/// a `SHOW` statement before the `IN` option
612612
fn supports_show_like_before_in(&self) -> bool {
613613
false

src/parser/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12382,13 +12382,10 @@ impl<'a> Parser<'a> {
1238212382
(Some(ShowStatementInParentType::Schema), None)
1238312383
}
1238412384
Some(parent_kw) => {
12385-
// The parent name here is still optional, for example:
12386-
// SHOW TABLES IN ACCOUNT, so parsing the object name
12385+
// The parent name here is still optional, for example:
12386+
// SHOW TABLES IN ACCOUNT, so parsing the object name
1238712387
// may fail because the statement ends.
12388-
let parent_name = match self.parse_object_name(false) {
12389-
Ok(n) => Some(n),
12390-
_ => None,
12391-
};
12388+
let parent_name = self.maybe_parse(|p| p.parse_object_name(false))?;
1239212389
match parent_kw {
1239312390
Keyword::ACCOUNT => (Some(ShowStatementInParentType::Account), parent_name),
1239412391
Keyword::DATABASE => (Some(ShowStatementInParentType::Database), parent_name),

0 commit comments

Comments
 (0)