Add SECURE keyword for views in Snowflake (#2004)

This commit is contained in:
Denys Tsomenko 2025-08-26 22:20:13 +03:00 committed by GitHub
parent 779dcf91f6
commit cffff30961
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 3 deletions

View file

@ -3256,6 +3256,9 @@ pub enum Statement {
or_alter: bool,
or_replace: bool,
materialized: bool,
/// Snowflake: SECURE view modifier
/// <https://docs.snowflake.com/en/sql-reference/sql/create-view#syntax>
secure: bool,
/// View name
name: ObjectName,
/// If `if_not_exists` is true, this flag is set to true if the view name comes before the `IF NOT EXISTS` clause.
@ -5118,6 +5121,7 @@ impl fmt::Display for Statement {
columns,
query,
materialized,
secure,
options,
cluster_by,
comment,
@ -5139,7 +5143,7 @@ impl fmt::Display for Statement {
}
write!(
f,
"{materialized}{temporary}VIEW {if_not_and_name}{to}",
"{secure}{materialized}{temporary}VIEW {if_not_and_name}{to}",
if_not_and_name = if *if_not_exists {
if *name_before_not_exists {
format!("{name} IF NOT EXISTS")
@ -5149,6 +5153,7 @@ impl fmt::Display for Statement {
} else {
format!("{name}")
},
secure = if *secure { "SECURE " } else { "" },
materialized = if *materialized { "MATERIALIZED " } else { "" },
temporary = if *temporary { "TEMPORARY " } else { "" },
to = to

View file

@ -395,6 +395,7 @@ impl Spanned for Statement {
or_alter: _,
or_replace: _,
materialized: _,
secure: _,
name,
columns,
query,