-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add bulk transaction support and enhanced DB interface compatibility #30
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
Conversation
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
…alias and subquery join tests
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.
There was a problem hiding this 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 |
|---|---|---|
| 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.
…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.
…t execution with trailing SELECT handling
…t execution with trailing SELECT handling
…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.
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.
This pull request includes the following changes:
bulkExecutemethod 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.DbDriverInterfacefor better flexibility.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
DbFunctionsInterfaceandDbDriverInterfaceincreases flexibility, enabling more robust database operations across different database drivers. New functionality and test coverage ensure robustness and address parameter overlaps and error states.