[Dbix-class] find_or_create and unique constraints

Peter Rabbitson rabbit+dbic at rabbit.us
Fri Oct 15 08:18:55 GMT 2010

Bill Moseley wrote:
> Two issues I'd like to see discussed here is if DBIC should throw an 
> exception if find() returns more than one row (instead of a warning), 
> and if it makes sense to fall back to the full criteria passed to find() 
> if no unique key can be determined.

I want to make sure I am getting this right - are you proposing that
we discuss drastically changing a stable API, potentially breaking
DBIC for hundreds if not thousands of users, all for the sake of
correctness? I am still not sure what the discussion scope is, thus
I'll reserve judgment until more details emerge.

But if I was to guess what you actually need - I can propose extracting
the "ooh you got too many rows" code into a single overridable point, so
you can hook it in your base resultset and make it die, or do whatever
else you wish it to do.


More information about the DBIx-Class mailing list