[Dbix-class] Excluding columns from a query

BUCHMULLER Norbert norbi.lists at nix.hu
Thu Feb 18 13:02:12 GMT 2010


On Wed, 17 Feb 2010 09:19:44 -0600 fREW Schmidt wrote:

>    1. Only have the remove-columns affect the default select, since
> having it affect an explicit columns list is a little silly.
>    2. Having it affect the *current* select list; the use-case for this
>    would be if you had an explicit columns list in previous search (or a
>    predefined search more likely) and you wanted to take away a column
> from that.

I'd vote for #2 as it would make possible things like that (a variant of
the use-case you mentioned):

 $rs->method_that_adds_a_calculated_column->search(
   ...
   {
      remove_columns => ['big_text_column'],
   }
 );  # and still have the calculated column (added via "+columns")

Also this behaviour is the less surprising: with #1 the behaviour of
'remove_columns' (or '-columns' or whatever it will be called)
would depend on whether a given column comes from the result source or
from a previous search() call.

norbi



More information about the DBIx-Class mailing list