[Dbix-class] Adding UNIQUE constraint support

Daniel Westermann-Clark daniel at acceleration.net
Fri Dec 16 23:55:56 CET 2005


In many of my applications, I use UNIQUE constraints.  To avoid
violating these constraints, a lot of the code ends up looking
something like:

my $a = DBIC::Artist->find_or_create({ ... UNIQUE columns ... });
$a->set_columns({ ... other columns ... });
$a->update;

This gets a little tedious, so I thought I could override
find_or_create to abstract this away.  The result is
DBIx::Class::Constraint::Unique, which you can find at:

http://svn.westermann-clark.com/projects/DBIx-Class-Constraint-Unique/trunk/

Thoughts?

-- 
Daniel Westermann-Clark



More information about the Dbix-class mailing list