[Dbix-class] Validating column data

Bill Moseley moseley at hank.org
Mon Feb 1 23:56:03 GMT 2010


I'm wondering about validating at DBIC layer in addition to my current
validation.

Specifically, I have a large number of classes that use an integer primary
key.  So,

   $schema->resultset( 'Foo' )->find( 'bad data' );

would never hit the database and would return undefined.  Likewise:

   $schema->resultset( 'Foo' )->search( { id =3D> 'bad data' } )->first;  #=
 or
called in list context

would act as if no rows were found.

Obviously, there's other column data that needs to be validated -- this
would just be an extra layer for primary keys.


I'm not sure I want to go this route, but curious how to accomplish this
with DBIC,


-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100201/898=
63539/attachment.htm


More information about the DBIx-Class mailing list