[Dbix-class] Re: ResultSet columns attribute broken?

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Jun 25 10:43:01 GMT 2009


Benjamin Schuster-Boeckler wrote:
> On 22 May 2009, at 11:14, Peter Rabbitson wrote:
> 
>> Benjamin Schuster-Boeckler wrote:
>>> On 1 May 2009, at 09:40, Peter Rabbitson wrote:
>>>
>>>> Benjamin Schuster-Boeckler wrote:
>>>>>> Bernhard Graf wrote:
>>>>>>> Peter Rabbitson wrote:
>>>>>>>
>>>>>>>> Yes because you are looking at TODO tests, don't worry about those.
>>>>>>>> I was actually asking if your live development code works, not the
>>>>>>>> test suite. Once we confirm that we have fixed your problem we will
>>>>>>>> release another DBIC version.
>>>>>>>
>>>>>>> Ah, ok.
>>>>>>>
>>>>>>> So I did install and - YES - it works fine!
>>>>>>>
>>>>>>> Thanks for your patience. ;-)
>>>>>>
>>>>>> 0.08102 now on CPAN, includes the above fix.
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>
>>>>> I'm sorry to say, but I still get this error. I have the following
>>>>> query
>>>>> (from within Catalyst):
>>>>>
>>>>> $c->model('DB::Line')->search({ 'types.name' => {'!=',
>>>>> 'Connection'} },
>>>>>                                                       { join     =>
>>>>> [qw/ types /],
>>>>>                                                         prefetch =>
>>>>> [qw/ types /],
>>>>>                                                         select   =>
>>>>> [qw/me.name types.name/],
>>>>>                                                         distinct => 1,
>>>>>                                                         order_by =>
>>>>> [qw/types.name me.name/]
>>>>>                                                       }
>>>>>
>>>>> This used to work just fine, until 0.0810x. Now I get
>>>>>
>>>>> DBIx::Class::ResultSet::search(): Column type not loaded or not passed
>>>>> to new() prior to insert() on
>>>>> TMEditor::Model::DB::Line=HASH(0x2662620)
>>>>> trying to resolve relationship (maybe you forgot to call
>>>>> ->reload_from_storage to get defaults from the db)
>>>>>
>>
>> Hi,
>>
>> Matt got confused, this indeed seems like an interface inconsistency.
>> We are
>> still trying to figure out if 080xx had the correct behavior, or if it
>> was
>> dangerously indeterministic. For the time being add me.<pkcols> to
>> +select
>> and you'll be fine.
>>
> 
> I was trying to do what you said, though I'm not entirely sure what you
> mean:
> 
> ->search({ 'types.name' => {'!=', 'Connection'} },
>                     { join     => [qw/ types /],
>                     prefetch => [qw/ types /],
>                     select   => [qw/me.name types.name/],
>                     +select  => [qw/me.auto_line types.type_id/],
>                     distinct => 1,
>                     order_by => [qw/types.name me.name/]
>                     } )
> 
> but I still get:
> DBIx::Class::ResultSet::search(): Column type not loaded or not passed
> to new() prior to insert() on TMEditor::Model::DB::Line=HASH(0x9cd52d8)
> trying to resolve relationship (maybe you forgot to call
> ->discard_changes to get defaults from the db)
> 
> TBH, I don't really understand the source of the problem. What's going
> wrong here?
> 

Currently all columns defining the relationship *must* be part of the select.
As I said it will be fixed, however there's no timeline, the code is not
trivial.



More information about the DBIx-Class mailing list