[Dbix-class] Problem with column_info_from_storage

Bogdan Lucaciu bogdan at wiz.ro
Wed Oct 18 00:02:06 CEST 2006


On Tue, 2006-10-17 at 18:41 +0200, Rolf Schaufelberger wrote:
> Yes I agree, but I would prefer to let the user decide if he wants the
> colunm 
> inflate to any (which?) Date::Time object, by adding this info in his
> class 
> and not get it set autmagically by looking into the database. But
> thats my 
> personal prefernce... 

DBIx::Class does nothing like that automagically, the user must load the
InflateColumn::DateTime component in order for this behaviour to occur.

from the POD:

This module figures out the type of DateTime::Format::* class to
inflate/deflate with based on the type of DBIx::Class::Storage::DBI::*
that you are using. 


Before this (optional) component existed, you had to do it completely
manually (as you can still do):

__PACKAGE__->inflate_column('colname', {
    inflate => sub { DateTime::Format::Pg->parse_datetime(shift); },
    deflate => sub { DateTime::Format::Pg->format_datetime(shift); },
});

bogdan




More information about the Dbix-class mailing list