db-pgsql icon indicating copy to clipboard operation
db-pgsql copied to clipboard

ColumnSchema classes for performance of typecasting

Open Tigrov opened this issue 2 years ago • 2 comments

To get 100% patch coverage it needs to run tests on i386 architecture or with PHP 32bit

Add to PHP actions config:

matrix:
    arch: ["amd64", "i386"]

But I think it is not necessary, to avoid many running tests.

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fixed issues yiisoft/db#737

Tigrov avatar Sep 01 '23 13:09 Tigrov

PR Summary

  • New Files for Different Column Definitions Several new files were added, each defining a different type of column in your database, like an array column, big integer column, binary column, bit column, boolean column, and so on. To be specific, each file contains a specific class that describes how each column type should behave, including methods to manipulate and retrieve data.

  • ColumnSchema.php Modifications Changes were made to direct specific column types to their corresponding newly created classes, as well as adding a deprecation notice.

  • Schema update for New Column Classes Our Schema.php file now supports these new column classes, ensuring that when a column is discovered it uses these new classes to define the column's behavior. For increased safety, some methods related to columns are now private or protected, preventing misuse.

  • Testing of New Classes Updates were made to our ColumnSchemaTest.php file to include tests for these new classes, ensuring they work as expected. The test cases for the array, big integer, binary, bit, boolean, and integer column classes have been added.

  • Additional Changes Some extra changes were made to handle the new column definitions correctly, including modifying the test structure and cleaning up some data.

  • Removal of Key in Test Provider The dimension key was removed from a default value array in a method within a test Provider file to match the new setup.

what-the-diff[bot] avatar Sep 01 '23 13:09 what-the-diff[bot]

Codecov Report

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

Project coverage is 99.26%. Comparing base (f2e0dd9) to head (d9c8f53).

Files Patch % Lines
src/Column/ArrayColumnSchema.php 97.14% 2 Missing :warning:
src/Column/StructuredColumnSchema.php 92.85% 2 Missing :warning:
src/Schema.php 96.82% 2 Missing :warning:
Additional details and impacted files
@@              Coverage Diff              @@
##              master     #315      +/-   ##
=============================================
- Coverage     100.00%   99.26%   -0.74%     
- Complexity       257      282      +25     
=============================================
  Files             18       23       +5     
  Lines            745      821      +76     
=============================================
+ Hits             745      815      +70     
- Misses             0        6       +6     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 01 '23 13:09 codecov[bot]