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

Batch insert with empty columns #795

Merged
merged 15 commits into from
Jan 9, 2024
Merged

Batch insert with empty columns #795

merged 15 commits into from
Jan 9, 2024

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Jan 3, 2024

Prepare for #772

Allow to use DMLQueryBuilderInterface::batchInsert($table, [], $rows) method with empty columns

Related PR

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

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (064e076) 99.64% compared to head (beb8768) 99.64%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #795   +/-   ##
=========================================
  Coverage     99.64%   99.64%           
- Complexity     1265     1271    +6     
=========================================
  Files            63       63           
  Lines          3063     3080   +17     
=========================================
+ Hits           3052     3069   +17     
  Misses           11       11           

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

Copy link

what-the-diff bot commented Jan 3, 2024

PR Summary

  • Updated Active Record and Rector Workflow PHP Version
    The PHP version used in the Active Record and Rector workflows have been updated. The Active Record workflow now uses PHP versions 8.1 and 8.2, and the Rector workflow now uses PHP version 8.3.

  • Enhancement to DML Query Builder Interface
    An enhancement has been added to the DML Query Builder Interface that allows the batchInsert() method to be used with empty columns. This offers greater flexibility when managing datasets.

  • Included Dev-PHP80 Version in Yii Debug Dependency
    The composer.json file was altered to include version dev-php80 in the yiisoft/yii-debug dependency, providing extended support and compatibility for developers using this version in their projects.

  • Refactoring of Batch Insert Method
    The batchInsert() method in the AbstractDMLQueryBuilder.php file was refactored. The change allows for better extraction of column names and preparation of values for batch insert operations, potentially improving data management efficiency.

  • Modification of Connection Method Call
    The getConnection() method call in the AbstractQueryBuilderTest.php file was revised to getConnection(true), enhancing the accuracy and predictability of tests.

  • Additional Test Cases
    New test cases were introduced in the CommandProvider.php and QueryBuilderProvider.php files. These include batch insert with empty columns and associative values, objects, and Traversable, as well as batch insert with empty columns and a non-existent table. These changes ensure a more robust testing environment.

  • Typo Correction in DbHelper
    A typo in the changeSqlForOracleBatchInsert() method found in the DbHelper.php file was fixed.

@Tigrov Tigrov marked this pull request as ready for review January 4, 2024 01:47
@Tigrov Tigrov added the status:code review The pull request needs review. label Jan 4, 2024
tests/Provider/QueryBuilderProvider.php Outdated Show resolved Hide resolved
@vjik vjik added status:under discussion and removed status:code review The pull request needs review. labels Jan 6, 2024
@Tigrov Tigrov added the status:code review The pull request needs review. label Jan 7, 2024
@Tigrov Tigrov requested a review from darkdef January 7, 2024 12:06
Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

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

Need line in changelog

.github/workflows/rector.yml Outdated Show resolved Hide resolved
Tigrov and others added 3 commits January 8, 2024 17:50
@Tigrov Tigrov requested a review from vjik January 8, 2024 11:22
@Tigrov Tigrov merged commit 085f007 into master Jan 9, 2024
87 of 88 checks passed
@Tigrov Tigrov deleted the batchInsert-empty-columns branch January 9, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants