Skip to content
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

ColumnSchema classes for performance of typecasting #752

Merged
merged 31 commits into from
May 30, 2024

Conversation

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Attention: Patch coverage is 97.61905% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 90.62%. Comparing base (beedc6b) to head (9400b1d).
Report is 1 commits behind head on master.

Files Patch % Lines
src/Schema/Column/AbstractColumnSchema.php 66.66% 2 Missing ⚠️
src/Schema/AbstractSchema.php 96.15% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #752      +/-   ##
============================================
- Coverage     99.72%   90.62%   -9.10%     
- Complexity     1309     1348      +39     
============================================
  Files            64       71       +7     
  Lines          3220     3306      +86     
============================================
- Hits           3211     2996     -215     
- Misses            9      310     +301     

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

@what-the-diff
Copy link

what-the-diff bot commented Sep 1, 2023

PR Summary

  • Improved Database Column Typing
    A new feature has been added that lets each type of database column (such as integer, string, and boolean) use its own specialized class. This will ensure data types are handled optimally, enhancing the system's performance.

  • Upgrade in DML Query Builder
    The DML (Data Manipulation Language, used to retrieve and manipulate data) Query Builder has been updated to use the newly-added column classes.

  • Deprecated Classes and Replacements
    Several older classes (AbstractColumnSchema, ColumnSchemaInterface) have been deprecated. The team introduced replacements like ColumnSchemaInterface from the Yiisoft\Db\Schema\Column namespace and several new column classes according to data types.

  • Introduction of Specific Column Schema Classes
    New classes for representing various database column types were introduced. Each class corresponds to a data type, such as IntegerColumnSchema for integer type, StringColumnSchema for string type, etc. These classes provide methods for correct typecasting, ensuring accuracy of data.

  • Updates for Schema Functionality
    The TableSchemaInterface class has been updated to use the new ColumnSchemaInterface. In the Schema class, the getColumnPhpType method now selects the appropriate column class based on the column data type.

  • Test Classes Introduced
    Multiple new test classes (CommonColumnSchemaTest, CommonSchemaTest, ColumnSchemaTest, SchemaTest, ColumnSchemaProvider) were also introduced. These will help ensure the detailed testing of the overall schema functionality, and the specific functionality of different column types.

  • Test Case Updates
    Updates were made to different test cases specifically in the ColumnSchemaTest and the SchemaTest classes to ensure the correctness of typecasting and data type retrieval respectively.

  • Code Corrections
    A minor typo in the AbstractColumnSchema class name in the ColumnSchema stub class was fixed.

@Tigrov Tigrov changed the title Column type classes ColumnSchema classes for performance of typecasting Sep 1, 2023
@Tigrov Tigrov marked this pull request as ready for review September 1, 2023 15:36
@vjik vjik added this to the 2.0.0 milestone Nov 8, 2023
@vjik vjik added the status:under development Someone is working on a pull request. label Jan 6, 2024
@Tigrov Tigrov added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels May 5, 2024
@Tigrov Tigrov requested review from a team and darkdef May 5, 2024 07:55
src/Schema/Column/BigIntColumnSchema.php Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@Tigrov Tigrov requested a review from vjik May 6, 2024 08:07
@Tigrov Tigrov merged commit 61c325e into yiisoft:master May 30, 2024
83 of 86 checks passed
@Tigrov Tigrov deleted the column_type_classes2 branch May 30, 2024 08:55
@Tigrov Tigrov mentioned this pull request Jun 22, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants