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

Felix Antonius Wilhelm Ostmann ostmann at websuche.de
Thu Jun 25 11:32:25 GMT 2009


Benjamin Schuster-Boeckler schrieb:
> 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/]
>                     } )
>
you have to quote the +select!


perl -MData::Dumper -we 'print Dumper({+select => undef});'
$VAR1 = {
          'select' => undef
        };

VS

perl -MData::Dumper -we 'print Dumper({"+select" => undef});'
$VAR1 = {
          '+select' => undef
        };

i dont know, if this will help in this case, but i think this is 
important, i forget this often :-/

> 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?
>
> Thanks in advance,
> Benjamin
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: 
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>


-- 
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--------------------------------------------------
Websuche   Search   Technology   GmbH   &   Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:    +49 541 40666-22
Email: info at websuche.de - Website: www.websuche.de
--------------------------------------------------
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin:     Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--------------------------------------------------




More information about the DBIx-Class mailing list