Skip to content
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

EXISTS clause in create / drop table? #27

Open
stevegoobermanhill opened this issue Nov 13, 2019 · 3 comments
Open

EXISTS clause in create / drop table? #27

stevegoobermanhill opened this issue Nov 13, 2019 · 3 comments

Comments

@stevegoobermanhill
Copy link

Great parser - thanks for all the effort.

It doesn't look like EXISTS clauses in table creation and deletion are supported right now. Such as

DROP TABLE IF EXISTS foo;
CREATE TABLE foo (...);

Is this correct. If so, are there any plans to support this functionality (the example on the homepage throws an error if an EXISTS clause is used in this context).

Thanks,
Steve

@JakeWheat
Copy link
Owner

Hi Steve,

The system doesn't support this syntax, and there are no plans to support it on my side, but a patch would be welcome!

@stevegoobermanhill
Copy link
Author

stevegoobermanhill commented Nov 18, 2019 via email

@JakeWheat
Copy link
Owner

I have a tutorial on implementing SQL parsing in Haskell!
http://jakewheat.github.io/intro_to_parsing/

Is there a way of getting the parser (parseStatements) to ignore unsupported statements

This is an interesting idea I didn't consider before. I will have a think about it. Maybe you can get a long way with splitting your SQL source on ';' characters then parsing each string separately?

There is a fork of parsec called megaparsec which supports this sort of thing more explicitly in the parser (I understand there is also a more proper way of doing it, in the uu-parsinglib library).

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

No branches or pull requests

2 participants