Skip to content

Commit 4d5661c

Browse files
committed
Code review comments
1 parent b2ceea9 commit 4d5661c

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
@@ -623,7 +623,7 @@ pub trait Dialect: Debug + Any {
623623
true
624624
}
625625

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

src/parser/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12456,13 +12456,10 @@ impl<'a> Parser<'a> {
1245612456
(Some(ShowStatementInParentType::Schema), None)
1245712457
}
1245812458
Some(parent_kw) => {
12459-
// The parent name here is still optional, for example:
12460-
// SHOW TABLES IN ACCOUNT, so parsing the object name
12459+
// The parent name here is still optional, for example:
12460+
// SHOW TABLES IN ACCOUNT, so parsing the object name
1246112461
// may fail because the statement ends.
12462-
let parent_name = match self.parse_object_name(false) {
12463-
Ok(n) => Some(n),
12464-
_ => None,
12465-
};
12462+
let parent_name = self.maybe_parse(|p| p.parse_object_name(false))?;
1246612463
match parent_kw {
1246712464
Keyword::ACCOUNT => (Some(ShowStatementInParentType::Account), parent_name),
1246812465
Keyword::DATABASE => (Some(ShowStatementInParentType::Database), parent_name),

0 commit comments

Comments
 (0)