[Dbix-class] best way to cleanse / validate data

Alexander Hartmaier alexander.hartmaier at t-systems.at
Thu Jan 20 09:40:15 GMT 2011

I'm using DBIx::Class::Validation since a few years without problems.
I only had to disable it for performance reasons in one of my apps.
If you're interested in the dbic metadata to FormValidator::Simple
profile generator I can mail it to the list, maybe someone polishes it
and releases it to CPAN.

Best regards, Alex

On Mon, 2011-01-17 at 20:18 +0100, Seth Daniel wrote:
> On Mon, Jan 17, 2011 at 08:49:30PM +0200, Oleg Kostyuk wrote:
> > 2011/1/17 Seth Daniel <dbix-class at sethdaniel.org>:
> [...]
> > > It seemed to me the lowest level I could do this type of checking was
> > > the accessor.  This turned out to be incorrect.  Certainly, doing the
> >
> > IIRC, lowest level is store_column()
> > http://search.cpan.org/~arcanez/DBIx-Class-0.08126/lib/DBIx/Class/Row.pm#store_column
> You are correct, as I discovered when trying to figure out why the
> accessors I built with DBIx::Class::MooseColumns weren't getting called.
> Is extending my result classes and doing validation/cleansing that way a
> good idea?
> Hm, POD for DBIx::Class::Row suggests it may be:
>   store_column
>     [...]
>     This is the lowest level at which data is set on a row object, extend
>     this method to catch all data setting methods.
> (of course it also says 'This method is used internally by "set_column"
> which you should probably be using')
> DBIx::Class::Validation takes a slightly different approach and extends
> update and insert.  I'll need to check if DBIC::Validation can do data
> normalization.  I don't believe it can.  But it plus extending
> store_columns may be what I'm looking for.
> Thanks.

T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.

More information about the DBIx-Class mailing list