[Dbix-class] DBIx::Class::Resultset - DBI Exception near PATH
Zbigniew Lukasiak
zzbbyy at gmail.com
Tue Feb 17 16:37:52 GMT 2009
On Tue, Feb 17, 2009 at 5:33 PM, Daniel Westermann-Clark <dwc at pobox.com> wrote:
> 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.
Ah - yeah - I should have add if you don't have any other unique key.
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/
More information about the DBIx-Class
mailing list