> Why do you need it to be in the join? whats the difference between:
> 
> ph_topics me LEFT JOIN ph_watchers watchers ON ( watchers.topic_id =
> me.id AND watchers.user_id = ? )
> 
> and
> 
> ph_topics me LEFT JOIN ph_watchers watchers ON ( watchers.topic_id =
> me.id ) WHERE watchers.user_id = 5
> 

First case produces a result row for every row in ph_topics.

Second case produces a result row only where watchers.user_id = 5.

One wonders though if the original poster wouldn't prefer the second
case.

In answer to the original question, I believe the parameter '5' could be
passed through as a bind variable; see 

http://search.cpan.org/~mstrout/DBIx-
Class-0.08003/lib/DBIx/Class/Manual/Cookbook.pod#Arbitrary_SQL_through_a_custom_ResultSource

-- 

Jon

_______________________________________________
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/[email protected]/

Reply via email to