That's okay, I don't mind using the literal string, I'd just wanted to
be sure that there's no other idiomatic way to perform this in Sequel.
Thanks,
Rodrigo
On 08-10-2014 16:39, Jeremy Evans wrote:
On Wednesday, October 8, 2014 12:27:26 PM UTC-7, Rodrigo Rosenfeld
Rosas wrote:
Is there a more idiomatic way of writing this in Sequel?
Sequel.function(:array_agg, Sequel.lit('v.value order by
v.position')).as(:value)
I'm particularly interested in replacing the Sequel.lit(...) part
with something like:
Sequel.order_by(:v__value, :v__position)
Not exactly this syntax, but you get the idea.
Sequel doesn't currently have DSL support for this syntax, so using a
literal string as you are doing is probably best.
It's fairly simple to create a Sequel.order_by method that returns
such a literal string and use that, if you want.
I've thought about including something similar in core, but I don't
think usage would be high enough to justify it.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.