[Dbix-class] inflate_column and sql_maker->quote_char/name_sep

Bernhard Graf dbic at augensalat.de
Thu Mar 2 16:39:08 CET 2006


In my table class inflate_column doesn't seemed to do anything.

My table class looked like:

package TDW::Schema::User;

use base 'DBIx::Class';
use strict;
use DateTime::Format::MySQL;

__PACKAGE__->load_components(qw/RandomStringColumns Core/);
__PACKAGE__->table('user');
__PACKAGE__->add_columns(qw/id name email birthday/);
__PACKAGE__->set_primary_key('id'); 
__PACKAGE__->random_string_columns('id', {salt => '[a-z0-9]'});

__PACKAGE__->storage->sql_maker->quote_char('`');
__PACKAGE__->storage->sql_maker->name_sep('.');

__PACKAGE__->inflate_column('birthday', {
    inflate => sub { my $d = shift; defined($d) ? DateTime::Format::MySQL->parse_date($d) : $d },
    deflate => sub { my $d = shift; defined($d) ? DateTime::Format::MySQL->format_date($d) : $d },
});
1;

As soon as I place sql_maker->quote_char()/name_sep() below
inflate_column() it works.

Weird!

Is there a bug or where is my fault?
-- 
Bernhard Graf



More information about the Dbix-class mailing list