I don't see a need for it. Isn't it easy enough to do something like this:
dataset.select(*(dataset.columns - [:col1, :col2]))
On Thursday, March 8, 2012 11:52:23 AM UTC-5, hiddenhippo wrote:
>
> Hi everyone,
>
> I'm looking to see what the community support is for including new
> functionality that allows you to define the columns not to be select
> within a query.
>
> Consider the following; basically I have a situation where I take a
> Sequel models and JSON them out for web-services, however my web-
> services only want to present certain columns. I might therefore have
> a table with 20 columns, ultimately of which I want to exclude 2. In
> order to do this you have no option but so type every column except
> the 2 I want to exclude, e.g.
>
> Model.select(:col1,:col2,:col3 .... :col20).all
>
> Rather than detail the columns that I want selected, my thought was to
> detail the columns not to be selected, and therefore not having to
> type half a gazillion columns into the query.
>
> I presented the above to Jeremy who kindly replied with a means to
> implement the above
>
> class Sequel::Dataset
> def exclude_select(*cols)
> select(*(columns - cols))
> end
> end
>
> He was reluctant to include the functionality as part of the standard
> library unless the community was behind it.
>
> Therefore I'm trying to measure general consensus from fellow Sequel
> users.
>
> Thanks
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sequel-talk/-/WxvSiOJSq2IJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.