[Dbix-class] DBIx::Class::ResultSet::RecursiveUpdate -
announcement and RFC
Zbigniew Lukasiak
zzbbyy at gmail.com
Mon Sep 29 08:10:51 BST 2008
A reply after having a bit sleep.
On Sun, Sep 28, 2008 at 10:00 PM, Daniel Westermann-Clark <dwc at pobox.com> wrote:
> On 2008-09-28 17:17:33 +0200, Zbigniew Lukasiak wrote:
>> update_or_create relies on find - if you don't pass the PK - then
>> find will issue an unrestricted search and return a random row (and
>> issue the warning), then that random row will be updated, create
>> will never be called. This is assuming you add { key => primary} -
>> if you don't do that then find will fall back to the old behaviour
>> and also return a random row.
>
> That's also assuming you don't have any other unique constraints
> defined. At least, that's how it was designed.
>
OK - so I am rewording my clause:
RecursiveUpdate does not require that you have additional unique
constraints on tables with auto_increment primary keys like the
original update_or_create does.
Is that acceptable?
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/
More information about the DBIx-Class
mailing list