Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/sqlquack-syntax/src/parser/_helpers/ddl/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ impl Parser {
/// Parse a Snowflake DROP of `kind`, already consumed: the name and the options that kind takes.
fn parse_drop_snowflake_object(&mut self, kind: String) -> Result<Expression> {
let if_exists = self.match_keywords(&[TokenType::If, TokenType::Exists]);
let name = self.parse_table_ref()?;
let name = self.parse_object_name()?;
let (cascade, restrict, force) = match kind.as_str() {
"APPLICATION" | "OPENFLOW RUNTIME" => {
(self.match_token(TokenType::Cascade), false, false)
Expand Down Expand Up @@ -1587,7 +1587,7 @@ impl Parser {
TokenType::View => self.parse_alter_view_with_modifiers(None, None, None),
TokenType::Index => self.parse_alter_index(),
TokenType::Sequence => self.parse_alter_sequence(),
_ if self.check_identifier("SESSION") => {
_ if self.check_identifier("SESSION") && !self.check_next_identifier("POLICY") => {
self.skip();
match self.parse_alter_session()? {
Some(expr) => Ok(expr),
Expand Down
1 change: 1 addition & 0 deletions crates/sqlquack-syntax/src/parser/_helpers/ddl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub(crate) mod create_table_forms;
pub(crate) mod explain;
pub(crate) mod scripting;
pub(crate) mod snowflake_alter;
pub(crate) mod snowflake_alter_account;
pub(crate) mod snowflake_alter_objects;
pub(crate) mod snowflake_alter_resources;
pub(crate) mod table_options;
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ impl Parser {
if self.match_token(TokenType::Function) || self.match_identifier("FUNCTION") {
return self.parse_alter_function().map(Some);
}
if let Some(alter) = self.parse_alter_snowflake_group()? {
return Ok(Some(alter));
}
if let Some(alter) = self.parse_alter_snowflake_resource()? {
return Ok(Some(alter));
}
Expand Down
Loading