mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Add SECURE keyword for views in Snowflake (#2004)
This commit is contained in:
parent
779dcf91f6
commit
cffff30961
6 changed files with 49 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -395,6 +395,7 @@ impl Spanned for Statement {
|
|||
or_alter: _,
|
||||
or_replace: _,
|
||||
materialized: _,
|
||||
secure: _,
|
||||
name,
|
||||
columns,
|
||||
query,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue