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

ColumnSchema classes for performance of typecasting

Open Tigrov opened this issue 1 year 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

  • Introduced a New File & Class for MSSQL Binary Column Schema The new file BinaryColumnSchema.php has introduced a new class BinaryColumnSchema specifically designed for handling binary columns in MSSQL databases. This provides a more specific way to typecast database columns.

  • Major Update to ColumnSchema File The ColumnSchema.php file has seen several alterations in this PR including:

    • Introduction of deprecation warnings encouraging use of individual classes for different column types.
    • Deprecation of the ColumnSchemaInterface interface.
    • Addition of size, precision, and scale properties providing detailed information about the column schema.
    • Revisions to loadColumnSchema and normalizeDefaultValue methods improving their efficiency.
    • Introduction of more accurate column schema generation based on PHP types.
  • Changes in the Schema File This PR also brings substantial updates to the Schema.php file, primarily focusing on enhancing methods related to the column schema. This includes detailed property settings, improved default value normalization, creation of column schemas based on PHP types, and several methods for data type abstraction.

  • Additions to ColumnSchemaTest A couple of vital updates have been made to the ColumnSchemaTest.php file. These include replacement of the PHPUnit framework test case, tests for the new BinaryColumnSchema class, and checks for specific column types and predefined types.

  • New ColumnSchemaProvider File This PR introduces a new file called ColumnSchemaProvider.php which aims to override predefined types and dbTypecast columns with the BinaryColumnSchema class, providing a higher degree of specificity for handling MSSQL binary columns.

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

Codecov Report

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

Project coverage is 96.56%. Comparing base (dc65f9e) to head (98dd564).

:exclamation: Current head 98dd564 differs from pull request most recent head 40d6c00

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

Files Patch % Lines
src/Schema.php 81.81% 6 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #277      +/-   ##
============================================
- Coverage     98.10%   96.56%   -1.54%     
- Complexity      218      224       +6     
============================================
  Files            17       16       -1     
  Lines           632      640       +8     
============================================
- Hits            620      618       -2     
- Misses           12       22      +10     

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

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