[CDBI] Re: has_many relationships and order_by

Matt S Trout dbix-class at trout.me.uk
Thu Dec 15 13:20:02 GMT 2005


On Thu, Dec 15, 2005 at 12:55:25PM +0000, Dan Rowles wrote:
> Have sent Tony a patch for this, so hopefully he'll include it in the 
> next release. My solution was that, if you only have a single hash 
> passed in, check to see if it contains keys that are not column names.
> 
> I'm not sure what you mean by the "doesn't have support for ordering" 
> part of your post. You can do "order_by" in searches - just pass in a 
> hash-ref as the last argument, for example:-
>   Class->search(name => "Bob", age => 12, { order_by => "weight" });

No, I'd just forgotten that baseline CDBI can handle order_by, probably
because of its utter inability to handle JOINs, LIMITs, indeed everything
I use on a day-to-day basis *apart* from order_by :)

My mistake, sorry.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +




More information about the ClassDBI mailing list