prefixing the "id" column with the name of the relationship seems much more
obvious than prefixing the base table's column with "me".  This doesn't seem
like it would be too complicated to implement -- if the column given is not
already prefixed by one or more table/relationship aliases, it could be
automatically changed to "me.$col".

On Tue, Nov 25, 2008 at 3:41 PM, Peter Rabbitson
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> wrote:

> Noel Burton-Krahn wrote:
> > On Tue, Nov 25, 2008 at 10:22 AM, Peter Rabbitson <[EMAIL PROTECTED]<[EMAIL 
> > PROTECTED]>>
> wrote:
> >
> > 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
>
_______________________________________________
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

Reply via email to