Grokbase
Topics Posts Groups | in
x
[ help ]

[Dbix-class] Related results, prefetch, paging = problem

View PostFlat  Thread  Threaded | < Prev
Mark Blythe [Dbix-class] Related results, prefetch, paging = problem
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Sorry, my mistake.  I missed one change in the example.  You should
use 'select' instead of 'columns'.  At least I did:

$c->stash->{routes} = $c->model('QDB::Routes')->search(
                  {
                          'me.net_id'    => $c->stash->{net_id},
                          'me.route_beg' => $c->stash->{node_id_beg},
                          'me.route_end' => $c->stash->{node_id_end},
                  },
                  {
                          join => { 'xc_params' => 'nodes' },

                          select  => [qw/
                          me.route_id me.route_beg me.route_end
me.err_code me.comment me.net_id
                          xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                          nodes.node_id nodes.node_name
                          / ],

                          as  => [qw/
                          route_id route_beg route_end err_code comment net_id
                          xc_params.node_rank xc_params.ch_beg xc_params.ch_end
                          xc_params.nodes.node_id xc_params.nodes.node_name
                          / ],

                          #TODO Paged output
                          order_by => [ @order_by ],
                          page     => $page,       # page to return
(defaults to 1)
rows => $rows, # number of results per page,
                          cache => 1
                  }
          );

Thread : [Dbix-class] Related results, prefetch, paging = problem
1)
d...@bk.ru Today I was trying to make a resultset with specifed set of columns and prefetch. And it's all will...
2)
Mark Blythe I ran into this just the other day, too. It has specifically to do with the nested relationship +...
3)
Mark Blythe Sorry, my mistake. I missed one change in the example. You should use 'select' instead of...
spacer
View PostFlat  Thread  Threaded | < Prev