[Dbix-class] Extracting ORDER BY clause

Dmitry Belyavsky beldmit at gmail.com
Tue Jul 5 06:16:17 GMT 2011


Greetings!

On Tue, Jul 5, 2011 at 3:24 AM, Eden Cardim <edencardim at gmail.com> wrote:
>>>>>> "Dmitry" == Dmitry Belyavsky <beldmit at gmail.com> writes:
>
>    Dmitry> Hello!
>    Dmitry> I need to extract a complex ORDER BY clause from the resultset in a
>    Dmitry> string form. How can I do it (may be using internal methods of
>    Dmitry> DBIx::Class, I know it's bad idea).
>
> What's a "complex order by"? Can you provide code examples using both
> DBIC, and the equivalent SQL you're expecting to obtain?

Sorry, the word "complex" is misleading here.

I want to extract ORDER BY string from any resultset. I need it for
the hand-maded query with window functions.

So I want smth like

my $rs = $schema->resultset("Client")->search({name => 'Ivan'},
{order_by => 'created'});
my $order_str = $rs->_get_order_by_any_way();

How can I get it?

Thank you!

-- 
SY, Dmitry Belyavsky



More information about the DBIx-Class mailing list