[Dbix-class] Excluding columns from a query

Mike South msouth at gmail.com
Wed Feb 17 15:55:15 GMT 2010

On Wed, Feb 17, 2010 at 9:19 AM, fREW Schmidt <frioux at gmail.com> wrote:

> Gah, I should have read this thread sooner!  I am actually working on
> adding such a feature to DBIC.  Getting it to work is quite easy.  Getting
> the right semantics is hard.  For instance, we've discussed this on IRC a=
> really there are two options:
>    1. Only have the remove-columns affect the default select, since having
>    it affect an explicit columns list is a little silly.
What if a query is built by getting the columns to select from one source
and the columns to exclude from another?  Say the client says "I want X Y
and Z" and the security layer says "We don't send Z over non-encrypted
channels".  The resulting select would look silly, granted, but it might be
easier in some situations for Thing A to contribute includes and Thing B to
contribute excludes without A and B needing to communicate with/know about
each other.  (Also I guess that kind of assumes that exclude wins when a
column is both included and excluded, but that's sort of true for both


>    1. 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 fr=
>    that.
> I'm personally in favor of the former, mostly because it's the simplest to
> explain, test, and implement, and really all this is is a shortcut anyway.
> Honestly I've implemented this twice now, both ways, but we need to nail
> down the semantics.  Furthermore, I feel like implementing remove-select =
> remove-as is needlessly complex.  If someone provides a select/as just bl=
> it away with columns.
> What do you guys think?
> --
> fREW Schmidt
> http://blog.afoolishmanifesto.com
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100217/063=

More information about the DBIx-Class mailing list