@@ -5278,11 +5278,13 @@ impl<'a> Parser<'a> {
52785278 self.parse_create_secret(or_replace, temporary, persistent)
52795279 } else if self.parse_keyword(Keyword::USER) {
52805280 self.parse_create_user(or_replace).map(Into::into)
5281+ } else if self.parse_keyword(Keyword::SCHEMA) {
5282+ self.parse_create_schema(or_replace)
52815283 } else if self.parse_keyword(Keyword::WAREHOUSE) {
52825284 self.parse_create_warehouse(or_replace).map(Into::into)
52835285 } else if or_replace {
52845286 self.expected_ref(
5285- "[EXTERNAL] TABLE or [MATERIALIZED] VIEW or FUNCTION or WAREHOUSE after CREATE OR REPLACE",
5287+ "[EXTERNAL] TABLE or [MATERIALIZED] VIEW or FUNCTION or SCHEMA or WAREHOUSE after CREATE OR REPLACE",
52865288 self.peek_token_ref(),
52875289 )
52885290 } else if self.parse_keyword(Keyword::EXTENSION) {
@@ -5293,8 +5295,6 @@ impl<'a> Parser<'a> {
52935295 self.parse_create_index(true).map(Into::into)
52945296 } else if self.parse_keyword(Keyword::VIRTUAL) {
52955297 self.parse_create_virtual_table()
5296- } else if self.parse_keyword(Keyword::SCHEMA) {
5297- self.parse_create_schema()
52985298 } else if self.parse_keyword(Keyword::DATABASE) {
52995299 self.parse_create_database()
53005300 } else if self.parse_keyword(Keyword::ROLE) {
@@ -5624,7 +5624,7 @@ impl<'a> Parser<'a> {
56245624 }
56255625
56265626 /// Parse a `CREATE SCHEMA` statement.
5627- pub fn parse_create_schema(&mut self) -> Result<Statement, ParserError> {
5627+ pub fn parse_create_schema(&mut self, or_replace: bool ) -> Result<Statement, ParserError> {
56285628 let if_not_exists = self.parse_keywords(&[Keyword::IF, Keyword::NOT, Keyword::EXISTS]);
56295629
56305630 let schema_name = self.parse_schema_name()?;
@@ -5655,6 +5655,7 @@ impl<'a> Parser<'a> {
56555655
56565656 Ok(Statement::CreateSchema {
56575657 schema_name,
5658+ or_replace,
56585659 if_not_exists,
56595660 with,
56605661 options,
0 commit comments