Skip to content

reneeb/DBIx-Class-InflateColumn-TimePiece

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kwalitee status GitHub issues CPAN Cover Status Cpan license

NAME

DBIx::Class::InflateColumn::TimePiece - Auto-create Time::Piece objects from integer (number of seconds since epoch) columns

VERSION

version 0.03

SYNOPSIS

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.

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.

SEE ALSO

Development

The distribution is contained in a Git repository, so simply clone the repository

$ git clone git://github.com/reneeb/DBIx-Class-InflateColumn-TimePiece.git

and change into the newly-created directory.

$ cd DBIx-Class-InflateColumn-TimePiece

The project uses Dist::Zilla to build the distribution, hence this will need to be installed before continuing:

$ cpanm Dist::Zilla

To install the required prequisite packages, run the following set of commands:

$ dzil authordeps --missing | cpanm
$ dzil listdeps --author --missing | cpanm

The distribution can be tested like so:

$ dzil test

To run the full set of tests (including author and release-process tests), add the --author and --release options:

$ dzil test --author --release

AUTHOR

Renee Baecker reneeb@cpan.org

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Renee Baecker.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages