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

Add possibility of adding an INDEX (or KEY) as a "constraint" to DDL statements #7348

Closed
lukaseder opened this issue Mar 26, 2018 · 0 comments

Comments

@lukaseder
Copy link
Member

lukaseder commented Mar 26, 2018

MySQL allows for treating indexes as constraints, syntactically, in DDL statements. From the manual:

create_definition:
    col_name column_definition
  | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)
      [index_option] ...
  | {INDEX|KEY} [index_name] [index_type] (index_col_name,...) -- This clause here
      [index_option] ...
  | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]
      [index_name] [index_type] (index_col_name,...)
      [index_option] ...
  | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)
      [index_option] ...
  | [CONSTRAINT [symbol]] FOREIGN KEY
      [index_name] (index_col_name,...) reference_definition
  | CHECK (expr)

It would be great to support this in the jOOQ API and in the parser (see #7347) and emulate it in other databases using an anonymous block.


See:

@lukaseder lukaseder added this to the Version 3.11.0 milestone Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant