When I perform a search using criteria from a related table, why doesn't DBIC pick up on that hint and automatically do the join? Example:
my @cds = $schema->resultset('Albums')->search( { 'artist.name' => 'Billy Joel' }, { join => 'artist' } ); If I'm already saying "artist.name" in the search criteria, shouldn't it be fairly trivial for DBIC to notice the table-specific qualification and setup the join for me? Since DBIC is so smart about so many other things, I'm guessing that the answer to my question will be something like "the criteria-processing code doesn't have access to the join-making code," or "the joins happen before the criteria are evaluated," or even "duh, foo.bar doesn't necessarily imply a join to the foo table." But I'm not yet familiar enough with the internals to know where to start looking for the answer myself. I would be up for some code diving if someone wanted to give me hint rather than a full explanation, though... --Jason _______________________________________________ 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/