NAME

Eve::PgSqlType::Interval - a PostgreSQL interval type.

SYNOPSIS

    my $interval = Eve::PgSqlType::Interval->new();
    $interval->serialize(value => $duration);

DESCRIPTION

Eve::PgSqlType::Interval is a PostgreSQL interval type adapter class.

METHODS

get_type()

Returns

The PG_TIMESTAMP type.

wrap()

Wraps an expression with CAST statement.

Arguments

expression

Returns

CAST (expression AS interval)

serialize()

Formats a DateTime::Duration object into the appropriate string interval representation with the DateTime::Format::Pg module.

Arguments

value

Returns

The string like '1 day 1 hour 1 minute 1 second'.

deserialize()

Parses an interval string representation into the appropriate DateTime::Duration object with the DateTime::Format::Pg module.

Arguments

value

Returns

A DateTime::Duration object.

SEE ALSO

DateTime
DateTime::Duration
DateTime::Format::Pg
DBD::Pg
Eve::PgSqlType

LICENSE AND COPYRIGHT

Copyright 2012 Igor Zinovyev.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

AUTHOR

Sergey Konoplev
Igor Zinovyev