[Dbix-class] DBIx::Class::Resultset - DBI Exception near PATH

Daniel Westermann-Clark dwc at pobox.com
Tue Feb 17 16:33:24 GMT 2009


On 2009-02-17 17:15:05 +0100, Zbigniew Lukasiak wrote:
> > So what I should I pass to 'id', nothing?
> 
> Yeah - this is the problem.  The official answer is that you should
> not use find_or_create on tables with auto-increment pks - you should
> use 'create' or 'find' as appriopriate instead.

No, the official answer is not to pass a value for a column that you
want the database to fill.  undef means null in other places to DBIC;
why should find_or_create be different?

find_or_create and friends work fine on tables with auto-increment
keys.  I use it all the time.

-- 
Daniel Westermann-Clark



More information about the DBIx-Class mailing list