[Dbix-class] might_have join condition with value rather than column

Ash Berlin ash_cpan at firemirror.com
Mon Jul 14 16:28:54 BST 2008


On 14 Jul 2008, at 15:59, Jason Gottshall wrote:

> Robert Loomans wrote:
>> Henry Drinkwater wrote:
>>> Hi,
>>>
>>> I am trying to create a might_have join condition in DBIx::Class  
>>> where I want to add a value comparison as well as having matching  
>>> values in the foreign and self columns. To give an example,  
>>> suppose I have two tables:
>> I too would love to be able to do this.
>>> but couldn't find anything that worked - I get an exception thrown  
>>> like this:
>>>
>>> Invalid rel cond val HASH(0x94a79c)
>>>
>>> for all the things I tried. Is this kind of join possible and if  
>>> so what is the right syntax?
>> I've looked for the error in the DBIC code and it doesn't support  
>> parsing such relations...
>> Is this an oversight and no-one else has had that particular itch,  
>> or is there reason for not implementing it?
>
> I raised the same issue a while back. The basic gist of the response  
> was that it's definitely desirable but probably a little tricky to  
> implement. I did some code diving at the time, and stopped when my  
> head got near the exploding point. I haven't had any tuits lately to  
> devote to the issue, but I'm sure the core maintainers would love to  
> have somebody take a crack at it...
>
> Jason
>

That about sums up my view on it. Also add that the fact that a static  
condition like that isn't *technically* anything to do with a  
relationship.

-ash



More information about the DBIx-Class mailing list