refactor: cleaner cloning API#16079
Merged
shlomi-noach merged 3 commits intovitessio:mainfrom Jun 10, 2024
Merged
Conversation
Signed-off-by: Andres Taylor <andres@planetscale.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Andres Taylor <andres@planetscale.com>
arthurschreiber
approved these changes
Jun 7, 2024
Signed-off-by: Andres Taylor <andres@planetscale.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16079 +/- ##
==========================================
+ Coverage 68.19% 68.22% +0.02%
==========================================
Files 1541 1541
Lines 197369 197371 +2
==========================================
+ Hits 134605 134650 +45
+ Misses 62764 62721 -43 ☔ View full report in Codecov by Sentry. |
Contributor
|
Hello! 👋 This Pull Request is now handled by arewefastyet. The current HEAD and future commits will be benchmarked. You can find the performance comparison on the arewefastyet website. |
harshit-gangal
approved these changes
Jun 10, 2024
5 tasks
5 tasks
harshit-gangal
pushed a commit
to planetscale/vitess
that referenced
this pull request
Jun 12, 2024
Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com>
harshit-gangal
pushed a commit
to planetscale/vitess
that referenced
this pull request
Jun 12, 2024
Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactor: Simplify Clone Usage with Generics
Summary
This PR refactors the codebase to use a more generic
Clonemethod, eliminating the need to specify exact types when cloning various structures. This makes the code cleaner and more maintainable.Changes
CloneSimpleTableExpr,CloneSQLNode,CloneRefOfParsedComments,CloneRefOfColumnDefinition, etc.) to use the genericsqlparser.Clone.Rationale
Using a generic
Clonemethod reduces redundancy and potential for errors. It also enhances the maintainability of the code by centralizing cloning logic.Impact
This refactor should have no functional impact on existing features but will make the code easier to work with.