Skip to content

Accept CREATE OR REPLACE SCHEMA - #2396

Merged
iffyio merged 2 commits into
apache:mainfrom
localstack:pr/04-create-or-replace-schema
Jul 27, 2026
Merged

Accept CREATE OR REPLACE SCHEMA#2396
iffyio merged 2 commits into
apache:mainfrom
localstack:pr/04-create-or-replace-schema

Conversation

@sabir-akhadov-localstack

@sabir-akhadov-localstack sabir-akhadov-localstack commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

CREATE OR REPLACE SCHEMA did not parse. CREATE SCHEMA was handled after the OR REPLACE allowlist bail-out in parse_create, so any OR REPLACE in front of it produced an error:

CREATE OR REPLACE SCHEMA foo
CREATE OR REPLACE SCHEMA IF NOT EXISTS foo

This routes the SCHEMA keyword ahead of that bail-out and adds an or_replace: bool field to Statement::CreateSchema. Display round-trips OR REPLACE.

@sabir-akhadov-localstack
sabir-akhadov-localstack force-pushed the pr/04-create-or-replace-schema branch from d5e66f5 to 782f668 Compare July 2, 2026 13:17
Add an `or_replace: bool` field to `Statement::CreateSchema` and route the
SCHEMA keyword ahead of the `or_replace` allowlist bail-out in
`Parser::parse_create` so that `CREATE OR REPLACE SCHEMA [IF NOT EXISTS] foo`
parses successfully. Display round-trips OR REPLACE.
@sabir-akhadov-localstack
sabir-akhadov-localstack force-pushed the pr/04-create-or-replace-schema branch from 782f668 to a772d1d Compare July 2, 2026 13:19
@sabir-akhadov-localstack
sabir-akhadov-localstack marked this pull request as ready for review July 2, 2026 13:20
@c2main

c2main commented Jul 9, 2026

Copy link
Copy Markdown

Just wondering: what dialect does support CREATE OR REPLACE SCHEMA ?

@sabir-akhadov-localstack

Copy link
Copy Markdown
Contributor Author

Just wondering: what dialect does support CREATE OR REPLACE SCHEMA ?

Snowflake

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@iffyio iffyio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iffyio
iffyio added this pull request to the merge queue Jul 27, 2026
Merged via the queue into apache:main with commit 6f8a716 Jul 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants