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

Allow adding autoincrement column via "ALTER VSCHEMA..." statement #5094

Merged

Conversation

kalfonso
Copy link
Contributor

Signed-off-by: Karel Alfonso Sague kalfonso@squareup.com

@kalfonso kalfonso requested a review from sougou as a code owner August 14, 2019 07:25
Signed-off-by: Karel Alfonso Sague <kalfonso@squareup.com>
@kalfonso kalfonso force-pushed the kalfonso.190814-alter-vschema-add-autoinc branch from 10dbb6b to c031bd6 Compare August 14, 2019 10:19
@@ -981,6 +981,8 @@ var (
input: "alter vschema add table a",
}, {
input: "alter vschema add sequence a_seq",
}, {
input: "alter vschema on a add auto_increment id using a_seq",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this syntax!

@@ -1357,6 +1357,17 @@ alter_statement:
{
$$ = &DDL{Action: AddSequenceStr, Table: $5}
}
| ALTER VSCHEMA ON table_name ADD AUTO_INCREMENT sql_id USING table_name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does “table_name” support keyspace prefix? Generally the sequence is in a different keyspace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it accepts a qualifier which would be the keyspace in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants