Skip to content

Conversation

@HilarioJrx
Copy link
Contributor

@HilarioJrx HilarioJrx commented Aug 14, 2025

The pull request introduces the following changes:

  • Modify build methods to accept DbDriverInterface.
  • Add tests for MySQL alias and subquery joins.

Please review the changes and provide feedback.

Description by Korbit AI

What change is being made?

Extend the build methods across various query classes to accept both DbDriverInterface and DbFunctionsInterface, and add tests for MySQL alias and subquery joins in the UpdateQueryTest.

Why are these changes being made?

The changes increase compatibility and flexibility by supporting both interfaces for providing database helpers. The added MySQL tests ensure that aliasing and subquery joins work correctly, addressing advanced query scenarios that can arise in complex database interactions.

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

@byjg byjg merged commit 3472fa2 into byjg:5.0 Aug 14, 2025
1 check was pending
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
Error Handling Incorrect 'Throw' keyword capitalization ▹ view
Functionality Incorrect NULL Value Handling ▹ 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

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

Comment on lines +88 to +90
if (is_null($dbDriver)) {
Throw new InvalidArgumentException('You must specify a DbDriverInterface to use Query join tables');
}
Copy link

Choose a reason for hiding this comment

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

Incorrect 'Throw' keyword capitalization category Error Handling

Tell me more
What is the issue?

Inconsistent capitalization in the 'Throw' keyword - it should be lowercase 'throw' as per PHP standards.

Why this matters

While the error is caught correctly, using inconsistent capitalization violates PHP coding standards and makes the code less maintainable.

Suggested change ∙ Feature Preview

Replace the capitalized 'Throw' with lowercase 'throw':

if (is_null($dbDriver)) {
    throw new InvalidArgumentException('You must specify a DbDriverInterface to use Query join tables');
}
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

Comment on lines 103 to +104
if (!is_numeric($value)) {
$value = $dbHelper?->delimiterField($value) ?? "'{$value}'";
$value = $dbDriverOrHelper?->delimiterField($value) ?? "'{$value}'";
Copy link

Choose a reason for hiding this comment

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

Incorrect NULL Value Handling category Functionality

Tell me more
What is the issue?

The code assumes non-numeric values need field delimiters or quotes, which may not handle null values correctly.

Why this matters

NULL values could be incorrectly wrapped in quotes, causing them to be treated as strings rather than NULL in the database.

Suggested change ∙ Feature Preview

Add a specific check for NULL values before the numeric check:

if ($value === null) {
    $value = 'NULL';
} elseif (!is_numeric($value)) {
    $value = $dbDriverOrHelper?->delimiterField($value) ?? "'{$value}'";
}
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

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