[Dbix-class] Three table relationships?

Zbigniew Lukasiak zzbbyy at gmail.com
Fri Feb 2 12:20:49 GMT 2007


On 1/31/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
> Actually, I said that many-many is a bridge across two relationships
> and that we needed to cover the general case of that in terms of the
> result_source level infrastructure, including providing metadata.

So here is an example for the general case, perhaps you could call it
a bit ephemeral (it might be used in a model for the [user, item, tag]
trio optimalised for some queries) - but I hope it is at least
amusing:

select * from a, b, c where
a.key1 = b.key2 and b.key1 = c.key2 and c.key1 = a.key2

With composed (key1, key2) primary keys for a, b and c tables.

This join is a three table relationship (just like the many to many
case) - and I think it is not reducible to a superposition of two
table relstionships (differently from the many to many case).

To reiterate - I did read your thesis that many to many is not a
relatioship - so you don't need to repeat that - I am just asking why
it is not and what is a relatioship.

--
Zbyszek



More information about the Dbix-class mailing list