Skip to content

Conversation

@vjik
Copy link
Member

@vjik vjik commented Nov 25, 2025

Q A
Is bugfix?
New feature?
Breaks BC? ✔️

Related to yiisoft/db#1108

@samdark samdark requested a review from Copilot November 25, 2025 21:16
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (873238f) to head (6c2459e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #447      +/-   ##
============================================
+ Coverage     98.70%   98.75%   +0.04%     
- Complexity      252      254       +2     
============================================
  Files            24       24              
  Lines           775      801      +26     
============================================
+ Hits            765      791      +26     
  Misses           10       10              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot finished reviewing on behalf of samdark November 25, 2025 21:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the ColumnDefinitionParser class to extend from AbstractColumnDefinitionParser instead of the concrete ColumnDefinitionParser class from the parent yiisoft/db package, aligning with architectural changes in the base library. The refactoring adds MySQL-specific parsing logic for enum types and type parameters.

  • Migrates from extending \Yiisoft\Db\Syntax\ColumnDefinitionParser to AbstractColumnDefinitionParser
  • Implements MySQL-specific parseTypeParams() method with support for enum values
  • Adds corresponding test coverage for enum type parsing

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Column/ColumnDefinitionParser.php Refactored to extend AbstractColumnDefinitionParser and added MySQL-specific parseTypeParams() and parseEnumValues() methods for handling enum types and other type parameters
tests/ColumnDefinitionParserTest.php Added new test class for column definition parser with data provider integration (missing namespace declaration)
tests/Provider/ColumnDefinitionParserProvider.php Added test data provider with enum-specific test cases
CHANGELOG.md Added changelog entry documenting the breaking change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vjik vjik requested review from a team and samdark November 25, 2025 21:36
@vjik vjik added the status:code review The pull request needs review. label Nov 25, 2025
Comment on lines +52 to +73
return match ($type) {
'bit',
'bigint',
'binary',
'char',
'decimal',
'double',
'float',
'int',
'integer',
'mediumint',
'numeric',
'real',
'smallint',
'string',
'tinyint',
'varbinary',
'varchar',
'year' => $this->parseSizeInfo($params),
'enum' => $this->parseEnumValues($params),
default => [],
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return match ($type) {
'bit',
'bigint',
'binary',
'char',
'decimal',
'double',
'float',
'int',
'integer',
'mediumint',
'numeric',
'real',
'smallint',
'string',
'tinyint',
'varbinary',
'varchar',
'year' => $this->parseSizeInfo($params),
'enum' => $this->parseEnumValues($params),
default => [],
};
return match ($type) {
'enum' => $this->parseEnumValues($params),
default => $this->parseSizeInfo($params),
};

It seems a mistake to limit the list of types for parsing.
We use column definition parser not only for native db types but for abstract types also.

Copy link
Member Author

Choose a reason for hiding this comment

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

What case for abstract types?

@vjik vjik added status:under development Someone is working on a pull request. and removed status:code review The pull request needs review. labels Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:under development Someone is working on a pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants