[Dbix-class] Extracting ORDER BY clause

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


Greetings!

On Tue, Jul 5, 2011 at 10:47 AM, Marc Logghe <logghe.marc at gmail.com> wrote:
> Hi,
>>
>> 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?
>>
>  Did not test this. But you might call $rs->as_query which returns an array
> ref. The first element in that array is the SQL. You can fish out the order
> by using a regex or split.

Yes, just now I do so. But I want to find more common way.

Thank you!

-- 
SY, Dmitry Belyavsky



More information about the DBIx-Class mailing list