-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
sqlc: additional ALTER support #5705
Labels
Component: Query Serving
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
Comments
This was referenced Jan 13, 2020
jmhodges
added a commit
to jmhodges/vitess
that referenced
this issue
Jan 29, 2020
This is a significant, but not complete expansion of the ALTER support in sqlparser. It adds support for these ALTER commands: * `ADD COLUMN` * `DROP COLUMN` * `ADD INDEX` * `DROP INDEX` * `DROP FOREIGN KEY` * `DROP PRIMARY KEY` * `ADD PARTITION` * `DROP PARTITION` * `ADD CHECK` (as a no-op; it's parsed but never executed by mysql servers) The main addition with this API is an additional field on `DDL` that is a slice of newly created `AlterSpecs`. An `AlterSpec` represents one of the commands that can occur in the same `ALTER` statement with other commands. This differentiates them from the `ALTER` statement parse states already in `sql.y` which are concerned with `ALTER` commands that must be the sole commands in the statement. The `ADD PARTITION` and `DROP PARTITION` states are the exception and are new singleton commands that `sql.y` now supports. This patch also includes some incidental updates to `go.mod` because of tooling issues (described in vitessio#5755) and are duplicated in vitessio#5766 Updates vitessio#5705 Signed-off-by: Jeff Hodges <jeff@somethingsimilar.com>
harshit-gangal
added
Component: Parser
Component: Query Serving
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
labels
Nov 2, 2020
harshit-gangal
changed the title
additional ALTER support
sqlc: additional ALTER support
Nov 2, 2020
Support for this was added in #7199. If anything is missing and still needs to be added, kindly reopen. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Query Serving
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
Feature Description
ALTER statements involving ADD, DROP, RENAME, and SET are currently parsed by sqlparser only enough to extract the table they involved. It's desirable for those ALTER statements to add information to the returned
sqlparser.DDL
about what columns or settings they're modifying.Use Case(s)
sqlparser is being used by sqlc, a SQL to Go code generator, and needs this information to correctly generate code from database migrations and other code using ALTER statements.
The text was updated successfully, but these errors were encountered: