Hi Charles,
I think you are looking for #select
database[:my_table].select(:col1, :col2)
Lots of awesome magic here:
http://sequel.rubyforge.org/rdoc/files/doc/querying_rdoc.html
On Tue, Dec 4, 2012 at 1:51 PM, Charles Monteiro
<[email protected]> wrote:
> hi, I have the following code that I'm trying to represent in Sequel:
>
> SELECT col1, col2
> INTO var1 , var2
> FROM my_table;
>
>
> I have been relying on "get" but that means breaking the above up into 2
> calls i.e.
>
> var1 = database[:my_table].get :col1
> var2 = database[:my_table].get :col2
>
> the actual code more refactored :) i.e. my_table.get :col1 but that's not
> relevant.
>
> what I want is one call that will return multiple values i.e something like
> this would be ideal:
>
> var1 , var2 = database[:my_table].get :col1, col2
>
> However, the docs don't provide that as option.
>
> What is my next most succinct way of doing that ?
>
> thanks
>
> Charles
>
> --
> 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/-/H7Up2qeLzQwJ.
> 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.
--
—Silas
--
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.