Skip to content

added create and drop schema #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2020
Merged

Conversation

alex-dukhno
Copy link
Contributor

This PR adds functionality to parse CREATE SCHEMA schema_name and DROP SCHEMA schema_name

Copy link
Contributor

@nickolay nickolay left a comment

Choose a reason for hiding this comment

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

Thanks!

Both SQL:2016 and Posgres have a number of options for the CREATE SCHEMA statement. They also support including other CREATE statements as part of the schema definition, rather than separate statements. This PR supports neither (which is fine, but I wanted to mention it).

} else {
self.expected("TABLE, VIEW or INDEX after CREATE", self.peek_token())
self.expected(
"TABLE, VIEW, INDEX or SCHEMA after CREATE",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think with the next addition it makes sense to change the message, so that it doesn't duplicate the list above (as it's incorrect already, missing "EXTERNAL").

@nickolay nickolay merged commit c918ff0 into apache:master May 28, 2020
@alex-dukhno alex-dukhno deleted the create-schema branch May 28, 2020 18:08
@alex-dukhno
Copy link
Contributor Author

alex-dukhno commented May 29, 2020

Both SQL:2016 and Posgres have a number of options for the CREATE SCHEMA statement. They also support including other CREATE statements as part of the schema definition, rather than separate statements.

I think it will be gradually added. From my side, I am contributing to parser those parts that I need to right now to develop Postgres compatible database 😄 So whenever I need support of including other statements I will come back to this repo 😃

@nickolay
Copy link
Contributor

Yep, I agree that implementing bits and pieces as you need them makes the most sense. Thanks for sharing them!

I'm just making a note of the the relevant docs and the bits that I think are helpful for maintaining and maybe re-using the parser.

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.

2 participants