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

ColumnSchema classes for performance of typecasting

Open Tigrov opened this issue 2 years ago • 2 comments

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

Tigrov avatar Sep 01 '23 13:09 Tigrov

PR Summary

  • Deprecated ColumnSchema Class and Introduced JsonColumnSchema Class The ColumnSchema class is now marked as deprecated, and a new class named JsonColumnSchema is introduced, hinting at a shift towards handling JSON type data.

  • New Interface Column\ColumnSchemaInterface A new interface, Column\ColumnSchemaInterface, was added suggesting an abstraction that classes dealing with column schemas need to implement.

  • Enhanced Schema Class The Schema class received an update, where size, precision, and scale properties are now included in the array of column information. This change offers more specifics about column information.

  • Refactored loadColumnSchema Method in Schema Class The loadColumnSchema method in the Schema class has been refactored to use the newly updated column information array and is now capable of handling distinct data types, enhancing its scope and functionality.

  • Removed createColumnSchema Method from Schema Class The createColumnSchema method was removed from the Schema class, suggesting a revision in the way column schemas are created.

  • Test Class Update with New Column Schema Classes The ColumnSchemaTest class now includes new column schema classes such as BinaryColumnSchema, BooleanColumnSchema, DoubleColumnSchema, IntegerColumnSchema, JsonColumnSchema, StringColumnSchema. The addition of these classes demonstrates the PR's attempt to improve testing for different categories of column schemas.

  • Test Refactoring in ColumnSchemaTest Class The tests in the ColumnSchemaTest class have been refactored to utilize the new column schema classes, enhancing the testing scope and coverage.

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

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.33%. Comparing base (85a1939) to head (711c381).

:exclamation: Current head 711c381 differs from pull request most recent head eae08a9

Please upload reports for the commit eae08a9 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #273      +/-   ##
============================================
- Coverage     98.46%   97.33%   -1.14%     
  Complexity      339      339              
============================================
  Files            21       19       -2     
  Lines          1043     1049       +6     
============================================
- Hits           1027     1021       -6     
- Misses           16       28      +12     

: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]