[Dbix-class] Extracting ORDER BY clause

Marc Logghe logghe.marc at gmail.com
Tue Jul 5 06:47:34 GMT 2011


Hi,

So I want smth like
>
> my $rs =3D $schema->resultset("Client")->search({name =3D> 'Ivan'},
> {order_by =3D> 'created'});
> my $order_str =3D $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 arr=
ay
ref. The first element in that array is the SQL. You can fish out the order
by using a regex or split.
HTH,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110705/4fe=
2b432/attachment.htm


More information about the DBIx-Class mailing list