redshift: add support for CREATE VIEW … WITH NO SCHEMA BINDING (#979)

This commit is contained in:
Lukasz Stefaniak 2023-10-02 19:42:01 +02:00 committed by GitHub
parent 40e2ecbdf3
commit c811e22605
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 2 deletions

View file

@ -2974,6 +2974,15 @@ impl<'a> Parser<'a> {
self.expect_keyword(Keyword::AS)?;
let query = Box::new(self.parse_query()?);
// Optional `WITH [ CASCADED | LOCAL ] CHECK OPTION` is widely supported here.
let with_no_schema_binding = dialect_of!(self is RedshiftSqlDialect | GenericDialect)
&& self.parse_keywords(&[
Keyword::WITH,
Keyword::NO,
Keyword::SCHEMA,
Keyword::BINDING,
]);
Ok(Statement::CreateView {
name,
columns,
@ -2982,6 +2991,7 @@ impl<'a> Parser<'a> {
or_replace,
with_options,
cluster_by,
with_no_schema_binding,
})
}