DBIx::Class::InflateColumn::TimePiece - Auto-create Time::Piece objects from integer (number of seconds since epoch) columns
version 0.03
package Event; use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/InflateColumn::TimePiece/); __PACKAGE__->table('my_events'); __PACKAGE__->add_columns( event_name => { data_type => 'varchar', size => 45, }, event_created => { data_type => 'integer', inflate_time_piece => 1, }, ); 1;
In the above example, a DBIx::Class named Event is created, then this DBIx::Class Component is loaded and two columns are added to the my_events table.
Event
my_events
A column with data_type equal to integer or int and with property inflate_time_piece set to true, will be inflated using localtime in Time::Piece and deflated using the epoch method.
data_type
integer
int
inflate_time_piece
localtime
Renee Baecker <reneeb@cpan.org>
This software is Copyright (c) 2018 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install DBIx::Class::InflateColumn::TimePiece, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::InflateColumn::TimePiece
CPAN shell
perl -MCPAN -e shell install DBIx::Class::InflateColumn::TimePiece
For more information on module installation, please visit the detailed CPAN module installation guide.