[Dbix-class] Auto-joins

Nilson Santos Figueiredo Junior acid06 at gmail.com
Thu Mar 30 20:22:00 CEST 2006


On 3/30/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> quick example for you from the S::A tests
>
> [-maybe => {race => [-and => [qw(black white asian)]]},
>    {-nest => {firsttime => [-or => {'=','yes'}, undef]}},
>    [ -and => {firstname => {-not_like => 'candace'}},
>              {lastname => {-in => [qw(jugs canyon towers)]}} ] ] ]
>
> making it work for trivial queries is trivial. making it work for every
> possible query is more complex :)

Yes. But I think it's better to be able to auto-join simple queries
than to not do it at all.

Actually, I'd never write queries like this example.
Anything that gets a little more complex will, usually, be much more
readable as plain SQL. I mean, the end of this query looks like Lisp
on steroids (i.e. with brackets and curly braces besides parens). It's
damn ugly.

I know this might be seen with some criticism, but I'd rather maintain
SQL statements than that complex data structures mess and I know this
query is actually not that complex.

Anyway... why not patching SQL::Abstract? Or is it somehow unpatchable
(i.e. so badly messed up that you wouldn't touch it with a 10 foot
pole)?

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list