On 2006-07-27 20:13:17 -0600, Nathan Kurz wrote: > Glancing at the source, it looks like > DBIx::Class::ResultSet::update_or_create() is accepting both $cond > and $attr, but only passes $cond on to find. And it looks like > DBIx::Class::ResultSet::find() will use unique contraints if passed > them, but only searches for primary columns if given nothing.
This is true. I've added a fix (and test) for this to trunk, which will be in the next release. http://dev.catalyst.perl.org/trac/bast/changeset/2643 However, it's important to note that DBIx::Class cannot currently update a row based on a unique constraint. You'll get an error about not being able to safely update the row on a PK-less table. So for now you'll have to add a primary key to your table. Promoting unique constraints to a full Row subclass is probably the most sensible option going forward. I'll try to open a branch for this over the weekend. Though since 0.07 is in its stable release cycle, it won't be released until 0.08. -- Daniel Westermann-Clark _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/dbix-class@lists.rawmode.org/