Skip Menu |

This queue is for tickets about the DBIx-Class-InflateColumn-TimeMoment CPAN distribution.

Report information
The Basics
Id: 125975
Status: open
Priority: 0/
Queue: DBIx-Class-InflateColumn-TimeMoment

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: support for 'timestamp with time zone'
DBIx::Class::InflateColumn::DateTime supports the format 'timestamp with time zone'. This module should be able to as well -- I did some testing, and Time::Moment->from_string($timestamptz, lenient => 1) does handle this format. It looks like just a few lines need to be added into the checks in register_column.
On 2018-07-31 12:05:58, ETHER wrote: Show quoted text
> DBIx::Class::InflateColumn::DateTime supports the format 'timestamp > with time zone'. This module should be able to as well -- I did some > testing, and Time::Moment->from_string($timestamptz, lenient => 1) > does handle this format. > > It looks like just a few lines need to be added into the checks in > register_column.
Specifically, line 42 needs to change from: - return unless ( ( $data_type eq 'datetime' ) or ( $data_type eq 'timestamp' ) or ( $data_type eq 'date' ) ); to: + return unless ( ( $data_type eq 'datetime' ) or ( $data_type eq 'timestamp' ) or ( $data_type eq 'date' ) or ( $data_type eq 'timestamp with time zone' ) ); Is there a git repository somewhere, where I can submit a patch?
Hi Karen, The package is on github at https://github.com/nigelm/dbix-class-inflatecolumn-timemoment [I just checked in a minor panic and that is in the package metadata] I am just (avoiding) packing for a week away, so it will be a little while until I get to it.
On 2018-07-31 13:04:05, NIGELM wrote: Show quoted text
> Hi Karen, > > The package is on github at https://github.com/nigelm/dbix-class- > inflatecolumn-timemoment > > [I just checked in a minor panic and that is in the package metadata] > > I am just (avoiding) packing for a week away, so it will be a little > while until I get to it.
Not a problem! As it happened I needed to subclass this anyway as we started using a time object that subclasses Time::Moment, so in that module I munge the data type to an acceptable one for inflation. Here's the code, for reference: https://github.com/joyent/conch/blob/master/lib/Conch/DB/InflateColumn/Time.pm