[Dbix-class] Excluding columns from a query

fREW Schmidt frioux at gmail.com
Thu Feb 18 19:40:15 GMT 2010


On Thu, Feb 18, 2010 at 12:58 PM, Octavian Rasnita <octavian at fcc.ro> wrote:

> From: "fREW Schmidt" <frioux at gmail.com>
>
>  On Thu, Feb 18, 2010 at 7:02 AM, BUCHMULLER Norbert <norbi.lists at nix.hu
>> >wrote:
>>
>>  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 th=
is
>>> >    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 =3D> ['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
>>>
>>>
>> ok, I've heard from I think 4 people regarding this now and everyone is =
in
>> favor of #2.  I'll implement it soon (within a week hopefully.)
>>
>
> Would it be possible to specify columns from joined tables like in the li=
ne
> below?
>
>     remove_columns =3D> ['big_text_column',
> 'another_table.another_big_column'],
>
> It would be great!
>
>
Uh, I haven't looked at that specifically, but I think it would be harder
*not* to do that since I'd need to special case it in the code.

And after I write this I am planning on writing a module for
DBIx::Class::Helpers that will disable TEXT and BLOBs etc by default :-)



-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100218/838=
d2e01/attachment.htm


More information about the DBIx-Class mailing list