I would definitely use #1, and would infrequently use #3 (which I  
prefer over #2). if it's a popularity contest, I probably wouldn't use  
#4. (I've never needed to in the past.)

--
(-, /\ \/ / /\/

On Nov 11, 2009, at 8:27 PM, Jeremy Evans <[email protected]>  
wrote:

>
> There hasn't been much activity in a couple weeks, but I have some
> things planned.  I'd like to get some feedback before starting them,
> though:
>
> 1) Some additional Dataset convenience methods: select_map,
> select_order_map, select_hash
>
> * select_map(:column1, :column2) => select(:column1, :column2).map
> (:column1, :column2)
> * select_order_map(:column1, :column2) => select
> (:column1, :column2).order(:column1, :column2).map(:column1, :column2)
> * select_hash(:column1, :column2) => select 
> (:column1, :column2).to_hash
> (:column1, :column2)
>
> I find myself using this type of thing a lot when I just want to
> create an array or map, and I think it's generally useful and could
> save some keystrokes.  There are possible issues with aliasing/
> qualifying columns, though.
>
> 2) ~nil
>
> Currently, Sequel doesn't add NilClass#~, so you can't use ~nil to
> represent NOT NULL.  This would mostly be useful in the following
> case:
>
>  DB[:table].filter(:column1=>1, :column2=>~nil)
>
> Currently, you'd need to do:
>
>  DB[:table].filter(:column1=>1).exclude(:column2=>nil)
>
> 3) Adding NULL and NOTNULL to Sequel::SQL::Constants
>
> This would allow you to easily use them directly if you include
> Sequel::SQL::Constants in the top level.  So you could do the above
> as:
>
>   # assume include Sequel::SQL::Constants
>   DB[:table].filter(:column1=>1, :column2=>NOTNULL)
>
> 4) Dataset#~
>
> Similar to ~nil above, would allow you to do this:
>
>  DB[:table].filter(:column1=>1, :column2=>~DB[:table2].select
> (:column3))
>
> Currently, you'd need to do:
>
>  DB[:table].filter(:column1=>1).exclude(:column2=>DB[:table2].select
> (:column3))
>
>
> I'm leaning against 2) and 4), but I'd like some feedback on those
> anyway.  1) and 3) could easily be done via an extension, so my main
> question there is should they be part of Sequel or should they be
> placed in an extension.
>
> Jeremy
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to