-
-
Notifications
You must be signed in to change notification settings - Fork 3
# Micro ORM 6.0 - Major Release #25
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
base: master
Are you sure you want to change the base?
Conversation
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 |
---|---|---|
Redundant Field Mapping Storage ▹ view | ✅ Fix detected | |
Database Values Override Issue ▹ view | ||
Missing null check for dbDriver in buildAndGetIterator ▹ view | ||
Multiple Sequential Mapper Lookups ▹ view | ||
Duplicate Method Existence Validation ▹ view | ||
Missing Exception Context ▹ view |
Files scanned
File Path | Reviewed |
---|---|
src/Exception/RequireChangedValuesConstraintException.php | ✅ |
src/Interface/UpdateConstraintInterface.php | ✅ |
src/Interface/UpdateBuilderInterface.php | ✅ |
src/Interface/QueryBuilderInterface.php | ✅ |
src/ORMHelper.php | ✅ |
src/Literal/Literal.php | ✅ |
src/Updatable.php | ✅ |
src/Constraint/CustomConstraint.php | ✅ |
src/DeleteQuery.php | ✅ |
src/PropertyHandler/PrepareToUpdateHandler.php | ✅ |
src/Recursive.php | ✅ |
src/Constraint/RequireChangedValuesConstraint.php | ✅ |
src/PropertyHandler/MapFromDbToInstanceHandler.php | ✅ |
src/WhereTrait.php | ✅ |
src/InsertQuery.php | ✅ |
src/Union.php | ✅ |
src/InsertSelectQuery.php | ✅ |
src/InsertBulkQuery.php | ✅ |
src/UpdateQuery.php | ✅ |
src/Query.php | ✅ |
src/QueryBasic.php | ✅ |
src/Mapper.php | ✅ |
src/Repository.php | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Feedback and Support
if (count($this->getFieldMap()) > 0) { | ||
ObjectCopy::copy($fieldValues, $instance); | ||
} | ||
$fieldValues = array_merge(Serialize::from($instance)->toArray(), $fieldValues); |
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.
Database Values Override Issue 
Tell me more
What is the issue?
The array_merge operation in getEntity() overrides database values with empty instance values instead of the other way around
Why this matters
This will cause database-loaded values to be overwritten by default/empty values from the newly created instance, effectively nullifying the database data.
Suggested change ∙ Feature Preview
Reverse the array_merge parameters to prioritize database values over instance values:
$fieldValues = array_merge($fieldValues, Serialize::from($instance)->toArray());
Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.
class RequireChangedValuesConstraintException extends Exception | ||
{ | ||
|
||
} |
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.
Missing Exception Context 
Tell me more
What is the issue?
The RequireChangedValuesConstraintException class is empty without any custom message or error code, making it difficult to identify the specific error condition when caught.
Why this matters
When this exception is thrown, developers catching it won't have context about what went wrong with the changed values constraint, leading to poor error handling and debugging experience.
Suggested change ∙ Feature Preview
Add a default constructor with a meaningful error message:
class RequireChangedValuesConstraintException extends Exception
{
public function __construct(string $message = "Update operation requires at least one changed value", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}
Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.
Replaced instances of SqlObject with SqlStatement in QueryTest.php assertions for consistency with updated class usage. Ensures test cases align with the expected class structure and behavior after recent changes.
This PR introduces version 6.0 of the Micro ORM with significant improvements and breaking changes. The update aligns with the AnyDataset-DB 6.0 release and includes structural changes to improve code quality and maintainability.
Major Changes
Breaking Compatibility Changes
New Features
Migration Guide
This release significantly improves the architecture while maintaining the core functionality and simplicity of the Micro ORM library.
Description by Korbit AI
What change is being made?
Introduce Micro ORM 6.0 with support for PHP 8.4, updated dependencies, enhanced documentation, and new features including custom update constraints, UUID primary key support, and enhanced query capabilities.
Why are these changes being made?
This major release aims to align the codebase with newer PHP versions and improve ORM functionality with more robust querying capabilities and custom update constraints. Enhancements to the documentation and minor code refactoring provide clearer guidelines for users and support seamless integration. The inclusion of test updates ensures comprehensive validation of the new features and changes.