* Ash Berlin <[EMAIL PROTECTED]> [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/>

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to