On Mon, Jul 16, 2007 at 01:27:23PM +0200, Marc Espie wrote:
> On Mon, Jul 16, 2007 at 11:59:22AM +0100, Joel Bernstein wrote:
> > In some ways you're comparing apples with Wednesday. What do you mean by
> > 'full support'? DBIC has /some/ many-to-many relationship support - see
> > DBIx::Class::Relationship - has_many(), belongs_to(), many_to_many().
> > If you can express a query you'd perform in SQL, you can use DBIC's
> > SQL::Abstract support to perform a join that isn't directly supported by
> > the higher level API.
> 
> ... Which is what I mean by `not supported'. Other relationship types
> have full support at the search level. Not so for `many-to-many', which
> is not quite a relationship, it has some of its properties, but it's somewhat
> faked, and definitely not a first class object compared to what you can do
> naturally with other relationshipt types.

That's because it -isn't- a relationship, a many-many is a bridge over two
relationships. There's no problem with doing something like

$cds->search({ 'producer.name' => { 'like', 'Bob%' } },
             { join => { cd_to_producer => 'producer' } });

The way we provide SQLA syntax, a relationship is something that can be
joined directly; we've been looking at ways to make many-many more elegant
within that but most of them turn out to be a bit of a hack.

Watch this space, I expect there'll be something better in 09 :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 

_______________________________________________
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/dbix-class@lists.rawmode.org/

Reply via email to