Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CHECK with IN clause does not parse #121

Copy link
Copy link
@tomc-goodrx

Description

@tomc-goodrx
Issue body actions

Using the IN keyword in a CHECK causes parsing to fail. For example:

`col_name` varchar(5) CHECK( `col_name` = 'year' OR `col_name` = 'month' ),

Works but with an IN statement doesn't:

`col_name` varchar(5) CHECK( `col_name` IN ('year', 'month') ),

With silent=False we get an error like:

  File ".../lib/python3.9/site-packages/simple_ddl_parser/ddl_parser.py", line 199, in p_error
    raise DDLParserError(f"Unknown statement at {p}")
simple_ddl_parser.ddl_parser.DDLParserError: Unknown statement at LexToken(STRING,"'year'",1,544)

Using OR statements becomes unwieldy when there are more than a handful of options in the enum so it would be nice to support this. Thanks.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.