Skip to content

Conversation

@byjg
Copy link
Owner

@byjg byjg commented Sep 3, 2025

This pull request includes the following changes:

  • Introduced bulkExecute method in the Repository class for atomic execution of multiple write queries (insert, update, delete) within a transaction. It includes support for optional isolation levels, detailed exception handling, and validation.
  • Extended build methods to accept the DbDriverInterface for better flexibility.
  • Added tests for MySQL alias handling and subquery joins.
  • Updated documentation and included unit tests to ensure reliability and correctness.

Description by Korbit AI

What change is being made?

Add support for executing multiple write queries in bulk within a single transaction and improve database interface compatibility in query building.

Why are these changes being made?

This change addresses the need for atomic operations where multiple database write actions (inserts, updates, deletes) must either all succeed or all fail as a group, ensuring data integrity. The enhancement to allow query building with both DbFunctionsInterface and DbDriverInterface increases flexibility, enabling more robust database operations across different database drivers. New functionality and test coverage ensure robustness and address parameter overlaps and error states.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

HilarioJrx and others added 3 commits August 14, 2025 19:40
feat: extend build methods to accept DbDriverInterface and add MySQL alias and subquery join tests
Implemented `bulkExecute` method to allow atomic execution of multiple write queries (insert, update, delete) within a transaction. Added support for optional isolation levels, detailed exception handling, and comprehensive validation. Updated documentation and included unit tests to ensure correctness and reliability.
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Readability Simplify Complex Type Check Condition ▹ view
Files scanned
File Path Reviewed
src/Interface/UpdateBuilderInterface.php
src/DeleteQuery.php
src/InsertSelectQuery.php
src/InsertQuery.php
src/InsertBulkQuery.php
src/UpdateQuery.php
src/Repository.php

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

byjg added 16 commits September 3, 2025 13:06
…aintainability

Extracted `saveUpdatable` and `saveUpdatableInternal` methods from `save` to modularize functionality. Simplified code structure and reduced duplication in insert and update operations. Enhanced handling of null primary key fields and ensured consistency with mapping operations.
…ueryRaw`

Updated `bulkExecute` in `Repository` to return results using `GenericIterator`. Introduced `QueryRaw` for executing raw SQL queries. Enhanced `QueryBasic` to handle empty table lists gracefully. Added corresponding unit tests for these features.
…ution

Refactored `bulkExecute` to concatenate multiple queries into a single SQL string with renamed parameters, avoiding collisions. Enhanced efficiency by reducing transaction overhead and improving parameter handling for better execution performance.
…ce Docker Compose for MySQL service, and update repository logic to handle database-specific nuances.
…nectionUtil` and optimize transaction handling in `Repository`.
…nectionUtil` and optimize transaction handling in `Repository`.
…nectionUtil` and optimize transaction handling in `Repository`.
…nectionUtil` and optimize transaction handling in `Repository`.
…nectionUtil` and optimize transaction handling in `Repository`.
…sary variable reassignment, and improve code clarity. Add test for bulk insert without parameters.
…sary variable reassignment, and improve code clarity. Add test for bulk insert without parameters.
@byjg byjg merged commit c0869e9 into master Sep 5, 2025
4 checks passed
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