[Dbix-class] Branch status reports please

Matt S Trout dbix-class at trout.me.uk
Wed May 24 23:08:44 CEST 2006

Daniel Westermann-Clark wrote:
> On 2006-05-24 13:20:32 +0100, Matt S Trout wrote:
>> find_compat
>>    - dwc
>>    - needs to merge back for 07 since it makes older find semantics 
>> still work without disrupting the new and improved unique-key-driven
>> find
> I started last night by allowing the non-unique queries through and by
> adding warnings for the obvious cases.
> My hope is to clean up the method a little before merging back, since
> it's a little unwieldy with all the compat stuff added back.
> I'm still undecided about the concept of allowing a search on a unique
> key plus some other constraint.  For example:
> $rs->find({ id => 1, name => 'Another Constraint' });
> In my mind the definition of find has always been to search by key
> only, but it seems others think differently.  ;)

Well you have no real choice about it - otherwise what would

$rs->search({ name => 'Another Constraint' })->find(1);


Note that I've no particular objection to any find that isn't a straight 
unique key one being coerced to the above internally, and a "real" find 
just calling $self->_find or similar which contains the original code.

> On another note, I'd like to add support eventually for automatically
> named unique constraints.  For instance:
> __PACKAGE__->table('mytable');
> __PACKAGE__->add_columns(qw/id name description/);
> __PACKAGE__->set_primary_key('id');
> __PACKAGE__->add_unique_constraint([ qw/name description/ ]);
> would add a unique constraint named 'mytable_name_description', but
> this may not make the deadline.

More information about the Dbix-class mailing list