-
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
[vtadmin] Add GetSchema endpoint #7596
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5da575e
Add GetSchema rpc, run generators and add stubs
ajm188 aff611f
Add (*cluster.Cluster).GetSchema, reimplement getSchemasForKeyspace t…
ajm188 66f0d14
Implement http wrapper for vtdammin GetSchema
ajm188 32dc3ea
[nit] remove duplicate import package
ajm188 d88ed3a
Add mock vtctldclient to vtadmin's testutil, test cluster's GetSchema
ajm188 01b898b
Wrap error with more context
ajm188 bbd2a68
Add tests for GetSchema
ajm188 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What do you think about making this
/schema?cluster_id=&keyspace=&table=
? I honestly think the way you have it now is prettier, but:/tablet
endpoint (which has an optional cluster parameter too)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.
I realize you started the disambiguation branch anyway so I expect you already have some plan 😎
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.
I think, given that you said this route scheme looks prettier, that we should keep it as-is because:
cluster.GetSchema
between the two endpoints, so we're not duplicating too muchGetSchema
doesn't have to thatlen(clusterIds)
is exactly 1, because it's not possible, but if we combine it with theFindSchema
endpoint then we'll end up introducing a bunch of "if this then do thingAForGetSchema else do thingBForFindSchema" branching)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.
Yeah makes sense!
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.
The /schema endpoint does seem a bit non-std instead of url params or nested resource paths like /schema/cluster/{cluster_id}/keyspace/{keyspace}/table/{table}. But it is more succinct and we can revisit this once we have all our endpoints in place.