-
Notifications
You must be signed in to change notification settings - Fork 5
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
Persist unique constraint setting in catalog #754
Conversation
|
||
// Creating an unique index on a single field automatically makes the field | ||
// unique. Do nothing for multiple-filed index creation because we do not | ||
// support unique constraints for composite keys at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should an error be given in the composite keys case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we do support composite key indexes.
ASSERT_TRUE(gaia_table_t::list() | ||
.where(gaia_table_expr::name == "t") | ||
.begin() | ||
->gaia_fields() | ||
.where(gaia_field_expr::name == "c") | ||
.begin() | ||
->unique()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting usage of the filter API!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added a new unique setting for the
field
table in catalog. Set the field as unique in catalog when creating tables or when creating an unique index on the field.