Noel Burton-Krahn wrote: > On Tue, Nov 25, 2008 at 10:22 AM, Peter Rabbitson <[EMAIL PROTECTED]> wrote: >> Noel Burton-Krahn wrote: >>> The problem is that DBIx has the "smarts" to prefix column names in >>> the select clause, like "select me.id, cds.id" but not in the where >>> clause "where id=?". >> How does DBIC know if the user meant 'where me.id = ?' and not 'where >> cds.id = ?'. Blindly prefixing stuff with 'me' is plain wrong. >> > > Consider the following search from a schema where person and address > both have a column named 'id': > > $schema->resultset('Person')->search({ id => $person_id}, { prefetch > => [ 'address' ] }); > > This is a reasonable query: load a person with address by the > person's id. The 'id' column is unambiguous in the search call.
Excellent example. Now tell me how to express the query "Get me all Persons which have an Address with (address.)id == $address_id, while prefetching the Address data as well. _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk