Skip to content

Parsing of INDEX or UNIQUE KEY within CREATE TABLE statements #253

@hubg398

Description

@hubg398

Is your feature request related to a problem? Please describe.
It fails parsing INDEX and UNIQUE KEY of columns, within CREATE TABLE .... statements. Which should be valid, at least for MySQL

Sample SQL:

CREATE TABLE `posts`(
    `integer_column__unique` INT NOT NULL AUTO_INCREMENT UNIQUE,   
    `integer_column__unique_key` INT NOT NULL AUTO_INCREMENT UNIQUE KEY,               
    `integer_column__index` INT NOT NULL AUTO_INCREMENT INDEX
);
  • 'integer_column__unique' with UNIQUE - ✅ This parses
  • 'integer_column__unique_key' with UNIQUE KEY - ❌ This parses, but doesnt identify the column as unique. It incorrectly identifies the column as primary key instead
  • 'integer_column__index' with INDEX - ❌ This fails to parses, gives no output (empty list)

Thanks btw for the work on this parser, works a charm in a lot of cases.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions