[Dbix-class] RFC: Round two for UNIQUE constraints

Matt S Trout dbix-class at trout.me.uk
Mon Jan 23 04:34:48 CET 2006


On Sun, Jan 22, 2006 at 10:08:03PM -0500, Daniel Westermann-Clark wrote:
> On 2006-01-22 15:45:50 +0000, Matt S Trout wrote:
> > I think the constraints should be named, since everything else is.
> 
> Take a gander at the attached patch.  It lets you name constraints:
> 
>   __PACKAGE__->add_unique_constraint(artist_title => [ qw/artist title/ ]);
> 
> Calling set_primary_key automatically adds a unique constraint named
> 'primary'.
> 
> By default update_or_create operates on all unique constraints for
> which values are specified.
> 
> Alternatively when you do a find, find_or_create, or update_or_create,
> you can specify a key attribute:

Excellent. Given my statement of 0.04999_03 being rc1 has been rather trashed
by the latest YAML preventing me doing "./Build dist" to put out an rc2, I
say go ahead and commit this to the branch.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list