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

Support DateTime instances

Open Tigrov opened this issue 2 years ago • 2 comments

Support for array of datetimes will be added after review of #303. Some functionality for casting array values is presented there.

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fixed issues #725

Tigrov avatar Aug 05 '23 13:08 Tigrov

PR Summary

  • Enhancement to the ColumnSchema Class A new function called hasTimezone() has been included to allow the program to check if a specific database column utilizes a timezone.

  • Revamp of the Schema Class

    • The property name numeric_precision has been simplified to precision for easier usage.
    • Integration of the abstime data type support has been enforced to handle absolute time data types.
    • The findColumns function was adjusted to retrieve both precision variations (numeric_precision and just precision) from the database.
    • The loadColumnSchema function has been revamped to set the column precision property.
    • Introduced a new function getDateTimeFormat to figure out the format of date/time associated columns.
  • Testing and Validation

    • The testing class, ColumnSchemaTest, now includes tests for the new date/time columns and verification of their type casting.
  • Improvements in the SchemaProvider Class

    • The class now includes definitions for the newly added date/time columns.
  • Changes in the pgsql.sql Fixture File

    • Newly added columns catering for timestamp, timestamptz, date, and time data types have been incorporated.
    • Default values for certain columns have been adjusted.

what-the-diff[bot] avatar Aug 05 '23 13:08 what-the-diff[bot]

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5359753) 100.00% compared to head (6af8302) 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #308   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       200       202    +2     
===========================================
  Files             13        13           
  Lines            598       602    +4     
===========================================
+ Hits             598       602    +4     
Files Changed Coverage Δ
src/ColumnSchema.php 100.00% <100.00%> (ø)
src/Schema.php 100.00% <100.00%> (ø)

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

codecov[bot] avatar Aug 05 '23 13:08 codecov[bot]