Skip to content

EXISTS clause in create / drop table? #27

Open

Description

@stevegoobermanhill

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

Activity

  1. JakeWheat commented on Nov 16, 2019

    @JakeWheat
    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!

  2. stevegoobermanhill commented on Nov 18, 2019

    @stevegoobermanhill
    Author
  3. JakeWheat commented on Nov 18, 2019

    @JakeWheat
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions