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

Improve database ddl plan #7034

Merged
merged 4 commits into from
Nov 19, 2020
Merged

Conversation

harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Nov 13, 2020

Closes: #7035

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal changed the title Improve database ddl Improve database ddl plan Nov 13, 2020
@harshit-gangal harshit-gangal marked this pull request as ready for review November 13, 2020 15:22
@harshit-gangal harshit-gangal added this to the v9.0 milestone Nov 13, 2020
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@@ -353,6 +357,35 @@ func createInstructionFor(query string, stmt sqlparser.Statement, vschema Contex
return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "BUG: unexpected statement type: %T", stmt)
}

func buildDBDDLPlan(stmt sqlparser.Statement, vschema ContextVSchema) (engine.Primitive, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

stmt could be typed to *sqlparser.DBDDL in the function signature here

Copy link
Member Author

Choose a reason for hiding this comment

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

this implements the function signature f func(statement sqlparser.Statement, schema ContextVSchema)

Copy link
Collaborator

@systay systay left a comment

Choose a reason for hiding this comment

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

A couple of nit picks, but LGTM

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal merged commit a4006b4 into vitessio:master Nov 19, 2020
@harshit-gangal harshit-gangal deleted the improve-dbddl branch November 19, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore create database query if keyspace exists
2 participants