Skip to content

Encapsulate Insert and Delete into specific structs #1224

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

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented Apr 15, 2024

cc @alamb

This refers to #1204 where we will pull out some of the higher level enum variants into their own Structs for easier use

@alamb alamb changed the title Encapsulate Insert and Delete Encapsulate Insert and Delete into specific structs Apr 21, 2024
Comment on lines +2869 to +2870
Statement::Insert(insert) => {
let Insert {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it matters, but just FYI you can do the same thing in the single let statement

Suggested change
Statement::Insert(insert) => {
let Insert {
Statement::Insert(Insert {
..
}) => {

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your comment! I'll remember this and update this snippet when I have some time. You're correct. I just follow the intuitive "refactor" :D

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8697518764

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 36 of 40 (90.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 88.09%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 25 29 86.21%
Totals Coverage Status
Change from base Build 8660968190: 0.001%
Covered Lines: 21287
Relevant Lines: 24165

💛 - Coveralls

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @tisonkun -- while this will require downstream changes, I think they are mechanical and will be straightforward for users and this will make it easier to manage these statements going forward.

@alamb alamb merged commit bf89b7d into apache:main Apr 21, 2024
10 checks passed
@tisonkun tisonkun deleted the encap-insert-delete branch April 21, 2024 13:41
@tisonkun
Copy link
Member Author

Thanks for your review and merge!

JichaoS pushed a commit to luabase/sqlparser-rs that referenced this pull request May 7, 2024
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