[Dbix-class] quote char works with sorting without breaking too much!
A. Pagaltzis
pagaltzis at gmx.de
Fri Jun 23 01:27:42 CEST 2006
* Ash Berlin <ash at cpan.org> [2006-06-22 13:50]:
> As for a go at taking that contrived CASE clause:
>
> { case => [ [ age => '<' => 18 => 'NULL'], [age => '>' => 45 =>
> 'NULL'], ['age'] ] }
>
> Possible with WHEN/ELSE keys:
>
> { case => [ { where => 'age' => '<' => 18 => 'NULL'}, {where =>
> 'age' => '>' => 45 => 'NULL'}, { else => 'age' } ] }
Errm, seriously: you find that more readable than literal SQL?
As a sidenote, this will take effort to implement, because you’re
using the same notation for `case` as for functions, which means
the SQL renderer has to know it’s not, which means it needs
hardwired knowledge of specific constructs. And what about
vendor-specific SQL extensions.
All of this so you can cast fairly clean SQL as a jumble of
brackets, braces and arrows.
I’m unconvinced. :-(
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Dbix-class
mailing list