db icon indicating copy to clipboard operation
db copied to clipboard

ColumnSchema classes for performance of typecasting

Open Tigrov opened this issue 2 years ago • 2 comments

Related PRs

  • yiisoft/db-mysql#303
  • yiisoft/db-pgsql#315
  • yiisoft/db-sqlite#273
  • yiisoft/db-mssql#277
  • yiisoft/db-oracle#236
Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fixed issues #737, yiisoft/db-mysql#292

Tigrov avatar Sep 01 '23 13:09 Tigrov

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 :warning:
src/Schema/AbstractSchema.php 96.15% 1 Missing :warning:
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     

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

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.

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