[Dbix-class] Auto-joins

Matt S Trout dbix-class at trout.me.uk
Thu Mar 30 19:51:39 CEST 2006


Nilson Santos Figueiredo Junior wrote:
> 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 mean... this can be almost trivially done. Or are there some hidden
> issues I'm missing?

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 :)

-- 
      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 Dbix-class mailing list