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

Refactor DMLQueryBuilder #302

Merged
merged 8 commits into from
Nov 1, 2023
Merged

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Aug 19, 2023

Related with yiisoft/db#746

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues

@what-the-diff
Copy link

what-the-diff bot commented Aug 19, 2023

PR Summary

  • Removal of reset Function and Addition of str_replace
    In the file DMLQueryBuilder.php, we previously had a function called reset. This function has been removed in order to improve our code. Additionally, a new feature called str_replace has been introduced, which helps with replacing certain parts of a string with different information.

  • Refactoring of upsert Function
    Also in the DMLQueryBuilder.php file, the upsert function, which helps in either updating already existing data or inserting new data if it does not exist, has been restructured and simplified for better performance and readability of code.

  • Updated Function Description for prepareInsertValues
    For the prepareInsertValues function in DMLQueryBuilder.php, the return type hint, which indicates the type of value that the function returns, and the comments, which give a general explanation of what the function does, have been updated for better understanding.

  • Additional Test Case for upsert Function
    Lastly, in the QueryBuilderProvider.php file, an extra test case has been introduced for the upsert function, to ensure its functionality and correctness under various scenarios.

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d48ca3a) 99.09% compared to head (cffd4a7) 99.08%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #302      +/-   ##
============================================
- Coverage     99.09%   99.08%   -0.02%     
  Complexity      184      184              
============================================
  Files            13       13              
  Lines           552      545       -7     
============================================
- Hits            547      540       -7     
  Misses            5        5              
Files Coverage Δ
src/DMLQueryBuilder.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Tigrov Tigrov marked this pull request as ready for review August 19, 2023 10:59
src/DMLQueryBuilder.php Show resolved Hide resolved
@Tigrov Tigrov merged commit dcb2370 into yiisoft:master Nov 1, 2023
40 of 42 checks passed
@Tigrov Tigrov deleted the refactor_dml_query_builder branch November 1, 2023 03:37
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.

2 participants