[Dbix-class] Auto-joins

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


On 3/30/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> Yes, that would be what we'd intend to do. But for the purposes of that we
> need a full SQL::Abstract abstract query tree parser with useful callbacks.
> Guess where the only such parser is. Now note my comments above about its
> complete lack of usefull callbacks :)

I'm not quite getting it.
You *can* do joins when an explicity "join => ..." clause is passed.
What prevents Class::DBI from automatically generating this?

I.e. when you call:

my $rs = $schema->resultset('CD')->search(
   {
     'artist.name' => 'Bob Marley'
   }
);

DBIx::Class would convert the arguments, as if the user had called:

my $rs = $schema->resultset('CD')->search(
   {
     'artist.name' => 'Bob Marley'
   },
   {
      join => ['artist']
   }
);

I mean... this can be almost trivially done. Or are there some hidden
issues I'm missing?

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list