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

Zbigniew Lukasiak zzbbyy at gmail.com
Tue Feb 17 16:15:05 GMT 2009


On Tue, Feb 17, 2009 at 4:58 PM, Dermot <paikkos at googlemail.com> wrote:
> 2009/2/17 Zbigniew Lukasiak <zzbbyy at gmail.com>:
>
>>
>> I don't know about the error you are getting now - but 'id => undef'
>> is also not quite correct here - because create will then try to
>> create a NULL id (which is presumably your primary key) - and this
>> will fail on many databases.
>
> 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.


-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/



More information about the DBIx-Class mailing list