db
db copied to clipboard
ColumnSchema classes for performance of typecasting
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 |
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.
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 likeColumnSchemaInterfacefrom theYiisoft\Db\Schema\Columnnamespace 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
IntegerColumnSchemafor integer type,StringColumnSchemafor string type, etc. These classes provide methods for correct typecasting, ensuring accuracy of data. -
Updates for Schema Functionality The
TableSchemaInterfaceclass has been updated to use the newColumnSchemaInterface. In theSchemaclass, thegetColumnPhpTypemethod 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
ColumnSchemaTestand theSchemaTestclasses to ensure the correctness of typecasting and data type retrieval respectively. -
Code Corrections A minor typo in the
AbstractColumnSchemaclass name in theColumnSchemastub class was fixed.